| 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 fout_poly.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 - Play an audio file. |
| 18 |
instr 1 |
| 19 |
; Generate an audio signal using |
| 20 |
; the audio file "drumsMlp.wav". |
| 21 |
asig soundin "drumsMlp.wav" |
| 22 |
|
| 23 |
out asig |
| 24 |
endin |
| 25 |
|
| 26 |
; Instrument #2 - Create a basic tone. |
| 27 |
instr 2 |
| 28 |
iamp = 5000 |
| 29 |
icps = 440 |
| 30 |
iphs = 0 |
| 31 |
|
| 32 |
; Create an audio signal. |
| 33 |
asig oscils iamp, icps, iphs |
| 34 |
|
| 35 |
out asig |
| 36 |
endin |
| 37 |
|
| 38 |
; Instrument #99 - Save the global signal to a file. |
| 39 |
instr 99 |
| 40 |
; Read the csound output buffer |
| 41 |
aoutput monitor |
| 42 |
; Write the output of csound to a headerless |
| 43 |
; audio file called "fout_poly.raw". |
| 44 |
fout "fout_poly.raw", 1, aoutput |
| 45 |
|
| 46 |
endin |
| 47 |
|
| 48 |
|
| 49 |
</CsInstruments> |
| 50 |
<CsScore> |
| 51 |
|
| 52 |
; Play Instrument #1 for two seconds. |
| 53 |
i 1 0 2 |
| 54 |
|
| 55 |
; Play Instrument #2 every quarter-second. |
| 56 |
i 2 0.00 0.1 |
| 57 |
i 2 0.25 0.1 |
| 58 |
i 2 0.50 0.1 |
| 59 |
i 2 0.75 0.1 |
| 60 |
i 2 1.00 0.1 |
| 61 |
i 2 1.25 0.1 |
| 62 |
i 2 1.50 0.1 |
| 63 |
i 2 1.75 0.1 |
| 64 |
|
| 65 |
; Make sure the global instrument, #99, is running |
| 66 |
; during the entire performance (2 seconds). |
| 67 |
i 99 0 2 |
| 68 |
e |
| 69 |
|
| 70 |
|
| 71 |
</CsScore> |
| 72 |
</CsoundSynthesizer> |