[Csnd] Csound MIDI Controller Data

classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Csound MIDI Controller Data

zappfinger
Without virtual, with a real instrument, this does not work. I had to
start instr 1 to get it running, while the normal midi data kept coming
without that:

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac  -+rtmidi=portmidi   -Ma  ;;;RT audio I/O with MIDI in
;-iadc    ;;;uncomment -iadc if RT audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o cpsmidi.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1

     iamp ampmidi 0.5             ;This works
     icps cpsmidi                 ;This works as well
     kfreq chanctrl 1, 1          ;This does not
     kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
     printk2 kfreq
     printk2 kfreq2
     aOsc1 buzz iamp, icps, 10, 1
     aFilt lowpass2 aOsc1, kfreq, 10

      out aFilt, aFilt
endin


</CsInstruments>
<CsScore>
f0 200
i1 0    200  ;<---- this was needed!
;sine wave.
f 1 0 16384 10 1
e
</CsScore>
</CsoundSynthesizer>


On 15/03/17 22:44, Victor Lazzarini wrote:

> tested your instrument and it also runs here, both chanctrl and ctl7 work perfectly.
> OSX, using -+rtmidi=virtual.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 15 Mar 2017, at 21:26, Richard <[hidden email]> wrote:
>>
>> I tried k-rate but it does not work...Here's the csd:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> ; Select audio/midi flags here according to platform
>> -odac     -M0  ;;;RT audio I/O with MIDI in
>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>> ; For Non-realtime ouput leave only the line below:
>> ; -o cpsmidi.wav -W ;;; for file output any platform
>> </CsOptions>
>> <CsInstruments>
>>
>> sr = 44100
>> ksmps = 32
>> nchnls = 2
>> 0dbfs = 1
>>
>> instr 1
>>
>>      iamp ampmidi 0.5             ;This works
>>      icps cpsmidi                 ;This works as well
>>      kfreq chanctrl 1, 1          ;This does not
>>      kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>      printk2 kfreq
>>      printk2 kfreq2
>>      aOsc1 buzz iamp, icps, 10, 1
>>      aFilt lowpass2 aOsc1, kfreq, 10
>>
>>       out aFilt, aFilt
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> f0 20
>> ;sine wave.
>> f 1 0 16384 10 1
>>
>> e
>> </CsScore>
>> </CsoundSynthesizer>
>> Richard
>>
>> On 15/03/17 22:21, Emmett Palaima wrote:
>>> Oeyvind is correct, the issue is definitely that you are using i-rate variables for chanctrl and ctrl7. Since they are i-rate the value can't update in real time. Use k-rate instead. Pretty surprised that the instrument even ran.
>>>
>>> If you fix that it should work.
>>>
>>> On Wed, Mar 15, 2017 at 5:05 PM, Richard <[hidden email]> wrote:
>>> I tried it here on OS X. It does not work. Also John's suggestion did not work...
>>>
>>> Richard
>>>
>>>
>>>
>>> On 15/03/17 21:53, Oeyvind Brandtsegg wrote:
>>> Yes, I think, as John suggests, that you probably want to run contrl7 at k-rate
>>>
>>> not:
>>>     ifreq chanctrl 1, 1
>>> but:
>>>     kfreq chanctrl 1, 1
>>>
>>>
>>> 2017-03-15 13:47 GMT-07:00 jpff <[hidden email]>:
>>> What happens if you run the canctl.csd example from the manual?
>>>
>>> <CsoundSynthesizer>
>>> <CsOptions>
>>> ; Select audio/midi flags here according to platform
>>> ; Audio out   No messages  MIDI in
>>> -odac            -d         -M0  ;;;RT audio I/O with MIDI in
>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>> ; For Non-realtime ouput leave only the line below:
>>> ; -o chanctrl.wav -W ;;; for file output any platform
>>> </CsOptions>
>>> <CsInstruments>
>>>
>>> sr = 44100
>>> ksmps = 32
>>> nchnls = 2
>>> 0dbfs = 1
>>>
>>> instr 1 ; press your midi keyboard and move your midi controller to see
>>> result
>>>
>>> ichnl  = 1              ;MIDI note inputs on channel 1
>>> ictlno = 7              ;use midi volume controller
>>> kch  chanctrl ichnl, 7  ;to control amplitude of oscil
>>>        printk2  kch
>>>
>>> asig oscil kch*(1/127), 220, 1
>>>        outs  asig, asig
>>> endin
>>>
>>> </CsInstruments>
>>> <CsScore>
>>> ;Dummy f-table to give time for real-time MIDI events
>>> f 0 30
>>> ;sine wave.
>>> f 1 0 16384 10 1
>>> e
>>>
>>> </CsScore>
>>> </CsoundSynthesizer>
>>>
>>>
>>> On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>
>>> I'm definitely on channel 1. Running on OSX. The thing is that it displays
>>> note events in the console without any op codes, but not controller
>>> events.
>>>
>>> On Wed, Mar 15, 2017 at 4:32 PM jpff <[hidden email]> wrote:
>>>         I know next to noting about MIDI but yoour chanctrl opcode only
>>>         woks at
>>>         init time -- is that what you want?
>>>
>>>         Same for ctrl7.
>>>
>>>         Peraps yo at a k-va as reslt.....
>>>
>>>
>>>         On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>
>>>         >
>>>         > instr 1
>>>         >
>>>         >
>>>         >       iamp ampmidi 0.5             ;This works
>>>         >
>>>         >       icps cpsmidi                 ;This works as well
>>>         >
>>>         >
>>>         >
>>>         >       ifreq chanctrl 1, 1          ;This does not
>>>         >
>>>         >       ifreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>         >
>>>         >
>>>         >       print ifreq
>>>         >
>>>         >       aOsc1 buzz iamp, icps, 10, 1
>>>         >
>>>         >       aFilt lowpass2 aOsc1, ifreq, 10
>>>         >
>>>         >
>>>         >        out aFilt, aFilt
>>>         >
>>>         > endin
>>>         >
>>>         >
>>>         > The main thing I don't understand is why it isn't displaying
>>>         controller
>>>         > changes in the console.
>>>         >
>>>         >
>>>         > On Wed, Mar 15, 2017 at 3:45 PM, Arthur Hunkins
>>>         > <[hidden email]> wrote:
>>>         >       I use ctrl7 all the time.
>>>         >
>>>         > Art Hunkinshttp://www.arthunkins.com
>>>         >
>>>         > On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley
>>>         <[hidden email]>
>>>         > wrote:
>>>         >       Sorry for this total newbie question, but how do I get
>>>         >       Csound to read the controller data from my MIDI keyboard?
>>>         >       Right now it's reading the note data, so I'm confused as
>>>         to
>>>         >       why it isn't for the control messages.
>>>         >
>>>         >       Thanks,
>>>         >       Sam
>>>         >
>>>         > Csound mailing list
>>>         > [hidden email]
>>>         > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>         > Send bugs reports to
>>>         >         https://github.com/csound/csound/issues
>>>         > Discussions of bugs and features can be posted here
>>>         >
>>>         >
>>>         > Csound mailing list [hidden email]
>>>         > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>         reports to
>>>         > https://github.com/csound/csound/issues Discussions of bugs and
>>>         features
>>>         > can be posted here
>>>         >
>>>         >
>>>         > Csound mailing list [hidden email]
>>>         > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>         reports to
>>>         > https://github.com/csound/csound/issues Discussions of bugs and
>>>         features can
>>>         > be posted here
>>>         >
>>>
>>>         Csound mailing list
>>>         [hidden email]
>>>         https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>         Send bugs reports to
>>>                 https://github.com/csound/csound/issues
>>>         Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>> https://github.com/csound/csound/issues Discussions of bugs and features
>>> can
>>> be posted here
>>>
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>          https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>>
>>>
>>>
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>         https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Csound MIDI Controller Data

Victor Lazzarini
As far as Csound is concerned, there is no difference between the MIDI modules, so what works for virtual, works for
the rest. Your instrument needs to be triggered by a MIDI note and once that is running, sending data to
chanctl works. With MIDI virtual there is no way to hold a note down and move a slider, but I just added an envelope
with a long release time, so when I pressed and released a key it would carry on for a while. Then I could move the
slider and see the data printed on the screen. Of course, if you add a score line, then you don’t need to trigger
the instr via MIDI.

 instr 1

    iamp ampmidi 0.5             ;This works
    icps cpsmidi                 ;This works as well
    kfreq chanctrl 1, 1          ;This does not
    kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
    printk2 kfreq
    printk2 kfreq2
    aOsc1 buzz iamp, icps, 10, -1
    aFilt lowpass2 aOsc1, kfreq, 10
    aFilt linenr aFilt, 0.1, 20, 0.01

     out aFilt, aFilt
