| 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 tablekt.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 |
|
| 18 |
gift1 ftgen 1, 0, 1024, 10, 1 ;sine wave |
| 19 |
gift2 ftgen 2, 0, 1024, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1 ;pulse |
| 20 |
|
| 21 |
|
| 22 |
instr 1 |
| 23 |
andx phasor 400 ;phasor for reading the index |
| 24 |
kfn init 1 ;initialize the choice of the function table |
| 25 |
kmetro init 1 ;initialize the frequency of the metro |
| 26 |
knewft metro kmetro ;make a new choice for selecting the function table once a second |
| 27 |
|
| 28 |
if knewft == 1 then |
| 29 |
kfn = (kfn == 1 ? 2 : 1) ;switch between 1 and 2 |
| 30 |
kmetro random .5, 2 ;create new metro frequency |
| 31 |
printk2 kfn |
| 32 |
endif |
| 33 |
|
| 34 |
ares tablekt andx, kfn, 1 |
| 35 |
outs ares, ares |
| 36 |
endin |
| 37 |
|
| 38 |
</CsInstruments> |
| 39 |
<CsScore> |
| 40 |
i 1 0 10 |
| 41 |
e |
| 42 |
</CsScore> |
| 43 |
</CsoundSynthesizer> |
| 44 |
|