Debian Codegraph @

src/Examples/FLOSS Manual Examples/03 Csound Language/03B09_Global_audio_add.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -o dac
4 </CsOptions>
5 <CsInstruments>
6 sr = 44100
7 ksmps = 4410; very high because of printing
8 ;(change to 441 to see the difference)
9 nchnls = 2
10 0dbfs = 1
11
12 ;initialize a general audio variable
13 gaSum init 0
14
15 instr 1
16 ;produce a sine signal (change frequency to 401 to see the difference)
17 aAdd oscils .1, 400, 0
18 ;add it to the general audio (= the previous vector)
19 gaSum = gaSum + aAdd
20 endin
21
22 instr 2
23 kmax max_k gaSum, 1, 1; calculate maximum
24 printk 0, kmax; print it out
25 outs gaSum, gaSum
26 endin
27
28 </CsInstruments>
29 <CsScore>
30 i 1 0 1
31 i 2 0 1
32 </CsScore>
33 </CsoundSynthesizer>
34 ;example by joachim heintz