endin

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 15 Mar 2017, at 22:14, Richard <[hidden email]> wrote:
>
> Without virtual, with a real instrument, this does not work. I had to start instr 1 to get it running, while the normal midi data kept coming without that:
>
> <CsoundSynthesizer>
> <CsOptions>
> ; Select audio/midi flags here according to platform
> -odac  -+rtmidi=portmidi   -Ma  ;;;RT audio I/O with MIDI in
> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
> ; For Non-realtime ouput leave only the line below:
> ; -o cpsmidi.wav -W ;;; for file output any platform
> </CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs = 1
>
> instr 1
>
>    iamp ampmidi 0.5             ;This works
>    icps cpsmidi                 ;This works as well
>    kfreq chanctrl 1, 1          ;This does not
>    kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>    printk2 kfreq
>    printk2 kfreq2
>    aOsc1 buzz iamp, icps, 10, 1
>    aFilt lowpass2 aOsc1, kfreq, 10
>
>     out aFilt, aFilt
> endin
>
>
> </CsInstruments>
> <CsScore>
> f0 200
> i1 0    200  ;<---- this was needed!
> ;sine wave.
> f 1 0 16384 10 1
> e
> </CsScore>
> </CsoundSynthesizer>
>
>
> On 15/03/17 22:44, Victor Lazzarini wrote:
>> tested your instrument and it also runs here, both chanctrl and ctl7 work perfectly.
>> OSX, using -+rtmidi=virtual.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 15 Mar 2017, at 21:26, Richard <[hidden email]> wrote:
>>>
>>> I tried k-rate but it does not work...Here's the csd:
>>>
>>> <CsoundSynthesizer>
>>> <CsOptions>
>>> ; Select audio/midi flags here according to platform
>>> -odac     -M0  ;;;RT audio I/O with MIDI in
>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>> ; For Non-realtime ouput leave only the line below:
>>> ; -o cpsmidi.wav -W ;;; for file output any platform
>>> </CsOptions>
>>> <CsInstruments>
>>>
>>> sr = 44100
>>> ksmps = 32
>>> nchnls = 2
>>> 0dbfs = 1
>>>
>>> instr 1
>>>
>>>     iamp ampmidi 0.5             ;This works
>>>     icps cpsmidi                 ;This works as well
>>>     kfreq chanctrl 1, 1          ;This does not
>>>     kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>     printk2 kfreq
>>>     printk2 kfreq2
>>>     aOsc1 buzz iamp, icps, 10, 1
>>>     aFilt lowpass2 aOsc1, kfreq, 10
>>>
>>>      out aFilt, aFilt
>>> endin
>>>
>>> </CsInstruments>
>>> <CsScore>
>>> f0 20
>>> ;sine wave.
>>> f 1 0 16384 10 1
>>>
>>> e
>>> </CsScore>
>>> </CsoundSynthesizer>
>>> Richard
>>>
>>> On 15/03/17 22:21, Emmett Palaima wrote:
>>>> Oeyvind is correct, the issue is definitely that you are using i-rate variables for chanctrl and ctrl7. Since they are i-rate the value can't update in real time. Use k-rate instead. Pretty surprised that the instrument even ran.
>>>>
>>>> If you fix that it should work.
>>>>
>>>> On Wed, Mar 15, 2017 at 5:05 PM, Richard <[hidden email]> wrote:
>>>> I tried it here on OS X. It does not work. Also John's suggestion did not work...
>>>>
>>>> Richard
>>>>
>>>>
>>>>
>>>> On 15/03/17 21:53, Oeyvind Brandtsegg wrote:
>>>> Yes, I think, as John suggests, that you probably want to run contrl7 at k-rate
>>>>
>>>> not:
>>>>    ifreq chanctrl 1, 1
>>>> but:
>>>>    kfreq chanctrl 1, 1
>>>>
>>>>
>>>> 2017-03-15 13:47 GMT-07:00 jpff <[hidden email]>:
>>>> What happens if you run the canctl.csd example from the manual?
>>>>
>>>> <CsoundSynthesizer>
>>>> <CsOptions>
>>>> ; Select audio/midi flags here according to platform
>>>> ; Audio out   No messages  MIDI in
>>>> -odac            -d         -M0  ;;;RT audio I/O with MIDI in
>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>> ; For Non-realtime ouput leave only the line below:
>>>> ; -o chanctrl.wav -W ;;; for file output any platform
>>>> </CsOptions>
>>>> <CsInstruments>
>>>>
>>>> sr = 44100
>>>> ksmps = 32
>>>> nchnls = 2
>>>> 0dbfs = 1
>>>>
>>>> instr 1 ; press your midi keyboard and move your midi controller to see
>>>> result
>>>>
>>>> ichnl  = 1              ;MIDI note inputs on channel 1
>>>> ictlno = 7              ;use midi volume controller
>>>> kch  chanctrl ichnl, 7  ;to control amplitude of oscil
>>>>       printk2  kch
>>>>
>>>> asig oscil kch*(1/127), 220, 1
>>>>       outs  asig, asig
>>>> endin
>>>>
>>>> </CsInstruments>
>>>> <CsScore>
>>>> ;Dummy f-table to give time for real-time MIDI events
>>>> f 0 30
>>>> ;sine wave.
>>>> f 1 0 16384 10 1
>>>> e
>>>>
>>>> </CsScore>
>>>> </CsoundSynthesizer>
>>>>
>>>>
>>>> On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>
>>>> I'm definitely on channel 1. Running on OSX. The thing is that it displays
>>>> note events in the console without any op codes, but not controller
>>>> events.
>>>>
>>>> On Wed, Mar 15, 2017 at 4:32 PM jpff <[hidden email]> wrote:
>>>>        I know next to noting about MIDI but yoour chanctrl opcode only
>>>>        woks at
>>>>        init time -- is that what you want?
>>>>
>>>>        Same for ctrl7.
>>>>
>>>>        Peraps yo at a k-va as reslt.....
>>>>
>>>>
>>>>        On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>
>>>>        >
>>>>        > instr 1
>>>>        >
>>>>        >
>>>>        >       iamp ampmidi 0.5             ;This works
>>>>        >
>>>>        >       icps cpsmidi                 ;This works as well
>>>>        >
>>>>        >
>>>>        >
>>>>        >       ifreq chanctrl 1, 1          ;This does not
>>>>        >
>>>>        >       ifreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>        >
>>>>        >
>>>>        >       print ifreq
>>>>        >
>>>>        >       aOsc1 buzz iamp, icps, 10, 1
>>>>        >
>>>>        >       aFilt lowpass2 aOsc1, ifreq, 10
>>>>        >
>>>>        >
>>>>        >        out aFilt, aFilt
>>>>        >
>>>>        > endin
>>>>        >
>>>>        >
>>>>        > The main thing I don't understand is why it isn't displaying
>>>>        controller
>>>>        > changes in the console.
>>>>        >
>>>>        >
>>>>        > On Wed, Mar 15, 2017 at 3:45 PM, Arthur Hunkins
>>>>        > <[hidden email]> wrote:
>>>>        >       I use ctrl7 all the time.
>>>>        >
>>>>        > Art Hunkinshttp://www.arthunkins.com
>>>>        >
>>>>        > On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley
>>>>        <[hidden email]>
>>>>        > wrote:
>>>>        >       Sorry for this total newbie question, but how do I get
>>>>        >       Csound to read the controller data from my MIDI keyboard?
>>>>        >       Right now it's reading the note data, so I'm confused as
>>>>        to
>>>>        >       why it isn't for the control messages.
>>>>        >
>>>>        >       Thanks,
>>>>        >       Sam
>>>>        >
>>>>        > Csound mailing list
>>>>        > [hidden email]
>>>>        > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>        > Send bugs reports to
>>>>        >         https://github.com/csound/csound/issues
>>>>        > Discussions of bugs and features can be posted here
>>>>        >
>>>>        >
>>>>        > Csound mailing list [hidden email]
>>>>        > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>        reports to
>>>>        > https://github.com/csound/csound/issues Discussions of bugs and
>>>>        features
>>>>        > can be posted here
>>>>        >
>>>>        >
>>>>        > Csound mailing list [hidden email]
>>>>        > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>        reports to
>>>>        > https://github.com/csound/csound/issues Discussions of bugs and
>>>>        features can
>>>>        > be posted here
>>>>        >
>>>>
>>>>        Csound mailing list
>>>>        [hidden email]
>>>>        https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>        Send bugs reports to
>>>>                https://github.com/csound/csound/issues
>>>>        Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list [hidden email]
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>> https://github.com/csound/csound/issues Discussions of bugs and features
>>>> can
>>>> be posted here
>>>>
>>>> Csound mailing list
>>>> [hidden email]
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>         https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>>
>>>>
>>>>
>>>> Csound mailing list
>>>> [hidden email]
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>        https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>>
>>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Csound MIDI Controller Data

zappfinger
So Channel Voice Messages on channel 1 trigger instr 1 by default as we
know. But why do Control Change Messages on channel 1 do not have the
same effect? Is that not a bug?

Richard


On 15/03/17 23:24, Victor Lazzarini wrote:

