Csound Csound-dev Csound-tekno Search About

Csound MIDI Controller Data

Date2017-03-15 16:17
FromSam Smalley
SubjectCsound MIDI Controller Data
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

Date2017-03-15 16:21
FromEmmett Palaima
SubjectRe: Csound MIDI Controller Data
Check out the chanctrl opcode for reading midi cc messages: http://www.csounds.com/manual/html/chanctrl.html

On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley <ssmalley@berklee.edu> 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

Date2017-03-15 16:24
FromSamuel Smalley
SubjectRe: Csound MIDI Controller Data
Still not getting anything. I tried to print directly to the console but that didn't work either. MIDI monitor shows the controllers are working though.

On Wed, Mar 15, 2017 at 12:21 PM, Emmett Palaima <epalaima@berklee.edu> wrote:
Check out the chanctrl opcode for reading midi cc messages: http://www.csounds.com/manual/html/chanctrl.html

On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley <ssmalley@berklee.edu> 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

Date2017-03-15 18:17
FromVictor Lazzarini
SubjectRe: Csound MIDI Controller Data
Code?

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 15 Mar 2017, at 16:25, Samuel Smalley <ssmalley@BERKLEE.EDU> wrote:

Still not getting anything. I tried to print directly to the console but that didn't work either. MIDI monitor shows the controllers are working though.

On Wed, Mar 15, 2017 at 12:21 PM, Emmett Palaima <epalaima@berklee.edu> wrote:
Check out the chanctrl opcode for reading midi cc messages: http://www.csounds.com/manual/html/chanctrl.html

On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley <ssmalley@berklee.edu> 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

Date2017-03-15 18:32
FromEmmett Palaima
SubjectRe: Csound MIDI Controller Data
Hmm... Strange. You are trying to read the knobs from your keyboard correct? 

Are you sure you are reading the correct CC on the correct midi channel? You might want to try checking the output from your controller in Max using midiin and midiparse objects, just so you know what to look for. 

Other than that I am not sure, I would say check the midi settings in CsoundQt preferences (or -M flag for command line), but since you are getting notes in I don't think this is the issue. 

Can you perhaps share a csd file showing how you are going about reading the midi input?

On Wed, Mar 15, 2017 at 12:24 PM, Samuel Smalley <ssmalley@berklee.edu> wrote:
Still not getting anything. I tried to print directly to the console but that didn't work either. MIDI monitor shows the controllers are working though.

On Wed, Mar 15, 2017 at 12:21 PM, Emmett Palaima <epalaima@berklee.edu> wrote:
Check out the chanctrl opcode for reading midi cc messages: http://www.csounds.com/manual/html/chanctrl.html

On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley <ssmalley@berklee.edu> 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

Date2017-03-15 19:45
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: Csound MIDI Controller Data
I use ctrl7 all the time.


On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley <ssmalley@berklee.edu> 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

Date2017-03-15 20:23
FromSamuel Smalley
SubjectRe: Csound MIDI Controller Data

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.


On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley <ssmalley@berklee.edu> 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

Date2017-03-15 20:31
FromRichard
SubjectRe: Csound MIDI Controller Data

Maybe you are not on midi channel 1?
BTW, what platform are you on?

Richard


On 15/03/17 21:23, 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.


On Wed, Mar 15, 2017 at 12:17 PM, Sam Smalley <ssmalley@berklee.edu> 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


Date2017-03-15 20:32
Fromjpff
SubjectRe: Csound MIDI Controller Data
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

Date2017-03-15 20:36
FromSamuel Smalley
SubjectRe: Csound MIDI Controller Data
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 <jpff@codemist.co.uk> 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 <ssmalley@berklee.edu>
> 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

Date2017-03-15 20:47
Fromjpff
SubjectRe: Csound MIDI Controller Data
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

Date2017-03-15 20:53
FromOeyvind Brandtsegg
SubjectRe: Csound MIDI Controller Data
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


Date2017-03-15 21:05
FromRichard
SubjectRe: Csound MIDI Controller Data
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

Date2017-03-15 21:19
Fromjpff
SubjectRe: Csound MIDI Controller Data
OK next question.  Which midi system is csound using?  I think you ave a 
choice of cmidi (coremidi) or pmidi (portmidi), but this is way beyond me, 
not having OSX so I defer to Victor et al who understand these things
==Jon ff


On Wed, 15 Mar 2017, 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

Date2017-03-15 21:21
FromEmmett Palaima
SubjectRe: Csound MIDI Controller Data
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 <zappfinger@gmail.com> 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 <jpff@codemist.co.uk>:
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 <jpff@codemist.co.uk> 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
       <ssmalley@berklee.edu>
       > 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

Date2017-03-15 21:26
FromRichard
SubjectRe: Csound MIDI Controller Data

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 <zappfinger@gmail.com> 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 <jpff@codemist.co.uk>:
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 <jpff@codemist.co.uk> 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
       <ssmalley@berklee.edu>
       > 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


Date2017-03-15 21:32
FromVictor Lazzarini
SubjectRe: Csound MIDI Controller Data
The opcode only runs once per note, try use a kvar output to get changes as you run the instrument.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 15 Mar 2017, at 20:36, Samuel Smalley <ssmalley@BERKLEE.EDU> 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 <jpff@codemist.co.uk> 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 <ssmalley@berklee.edu>
> 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

Date2017-03-15 21:41
FromVictor Lazzarini
SubjectRe: Csound MIDI Controller Data
Tested this one here and it works as expected:


instr 1
k1 ctrl7 1, 1, 0, 1
printk2 k1
endin

tested with -+rtmidi=virtual, since I don’t have a physical device with me. Channel 1, controller 1.

========================
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

Date2017-03-15 21:44
FromVictor Lazzarini
SubjectRe: Csound MIDI Controller Data
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

Date2017-03-15 22:14
FromRichard
SubjectRe: Csound MIDI Controller Data
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

Date2017-03-15 22:24
FromVictor Lazzarini
SubjectRe: Csound MIDI Controller Data
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

Date2017-03-15 22:33
FromRichard
SubjectRe: Csound MIDI Controller Data
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

Date2017-03-15 22:46
FromVictor Lazzarini
SubjectRe: Csound MIDI Controller Data
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

Date2017-03-15 22:50
FromVictor Lazzarini
SubjectRe: Csound MIDI Controller Data
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