Debian Codegraph @

examples/equals.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac ;;;realtime audio out
5 ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o equals.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 32
13 nchnls = 2
14 0dbfs = 1
15
16 instr 1
17
18 ienv = p4 ;choose envelope in score
19
20 if (ienv == 0) kthen
21 kenv adsr 0.05, 0.05, 0.95, 0.05 ;sustained envelope
22 elseif (ienv == 1) kthen
23 kenv adsr 0.5, 1, 0.5, 0.5 ;triangular envelope
24 elseif (ienv == 2) kthen
25 kenv adsr 1, 1, 1, 0 ;ramp up
26 endif
27
28 aout vco2 .1, 110, 10
29 aout = aout * kenv
30 outs aout, aout
31
32 endin
33
34 </CsInstruments>
35 <CsScore>
36
37 i1 0 2 0
38 i1 3 2 1
39 i1 6 2 2
40
41 e
42 </CsScore>
43 </CsoundSynthesizer>