> As far as Csound is concerned, there is no difference between the MIDI modules, so what works for virtual, works for
> the rest. Your instrument needs to be triggered by a MIDI note and once that is running, sending data to
> chanctl works. With MIDI virtual there is no way to hold a note down and move a slider, but I just added an envelope
> with a long release time, so when I pressed and released a key it would carry on for a while. Then I could move the
> slider and see the data printed on the screen. Of course, if you add a score line, then you don’t need to trigger
> the instr via MIDI.
>
>   instr 1
>
>      iamp ampmidi 0.5             ;This works
>      icps cpsmidi                 ;This works as well
>      kfreq chanctrl 1, 1          ;This does not
>      kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>      printk2 kfreq
>      printk2 kfreq2
>      aOsc1 buzz iamp, icps, 10, -1
>      aFilt lowpass2 aOsc1, kfreq, 10
>      aFilt linenr aFilt, 0.1, 20, 0.01
>
>       out aFilt, aFilt
> endin
>
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 15 Mar 2017, at 22:14, Richard <[hidden email]> wrote:
>>
>> Without virtual, with a real instrument, this does not work. I had to start instr 1 to get it running, while the normal midi data kept coming without that:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> ; Select audio/midi flags here according to platform
>> -odac  -+rtmidi=portmidi   -Ma  ;;;RT audio I/O with MIDI in
>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>> ; For Non-realtime ouput leave only the line below:
>> ; -o cpsmidi.wav -W ;;; for file output any platform
>> </CsOptions>
>> <CsInstruments>
>>
>> sr = 44100
>> ksmps = 32
>> nchnls = 2
>> 0dbfs = 1
>>
>> instr 1
>>
>>     iamp ampmidi 0.5             ;This works
>>     icps cpsmidi                 ;This works as well
>>     kfreq chanctrl 1, 1          ;This does not
>>     kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>     printk2 kfreq
>>     printk2 kfreq2
>>     aOsc1 buzz iamp, icps, 10, 1
>>     aFilt lowpass2 aOsc1, kfreq, 10
>>
>>      out aFilt, aFilt
>> endin
>>
>>
>> </CsInstruments>
>> <CsScore>
>> f0 200
>> i1 0    200  ;<---- this was needed!
>> ;sine wave.
>> f 1 0 16384 10 1
>> e
>> </CsScore>
>> </CsoundSynthesizer>
>>
>>
>> On 15/03/17 22:44, Victor Lazzarini wrote:
>>> tested your instrument and it also runs here, both chanctrl and ctl7 work perfectly.
>>> OSX, using -+rtmidi=virtual.
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 15 Mar 2017, at 21:26, Richard <[hidden email]> wrote:
>>>>
>>>> I tried k-rate but it does not work...Here's the csd:
>>>>
>>>> <CsoundSynthesizer>
>>>> <CsOptions>
>>>> ; Select audio/midi flags here according to platform
>>>> -odac     -M0  ;;;RT audio I/O with MIDI in
>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>> ; For Non-realtime ouput leave only the line below:
>>>> ; -o cpsmidi.wav -W ;;; for file output any platform
>>>> </CsOptions>
>>>> <CsInstruments>
>>>>
>>>> sr = 44100
>>>> ksmps = 32
>>>> nchnls = 2
>>>> 0dbfs = 1
>>>>
>>>> instr 1
>>>>
>>>>      iamp ampmidi 0.5             ;This works
>>>>      icps cpsmidi                 ;This works as well
>>>>      kfreq chanctrl 1, 1          ;This does not
>>>>      kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>      printk2 kfreq
>>>>      printk2 kfreq2
>>>>      aOsc1 buzz iamp, icps, 10, 1
>>>>      aFilt lowpass2 aOsc1, kfreq, 10
>>>>
>>>>       out aFilt, aFilt
>>>> endin
>>>>
>>>> </CsInstruments>
>>>> <CsScore>
>>>> f0 20
>>>> ;sine wave.
>>>> f 1 0 16384 10 1
>>>>
>>>> e
>>>> </CsScore>
>>>> </CsoundSynthesizer>
>>>> Richard
>>>>
>>>> On 15/03/17 22:21, Emmett Palaima wrote:
>>>>> Oeyvind is correct, the issue is definitely that you are using i-rate variables for chanctrl and ctrl7. Since they are i-rate the value can't update in real time. Use k-rate instead. Pretty surprised that the instrument even ran.
>>>>>
>>>>> If you fix that it should work.
>>>>>
>>>>> On Wed, Mar 15, 2017 at 5:05 PM, Richard <[hidden email]> wrote:
>>>>> I tried it here on OS X. It does not work. Also John's suggestion did not work...
>>>>>
>>>>> Richard
>>>>>
>>>>>
>>>>>
>>>>> On 15/03/17 21:53, Oeyvind Brandtsegg wrote:
>>>>> Yes, I think, as John suggests, that you probably want to run contrl7 at k-rate
>>>>>
>>>>> not:
>>>>>     ifreq chanctrl 1, 1
>>>>> but:
>>>>>     kfreq chanctrl 1, 1
>>>>>
>>>>>
>>>>> 2017-03-15 13:47 GMT-07:00 jpff <[hidden email]>:
>>>>> What happens if you run the canctl.csd example from the manual?
>>>>>
>>>>> <CsoundSynthesizer>
>>>>> <CsOptions>
>>>>> ; Select audio/midi flags here according to platform
>>>>> ; Audio out   No messages  MIDI in
>>>>> -odac            -d         -M0  ;;;RT audio I/O with MIDI in
>>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>>> ; For Non-realtime ouput leave only the line below:
>>>>> ; -o chanctrl.wav -W ;;; for file output any platform
>>>>> </CsOptions>
>>>>> <CsInstruments>
>>>>>
>>>>> sr = 44100
>>>>> ksmps = 32
>>>>> nchnls = 2
>>>>> 0dbfs = 1
>>>>>
>>>>> instr 1 ; press your midi keyboard and move your midi controller to see
>>>>> result
>>>>>
>>>>> ichnl  = 1              ;MIDI note inputs on channel 1
>>>>> ictlno = 7              ;use midi volume controller
>>>>> kch  chanctrl ichnl, 7  ;to control amplitude of oscil
>>>>>        printk2  kch
>>>>>
>>>>> asig oscil kch*(1/127), 220, 1
>>>>>        outs  asig, asig
>>>>> endin
>>>>>
>>>>> </CsInstruments>
>>>>> <CsScore>
>>>>> ;Dummy f-table to give time for real-time MIDI events
>>>>> f 0 30
>>>>> ;sine wave.
>>>>> f 1 0 16384 10 1
>>>>> e
>>>>>
>>>>> </CsScore>
>>>>> </CsoundSynthesizer>
>>>>>
>>>>>
>>>>> On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>>
>>>>> I'm definitely on channel 1. Running on OSX. The thing is that it displays
>>>>> note events in the console without any op codes, but not controller
>>>>> events.
>>>>>
>>>>> On Wed, Mar 15, 2017 at 4:32 PM jpff <[hidden email]> wrote:
>>>>>         I know next to noting about MIDI but yoour chanctrl opcode only
>>>>>         woks at
>>>>>         init time -- is that what you want?
>>>>>
>>>>>         Same for ctrl7.
>>>>>
>>>>>         Peraps yo at a k-va as reslt.....
>>>>>
>>>>>
>>>>>         On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>>
>>>>>         >
>>>>>         > instr 1
>>>>>         >
>>>>>         >
>>>>>         >       iamp ampmidi 0.5             ;This works
>>>>>         >
>>>>>         >       icps cpsmidi                 ;This works as well
>>>>>         >
>>>>>         >
>>>>>         >
>>>>>         >       ifreq chanctrl 1, 1          ;This does not
>>>>>         >
>>>>>         >       ifreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>>         >
>>>>>         >
>>>>>         >       print ifreq
>>>>>         >
>>>>>         >       aOsc1 buzz iamp, icps, 10, 1
>>>>>         >
>>>>>         >       aFilt lowpass2 aOsc1, ifreq, 10
>>>>>         >
>>>>>         >
>>>>>         >        out aFilt, aFilt
>>>>>         >
>>>>>         > endin
>>>>>         >
>>>>>         >
>>>>>         > The main thing I don't understand is why it isn't displaying
>>>>>         controller
>>>>>         > changes in the console.
>>>>>         >
>>>>>         >
>>>>>         > On Wed, Mar 15, 2017 at 3:45 PM, Arthur Hunkins
>>>>>         > <[hidden email]> wrote:
>>>>>         >       I use ctrl7 all the time.
>>>>>         >
>>>>>         > Art Hunkinshttp://www.arthunkins.com
>>>>>         >
>>>>>         > On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley
>>>>>         <[hidden email]>
>>>>>         > wrote:
>>>>>         >       Sorry for this total newbie question, but how do I get
>>>>>         >       Csound to read the controller data from my MIDI keyboard?
>>>>>         >       Right now it's reading the note data, so I'm confused as
>>>>>         to
>>>>>         >       why it isn't for the control messages.
>>>>>         >
>>>>>         >       Thanks,
>>>>>         >       Sam
>>>>>         >
>>>>>         > Csound mailing list
>>>>>         > [hidden email]
>>>>>         > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>         > Send bugs reports to
>>>>>         >         https://github.com/csound/csound/issues
>>>>>         > Discussions of bugs and features can be posted here
>>>>>         >
>>>>>         >
>>>>>         > Csound mailing list [hidden email]
>>>>>         > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>         reports to
>>>>>         > https://github.com/csound/csound/issues Discussions of bugs and
>>>>>         features
>>>>>         > can be posted here
>>>>>         >
>>>>>         >
>>>>>         > Csound mailing list [hidden email]
>>>>>         > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>         reports to
>>>>>         > https://github.com/csound/csound/issues Discussions of bugs and
>>>>>         features can
>>>>>         > be posted here
>>>>>         >
>>>>>
>>>>>         Csound mailing list
>>>>>         [hidden email]
>>>>>         https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>         Send bugs reports to
>>>>>                 https://github.com/csound/csound/issues
>>>>>         Discussions of bugs and features can be posted here
>>>>>
>>>>> Csound mailing list [hidden email]
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>> https://github.com/csound/csound/issues Discussions of bugs and features
>>>>> can
>>>>> be posted here
>>>>>
>>>>> Csound mailing list
>>>>> [hidden email]
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>          https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>>
>>>>>
>>>>>
>>>>> Csound mailing list
>>>>> [hidden email]
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>         https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>>>
>>>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>          https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Csound MIDI Controller Data

