Debian Codegraph @

examples/prealloc.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 prealloc.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 ; Pre-allocate memory for five instances of Instrument #1.
18 prealloc 1, 5
19
20 ; Instrument #1
21 instr 1
22 ; Generate a waveform, get the cycles per second from the 4th p-field.
23 a1 oscil 6500, p4, 1
24 out a1
25 endin
26
27
28 </CsInstruments>
29 <CsScore>
30
31 ; Just generate a nice, ordinary sine wave.
32 f 1 0 32768 10 1
33
34 ; Play five instances of Instrument #1 for one second.
35 ; Note that 4th p-field contains cycles per second.
36 i 1 0 1 220
37 i 1 0 1 440
38 i 1 0 1 880
39 i 1 0 1 1320
40 i 1 0 1 1760
41 e
42
43
44 </CsScore>
45 </CsoundSynthesizer>