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