Victor Lazzarini
Only Note ON messages can trigger instruments, nothing else. It’s how it always worked. You can parse MIDI with midiin and use any message from that to
trigger instruments, but that’s a different story.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 15 Mar 2017, at 22:33, Richard <[hidden email]> wrote:
>
> So Channel Voice Messages on channel 1 trigger instr 1 by default as we know. But why do Control Change Messages on channel 1 do not have the same effect? Is that not a bug?
>
> Richard
>
>
> On 15/03/17 23:24, Victor Lazzarini wrote:
>> As far as Csound is concerned, there is no difference between the MIDI modules, so what works for virtual, works for
>> the rest. Your instrument needs to be triggered by a MIDI note and once that is running, sending data to
>> chanctl works. With MIDI virtual there is no way to hold a note down and move a slider, but I just added an envelope
>> with a long release time, so when I pressed and released a key it would carry on for a while. Then I could move the
>> slider and see the data printed on the screen. Of course, if you add a score line, then you don’t need to trigger
>> the instr via MIDI.
>>
>>  instr 1
>>
>>     iamp ampmidi 0.5             ;This works
>>     icps cpsmidi                 ;This works as well
>>     kfreq chanctrl 1, 1          ;This does not
>>     kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>     printk2 kfreq
>>     printk2 kfreq2
>>     aOsc1 buzz iamp, icps, 10, -1
>>     aFilt lowpass2 aOsc1, kfreq, 10
>>     aFilt linenr aFilt, 0.1, 20, 0.01
>>
>>      out aFilt, aFilt
>> endin
>>
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 15 Mar 2017, at 22:14, Richard <[hidden email]> wrote:
>>>
>>> Without virtual, with a real instrument, this does not work. I had to start instr 1 to get it running, while the normal midi data kept coming without that:
>>>
>>> <CsoundSynthesizer>
>>> <CsOptions>
>>> ; Select audio/midi flags here according to platform
>>> -odac  -+rtmidi=portmidi   -Ma  ;;;RT audio I/O with MIDI in
>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>> ; For Non-realtime ouput leave only the line below:
>>> ; -o cpsmidi.wav -W ;;; for file output any platform
>>> </CsOptions>
>>> <CsInstruments>
>>>
>>> sr = 44100
>>> ksmps = 32
>>> nchnls = 2
>>> 0dbfs = 1
>>>
>>> instr 1
>>>
>>>    iamp ampmidi 0.5             ;This works
>>>    icps cpsmidi                 ;This works as well
>>>    kfreq chanctrl 1, 1          ;This does not
>>>    kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>    printk2 kfreq
>>>    printk2 kfreq2
>>>    aOsc1 buzz iamp, icps, 10, 1
>>>    aFilt lowpass2 aOsc1, kfreq, 10
>>>
>>>     out aFilt, aFilt
>>> endin
>>>
>>>
>>> </CsInstruments>
>>> <CsScore>
>>> f0 200
>>> i1 0    200  ;<---- this was needed!
>>> ;sine wave.
>>> f 1 0 16384 10 1
>>> e
>>> </CsScore>
>>> </CsoundSynthesizer>
>>>
>>>
>>> On 15/03/17 22:44, Victor Lazzarini wrote:
>>>> tested your instrument and it also runs here, both chanctrl and ctl7 work perfectly.
>>>> OSX, using -+rtmidi=virtual.
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>
>>>>> On 15 Mar 2017, at 21:26, Richard <[hidden email]> wrote:
>>>>>
>>>>> I tried k-rate but it does not work...Here's the csd:
>>>>>
>>>>> <CsoundSynthesizer>
>>>>> <CsOptions>
>>>>> ; Select audio/midi flags here according to platform
>>>>> -odac     -M0  ;;;RT audio I/O with MIDI in
>>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>>> ; For Non-realtime ouput leave only the line below:
>>>>> ; -o cpsmidi.wav -W ;;; for file output any platform
>>>>> </CsOptions>
>>>>> <CsInstruments>
>>>>>
>>>>> sr = 44100
>>>>> ksmps = 32
>>>>> nchnls = 2
>>>>> 0dbfs = 1
>>>>>
>>>>> instr 1
>>>>>
>>>>>     iamp ampmidi 0.5             ;This works
>>>>>     icps cpsmidi                 ;This works as well
>>>>>     kfreq chanctrl 1, 1          ;This does not
>>>>>     kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>>     printk2 kfreq
>>>>>     printk2 kfreq2
>>>>>     aOsc1 buzz iamp, icps, 10, 1
>>>>>     aFilt lowpass2 aOsc1, kfreq, 10
>>>>>
>>>>>      out aFilt, aFilt
>>>>> endin
>>>>>
>>>>> </CsInstruments>
>>>>> <CsScore>
>>>>> f0 20
>>>>> ;sine wave.
>>>>> f 1 0 16384 10 1
>>>>>
>>>>> e
>>>>> </CsScore>
>>>>> </CsoundSynthesizer>
>>>>> Richard
>>>>>
>>>>> On 15/03/17 22:21, Emmett Palaima wrote:
>>>>>> Oeyvind is correct, the issue is definitely that you are using i-rate variables for chanctrl and ctrl7. Since they are i-rate the value can't update in real time. Use k-rate instead. Pretty surprised that the instrument even ran.
>>>>>>
>>>>>> If you fix that it should work.
>>>>>>
>>>>>> On Wed, Mar 15, 2017 at 5:05 PM, Richard <[hidden email]> wrote:
>>>>>> I tried it here on OS X. It does not work. Also John's suggestion did not work...
>>>>>>
>>>>>> Richard
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 15/03/17 21:53, Oeyvind Brandtsegg wrote:
>>>>>> Yes, I think, as John suggests, that you probably want to run contrl7 at k-rate
>>>>>>
>>>>>> not:
>>>>>>    ifreq chanctrl 1, 1
>>>>>> but:
>>>>>>    kfreq chanctrl 1, 1
>>>>>>
>>>>>>
>>>>>> 2017-03-15 13:47 GMT-07:00 jpff <[hidden email]>:
>>>>>> What happens if you run the canctl.csd example from the manual?
>>>>>>
>>>>>> <CsoundSynthesizer>
>>>>>> <CsOptions>
>>>>>> ; Select audio/midi flags here according to platform
>>>>>> ; Audio out   No messages  MIDI in
>>>>>> -odac            -d         -M0  ;;;RT audio I/O with MIDI in
>>>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>>>> ; For Non-realtime ouput leave only the line below:
>>>>>> ; -o chanctrl.wav -W ;;; for file output any platform
>>>>>> </CsOptions>
>>>>>> <CsInstruments>
>>>>>>
>>>>>> sr = 44100
>>>>>> ksmps = 32
>>>>>> nchnls = 2
>>>>>> 0dbfs = 1
>>>>>>
>>>>>> instr 1 ; press your midi keyboard and move your midi controller to see
>>>>>> result
>>>>>>
>>>>>> ichnl  = 1              ;MIDI note inputs on channel 1
>>>>>> ictlno = 7              ;use midi volume controller
>>>>>> kch  chanctrl ichnl, 7  ;to control amplitude of oscil
>>>>>>       printk2  kch
>>>>>>
>>>>>> asig oscil kch*(1/127), 220, 1
>>>>>>       outs  asig, asig
>>>>>> endin
>>>>>>
>>>>>> </CsInstruments>
>>>>>> <CsScore>
>>>>>> ;Dummy f-table to give time for real-time MIDI events
>>>>>> f 0 30
>>>>>> ;sine wave.
>>>>>> f 1 0 16384 10 1
>>>>>> e
>>>>>>
>>>>>> </CsScore>
>>>>>> </CsoundSynthesizer>
>>>>>>
>>>>>>
>>>>>> On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>>>
>>>>>> I'm definitely on channel 1. Running on OSX. The thing is that it displays
>>>>>> note events in the console without any op codes, but not controller
>>>>>> events.
>>>>>>
>>>>>> On Wed, Mar 15, 2017 at 4:32 PM jpff <[hidden email]> wrote:
>>>>>>        I know next to noting about MIDI but yoour chanctrl opcode only
>>>>>>        woks at
>>>>>>        init time -- is that what you want?
>>>>>>
>>>>>>        Same for ctrl7.
>>>>>>
>>>>>>        Peraps yo at a k-va as reslt.....
>>>>>>
>>>>>>
>>>>>>        On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>>>
>>>>>>        >
>>>>>>        > instr 1
>>>>>>        >
>>>>>>        >
>>>>>>        >       iamp ampmidi 0.5             ;This works
>>>>>>        >
>>>>>>        >       icps cpsmidi                 ;This works as well
>>>>>>        >
>>>>>>        >
>>>>>>        >
>>>>>>        >       ifreq chanctrl 1, 1          ;This does not
>>>>>>        >
>>>>>>        >       ifreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>>>        >
>>>>>>        >
>>>>>>        >       print ifreq
>>>>>>        >
>>>>>>        >       aOsc1 buzz iamp, icps, 10, 1
>>>>>>        >
>>>>>>        >       aFilt lowpass2 aOsc1, ifreq, 10
>>>>>>        >
>>>>>>        >
>>>>>>        >        out aFilt, aFilt
>>>>>>        >
>>>>>>        > endin
>>>>>>        >
>>>>>>        >
>>>>>>        > The main thing I don't understand is why it isn't displaying
>>>>>>        controller
>>>>>>        > changes in the console.
>>>>>>        >
>>>>>>        >
>>>>>>        > On Wed, Mar 15, 2017 at 3:45 PM, Arthur Hunkins
>>>>>>        > <[hidden email]> wrote:
>>>>>>        >       I use ctrl7 all the time.
>>>>>>        >
>>>>>>        > Art Hunkinshttp://www.arthunkins.com
>>>>>>        >
>>>>>>        > On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley
>>>>>>        <[hidden email]>
>>>>>>        > wrote:
>>>>>>        >       Sorry for this total newbie question, but how do I get
>>>>>>        >       Csound to read the controller data from my MIDI keyboard?
>>>>>>        >       Right now it's reading the note data, so I'm confused as
>>>>>>        to
>>>>>>        >       why it isn't for the control messages.
>>>>>>        >
>>>>>>        >       Thanks,
>>>>>>        >       Sam
>>>>>>        >
>>>>>>        > Csound mailing list
>>>>>>        > [hidden email]
>>>>>>        > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>        > Send bugs reports to
>>>>>>        >         https://github.com/csound/csound/issues
>>>>>>        > Discussions of bugs and features can be posted here
>>>>>>        >
>>>>>>        >
>>>>>>        > Csound mailing list [hidden email]
>>>>>>        > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>        reports to
>>>>>>        > https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>        features
>>>>>>        > can be posted here
>>>>>>        >
>>>>>>        >
>>>>>>        > Csound mailing list [hidden email]
>>>>>>        > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>        reports to
>>>>>>        > https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>        features can
>>>>>>        > be posted here
>>>>>>        >
>>>>>>
>>>>>>        Csound mailing list
>>>>>>        [hidden email]
>>>>>>        https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>        Send bugs reports to
>>>>>>                https://github.com/csound/csound/issues
>>>>>>        Discussions of bugs and features can be posted here
>>>>>>
>>>>>> Csound mailing list [hidden email]
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features
>>>>>> can
>>>>>> be posted here
>>>>>>
>>>>>> Csound mailing list
>>>>>> [hidden email]
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>         https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>>>
>>>>>>
>>>>>>
>>>>>> Csound mailing list
>>>>>> [hidden email]
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>        https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>>>
>>>>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>> Csound mailing list
>>>> [hidden email]
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>         https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>       https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Csound MIDI Controller Data

