[Csnd] Re: Re: different pitches during a live-midi performance
Date | 2009-09-29 16:34 |
From | "Art Hunkins" |
Subject | [Csnd] Re: Re: different pitches during a live-midi performance |
Then, at the start of each "real" instrument, put: ileftpedal = i(gkleftpedal) imiddlepedal = i(gkmiddlepedal) if this is what you want. Art Hunkins ----- Original Message ----- From: "Oeyvind Brandtsegg" |
Date | 2009-09-29 17:58 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: different pitches during a live-midi performance |
Attachments | bartokaufCundFes.cps bartokaufCundGis.cps bartokaufGisundDisis.cps |
Dear community, I tried it now with the following file, but without success. I can hear sound, but the pitch doesn't change. <CsoundSynthesizer> <CsOptions> -odevaudio -M2 -b400 -m0d </CsOptions> <CsInstruments> sr = 48000 kr = 2400 ksmps = 20 nchnls = 2 gkleftpedal init 0 gkmiddlepedal init 0 ipch = 8.02 iequal = 12 massign 0, 1 ; assign all midi events to instr 1, pgmassign 0, 1 ; also all program changes instr 1 ileftpedal = i(gkleftpedal) imiddlepedal = i(gkmiddlepedal) 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 = 10 icps table indx, ituningtable iamp ampmidi 10000 icar = 1 imod = 1; ;kndx = iamp/3000 ; the louder, the more index it will have 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 3000/iamp, 3, 0.2, 0.111, 0 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 ituningtable = 10 gkleftpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal ileftpedal = i(gkleftpedal) gkmiddlepedal ctrl7 1, 66, 0, 1 ; controller 66 is the middle pedal imiddlepedal = i(gkmiddlepedal) if (ileftpedal>0) then ituningtable = ituningtable+1 ;choose tuningtable number 11, if the left pedal is down elseif (imiddlepedal>0) then ituningtable = ituningtable+2 else ituningtable = ituningtable ; 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> ; die Partiturereignisse werden definiert <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 600 i2 0 600 </CsScore> |