| 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 |
ktrigger chnget "button1" |
| 18 |
knotedur chnget "duration" |
| 19 |
|
| 20 |
if(ktrigger > 0) then |
| 21 |
event "i", 2, 0, knotedur |
| 22 |
endif |
| 23 |
|
| 24 |
endin |
| 25 |
|
| 26 |
instr 2 |
| 27 |
|
| 28 |
print p3 |
| 29 |
|
| 30 |
iattack chnget "attack" |
| 31 |
idecay chnget "decay" |
| 32 |
isustain chnget "sustain" |
| 33 |
irelease chnget "release" |
| 34 |
|
| 35 |
|
| 36 |
;ipchMul rnd31 .5, -0.5 |
| 37 |
;ipchMul = ipchMul + .5 |
| 38 |
;ipch = 100 + (1000 * ipchMul) |
| 39 |
ipch = 100 + rnd(1000) |
| 40 |
|
| 41 |
;print iattack |
| 42 |
;print idecay |
| 43 |
;print isustain |
| 44 |
;print irelease |
| 45 |
|
| 46 |
a2 linsegr 0, iattack, 1, idecay, isustain, irelease, 0 |
| 47 |
a1 oscili a2 * .25, ipch, 1 |
| 48 |
outs a1,a1 |
| 49 |
endin |
| 50 |
|
| 51 |
</CsInstruments> |
| 52 |
<CsScore> |
| 53 |
f1 0 16384 10 1 |
| 54 |
|
| 55 |
i1 0 3600 |
| 56 |
|
| 57 |
</CsScore> |
| 58 |
</CsoundSynthesizer> |