| 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 table.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 |
; Instrument #1. |
| 18 |
instr 1 |
| 19 |
; Vary our index linearly from 0 to 1. |
| 20 |
kndx line 0, p3, 1 |
| 21 |
|
| 22 |
; Read Table #1 with our index. |
| 23 |
ifn = 1 |
| 24 |
ixmode = 1 |
| 25 |
kfreq ptable kndx, ifn, ixmode |
| 26 |
|
| 27 |
; Generate a sine waveform, use our table values |
| 28 |
; to vary its frequency. |
| 29 |
a1 oscil 20000, kfreq, 2 |
| 30 |
out a1 |
| 31 |
endin |
| 32 |
|
| 33 |
|
| 34 |
</CsInstruments> |
| 35 |
<CsScore> |
| 36 |
|
| 37 |
; Table #1, a line from 200 to 2,000. |
| 38 |
f 1 0 1025 -7 200 1024 2000 |
| 39 |
; Table #2, a sine wave. |
| 40 |
f 2 0 16384 10 1 |
| 41 |
|
| 42 |
; Play Instrument #1 for 2 seconds. |
| 43 |
i 1 0 2 |
| 44 |
e |
| 45 |
|
| 46 |
|
| 47 |
</CsScore> |
| 48 |
</CsoundSynthesizer> |