Csound Csound-dev Csound-tekno Search About

Re: Csound MIDI Controller Data

Date2017-03-19 03:55
FromPartev Barr Sarkissian
SubjectRe: Csound MIDI Controller Data

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 


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

--- Victor.Lazzarini@NUIM.IE wrote:

From:         Victor Lazzarini 
To:           CSOUND@LISTSERV.HEANET.IE
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  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  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  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:
>>>> 
>>>> 
>>>> 
>>>> ; 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
>>>> 
>>>> 
>>>> 
>>>> 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
>>>> 
>>>> 
>>>> 
>>>> 
>>>> f0 200
>>>> i1 0    200  ;<---- this was needed!
>>>> ;sine wave.
>>>> f 1 0 16384 10 1
>>>> e
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 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  wrote:
>>>>>> 
>>>>>> I tried k-rate but it does not work...Here's the csd:
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> ; 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
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 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
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> f0 20
>>>>>> ;sine wave.
>>>>>> f 1 0 16384 10 1
>>>>>> 
>>>>>> e
>>>>>> 
>>>>>> 
>>>>>> 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  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 :
>>>>>>> What happens if you run the canctl.csd example from the manual?
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> ; 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
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 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
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> ;Dummy f-table to give time for real-time MIDI events
>>>>>>> f 0 30
>>>>>>> ;sine wave.
>>>>>>> f 1 0 16384 10 1
>>>>>>> e
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 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  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
>>>>>>>> <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>>>>>>>>      I use ctrl7 all the time.
>>>>>>>> 
>>>>>>>> Art Hunkinshttp://www.arthunkins.com
>>>>>>>> 
>>>>>>>> On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley
>>>>>>>       
>>>>>>>> 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
>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>> 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 Csound@listserv.heanet.ie
>>>>>>>> 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 Csound@listserv.heanet.ie
>>>>>>>> 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
>>>>>>>       Csound@listserv.heanet.ie
>>>>>>>       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 Csound@listserv.heanet.ie
>>>>>>> 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
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> 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
>>>>>>> Csound@listserv.heanet.ie
>>>>>>> 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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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
>>>>> Csound@listserv.heanet.ie
>>>>> 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
>>>> Csound@listserv.heanet.ie
>>>> 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
>>> Csound@listserv.heanet.ie
>>> 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
>> Csound@listserv.heanet.ie
>> 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
> Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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
Csound@listserv.heanet.ie
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

Date2017-03-19 08:02
FromRichard
SubjectRe: Csound MIDI Controller Data
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
>
>
> =========================================================
>
> --- Victor.Lazzarini@NUIM.IE wrote:
>
> From:         Victor Lazzarini 
> To:           CSOUND@LISTSERV.HEANET.IE
> 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  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  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  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:
>>>>>
>>>>> 
>>>>> 
>>>>> ; 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
>>>>> 
>>>>> 
>>>>>
>>>>> 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
>>>>>
>>>>>
>>>>> 
>>>>> 
>>>>> f0 200
>>>>> i1 0    200  ;<---- this was needed!
>>>>> ;sine wave.
>>>>> f 1 0 16384 10 1
>>>>> e
>>>>> 
>>>>> 
>>>>>
>>>>>
>>>>> 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  wrote:
>>>>>>>
>>>>>>> I tried k-rate but it does not work...Here's the csd:
>>>>>>>
>>>>>>> 
>>>>>>> 
>>>>>>> ; 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
>>>>>>> 
>>>>>>> 
>>>>>>>
>>>>>>> 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
>>>>>>>
>>>>>>> 
>>>>>>> 
>>>>>>> f0 20
>>>>>>> ;sine wave.
>>>>>>> f 1 0 16384 10 1
>>>>>>>
>>>>>>> e
>>>>>>> 
>>>>>>> 
>>>>>>> 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  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 :
>>>>>>>> What happens if you run the canctl.csd example from the manual?
>>>>>>>>
>>>>>>>> 
>>>>>>>> 
>>>>>>>> ; 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
>>>>>>>> 
>>>>>>>> 
>>>>>>>>
>>>>>>>> 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
>>>>>>>>
>>>>>>>> 
>>>>>>>> 
>>>>>>>> ;Dummy f-table to give time for real-time MIDI events
>>>>>>>> f 0 30
>>>>>>>> ;sine wave.
>>>>>>>> f 1 0 16384 10 1
>>>>>>>> e
>>>>>>>>
>>>>>>>> 
>>>>>>>> 
>>>>>>>>
>>>>>>>>
>>>>>>>> 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  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
>>>>>>>>> <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>>>>>>>>>       I use ctrl7 all the time.
>>>>>>>>>
>>>>>>>>> Art Hunkinshttp://www.arthunkins.com
>>>>>>>>>
>>>>>>>>> On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley
>>>>>>>>        
>>>>>>>>> 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
>>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>>> 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 Csound@listserv.heanet.ie
>>>>>>>>> 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 Csound@listserv.heanet.ie
>>>>>>>>> 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
>>>>>>>>        Csound@listserv.heanet.ie
>>>>>>>>        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 Csound@listserv.heanet.ie
>>>>>>>> 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
>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>> 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
>>>>>>>> Csound@listserv.heanet.ie
>>>>>>>> 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 Csound@listserv.heanet.ie 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 Csound@listserv.heanet.ie 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
>>>>>> Csound@listserv.heanet.ie
>>>>>> 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
>>>>> Csound@listserv.heanet.ie
>>>>> 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
>>>> Csound@listserv.heanet.ie
>>>> 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
>>> Csound@listserv.heanet.ie
>>> 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
>> Csound@listserv.heanet.ie
>> 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
> Csound@listserv.heanet.ie
> 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
> Csound@listserv.heanet.ie
> 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
Csound@listserv.heanet.ie
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