Debian Codegraph @

examples/Mixer.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 out
6 ; For Non-realtime ouput leave only the line below:
7 ; -o Mixer.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
17
18 katt expon 0.01, p3, 1 ;create an attack
19 aout poscil .7, 440,1
20 MixerSetLevel 1, 3, katt ;impose attack on the gain level
21 MixerSend aout, 1, 3, 0 ;send to channel 0
22 endin
23
24 instr 2
25
26 aout vco2 .5, 110 ;saw wave
27 MixerSetLevel 2, 3, .25 ;set level to .25 of vco2
28 MixerSend aout, 2, 3, 1 ;send to channel 1
29 endin
30
31 instr 3 ;mix instr.1 and 2 with reverb
32
33 kgain1 MixerGetLevel 1,3 ;get level form buss 3
34 kgain2 MixerGetLevel 2,3 ;get level form buss 3
35 a1 MixerReceive 3,0 ;receive channel 0
36 a2 MixerReceive 3,1 ;receive channel 1
37 aout = a1*kgain1+a2*kgain2 ;mix them
38 aoutL, aoutR reverbsc aout, aout, 0.85, 12000 ;add a nice reverb
39 outs aoutL, aoutR
40 MixerClear
41 endin
42
43 </CsInstruments>
44 <CsScore>
45 f1 0 4096 10 1
46
47 i1 0 2
48 i2 0 2
49 i3 0 8 ;reverb stays on for 8 sec.
50
51 e
52 </CsScore>
53 </CsoundSynthesizer>
54