Victor Lazzarini
https://csound.github.io/docs/manual/MidiTop.html

"When MIDI input is enabled (with -M or -F), each incoming noteon message will generate a note event for an instrument which has the same number as the channel of the event”

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 15 Mar 2017, at 22:46, Victor Lazzarini <[hidden email]> wrote:
>
> Only Note ON messages can trigger instruments, nothing else. It’s how it always worked. You can parse MIDI with midiin and use any message from that to
> trigger instruments, but that’s a different story.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 15 Mar 2017, at 22:33, Richard <[hidden email]> wrote:
>>
>> So Channel Voice Messages on channel 1 trigger instr 1 by default as we know. But why do Control Change Messages on channel 1 do not have the same effect? Is that not a bug?
>>
>> Richard
>>
>>
>> On 15/03/17 23:24, Victor Lazzarini wrote:
>>> As far as Csound is concerned, there is no difference between the MIDI modules, so what works for virtual, works for
>>> the rest. Your instrument needs to be triggered by a MIDI note and once that is running, sending data to
>>> chanctl works. With MIDI virtual there is no way to hold a note down and move a slider, but I just added an envelope
>>> with a long release time, so when I pressed and released a key it would carry on for a while. Then I could move the
>>> slider and see the data printed on the screen. Of course, if you add a score line, then you don’t need to trigger
>>> the instr via MIDI.
>>>
>>> instr 1
>>>
>>>    iamp ampmidi 0.5             ;This works
>>>    icps cpsmidi                 ;This works as well
>>>    kfreq chanctrl 1, 1          ;This does not
>>>    kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>    printk2 kfreq
>>>    printk2 kfreq2
>>>    aOsc1 buzz iamp, icps, 10, -1
>>>    aFilt lowpass2 aOsc1, kfreq, 10
>>>    aFilt linenr aFilt, 0.1, 20, 0.01
>>>
>>>     out aFilt, aFilt
>>> endin
>>>
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 15 Mar 2017, at 22:14, Richard <[hidden email]> wrote:
>>>>
>>>> Without virtual, with a real instrument, this does not work. I had to start instr 1 to get it running, while the normal midi data kept coming without that:
>>>>
>>>> <CsoundSynthesizer>
>>>> <CsOptions>
>>>> ; Select audio/midi flags here according to platform
>>>> -odac  -+rtmidi=portmidi   -Ma  ;;;RT audio I/O with MIDI in
>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>> ; For Non-realtime ouput leave only the line below:
>>>> ; -o cpsmidi.wav -W ;;; for file output any platform
>>>> </CsOptions>
>>>> <CsInstruments>
>>>>
>>>> sr = 44100
>>>> ksmps = 32
>>>> nchnls = 2
>>>> 0dbfs = 1
>>>>
>>>> instr 1
>>>>
>>>>   iamp ampmidi 0.5             ;This works
>>>>   icps cpsmidi                 ;This works as well
>>>>   kfreq chanctrl 1, 1          ;This does not
>>>>   kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>   printk2 kfreq
>>>>   printk2 kfreq2
>>>>   aOsc1 buzz iamp, icps, 10, 1
>>>>   aFilt lowpass2 aOsc1, kfreq, 10
>>>>
>>>>    out aFilt, aFilt
>>>> endin
>>>>
>>>>
>>>> </CsInstruments>
>>>> <CsScore>
>>>> f0 200
>>>> i1 0    200  ;<---- this was needed!
>>>> ;sine wave.
>>>> f 1 0 16384 10 1
>>>> e
>>>> </CsScore>
>>>> </CsoundSynthesizer>
>>>>
>>>>
>>>> On 15/03/17 22:44, Victor Lazzarini wrote:
>>>>> tested your instrument and it also runs here, both chanctrl and ctl7 work perfectly.
>>>>> OSX, using -+rtmidi=virtual.
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>> Maynooth University,
>>>>> Maynooth, Co Kildare, Ireland
>>>>> Tel: 00 353 7086936
>>>>> Fax: 00 353 1 7086952
>>>>>
>>>>>> On 15 Mar 2017, at 21:26, Richard <[hidden email]> wrote:
>>>>>>
>>>>>> I tried k-rate but it does not work...Here's the csd:
>>>>>>
>>>>>> <CsoundSynthesizer>
>>>>>> <CsOptions>
>>>>>> ; Select audio/midi flags here according to platform
>>>>>> -odac     -M0  ;;;RT audio I/O with MIDI in
>>>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>>>> ; For Non-realtime ouput leave only the line below:
>>>>>> ; -o cpsmidi.wav -W ;;; for file output any platform
>>>>>> </CsOptions>
>>>>>> <CsInstruments>
>>>>>>
>>>>>> sr = 44100
>>>>>> ksmps = 32
>>>>>> nchnls = 2
>>>>>> 0dbfs = 1
>>>>>>
>>>>>> instr 1
>>>>>>
>>>>>>    iamp ampmidi 0.5             ;This works
>>>>>>    icps cpsmidi                 ;This works as well
>>>>>>    kfreq chanctrl 1, 1          ;This does not
>>>>>>    kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>>>    printk2 kfreq
>>>>>>    printk2 kfreq2
>>>>>>    aOsc1 buzz iamp, icps, 10, 1
>>>>>>    aFilt lowpass2 aOsc1, kfreq, 10
>>>>>>
>>>>>>     out aFilt, aFilt
>>>>>> endin
>>>>>>
>>>>>> </CsInstruments>
>>>>>> <CsScore>
>>>>>> f0 20
>>>>>> ;sine wave.
>>>>>> f 1 0 16384 10 1
>>>>>>
>>>>>> e
>>>>>> </CsScore>
>>>>>> </CsoundSynthesizer>
>>>>>> Richard
>>>>>>
>>>>>> On 15/03/17 22:21, Emmett Palaima wrote:
>>>>>>> Oeyvind is correct, the issue is definitely that you are using i-rate variables for chanctrl and ctrl7. Since they are i-rate the value can't update in real time. Use k-rate instead. Pretty surprised that the instrument even ran.
>>>>>>>
>>>>>>> If you fix that it should work.
>>>>>>>
>>>>>>> On Wed, Mar 15, 2017 at 5:05 PM, Richard <[hidden email]> wrote:
>>>>>>> I tried it here on OS X. It does not work. Also John's suggestion did not work...
>>>>>>>
>>>>>>> Richard
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 15/03/17 21:53, Oeyvind Brandtsegg wrote:
>>>>>>> Yes, I think, as John suggests, that you probably want to run contrl7 at k-rate
>>>>>>>
>>>>>>> not:
>>>>>>>   ifreq chanctrl 1, 1
>>>>>>> but:
>>>>>>>   kfreq chanctrl 1, 1
>>>>>>>
>>>>>>>
>>>>>>> 2017-03-15 13:47 GMT-07:00 jpff <[hidden email]>:
>>>>>>> What happens if you run the canctl.csd example from the manual?
>>>>>>>
>>>>>>> <CsoundSynthesizer>
>>>>>>> <CsOptions>
>>>>>>> ; Select audio/midi flags here according to platform
>>>>>>> ; Audio out   No messages  MIDI in
>>>>>>> -odac            -d         -M0  ;;;RT audio I/O with MIDI in
>>>>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>>>>> ; For Non-realtime ouput leave only the line below:
>>>>>>> ; -o chanctrl.wav -W ;;; for file output any platform
>>>>>>> </CsOptions>
>>>>>>> <CsInstruments>
>>>>>>>
>>>>>>> sr = 44100
>>>>>>> ksmps = 32
>>>>>>> nchnls = 2
>>>>>>> 0dbfs = 1
>>>>>>>
>>>>>>> instr 1 ; press your midi keyboard and move your midi controller to see
>>>>>>> result
>>>>>>>
>>>>>>> ichnl  = 1              ;MIDI note inputs on channel 1
>>>>>>> ictlno = 7              ;use midi volume controller
>>>>>>> kch  chanctrl ichnl, 7  ;to control amplitude of oscil
>>>>>>>      printk2  kch
>>>>>>>
>>>>>>> asig oscil kch*(1/127), 220, 1
>>>>>>>      outs  asig, asig
>>>>>>> endin
>>>>>>>
>>>>>>> </CsInstruments>
>>>>>>> <CsScore>
>>>>>>> ;Dummy f-table to give time for real-time MIDI events
>>>>>>> f 0 30
>>>>>>> ;sine wave.
>>>>>>> f 1 0 16384 10 1
>>>>>>> e
>>>>>>>
>>>>>>> </CsScore>
>>>>>>> </CsoundSynthesizer>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>>>>
>>>>>>> I'm definitely on channel 1. Running on OSX. The thing is that it displays
>>>>>>> note events in the console without any op codes, but not controller
>>>>>>> events.
>>>>>>>
>>>>>>> On Wed, Mar 15, 2017 at 4:32 PM jpff <[hidden email]> wrote:
>>>>>>>       I know next to noting about MIDI but yoour chanctrl opcode only
>>>>>>>       woks at
>>>>>>>       init time -- is that what you want?
>>>>>>>
>>>>>>>       Same for ctrl7.
>>>>>>>
>>>>>>>       Peraps yo at a k-va as reslt.....
>>>>>>>
>>>>>>>
>>>>>>>       On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> instr 1
>>>>>>>>
>>>>>>>>
>>>>>>>>      iamp ampmidi 0.5             ;This works
>>>>>>>>
>>>>>>>>      icps cpsmidi                 ;This works as well
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>      ifreq chanctrl 1, 1          ;This does not
>>>>>>>>
>>>>>>>>      ifreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>>>>>
>>>>>>>>
>>>>>>>>      print ifreq
>>>>>>>>
>>>>>>>>      aOsc1 buzz iamp, icps, 10, 1
>>>>>>>>
>>>>>>>>      aFilt lowpass2 aOsc1, ifreq, 10
>>>>>>>>
>>>>>>>>
>>>>>>>>       out aFilt, aFilt
>>>>>>>>
>>>>>>>> endin
>>>>>>>>
>>>>>>>>
>>>>>>>> The main thing I don't understand is why it isn't displaying
>>>>>>>       controller
>>>>>>>> changes in the console.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Mar 15, 2017 at 3:45 PM, Arthur Hunkins
>>>>>>>> <[hidden email]> wrote:
>>>>>>>>      I use ctrl7 all the time.
>>>>>>>>
>>>>>>>> Art Hunkinshttp://www.arthunkins.com
>>>>>>>>
>>>>>>>> On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley
>>>>>>>       <[hidden email]>
>>>>>>>> wrote:
>>>>>>>>      Sorry for this total newbie question, but how do I get
>>>>>>>>      Csound to read the controller data from my MIDI keyboard?
>>>>>>>>      Right now it's reading the note data, so I'm confused as
>>>>>>>       to
>>>>>>>>      why it isn't for the control messages.
>>>>>>>>
>>>>>>>>      Thanks,
>>>>>>>>      Sam
>>>>>>>>
>>>>>>>> Csound mailing list
>>>>>>>> [hidden email]
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>> Send bugs reports to
>>>>>>>>        https://github.com/csound/csound/issues
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>
>>>>>>>>
>>>>>>>> Csound mailing list [hidden email]
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>>       reports to
>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>       features
>>>>>>>> can be posted here
>>>>>>>>
>>>>>>>>
>>>>>>>> Csound mailing list [hidden email]
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>>       reports to
>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>       features can
>>>>>>>> be posted here
>>>>>>>>
>>>>>>>
>>>>>>>       Csound mailing list
>>>>>>>       [hidden email]
>>>>>>>       https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>       Send bugs reports to
>>>>>>>               https://github.com/csound/csound/issues
>>>>>>>       Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list [hidden email]
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features
>>>>>>> can
>>>>>>> be posted here
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> [hidden email]
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>        https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> [hidden email]
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>       https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>> Csound mailing list
>>>>> [hidden email]
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>        https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>> Csound mailing list
>>>> [hidden email]
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>      https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>        https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>      https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Csound MIDI Controller Data

