Debian Codegraph @

examples/cosseg.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 linseg.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 giSine ftgen 0, 0, 2^10, 10, 1
17
18 instr 1
19
20 kcps = cpspch(p4)
21 kenv cosseg 0, 0.25, 1, 0.75, 0 ; together = 1 sec
22 asig poscil kenv, kcps, giSine
23 outs asig, asig
24
25 endin
26
27 instr 2 ; scaling to duration
28
29 kcps = cpspch(p4)
30 kenv cosseg 0, p3*0.25, 1, p3*0.75, 0
31 asig poscil kenv, kcps, giSine
32 outs asig, asig
33
34 endin
35
36 instr 3 ; with negative value
37
38 kcps = cpspch(p4)
39 aenv cosseg 0, 0.1, 1, 0.5, -0.9, 0.4, 0
40 asig poscil aenv, kcps, giSine
41 outs asig, asig
42
43 endin
44 </CsInstruments>
45 <CsScore>
46
47 i 1 0 1 7.00 ; = 1 sec, p3 fits exactly
48 i 1 2 2 7.00 ; = 2 sec, p3 truncated at 1 sec
49
50 i 2 4 1 7.00 ; scales to duration
51 i 2 6 2 7.00 ; of p3
52
53 i 3 9 2 7.00
54 e
55 </CsScore>
56 </CsoundSynthesizer>