Debian Codegraph @

src/Examples/FLOSS Manual Examples/05 Sound Modification/05B01_routing.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -odac -m128
4 </CsOptions>
5 <CsInstruments>
6 sr = 44100
7 ksmps = 32
8 0dbfs = 1
9 nchnls = 2
10 seed 1
11
12 opcode Resonator, a, akk
13 aSig, kFreq, kQ xin
14 kRatio[] fillarray 1, 2.89, 4.95, 6.99, 8.01, 9.02
15 a1 = mode:a(aSig, kFreq*kRatio[0], kQ)
16 a2 = mode:a(aSig, kFreq*kRatio[1], kQ)
17 a3 = mode:a(aSig, kFreq*kRatio[2], kQ)
18 a4 = mode:a(aSig, kFreq*kRatio[3], kQ)
19 a5 = mode:a(aSig, kFreq*kRatio[4], kQ)
20 a6 = mode:a(aSig, kFreq*kRatio[5], kQ)
21 aSum sum a1, a2, a3, a4, a5, a6
22 aOut = balance:a(aSum, aSig)
23 xout aOut
24 endop
25
26 instr Equal
27 kTrig metro 80/60
28 schedkwhen kTrig, 0, 0, "Perc", 0, 1, .4, 1
29 schedkwhen kTrig, 0, 0, "Perc", 0, 1, .4, 2
30 endin
31
32 instr Beat
33 kRoutArr[] fillarray 1, 2, 2
34 kIndex init 0
35 if metro:k(80/60) == 1 then
36 event "i", "Perc", 0, 1, .6, kRoutArr[kIndex]
37 kIndex = (kIndex+1) % 3
38 endif
39 endin
40
41 instr Dialog
42 if metro:k(80/60) == 1 then
43 event "i", "Perc", 0, 1, .6, int(random:k(1,2.999))
44 endif
45 endin
46
47 instr Perc
48 iAmp = p4
49 iChannel = p5
50 aBeat pluck iAmp, 100, 100, 0, 3, .5
51 aOut Resonator aBeat, 300, 5
52 outch iChannel, aOut
53 endin
54
55 </CsInstruments>
56 <CsScore>
57 i "Equal" 0 9.5
58 i "Beat" 11 9.5
59 i "Dialog" 22 9.5
60 </CsScore>
61 </CsoundSynthesizer>
62 ;example by joachim heintz and philipp henkel