Partev Barr Sarkissian
In reply to this post by Samuel Smalley


There are four MIDI Modes,... is the MIDI device you're trying
to talk to in the right MIDI Mode (Omni, Poly, etc)?

Transmitting MIDI and Receiver of MIDI, both on same channel.
Control-7 for Channel and Volume. Frequency and amplitude works.

Is the MIDI data two bytes or three bytes?



-PBS


=========================================================

--- [hidden email] wrote:

From:         Victor Lazzarini <[hidden email]>
To:           [hidden email]
Subject: Re: [Csnd] Csound MIDI Controller Data
Date:         Wed, 15 Mar 2017 22:50:39 +0000

https://csound.github.io/docs/manual/MidiTop.html

"When MIDI input is enabled (with -M or -F), each incoming noteon message will generate a note event for an instrument which has the same number as the channel of the event”

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 15 Mar 2017, at 22:46, Victor Lazzarini <[hidden email]> wrote:
>
> Only Note ON messages can trigger instruments, nothing else. It’s how it always worked. You can parse MIDI with midiin and use any message from that to
> trigger instruments, but that’s a different story.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 15 Mar 2017, at 22:33, Richard <[hidden email]> wrote:
>>
>> So Channel Voice Messages on channel 1 trigger instr 1 by default as we know. But why do Control Change Messages on channel 1 do not have the same effect? Is that not a bug?
>>
>> Richard
>>
>>
>> On 15/03/17 23:24, Victor Lazzarini wrote:
>>> As far as Csound is concerned, there is no difference between the MIDI modules, so what works for virtual, works for
>>> the rest. Your instrument needs to be triggered by a MIDI note and once that is running, sending data to
>>> chanctl works. With MIDI virtual there is no way to hold a note down and move a slider, but I just added an envelope
>>> with a long release time, so when I pressed and released a key it would carry on for a while. Then I could move the
>>> slider and see the data printed on the screen. Of course, if you add a score line, then you don’t need to trigger
>>> the instr via MIDI.
>>>
>>> instr 1
>>>
>>>    iamp ampmidi 0.5             ;This works
>>>    icps cpsmidi                 ;This works as well
>>>    kfreq chanctrl 1, 1          ;This does not
>>>    kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>    printk2 kfreq
>>>    printk2 kfreq2
>>>    aOsc1 buzz iamp, icps, 10, -1
>>>    aFilt lowpass2 aOsc1, kfreq, 10
>>>    aFilt linenr aFilt, 0.1, 20, 0.01
>>>
>>>     out aFilt, aFilt
>>> endin
>>>
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 15 Mar 2017, at 22:14, Richard <[hidden email]> wrote:
>>>>
>>>> Without virtual, with a real instrument, this does not work. I had to start instr 1 to get it running, while the normal midi data kept coming without that:
>>>>
>>>> <CsoundSynthesizer>
>>>> <CsOptions>
>>>> ; Select audio/midi flags here according to platform
>>>> -odac  -+rtmidi=portmidi   -Ma  ;;;RT audio I/O with MIDI in
>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>> ; For Non-realtime ouput leave only the line below:
>>>> ; -o cpsmidi.wav -W ;;; for file output any platform
>>>> </CsOptions>
>>>> <CsInstruments>
>>>>
>>>> sr = 44100
>>>> ksmps = 32
>>>> nchnls = 2
>>>> 0dbfs = 1
>>>>
>>>> instr 1
>>>>
>>>>   iamp ampmidi 0.5             ;This works
>>>>   icps cpsmidi                 ;This works as well
>>>>   kfreq chanctrl 1, 1          ;This does not
>>>>   kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>   printk2 kfreq
>>>>   printk2 kfreq2
>>>>   aOsc1 buzz iamp, icps, 10, 1
>>>>   aFilt lowpass2 aOsc1, kfreq, 10
>>>>
>>>>    out aFilt, aFilt
>>>> endin
>>>>
>>>>
>>>> </CsInstruments>
>>>> <CsScore>
>>>> f0 200
>>>> i1 0    200  ;<---- this was needed!
>>>> ;sine wave.
>>>> f 1 0 16384 10 1
>>>> e
>>>> </CsScore>
>>>> </CsoundSynthesizer>
>>>>
>>>>
>>>> On 15/03/17 22:44, Victor Lazzarini wrote:
>>>>> tested your instrument and it also runs here, both chanctrl and ctl7 work perfectly.
>>>>> OSX, using -+rtmidi=virtual.
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>> Maynooth University,
>>>>> Maynooth, Co Kildare, Ireland
>>>>> Tel: 00 353 7086936
>>>>> Fax: 00 353 1 7086952
>>>>>
>>>>>> On 15 Mar 2017, at 21:26, Richard <[hidden email]> wrote:
>>>>>>
>>>>>> I tried k-rate but it does not work...Here's the csd:
>>>>>>
>>>>>> <CsoundSynthesizer>
>>>>>> <CsOptions>
>>>>>> ; Select audio/midi flags here according to platform
>>>>>> -odac     -M0  ;;;RT audio I/O with MIDI in
>>>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>>>> ; For Non-realtime ouput leave only the line below:
>>>>>> ; -o cpsmidi.wav -W ;;; for file output any platform
>>>>>> </CsOptions>
>>>>>> <CsInstruments>
>>>>>>
>>>>>> sr = 44100
>>>>>> ksmps = 32
>>>>>> nchnls = 2
>>>>>> 0dbfs = 1
>>>>>>
>>>>>> instr 1
>>>>>>
>>>>>>    iamp ampmidi 0.5             ;This works
>>>>>>    icps cpsmidi                 ;This works as well
>>>>>>    kfreq chanctrl 1, 1          ;This does not
>>>>>>    kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>>>    printk2 kfreq
>>>>>>    printk2 kfreq2
>>>>>>    aOsc1 buzz iamp, icps, 10, 1
>>>>>>    aFilt lowpass2 aOsc1, kfreq, 10
>>>>>>
>>>>>>     out aFilt, aFilt
>>>>>> endin
>>>>>>
>>>>>> </CsInstruments>
>>>>>> <CsScore>
>>>>>> f0 20
>>>>>> ;sine wave.
>>>>>> f 1 0 16384 10 1
>>>>>>
>>>>>> e
>>>>>> </CsScore>
>>>>>> </CsoundSynthesizer>
>>>>>> Richard
>>>>>>
>>>>>> On 15/03/17 22:21, Emmett Palaima wrote:
>>>>>>> Oeyvind is correct, the issue is definitely that you are using i-rate variables for chanctrl and ctrl7. Since they are i-rate the value can't update in real time. Use k-rate instead. Pretty surprised that the instrument even ran.
>>>>>>>
>>>>>>> If you fix that it should work.
>>>>>>>
>>>>>>> On Wed, Mar 15, 2017 at 5:05 PM, Richard <[hidden email]> wrote:
>>>>>>> I tried it here on OS X. It does not work. Also John's suggestion did not work...
>>>>>>>
>>>>>>> Richard
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On 15/03/17 21:53, Oeyvind Brandtsegg wrote:
>>>>>>> Yes, I think, as John suggests, that you probably want to run contrl7 at k-rate
>>>>>>>
>>>>>>> not:
>>>>>>>   ifreq chanctrl 1, 1
>>>>>>> but:
>>>>>>>   kfreq chanctrl 1, 1
>>>>>>>
>>>>>>>
>>>>>>> 2017-03-15 13:47 GMT-07:00 jpff <[hidden email]>:
>>>>>>> What happens if you run the canctl.csd example from the manual?
>>>>>>>
>>>>>>> <CsoundSynthesizer>
>>>>>>> <CsOptions>
>>>>>>> ; Select audio/midi flags here according to platform
>>>>>>> ; Audio out   No messages  MIDI in
>>>>>>> -odac            -d         -M0  ;;;RT audio I/O with MIDI in
>>>>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>>>>> ; For Non-realtime ouput leave only the line below:
>>>>>>> ; -o chanctrl.wav -W ;;; for file output any platform
>>>>>>> </CsOptions>
>>>>>>> <CsInstruments>
>>>>>>>
>>>>>>> sr = 44100
>>>>>>> ksmps = 32
>>>>>>> nchnls = 2
>>>>>>> 0dbfs = 1
>>>>>>>
>>>>>>> instr 1 ; press your midi keyboard and move your midi controller to see
>>>>>>> result
>>>>>>>
>>>>>>> ichnl  = 1              ;MIDI note inputs on channel 1
>>>>>>> ictlno = 7              ;use midi volume controller
>>>>>>> kch  chanctrl ichnl, 7  ;to control amplitude of oscil
>>>>>>>      printk2  kch
>>>>>>>
>>>>>>> asig oscil kch*(1/127), 220, 1
>>>>>>>      outs  asig, asig
>>>>>>> endin
>>>>>>>
>>>>>>> </CsInstruments>
>>>>>>> <CsScore>
>>>>>>> ;Dummy f-table to give time for real-time MIDI events
>>>>>>> f 0 30
>>>>>>> ;sine wave.
>>>>>>> f 1 0 16384 10 1
>>>>>>> e
>>>>>>>
>>>>>>> </CsScore>
>>>>>>> </CsoundSynthesizer>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>>>>
>>>>>>> I'm definitely on channel 1. Running on OSX. The thing is that it displays
>>>>>>> note events in the console without any op codes, but not controller
>>>>>>> events.
>>>>>>>
>>>>>>> On Wed, Mar 15, 2017 at 4:32 PM jpff <[hidden email]> wrote:
>>>>>>>       I know next to noting about MIDI but yoour chanctrl opcode only
>>>>>>>       woks at
>>>>>>>       init time -- is that what you want?
>>>>>>>
>>>>>>>       Same for ctrl7.
>>>>>>>
>>>>>>>       Peraps yo at a k-va as reslt.....
>>>>>>>
>>>>>>>
>>>>>>>       On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> instr 1
>>>>>>>>
>>>>>>>>
>>>>>>>>      iamp ampmidi 0.5             ;This works
>>>>>>>>
>>>>>>>>      icps cpsmidi                 ;This works as well
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>      ifreq chanctrl 1, 1          ;This does not
>>>>>>>>
>>>>>>>>      ifreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>>>>>
>>>>>>>>
>>>>>>>>      print ifreq
>>>>>>>>
>>>>>>>>      aOsc1 buzz iamp, icps, 10, 1
>>>>>>>>
>>>>>>>>      aFilt lowpass2 aOsc1, ifreq, 10
>>>>>>>>
>>>>>>>>
>>>>>>>>       out aFilt, aFilt
>>>>>>>>
>>>>>>>> endin
>>>>>>>>
>>>>>>>>
>>>>>>>> The main thing I don't understand is why it isn't displaying
>>>>>>>       controller
>>>>>>>> changes in the console.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Mar 15, 2017 at 3:45 PM, Arthur Hunkins
>>>>>>>> <[hidden email]> wrote:
>>>>>>>>      I use ctrl7 all the time.
>>>>>>>>
>>>>>>>> Art Hunkinshttp://www.arthunkins.com
>>>>>>>>
>>>>>>>> On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley
>>>>>>>       <[hidden email]>
>>>>>>>> wrote:
>>>>>>>>      Sorry for this total newbie question, but how do I get
>>>>>>>>      Csound to read the controller data from my MIDI keyboard?
>>>>>>>>      Right now it's reading the note data, so I'm confused as
>>>>>>>       to
>>>>>>>>      why it isn't for the control messages.
>>>>>>>>
>>>>>>>>      Thanks,
>>>>>>>>      Sam
>>>>>>>>
>>>>>>>> Csound mailing list
>>>>>>>> [hidden email]
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>> Send bugs reports to
>>>>>>>>        https://github.com/csound/csound/issues
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>
>>>>>>>>
>>>>>>>> Csound mailing list [hidden email]
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>>       reports to
>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>       features
>>>>>>>> can be posted here
>>>>>>>>
>>>>>>>>
>>>>>>>> Csound mailing list [hidden email]
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>>       reports to
>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>       features can
>>>>>>>> be posted here
>>>>>>>>
>>>>>>>
>>>>>>>       Csound mailing list
>>>>>>>       [hidden email]
>>>>>>>       https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>       Send bugs reports to
>>>>>>>               https://github.com/csound/csound/issues
>>>>>>>       Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list [hidden email]
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features
>>>>>>> can
>>>>>>> be posted here
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> [hidden email]
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>        https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Csound mailing list
>>>>>>> [hidden email]
>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>> Send bugs reports to
>>>>>>>       https://github.com/csound/csound/issues
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>
>>>>>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>> Csound mailing list
>>>>> [hidden email]
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>        https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>> Csound mailing list
>>>> [hidden email]
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>      https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>        https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>      https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here




