| 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 trandom.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 ; every run time different values |
| 17 |
|
| 18 |
instr 1 |
| 19 |
|
| 20 |
kmin init 0 ;random number between 0 and 220 |
| 21 |
kmax init 220 |
| 22 |
ktrig = p4 |
| 23 |
k1 trandom ktrig, kmin, kmax |
| 24 |
printk2 k1 ;print when k1 changes |
| 25 |
asig poscil .4, 220+k1, 1 ;if triggered, add random values to frequency |
| 26 |
outs asig, asig |
| 27 |
|
| 28 |
endin |
| 29 |
</CsInstruments> |
| 30 |
<CsScore> |
| 31 |
f1 0 4096 10 1 |
| 32 |
|
| 33 |
i 1 0 2 0 ;not triggered |
| 34 |
i 1 + 2 1 ;triggered |
| 35 |
e |
| 36 |
</CsScore> |
| 37 |
</CsoundSynthesizer> |