Debian Codegraph @

src/Examples/FLOSS Manual Examples/03 Csound Language/03H01_Macros_basic.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -odac
4 </CsOptions>
5 <CsInstruments>
6 sr = 44100
7 ksmps = 16
8 nchnls = 1
9 0dbfs = 1
10
11 ; define the macro
12 #define SOUNDFILE # "loop.wav" #
13
14 instr 1
15 ; use an expansion of the macro in deriving the duration of the sound file
16 idur filelen $SOUNDFILE
17 event_i "i",2,0,idur
18 endin
19
20 instr 2
21 ; use another expansion of the macro in playing the sound file
22 a1 diskin2 $SOUNDFILE,1
23 out a1
24 endin
25
26 </CsInstruments>
27 <CsScore>
28 i 1 0 0.01
29 e
30 </CsScore>
31 </CsoundSynthesizer>
32 ; example written by Iain McCurdy