| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
-odac ;;;realtime audio out |
| 5 |
;-iadc ;;;uncomment -iadc if realtime audio input is needed too |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o urd.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 |
instr 1 |
| 17 |
|
| 18 |
ktab = 1 ;ftable 1 |
| 19 |
kurd = urd(ktab) |
| 20 |
ktrig metro 5 ;triggers 5 times per second |
| 21 |
kres samphold kurd, ktrig ;sample and hold value of kurd |
| 22 |
printk2 kres ;print it |
| 23 |
asig poscil .5, 220+kres, 2 |
| 24 |
outs asig, asig |
| 25 |
endin |
| 26 |
|
| 27 |
instr 2 |
| 28 |
|
| 29 |
seed 0 ;every run new values |
| 30 |
|
| 31 |
ktab = 1 ;ftable 1 |
| 32 |
kurd = urd(ktab) |
| 33 |
ktrig metro 5 ;triggers 5 times per second |
| 34 |
kres samphold kurd, ktrig ;sample and hold value of kurd |
| 35 |
printk2 kres ;print it |
| 36 |
asig poscil .5, 220+kres, 2 |
| 37 |
outs asig, asig |
| 38 |
|
| 39 |
endin |
| 40 |
</CsInstruments> |
| 41 |
<CsScore> |
| 42 |
f1 0 -20 -42 10 20 .3 100 200 .7 ;30% choose between 10 and 20 and 70% between 100 and 200 |
| 43 |
f2 0 8192 10 1 ;sine wave |
| 44 |
|
| 45 |
i 1 0 5 |
| 46 |
i 2 6 5 |
| 47 |
e |
| 48 |
</CsScore> |
| 49 |
</CsoundSynthesizer> |