1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out Audio in No messages
-odac -iadc -d ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o fout_poly.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
kr = 44100
ksmps = 1
nchnls = 1
; Instrument #1 - Play an audio file.
instr 1
; Generate an audio signal using
; the audio file "beats.wav".
asig soundin "beats.wav"
out asig
endin
; Instrument #2 - Create a basic tone.
instr 2
iamp = 5000
icps = 440
iphs = 0
; Create an audio signal.
asig oscils iamp, icps, iphs
out asig
endin
; Instrument #99 - Save the global signal to a file.
instr 99
; Read the csound output buffer
aoutput monitor
; Write the output of csound to a headerless
; audio file called "fout_poly.raw".
fout "fout_poly.raw", 1, aoutput
endin
</CsInstruments>
<CsScore>
; Play Instrument #1 for two seconds.
i 1 0 2
; Play Instrument #2 every quarter-second.
i 2 0.00 0.1
i 2 0.25 0.1
i 2 0.50 0.1
i 2 0.75 0.1
i 2 1.00 0.1
i 2 1.25 0.1
i 2 1.50 0.1
i 2 1.75 0.1
; Make sure the global instrument, #99, is running
; during the entire performance (2 seconds).
i 99 0 2
e
</CsScore>
</CsoundSynthesizer>
|