| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
; Audio out Audio in |
| 5 |
-odac -iadc ;;;RT audio I/O |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o ziwm.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
; Initialize the global variables. |
| 12 |
sr = 44100 |
| 13 |
kr = 4410 |
| 14 |
ksmps = 10 |
| 15 |
nchnls = 1 |
| 16 |
|
| 17 |
; Initialize the ZAK space. |
| 18 |
; Create 1 a-rate variable and 1 k-rate variable. |
| 19 |
zakinit 1, 1 |
| 20 |
|
| 21 |
; Instrument #1 -- a simple instrument. |
| 22 |
instr 1 |
| 23 |
; Add 20.5 to zk variable #1. |
| 24 |
ziwm 20.5, 1 |
| 25 |
endin |
| 26 |
|
| 27 |
; Instrument #2 -- another simple instrument. |
| 28 |
instr 2 |
| 29 |
; Add 15.25 to zk variable #1. |
| 30 |
ziwm 15.25, 1 |
| 31 |
endin |
| 32 |
|
| 33 |
; Instrument #3 -- prints out zk variable #1. |
| 34 |
instr 3 |
| 35 |
; Read zk variable #1 at i-rate. |
| 36 |
i1 zir 1 |
| 37 |
|
| 38 |
; Print out the value of zk variable #1. |
| 39 |
; It should be 35.75 (20.5 + 15.25) |
| 40 |
print i1 |
| 41 |
endin |
| 42 |
|
| 43 |
|
| 44 |
</CsInstruments> |
| 45 |
<CsScore> |
| 46 |
|
| 47 |
; Play Instrument #1 for one second. |
| 48 |
i 1 0 1 |
| 49 |
; Play Instrument #2 for one second. |
| 50 |
i 2 0 1 |
| 51 |
; Play Instrument #3 for one second. |
| 52 |
i 3 0 1 |
| 53 |
e |
| 54 |
|
| 55 |
|
| 56 |
</CsScore> |
| 57 |
</CsoundSynthesizer> |