| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
-odac ;;;realtime audio out |
| 5 |
;-iadc ;;;uncomment -iadc if RT audio input is needed too |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o loop_le.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
sr = 44100 |
| 12 |
ksmps = 32 |
| 13 |
nchnls = 2 |
| 14 |
0dbfs = 1 |
| 15 |
|
| 16 |
seed 0 |
| 17 |
gisine ftgen 0, 0, 2^10, 10, 1 |
| 18 |
|
| 19 |
instr 1 ;master instrument |
| 20 |
|
| 21 |
ininstr = 5 ;number of called instances |
| 22 |
indx = 0 |
| 23 |
loop: |
| 24 |
prints "play instance %d\\n", indx |
| 25 |
ipan random 0, 1 |
| 26 |
ifreq random 100, 1000 |
| 27 |
iamp = 1/ininstr |
| 28 |
event_i "i", 10, 0, p3, iamp, ifreq, ipan |
| 29 |
loop_le indx, 1, ininstr, loop |
| 30 |
|
| 31 |
endin |
| 32 |
|
| 33 |
instr 10 |
| 34 |
|
| 35 |
ipeak random 0, 1 ;where is the envelope peak |
| 36 |
asig poscil3 p4, p5, gisine |
| 37 |
aenv transeg 0, p3*ipeak, 6, 1, p3-p3*ipeak, -6, 0 |
| 38 |
aL,aR pan2 asig*aenv, p6 |
| 39 |
outs aL, aR |
| 40 |
|
| 41 |
endin |
| 42 |
|
| 43 |
</CsInstruments> |
| 44 |
<CsScore> |
| 45 |
i1 0 10 |
| 46 |
e |
| 47 |
</CsScore> |
| 48 |
</CsoundSynthesizer> |