Debian Codegraph @

examples/maxaccum.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 maxaccum.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 ;saw
17
18 asig vco2 .2, p4
19 outs asig, asig
20 gasaw = asig
21 endin
22
23 instr 2 ;sine
24
25 aout poscil .3, p4, 1
26 outs aout, aout
27 gasin = aout
28 endin
29
30 instr 10
31
32 accum init 0
33 maxaccum accum, gasaw + gasin ;saw and sine accumulated
34 outs accum, accum
35
36 clear accum
37 endin
38
39 </CsInstruments>
40 <CsScore>
41 f 1 0 4096 10 1
42
43 i 1 0 7 330
44 i 2 3 3 440
45
46 i 1 10 7 330 ;same notes but without maxaccum, for comparison
47 i 2 13 3 440
48
49 i 10 0 6 ;accumulation note stops after 6 seconds
50
51 e
52
53 </CsScore>
54 </CsoundSynthesizer>