[Csnd] midinoteonkey not working?
Date | 2017-11-19 17:58 |
From | Richard |
Subject | [Csnd] midinoteonkey not working? |
Here is my csd again, showing that it looks like a problem with vco2 and reinit, not with vco. But also midinoteonkey does not do what it should do: it does not use the midi notes from the score, only the notes that I play live.
<CsoundSynthesizer> <CsOptions> -odac3 -M0 </CsOptions> <CsInstruments> sr = 44100 ksmps = 128 0dbfs = 1 nchnls = 2
instr 1 kwaveform = 0 kwave = p6 kwavetrig changed kwave
if (kwave==1) then kwaveform = 0 ;SAW elseif (kwave==2) then kwaveform = 2 ; SQUARE elseif (kwave==3) then kwaveform = 12 ; TRIANGEL endif
if kwavetrig = 1 then reinit REINIT_VCO endif
REINIT_VCO: kkey init 0 ;initialize key number kvel init 0 ;initialize velocity midinoteonkey kkey, kvel printk2 kkey avco vco kvel/127, cpsmidinn(kkey), i(kwaveform),1 ; problem with changing kwave (p6) does not occur ;avco vco2 kvel/127, cpsmidinn(kkey), i(kwaveform) ; problem with changing kwave (p6) does not occur outs avco*kvel, avco*kvel endin </CsInstruments> <CsScore> f 0 30 ; Table #1, a sine wave. f 1 0 65536 10 1
i 1 0 1 62 100 1 ; midi note numbers are not picked up by midinoteonkey... i 1 1.5 1 64 100 1 ; when you make p6 1 for each scoreline there is no problem with vco2 i 1 2.5 1 62 100 2 ; this causes the errors, only with vco2. not with vco. i 1 3.5 1 64 100 3 </CsScore> </CsoundSynthesizer> |
Date | 2017-11-19 20:34 |
From | Rory Walsh |
Subject | Re: [Csnd] midinoteonkey not working? |
midinoteonkey is doing exactly what it's supposed to do, read MIDI notes that you play. Score events are not MIDI events. If you want to read the notes you have in your score just pass p4 to cpsmidinn(). On 19 November 2017 at 17:58, Richard <zappfinger@gmail.com> wrote:
|
Date | 2017-11-19 21:11 |
From | Richard |
Subject | Re: [Csnd] midinoteonkey not working? |
That is not how I read the example (I tried this and it does not work): http://www.csounds.com/manual/html/midinoteonkey.html especially looking at the sore section: <CsScore> f 0 30 ;runs for 30 seconds i 1 0 2 62 ; play these notes from score as well i 1 + 2 65 e </CsScore> Richard On 19/11/17 21:34, Rory Walsh wrote:
|
Date | 2017-11-19 21:21 |
From | Rory Walsh |
Subject | Re: [Csnd] midinoteonkey not working? |
You're right, I was confusing it with notenum. This is one of Mike's opcodes, maybe he can advise. On 19 Nov 2017 9:11 p.m., "Richard" <zappfinger@gmail.com> wrote:
|
Date | 2017-11-19 21:26 |
From | Richard |
Subject | Re: [Csnd] midinoteonkey not working? |
Yes, I also do not understand where the velocity (kvel) comes
from, when reading from the score, because only the note numbers
are there... On 19/11/17 22:21, Rory Walsh wrote:
|
Date | 2017-11-19 21:34 |
From | jpff |
Subject | Re: [Csnd] midinoteonkey not working? |
midinoteonkey will replace the values of the two args if it is a midi-actvated note, or leae tem alone if not. So it eeds someting like kfreq = p4 kamp = p5 midinoteonkey kfreq, kamp On Sun, 19 Nov 2017, Richard wrote: > > That is not how I read the example (I tried this and it does not work): > > http://www.csounds.com/manual/html/midinoteonkey.html > > especially looking at the sore section: > > |