Debian Codegraph @

src/Examples/FLOSS Manual Examples/07 MIDI/07C04_smoothing.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -Ma -odac
4 </CsOptions>
5 <CsInstruments>
6 sr = 44100
7 ksmps = 32
8 nchnls = 1
9 0dbfs = 1
10
11 giSine ftgen 0,0,2^12,10,1
12 initc7 1,1,1 ;initialize CC 1 to its max. level
13
14 instr 1
15 iCps cpsmidi ;read in midi pitch in cycles-per-second
16 iAmp ampmidi 1 ;read in note velocity - re-range 0 to 1
17 kVol ctrl7 1,1,0,1 ;read in CC 1, chan. 1. Re-range from 0 to 1
18 kPortTime linseg 0,0.001,0.01 ;create a value that quickly ramps up to .01
19 kVol portk kVol,kPortTime ;create a filtered version of kVol
20 aVol interp kVol ;create an a-rate version of kVol
21 aSig poscil iAmp*aVol,iCps,giSine
22 out aSig
23 endin
24
25 </CsInstruments>
26 <CsScore>
27 </CsScore>
28 <CsoundSynthesizer>
29 ;example by Iain McCurdy