Debian Codegraph @

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