Csound MIDI Controller Data
Date | 2017-03-15 16:17 |
From | Sam Smalley |
Subject | Csound 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 |
Date | 2017-03-15 16:21 |
From | Emmett Palaima |
Subject | Re: 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. |
Date | 2017-03-15 16:24 |
From | Samuel Smalley |
Subject | Re: 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:
|
Date | 2017-03-15 18:17 |
From | Victor Lazzarini |
Subject | Re: Csound MIDI Controller Data |
Code?
Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2017-03-15 18:32 |
From | Emmett Palaima |
Subject | Re: 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:
|
Date | 2017-03-15 19:45 |
From | Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> |
Subject | Re: Csound MIDI Controller Data |
I use ctrl7 all the time. Art Hunkins 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. |
Date | 2017-03-15 20:23 |
From | Samuel Smalley |
Subject | Re: Csound MIDI Controller Data |
instr 1
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:
|
Date | 2017-03-15 20:31 |
From | Richard |
Subject | Re: Csound MIDI Controller Data |
Maybe you are not on midi channel 1? Richard On 15/03/17 21:23, Samuel Smalley
wrote:
|
Date | 2017-03-15 20:32 |
From | jpff |
Subject | Re: 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 |
Date | 2017-03-15 20:36 |
From | Samuel Smalley |
Subject | Re: 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 |
Date | 2017-03-15 20:47 |
From | jpff |
Subject | Re: Csound MIDI Controller Data |
What happens if you run the canctl.csd example from the manual? |
Date | 2017-03-15 20:53 |
From | Oeyvind Brandtsegg |
Subject | Re: 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 |
Date | 2017-03-15 21:05 |
From | Richard |
Subject | Re: 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 |
Date | 2017-03-15 21:19 |
From | jpff |
Subject | Re: 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 |
Date | 2017-03-15 21:21 |
From | Emmett Palaima |
Subject | Re: 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... |
Date | 2017-03-15 21:26 |
From | Richard |
Subject | Re: Csound MIDI Controller Data |
I tried k-rate but it does not work...Here's the csd: <CsoundSynthesizer> Richard On 15/03/17 22:21, Emmett Palaima
wrote:
|
Date | 2017-03-15 21:32 |
From | Victor Lazzarini |
Subject | Re: 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
|
Date | 2017-03-15 21:41 |
From | Victor Lazzarini |
Subject | Re: 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 |
Date | 2017-03-15 21:44 |
From | Victor Lazzarini |
Subject | Re: 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 |
Date | 2017-03-15 22:14 |
From | Richard |
Subject | Re: 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: |
Date | 2017-03-15 22:24 |
From | Victor Lazzarini |
Subject | Re: 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 |
Date | 2017-03-15 22:33 |
From | Richard |
Subject | Re: 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 |
Date | 2017-03-15 22:46 |
From | Victor Lazzarini |
Subject | Re: 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 |
Date | 2017-03-15 22:50 |
From | Victor Lazzarini |
Subject | Re: 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 |