1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
<CsoundSynthesizer>
<CsOptions>
-o dac
-d
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 64
nchnls = 2
0dbfs = 1
seed 0
instr 1
inoterate chnget "noteRate"
inotedur chnget "duration"
;print inoterate
;print inotedur
event_i "i", 1, inoterate, 1
event_i "i", 2, 0, inotedur
turnoff
endin
instr 2
iattack chnget "attack"
idecay chnget "decay"
isustain chnget "sustain"
irelease chnget "release"
;ipchMul rnd31 .5, -0.5
;ipchMul = ipchMul + .5
;ipch = 100 + (1000 * ipchMul)
ipch = 100 + rnd(1000)
;print iattack
;print idecay
;print isustain
;print irelease
a2 linsegr 0, iattack, 1, idecay, isustain, irelease, 0
a1 oscili a2 * .3, ipch, 1
outs a1,a1
endin
</CsInstruments>
<CsScore>
f1 0 16384 10 1
i1 0 1
f 0 3600
</CsScore>
</CsoundSynthesizer>
|