[Csnd] Re: Re: Re: different pitches during a live-midi performance
Date | 2009-07-03 21:22 |
From | "Art Hunkins" |
Subject | [Csnd] Re: Re: Re: different pitches during a live-midi performance |
Hello, Stefan,
Here's what I'd try:
In header:
gkpedal init 0
and after your massign:
massign 64, 2
(or whatever controller # your foot pedal is,
assign its data to instr 2. The massigns may be tricky.)
You should be able to use any type of foot pedal
your MIDI keyboard will accept.
Make a completely new instrument that receives
MIDI data only on controller 64 (or whichever # you choose):
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
The above instrument is always receiving foot
controller data.
In the score, add:
i2 0 3600
In your instr1, add (at beginning):
ipedal = i(gkpedal)
and later (after icps computed):
if imnn != 60 and imnn != 62 and notnum
...... igoto skip ; this is a list of *all your black MIDI key
numbers*!
icps = (ipedal > 0? icps - (icps * .1): icps +
(icps * .1)
skip:
In the above, ".1" is the percentage of the
frequency you wish to add or subtract from your "basic pitch"
(12tet).
You may want to make some other kind of pitch
adjustment. For example you might put the low version (freq) of the black key
pitch in your table, then multiply it by some factor if the pedal were up
(gkpedal == 0):
icps = (ipedal > 0? icps + (icps * .1):
icps)
Or perhaps you want different groups of "igoto"
branches, where for example all F#'s modify in one way, all G#'s in
another.
Let me know how it works out for you.
Art Hunkins
|
Date | 2009-07-05 17:06 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: Re: different pitches during a live-midi performance |
Attachments | 17tet.cps |
Dear Art, thanks very much! I tried out what You suggested to me, but I get always error messages in line 30 and 31. I don't know what I'm doing wrong, I have to admit, that I don't have enough experiences with the syntax. It would be great, if You could gove me a hint, one more time! Thanks, Stefan Here is, again, the file ( a little smaller now): <CsoundSynthesizer> <CsOptions> -odevaudio -M2 -b400 </CsOptions> <CsInstruments> sr = 44100 kr = 2205 ksmps = 20 nchnls = 2 gkpedal init 0 ipch = 8.02 iequal = 12 massign 0, 1 ; assign all midi events to instr 1, massign 64, 2 ; pgmassign 0, 1 ; also all program changes instr 1 ipedal = i(gkpedal) ituningtable = 10 ; the number of the f-table imnn notnum indx = imnn * 2 + 1 ; values in table alternate between ; Midi note nums and frequencies icps table indx, ituningtable if imnn != 61 and imnn != 63 and imnn !=66 igoto skip icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1) skip: iamp ampmidi 10000 ; Hüllkurven definieren ;nachklingzeit inach = 0.1 ;Ende der Lautstartekurve iend = 0.0000000001 ; für alle die gleiche Endlautstärke ; die Einschwingzeit für jeden Teilton iein = 0.0030 ;die unterschiedlichen ausschwingzeiten iabkling1 = 4.5*2 iabkling2 = 7.22*2 iabkling3 = 9.26*2 iabkling4 = 9.42*2 ;die anfangslautstaerke ianfang = 0.001 ;wie laut klingt der Ton am Ende, nach dem loslassen der Note iweiterkling = 0.00000000000001 ;die unterschiedlichen Maxima der Hüllkurven ilautfaktor = 0.8 imax1 = 1 imax2 = ilautfaktor imax3= ilautfaktor^2 imax4 = ilautfaktor^3 ;die Individuellen Hüllkurven für jeden einzelnen Teilton kenv1 expsegr ianfang, iein, imax1, iabkling1, iend, inach, iweiterkling kenv2 expsegr ianfang, iein, imax2, iabkling2, iend, inach, iweiterkling kenv3 expsegr ianfang, iein, imax3, iabkling3, iend, inach, iweiterkling kenv4 expsegr ianfang, iein, imax4, iabkling4, iend, inach, iweiterkling ;die Frequenzverhältnisse ifundamental = icps ipartialB =icps*2; teilton2 ipartialC = icps*3 ;teilton 3 ipartialD = icps*4 a1 oscil kenv1*iamp, ifundamental, 1 a2 oscil kenv2*iamp, ipartialB, 1 a3 oscil kenv3*iamp, ipartialC, 1 a4 oscil kenv4*iamp, ipartialD, 1 aton = a1+a2+a3+a4 ;velocity controlled tone control icutoff_oct veloc 6, 14 ;lowpass filter our audio signal alautfilter tone aton, cpsoct(icutoff_oct) ;k1 linenr 0.01, 0.03, 0.1, 0.01 outs alautfilter, alautfilter endin instr 2 gkpedal ctrl7 1, 64, 0, 1 endin </CsInstruments> ; die Partiturereignisse werden definiert <CsScore> f1 0 8193 10 1 f 10 0 256 -23 "17tet.cps" i1 0 3600 i2 0 3600 </CsScore> </CsoundSynthesizer> 2009/7/3 Art Hunkins <abhunkin@uncg.edu>
|