| 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 r.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 |
; The score's p4 parameter has the number of repeats. |
| 20 |
kreps = p4 |
| 21 |
; The score's p5 parameter has our note's frequency. |
| 22 |
kcps = p5 |
| 23 |
|
| 24 |
; Print the number of repeats. |
| 25 |
printks "Repeated %i time(s).\\n", 1, kreps |
| 26 |
|
| 27 |
; Generate a nice beep. |
| 28 |
a1 oscil 20000, kcps, 1 |
| 29 |
out a1 |
| 30 |
endin |
| 31 |
|
| 32 |
|
| 33 |
</CsInstruments> |
| 34 |
<CsScore> |
| 35 |
|
| 36 |
; Table #1, a sine wave. |
| 37 |
f 1 0 16384 10 1 |
| 38 |
|
| 39 |
; We'll repeat this section 6 times. Each time it |
| 40 |
; is repeated, its macro REPS_MACRO is incremented. |
| 41 |
r6 REPS_MACRO |
| 42 |
|
| 43 |
; Play Instrument #1. |
| 44 |
; p4 = the r statement's macro, REPS_MACRO. |
| 45 |
; p5 = the frequency in cycles per second. |
| 46 |
i 1 00.10 00.10 $REPS_MACRO 1760 |
| 47 |
i 1 00.30 00.10 $REPS_MACRO 880 |
| 48 |
i 1 00.50 00.10 $REPS_MACRO 440 |
| 49 |
i 1 00.70 00.10 $REPS_MACRO 220 |
| 50 |
|
| 51 |
; Marks the end of the section. |
| 52 |
s |
| 53 |
|
| 54 |
e |
| 55 |
|
| 56 |
|
| 57 |
</CsScore> |
| 58 |
</CsoundSynthesizer> |