Debian Codegraph @

examples/expsegb.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 ; Audio out Audio in
5 -odac -iadc ;;;RT audio I/O
6 ; For Non-realtime ouput leave only the line below:
7 ; -o expseg.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 ; p4 = frequency in pitch-class notation.
20 kcps = cpspch(p4)
21
22 ; Create an amplitude envelope.
23 kenv expsegb 0.01, p3*0.25, 1, p3, 0.01
24 kamp = kenv * 30000
25
26 a1 oscil kamp, kcps, 1
27 out a1
28 endin
29
30
31 </CsInstruments>
32 <CsScore>
33
34 ; Table #1, a sine wave.
35 f 1 0 16384 10 1
36
37 ; Play Instrument #1 for a half-second, p4=8.00
38 i 1 0 0.5 8.00
39 ; Play Instrument #1 for a half-second, p4=8.01
40 i 1 1 0.5 8.01
41 ; Play Instrument #1 for a half-second, p4=8.02
42 i 1 2 0.5 8.02
43 ; Play Instrument #1 for a half-second, p4=8.03
44 i 1 3 0.5 8.03
45 e
46
47
48 </CsScore>
49 </CsoundSynthesizer>