Debian Codegraph @

examples/mode.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 ; Audio out Audio in No messages
5 -odac -iadc -d ;;;RT audio I/O
6 ; For Non-realtime ouput leave only the line below:
7 ; -o moogvcf.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 ; Initialize the global variables.
12 sr = 44100
13 kr = 4410
14 ksmps = 10
15 nchnls = 2
16
17 instr 1; 2 modes excitator
18
19 idur init p3
20 ifreq11 init p4
21 ifreq12 init p5
22 iQ11 init p6
23 iQ12 init p7
24 iamp init ampdb(p8)
25 ifreq21 init p9
26 ifreq22 init p10
27 iQ21 init p11
28 iQ22 init p12
29
30 ; to simulate the shock between the excitator and the resonator
31 ashock mpulse 3,0
32
33 aexc1 mode ashock,ifreq11,iQ11
34 aexc1 = aexc1*iamp
35 aexc2 mode ashock,ifreq12,iQ12
36 aexc2 = aexc2*iamp
37
38
39 aexc = (aexc1+aexc2)/2
40
41 ;"Contact" condition : when aexc reaches 0, the excitator looses
42 ;contact with the resonator, and stops "pushing it"
43 aexc limit aexc,0,3*iamp
44
45 ; 2modes resonator
46
47 ares1 mode aexc,ifreq21,iQ21
48 ares2 mode aexc,ifreq22,iQ22
49
50 ares = (ares1+ares2)/2
51
52 display aexc+ares,p3
53 outs aexc+ares,aexc+ares
54
55 endin
56
57
58 </CsInstruments>
59 <CsScore>
60
61 ;wooden excitator against glass resonator
62 i1 0 8 1000 3000 12 8 70 440 888 500 420
63
64 ;felt against glass
65 i1 4 8 80 188 8 3 70 440 888 500 420
66
67 ;wood against wood
68 i1 8 8 1000 3000 12 8 70 440 630 60 53
69
70 ;felt against wood
71 i1 12 8 80 180 8 3 70 440 630 60 53
72
73
74 i1 16 8 1000 3000 12 8 70 440 888 2000 1630
75 i1 23 8 80 180 8 3 70 440 888 2000 1630
76
77
78 ;With a metallic excitator
79
80 i1 33 8 1000 1800 1000 720 70 440 882 500 500
81 i1 37 8 1000 1800 1000 850 70 440 630 60 53
82
83 i1 42 8 1000 1800 2000 1720 70 440 442 500 500
84
85
86 </CsScore>
87 </CsoundSynthesizer>