[Csnd] Re: Re: Re: Re: different pitches during a live-midi performance
Date | 2009-09-29 18:13 |
From | "Art Hunkins" |
Subject | [Csnd] Re: Re: Re: Re: different pitches during a live-midi performance |
Stefan,
Your two ctrl7 lines (in instr 2) need to be in
instr 1, replacing
ileftpedal = i(gkleftpedal)
imiddlepedal = i(gkmiddlepedal) Art Hunkins
|
Date | 2009-10-01 10:03 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: Re: Re: different pitches during a live-midi performance |
Dear community, sorry for bothering You all, but I still have the same problem. I have to admit, that I don't understand, how I can try putting the ctrl7 opcodes in a separate instrument I tried it with the following code, but without succes:
<CsoundSynthesizer> <CsOptions> -odevaudio -M0 -b400 -m0d </CsOptions> <CsInstruments> sr = 48000 kr = 2400 ksmps = 20 nchnls = 2 ipch = 8.02 iequal = 12 massign 0, 1 ; assign all midi events to instr 1, pgmassign 0, 1 ; also all program changes instr 1 gkleftpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal gkmiddlepedal ctrl7 1, 66, 0, 1 ; controller 66 is the middle pedal gkleftpedal init 0 gkmiddlepedal init 0 gasend1 init 0 gasend2 init 0 imnn notnum indx = imnn * 2 + 1 ; values in table alternate between ; Midi note nums and frequencies ituningtable init 10 icps table indx, ituningtable iamp ampmidi 10000 icar = 1 imod = 1; kndx = iamp/2000 ; the louder, the more index it will have ; making the overall amplitude envelope kampenv mxadsr 100/iamp, 0.0402, 0.785, 0.102, 0.001 ;the envelope for the fmindex ; att, decay, isl, ausklingzeit kindexenv madsr 4000/iamp, 3, 0.2, 0.111, 0 ; and now the whole sound a1 foscil iamp*kampenv, icps, icar, imod, kndx*kindexenv, 1 outs a1, a1 asend1 = gasend1+a1 gasend2 = gasend2+a1 endin instr 2 ; modifies the pitch via the left and the right pedal ileftpedal = i(gkleftpedal) imiddlepedal = i(gkmiddlepedal) if (ileftpedal>0) then ituningtable = 11 ;choose tuningtable number 11, if the left pedal is down elseif (imiddlepedal>0) then ituningtable = 12 else ituningtable = 10 ; when the left pedal is not used, use tuningtable numer 10 endif endin instr 3 ;RECORDS ALL SOUND ;RECORD A Stereo 16 BIT SOUND FILE fout "soneartklarinette.wav", 4, gasend1, gasend2 ;CLEAR GLOBAL VARIABLE (I.E. ASSIGN IT TO ZERO) gasend1 = 0 gasend2 = 0 endin </CsInstruments> <CsScore> f1 0 8193 10 1 f 10 0 256 -23 "bartokaufCundGis.cps" f 11 0 256 -23 "bartokaufCundFes.cps" f 12 0 256 -23 "bartokaufGisundDisis.cps" i1 0 15 i2 0 15 </CsScore> |
Date | 2009-10-01 11:11 |
From | Oeyvind Brandtsegg |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance |
I tried to move stuff around a bit in your example, to set it up the way I described earlier. Beware, I haven't tested this code. Let's hope it runs at all. Anyway, it should provide a hint of what I did mean. Note that the only thing happening in instr 1 is the ctrl7 inputs, writing to global signals. This instrument should be "always on". Instr 2 should not be always on as it is triggered from midi. best Oeyvind |
Date | 2009-10-01 20:50 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance |
Dear Oeyvind, thanks for Your support. I tried it, but, unfortunately, I still have problems. The left pedal works all the time, but the sostenuto-Pedal only sometimes. Maybee it is a problem with the pedal itself. I guess, I will try a different one, to see what will happen. 2009/10/1 Oeyvind Brandtsegg <obrandts@gmail.com> I tried to move stuff around a bit in your example, to set it up the |
Date | 2009-10-01 22:12 |
From | Oeyvind Brandtsegg |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance |
Ok, did you try sticking in some print statements in instr 1? Like this gkleftpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal gkmiddlepedal ctrl7 1, 66, 0, 1 ; controller 66 is the middle pedal printk2 gkleftpedal printk2 gkmiddlepedal, 20 The argument with value 20 to printk2 offsets the printing 20 spaces, so it's easier to differentiate between the two printing actions. If it prints correctly according to your actions on the pedal, then the pedal is fine. all best Oeyvind 2009/10/1 Stefan Thomas |
Date | 2009-10-02 08:52 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance |
Dear Oeyvind, thanks again for Your support. I did as You suggested. I could see, that the message for the sostenuto pedal goes sometimes to number zero, although my foot still stays on the pedal. I'm quite sure now, that it is a mechanical problem of the pedal itself. But the code itself seems to work perfectly! 2009/10/1 Oeyvind Brandtsegg <obrandts@gmail.com> Ok, |