| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
; Audio out Audio in No messages |
| 5 |
-odac -iadc -d ;;;RT audio I/O |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o zkmod.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 = 2 |
| 16 |
|
| 17 |
; Initialize the ZAK space. |
| 18 |
; Create 2 a-rate variables and 2 k-rate variables. |
| 19 |
zakinit 2, 2 |
| 20 |
|
| 21 |
; Instrument #1 -- a signal with jitter. |
| 22 |
instr 1 |
| 23 |
; Generate a k-rate signal goes from 30 to 2,000. |
| 24 |
kline line 30, p3, 2000 |
| 25 |
|
| 26 |
; Add the signal into zk variable #1. |
| 27 |
zkw kline, 1 |
| 28 |
endin |
| 29 |
|
| 30 |
; Instrument #2 -- generates audio output. |
| 31 |
instr 2 |
| 32 |
; Create a k-rate signal modulated the jitter opcode. |
| 33 |
kamp init 20 |
| 34 |
kcpsmin init 40 |
| 35 |
kcpsmax init 60 |
| 36 |
kjtr jitter kamp, kcpsmin, kcpsmax |
| 37 |
|
| 38 |
; Get the frequency values from zk variable #1. |
| 39 |
kfreq zkr 1 |
| 40 |
; Add the the frequency values in zk variable #1 to |
| 41 |
; the jitter signal. |
| 42 |
kjfreq zkmod kjtr, 1 |
| 43 |
|
| 44 |
; Use a simple sine waveform for the left speaker. |
| 45 |
aleft oscil 20000, kfreq, 1 |
| 46 |
; Use a sine waveform with jitter for the right speaker. |
| 47 |
aright oscil 20000, kjfreq, 1 |
| 48 |
|
| 49 |
; Generate the audio output. |
| 50 |
outs aleft, aright |
| 51 |
|
| 52 |
; Clear the zk variables, prepare them for |
| 53 |
; another pass. |
| 54 |
zkcl 0, 2 |
| 55 |
endin |
| 56 |
|
| 57 |
|
| 58 |
</CsInstruments> |
| 59 |
<CsScore> |
| 60 |
|
| 61 |
; Table #1, a sine wave. |
| 62 |
f 1 0 16384 10 1 |
| 63 |
|
| 64 |
; Play Instrument #1 for 2 seconds. |
| 65 |
i 1 0 2 |
| 66 |
; Play Instrument #2 for 2 seconds. |
| 67 |
i 2 0 2 |
| 68 |
e |
| 69 |
|
| 70 |
|
| 71 |
</CsScore> |
| 72 |
</CsoundSynthesizer> |