Debian Codegraph @

src/Examples/CsoundQt/Getting Started/Toots/Toot5.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 </CsOptions>
4 <CsInstruments>
5 ; Adapted from Richard Boulanger's toots
6 sr = 44100
7 ksmps = 128
8 nchnls = 2
9 0dbfs = 1
10
11 instr 5
12 irel = 0.01 ; set vibrato release time
13 idel1 = p3 * p10 ; calculate initial delay (% of dur)
14 isus = p3 - (idel1 + irel) ; calculate remaining duration
15
16 iamp = ampdbfs(p4)
17 iscale = iamp * .333 ; p4=amp
18 inote = cpspch(p5) ; p5=freq
19
20 k3 linseg 0, idel1, p9, isus, p9, irel, 0 ; p6=attack time
21 k2 oscil k3, p8, 1 ; p7=release time
22 k1 linen iscale, p6, p3, p7 ; p8=vib rate
23
24 a3 oscil k1, inote*.995+k2, 1 ; p9=vib depth
25 a2 oscil k1, inote*1.005+k2, 1 ; p10=vib delay (0-1)
26 a1 oscil k1, inote+k2, 1
27
28 outs a1+a2+a3, a1+a2+a3
29
30 endin
31 </CsInstruments>
32 <CsScore>
33 ; number time size GEN p1
34 f 1 0 4096 10 1 ; use GEN10 to compute a sine wave
35
36 ;ins strt dur amp freq atk rel vibrt vbdpt vbdel
37 i5 0 3 -10 10.00 0.1 0.7 7 6 .4
38
39 i5 4 3 -10 10.02 1 0.2 6 6 .4
40
41 i5 8 4 -10 10.04 2 1 5 6 .4
42 e ; indicates the end of the score
43 </CsScore>
44 </CsoundSynthesizer>
45 <bsbPanel>
46 <label>Widgets</label>
47 <objectName/>
48 <x>502</x>
49 <y>269</y>
50 <width>413</width>
51 <height>440</height>
52 <visible>true</visible>
53 <uuid/>
54 <bgcolor mode="background">
55 <r>7</r>
56 <g>95</g>
57 <b>162</b>
58 </bgcolor>
59 <bsbObject version="2" type="BSBLabel">
60 <objectName/>
61 <x>14</x>
62 <y>12</y>
63 <width>100</width>
64 <height>29</height>
65 <uuid>{48c50f90-782c-4085-bddf-6438c45c0604}</uuid>
66 <visible>true</visible>
67 <midichan>0</midichan>
68 <midicc>-3</midicc>
69 <label>Toot 5</label>
70 <alignment>left</alignment>
71 <font>DejaVu Sans</font>
72 <fontsize>18</fontsize>
73 <precision>3</precision>
74 <color>
75 <r>241</r>
76 <g>241</g>
77 <b>241</b>
78 </color>
79 <bgcolor mode="nobackground">
80 <r>255</r>
81 <g>255</g>
82 <b>255</b>
83 </bgcolor>
84 <bordermode>noborder</bordermode>
85 <borderradius>1</borderradius>
86 <borderwidth>1</borderwidth>
87 </bsbObject>
88 <bsbObject version="2" type="BSBLabel">
89 <objectName/>
90 <x>14</x>
91 <y>43</y>
92 <width>365</width>
93 <height>114</height>
94 <uuid>{3f95e491-29da-4b7d-825e-67cf89ef4eff}</uuid>
95 <visible>true</visible>
96 <midichan>0</midichan>
97 <midicc>-3</midicc>
98 <label>To add some delayed vibrato to our chorusing instrument we use another oscillator for the vibrato and a line segment generator, linseg, as a means of controlling the delay. linseg is a k-rate or a-rate signal generator which traces a series of straight line segments between any number of specified points.</label>
99 <alignment>left</alignment>
100 <font>DejaVu Sans</font>
101 <fontsize>12</fontsize>
102 <precision>3</precision>
103 <color>
104 <r>241</r>
105 <g>241</g>
106 <b>241</b>
107 </color>
108 <bgcolor mode="nobackground">
109 <r>255</r>
110 <g>255</g>
111 <b>255</b>
112 </bgcolor>
113 <bordermode>noborder</bordermode>
114 <borderradius>1</borderradius>
115 <borderwidth>1</borderwidth>
116 </bsbObject>
117 <bsbObject version="2" type="BSBScope">
118 <objectName/>
119 <x>50</x>
120 <y>276</y>
121 <width>292</width>
122 <height>96</height>
123 <uuid>{c62f9a7e-a132-4302-94ce-7f92a94c6052}</uuid>
124 <visible>true</visible>
125 <midichan>0</midichan>
126 <midicc>-3</midicc>
127 <value>-255.00000000</value>
128 <type>scope</type>
129 <zoomx>2.00000000</zoomx>
130 <zoomy>1.00000000</zoomy>
131 <dispx>1.00000000</dispx>
132 <dispy>1.00000000</dispy>
133 <mode>0.00000000</mode>
134 </bsbObject>
135 <bsbObject version="2" type="BSBLabel">
136 <objectName/>
137 <x>14</x>
138 <y>162</y>
139 <width>365</width>
140 <height>102</height>
141 <uuid>{7825fe0b-8a41-49ec-a392-c9ec0123c9ee}</uuid>
142 <visible>true</visible>
143 <midichan>0</midichan>
144 <midicc>-3</midicc>
145 <label>Since we intend to use this to slowly scale the amount of signal coming from our vibrato oscillator, we'll choose the k-rate version. The i-rate variables: ia, ib, ic, etc., are the values for the points. The i-rate variables: idur1, idur2, idur3, etc., set the duration, in seconds, between segments.</label>
146 <alignment>left</alignment>
147 <font>DejaVu Sans</font>
148 <fontsize>12</fontsize>
149 <precision>3</precision>
150 <color>
151 <r>241</r>
152 <g>241</g>
153 <b>241</b>
154 </color>
155 <bgcolor mode="nobackground">
156 <r>255</r>
157 <g>255</g>
158 <b>255</b>
159 </bgcolor>
160 <bordermode>noborder</bordermode>
161 <borderradius>1</borderradius>
162 <borderwidth>1</borderwidth>
163 </bsbObject>
164 </bsbPanel>
165 <bsbPresets>
166 </bsbPresets>