_____________________________________________________________
Netscape.  Just the Net You Need.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Csound MIDI Controller Data

zappfinger
He needs to schedule instr 1 also from the score for the control
messages to work, like

i 1 0 3600

Richard


On 19/03/17 04:55, Partev Barr Sarkissian wrote:

>
> There are four MIDI Modes,... is the MIDI device you're trying
> to talk to in the right MIDI Mode (Omni, Poly, etc)?
>
> Transmitting MIDI and Receiver of MIDI, both on same channel.
> Control-7 for Channel and Volume. Frequency and amplitude works.
>
> Is the MIDI data two bytes or three bytes?
>
>
>
> -PBS
>
>
> =========================================================
>
> --- [hidden email] wrote:
>
> From:         Victor Lazzarini <[hidden email]>
> To:           [hidden email]
> Subject: Re: [Csnd] Csound MIDI Controller Data
> Date:         Wed, 15 Mar 2017 22:50:39 +0000
>
> https://csound.github.io/docs/manual/MidiTop.html
>
> "When MIDI input is enabled (with -M or -F), each incoming noteon message will generate a note event for an instrument which has the same number as the channel of the event”
>
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 15 Mar 2017, at 22:46, Victor Lazzarini <[hidden email]> wrote:
>>
>> Only Note ON messages can trigger instruments, nothing else. It’s how it always worked. You can parse MIDI with midiin and use any message from that to
>> trigger instruments, but that’s a different story.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 15 Mar 2017, at 22:33, Richard <[hidden email]> wrote:
>>>
>>> So Channel Voice Messages on channel 1 trigger instr 1 by default as we know. But why do Control Change Messages on channel 1 do not have the same effect? Is that not a bug?
>>>
>>> Richard
>>>
>>>
>>> On 15/03/17 23:24, Victor Lazzarini wrote:
>>>> As far as Csound is concerned, there is no difference between the MIDI modules, so what works for virtual, works for
>>>> the rest. Your instrument needs to be triggered by a MIDI note and once that is running, sending data to
>>>> chanctl works. With MIDI virtual there is no way to hold a note down and move a slider, but I just added an envelope
>>>> with a long release time, so when I pressed and released a key it would carry on for a while. Then I could move the
>>>> slider and see the data printed on the screen. Of course, if you add a score line, then you don’t need to trigger
>>>> the instr via MIDI.
>>>>
>>>> instr 1
>>>>
>>>>     iamp ampmidi 0.5             ;This works
>>>>     icps cpsmidi                 ;This works as well
>>>>     kfreq chanctrl 1, 1          ;This does not
>>>>     kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>     printk2 kfreq
>>>>     printk2 kfreq2
>>>>     aOsc1 buzz iamp, icps, 10, -1
>>>>     aFilt lowpass2 aOsc1, kfreq, 10
>>>>     aFilt linenr aFilt, 0.1, 20, 0.01
>>>>
>>>>      out aFilt, aFilt
>>>> endin
>>>>
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>
>>>>> On 15 Mar 2017, at 22:14, Richard <[hidden email]> wrote:
>>>>>
>>>>> Without virtual, with a real instrument, this does not work. I had to start instr 1 to get it running, while the normal midi data kept coming without that:
>>>>>
>>>>> <CsoundSynthesizer>
>>>>> <CsOptions>
>>>>> ; Select audio/midi flags here according to platform
>>>>> -odac  -+rtmidi=portmidi   -Ma  ;;;RT audio I/O with MIDI in
>>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>>> ; For Non-realtime ouput leave only the line below:
>>>>> ; -o cpsmidi.wav -W ;;; for file output any platform
>>>>> </CsOptions>
>>>>> <CsInstruments>
>>>>>
>>>>> sr = 44100
>>>>> ksmps = 32
>>>>> nchnls = 2
>>>>> 0dbfs = 1
>>>>>
>>>>> instr 1
>>>>>
>>>>>    iamp ampmidi 0.5             ;This works
>>>>>    icps cpsmidi                 ;This works as well
>>>>>    kfreq chanctrl 1, 1          ;This does not
>>>>>    kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>>    printk2 kfreq
>>>>>    printk2 kfreq2
>>>>>    aOsc1 buzz iamp, icps, 10, 1
>>>>>    aFilt lowpass2 aOsc1, kfreq, 10
>>>>>
>>>>>     out aFilt, aFilt
>>>>> endin
>>>>>
>>>>>
>>>>> </CsInstruments>
>>>>> <CsScore>
>>>>> f0 200
>>>>> i1 0    200  ;<---- this was needed!
>>>>> ;sine wave.
>>>>> f 1 0 16384 10 1
>>>>> e
>>>>> </CsScore>
>>>>> </CsoundSynthesizer>
>>>>>
>>>>>
>>>>> On 15/03/17 22:44, Victor Lazzarini wrote:
>>>>>> tested your instrument and it also runs here, both chanctrl and ctl7 work perfectly.
>>>>>> OSX, using -+rtmidi=virtual.
>>>>>> ========================
>>>>>> Prof. Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>>>> Maynooth University,
>>>>>> Maynooth, Co Kildare, Ireland
>>>>>> Tel: 00 353 7086936
>>>>>> Fax: 00 353 1 7086952
>>>>>>
>>>>>>> On 15 Mar 2017, at 21:26, Richard <[hidden email]> wrote:
>>>>>>>
>>>>>>> I tried k-rate but it does not work...Here's the csd:
>>>>>>>
>>>>>>> <CsoundSynthesizer>
>>>>>>> <CsOptions>
>>>>>>> ; Select audio/midi flags here according to platform
>>>>>>> -odac     -M0  ;;;RT audio I/O with MIDI in
>>>>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>>>>> ; For Non-realtime ouput leave only the line below:
>>>>>>> ; -o cpsmidi.wav -W ;;; for file output any platform
>>>>>>> </CsOptions>
>>>>>>> <CsInstruments>
>>>>>>>
>>>>>>> sr = 44100
>>>>>>> ksmps = 32
>>>>>>> nchnls = 2
>>>>>>> 0dbfs = 1
>>>>>>>
>>>>>>> instr 1
>>>>>>>
>>>>>>>     iamp ampmidi 0.5             ;This works
>>>>>>>     icps cpsmidi                 ;This works as well
>>>>>>>     kfreq chanctrl 1, 1          ;This does not
>>>>>>>     kfreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>>>>     printk2 kfreq
>>>>>>>     printk2 kfreq2
>>>>>>>     aOsc1 buzz iamp, icps, 10, 1
>>>>>>>     aFilt lowpass2 aOsc1, kfreq, 10
>>>>>>>
>>>>>>>      out aFilt, aFilt
>>>>>>> endin
>>>>>>>
>>>>>>> </CsInstruments>
>>>>>>> <CsScore>
>>>>>>> f0 20
>>>>>>> ;sine wave.
>>>>>>> f 1 0 16384 10 1
>>>>>>>
>>>>>>> e
>>>>>>> </CsScore>
>>>>>>> </CsoundSynthesizer>
>>>>>>> Richard
>>>>>>>
>>>>>>> On 15/03/17 22:21, Emmett Palaima wrote:
>>>>>>>> Oeyvind is correct, the issue is definitely that you are using i-rate variables for chanctrl and ctrl7. Since they are i-rate the value can't update in real time. Use k-rate instead. Pretty surprised that the instrument even ran.
>>>>>>>>
>>>>>>>> If you fix that it should work.
>>>>>>>>
>>>>>>>> On Wed, Mar 15, 2017 at 5:05 PM, Richard <[hidden email]> wrote:
>>>>>>>> I tried it here on OS X. It does not work. Also John's suggestion did not work...
>>>>>>>>
>>>>>>>> Richard
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 15/03/17 21:53, Oeyvind Brandtsegg wrote:
>>>>>>>> Yes, I think, as John suggests, that you probably want to run contrl7 at k-rate
>>>>>>>>
>>>>>>>> not:
>>>>>>>>    ifreq chanctrl 1, 1
>>>>>>>> but:
>>>>>>>>    kfreq chanctrl 1, 1
>>>>>>>>
>>>>>>>>
>>>>>>>> 2017-03-15 13:47 GMT-07:00 jpff <[hidden email]>:
>>>>>>>> What happens if you run the canctl.csd example from the manual?
>>>>>>>>
>>>>>>>> <CsoundSynthesizer>
>>>>>>>> <CsOptions>
>>>>>>>> ; Select audio/midi flags here according to platform
>>>>>>>> ; Audio out   No messages  MIDI in
>>>>>>>> -odac            -d         -M0  ;;;RT audio I/O with MIDI in
>>>>>>>> ;-iadc    ;;;uncomment -iadc if RT audio input is needed too
>>>>>>>> ; For Non-realtime ouput leave only the line below:
>>>>>>>> ; -o chanctrl.wav -W ;;; for file output any platform
>>>>>>>> </CsOptions>
>>>>>>>> <CsInstruments>
>>>>>>>>
>>>>>>>> sr = 44100
>>>>>>>> ksmps = 32
>>>>>>>> nchnls = 2
>>>>>>>> 0dbfs = 1
>>>>>>>>
>>>>>>>> instr 1 ; press your midi keyboard and move your midi controller to see
>>>>>>>> result
>>>>>>>>
>>>>>>>> ichnl  = 1              ;MIDI note inputs on channel 1
>>>>>>>> ictlno = 7              ;use midi volume controller
>>>>>>>> kch  chanctrl ichnl, 7  ;to control amplitude of oscil
>>>>>>>>       printk2  kch
>>>>>>>>
>>>>>>>> asig oscil kch*(1/127), 220, 1
>>>>>>>>       outs  asig, asig
>>>>>>>> endin
>>>>>>>>
>>>>>>>> </CsInstruments>
>>>>>>>> <CsScore>
>>>>>>>> ;Dummy f-table to give time for real-time MIDI events
>>>>>>>> f 0 30
>>>>>>>> ;sine wave.
>>>>>>>> f 1 0 16384 10 1
>>>>>>>> e
>>>>>>>>
>>>>>>>> </CsScore>
>>>>>>>> </CsoundSynthesizer>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>>>>>
>>>>>>>> I'm definitely on channel 1. Running on OSX. The thing is that it displays
>>>>>>>> note events in the console without any op codes, but not controller
>>>>>>>> events.
>>>>>>>>
>>>>>>>> On Wed, Mar 15, 2017 at 4:32 PM jpff <[hidden email]> wrote:
>>>>>>>>        I know next to noting about MIDI but yoour chanctrl opcode only
>>>>>>>>        woks at
>>>>>>>>        init time -- is that what you want?
>>>>>>>>
>>>>>>>>        Same for ctrl7.
>>>>>>>>
>>>>>>>>        Peraps yo at a k-va as reslt.....
>>>>>>>>
>>>>>>>>
>>>>>>>>        On Wed, 15 Mar 2017, Samuel Smalley wrote:
>>>>>>>>
>>>>>>>>> instr 1
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>       iamp ampmidi 0.5             ;This works
>>>>>>>>>
>>>>>>>>>       icps cpsmidi                 ;This works as well
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>       ifreq chanctrl 1, 1          ;This does not
>>>>>>>>>
>>>>>>>>>       ifreq2 ctrl7 1, 1, 0, 20000  ;This also does not
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>       print ifreq
>>>>>>>>>
>>>>>>>>>       aOsc1 buzz iamp, icps, 10, 1
>>>>>>>>>
>>>>>>>>>       aFilt lowpass2 aOsc1, ifreq, 10
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>        out aFilt, aFilt
>>>>>>>>>
>>>>>>>>> endin
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> The main thing I don't understand is why it isn't displaying
>>>>>>>>        controller
>>>>>>>>> changes in the console.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Wed, Mar 15, 2017 at 3:45 PM, Arthur Hunkins
>>>>>>>>> <[hidden email]> wrote:
>>>>>>>>>       I use ctrl7 all the time.
>>>>>>>>>
>>>>>>>>> Art Hunkinshttp://www.arthunkins.com
>>>>>>>>>
>>>>>>>>> On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley
>>>>>>>>        <[hidden email]>
>>>>>>>>> wrote:
>>>>>>>>>       Sorry for this total newbie question, but how do I get
>>>>>>>>>       Csound to read the controller data from my MIDI keyboard?
>>>>>>>>>       Right now it's reading the note data, so I'm confused as
>>>>>>>>        to
>>>>>>>>>       why it isn't for the control messages.
>>>>>>>>>
>>>>>>>>>       Thanks,
>>>>>>>>>       Sam
>>>>>>>>>
>>>>>>>>> Csound mailing list
>>>>>>>>> [hidden email]
>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>>> Send bugs reports to
>>>>>>>>>         https://github.com/csound/csound/issues
>>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Csound mailing list [hidden email]
>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>>>        reports to
>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>>        features
>>>>>>>>> can be posted here
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Csound mailing list [hidden email]
>>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs
>>>>>>>>        reports to
>>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and
>>>>>>>>        features can
>>>>>>>>> be posted here
>>>>>>>>>
>>>>>>>>        Csound mailing list
>>>>>>>>        [hidden email]
>>>>>>>>        https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>>        Send bugs reports to
>>>>>>>>                https://github.com/csound/csound/issues
>>>>>>>>        Discussions of bugs and features can be posted here
>>>>>>>>
>>>>>>>> Csound mailing list [hidden email]
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>>>>>>> https://github.com/csound/csound/issues Discussions of bugs and features
>>>>>>>> can
>>>>>>>> be posted here
>>>>>>>>
>>>>>>>> Csound mailing list
>>>>>>>> [hidden email]
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>> Send bugs reports to
>>>>>>>>         https://github.com/csound/csound/issues
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Csound mailing list
>>>>>>>> [hidden email]
>>>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>>>> Send bugs reports to
>>>>>>>>        https://github.com/csound/csound/issues
>>>>>>>> Discussions of bugs and features can be posted here
>>>>>>>>
>>>>>>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>>>> Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
>>>>>> Csound mailing list
>>>>>> [hidden email]
>>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>>> Send bugs reports to
>>>>>>         https://github.com/csound/csound/issues
>>>>>> Discussions of bugs and features can be posted here
>>>>> Csound mailing list
>>>>> [hidden email]
>>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>>> Send bugs reports to
>>>>>       https://github.com/csound/csound/issues
>>>>> Discussions of bugs and features can be posted here
>>>> Csound mailing list
>>>> [hidden email]
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>         https://github.com/csound/csound/issues
>>>> Discussions of bugs and features can be posted here
>>> Csound mailing list
>>> [hidden email]
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>       https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>
>
>
>
> _____________________________________________________________
> Netscape.  Just the Net You Need.
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
12
Loading...