Debian Codegraph @

examples/setctrl.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 setctrl.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 ; Instrument #1.
18 instr 1
19 ; Display the label "Volume" on Slider #1.
20 setctrl 1, "Volume", 4
21 ; Set Slider #1's initial value to 20.
22 setctrl 1, 20, 1
23
24 ; Capture and display the values for Slider #1.
25 k1 control 1
26 printk2 k1
27
28 ; Play a simple oscillator.
29 ; Use the values from Slider #1 for amplitude.
30 kamp = k1 * 128
31 a1 oscil kamp, 440, 1
32 out a1
33 endin
34
35
36 </CsInstruments>
37 <CsScore>
38
39 ; Table #1, a sine wave.
40 f 1 0 16384 10 1
41
42 ; Play Instrument #1 for thirty seconds.
43 i 1 0 30
44 e
45
46
47 </CsScore>
48 </CsoundSynthesizer>