| 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 readclock.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
; Initialize the global variables. |
| 12 |
sr = 44100 |
| 13 |
kr = 44100 |
| 14 |
ksmps = 1 |
| 15 |
nchnls = 1 |
| 16 |
|
| 17 |
; Instrument #1. |
| 18 |
instr 1 |
| 19 |
; Start clock #1. |
| 20 |
clockon 1 |
| 21 |
; Do something that keeps Csound busy. |
| 22 |
a1 oscili 10000, 440, 1 |
| 23 |
out a1 |
| 24 |
; Stop clock #1. |
| 25 |
clockoff 1 |
| 26 |
; Print the time accumulated in clock #1. |
| 27 |
i1 readclock 1 |
| 28 |
print i1 |
| 29 |
endin |
| 30 |
|
| 31 |
|
| 32 |
</CsInstruments> |
| 33 |
<CsScore> |
| 34 |
|
| 35 |
; Initialize the function tables. |
| 36 |
; Table 1: an ordinary sine wave. |
| 37 |
f 1 0 32768 10 1 |
| 38 |
|
| 39 |
; Play Instrument #1 for one second starting at 0:00. |
| 40 |
i 1 0 1 |
| 41 |
; Play Instrument #1 for one second starting at 0:01. |
| 42 |
i 1 1 1 |
| 43 |
; Play Instrument #1 for one second starting at 0:02. |
| 44 |
i 1 2 1 |
| 45 |
e |
| 46 |
|
| 47 |
|
| 48 |
</CsScore> |
| 49 |
</CsoundSynthesizer> |