Debian Codegraph @

examples/define_args.csd

raw
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 define_args.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 ; Define the oscillator macro.
18 #define OSCMACRO(VOLUME'FREQ'TABLE) #oscil $VOLUME, $FREQ, $TABLE#
19
20 ; Instrument #1
21 instr 1
22 ; Use the oscillator macro.
23 ; This will be expanded to "a1 oscil 5000, 440, 1".
24 a1 $OSCMACRO(5000'440'1)
25
26 ; Send it to the output.
27 out a1
28 endin
29
30
31 </CsInstruments>
32 <CsScore>
33
34 ; Define Table #1 with an ordinary sine wave.
35 f 1 0 32768 10 1
36
37 ; Play Instrument #1 for two seconds.
38 i 1 0 2
39 e
40
41
42 </CsScore>
43 </CsoundSynthesizer>