Debian Codegraph @

examples/minabsaccum.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 minabsaccum.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 minabsaccum accum, gasaw + gasin ;saw and sine accumulated
34 accum dcblock2 accum ;get rid of DC
35 outs accum, accum
36
37 clear accum
38 endin
39
40 </CsInstruments>
41 <CsScore>
42 f 1 0 4096 10 1
43
44 i 1 0 7 330
45 i 2 3 3 440
46
47 i 1 10 7 330 ;same notes but without minabsaccum, for comparison
48 i 2 13 3 440
49
50 i 10 0 6 ;accumulation note stops after 6 seconds
51
52 e
53 </CsScore>
54 </CsoundSynthesizer>