Debian Codegraph @

src/Examples/CsoundQt/Getting Started/Basics/Basic Elements Variables.csd

raw
1 /*Getting started.. 1.4 Basic Elements: Constants and Variables
2
3 Variables are named 'cells' or 'slots' which contain data. They may be updated at one of the available update rates: i, k and a, which stand for initialization, control and audio.
4 The type of variable is determined by the first letter of its name (i,k,a). The names can be easier to read, if you start new words with big letters.
5
6 For example:
7 aMyAudioVariable
8 kMyControlVariable
9 iThisIsTheInitVariable
10
11 Numeric Value types: (From: An Overview of Csound Variable Types by Andres Cabrera (Csound Journal Issue 10 on www.csounds.com))
12 a-type: These variables hold audio samples, or control signals that are
13 calculated and updated every audio sample.
14
15 k-type: These variables hold scalar values which are updated only
16 once per control period.
17
18 i-type: Initialization variables are only updated on every note's
19 initialization pass.
20
21 More detailed information can be found here:
22 -Constants and Variables (Menu: Help->Csound Manual->1. Overview - Syntax of the orchestra->Constants and Variables)
23 -An Overview of Csound Variable Types by Andres Cabrera (Csound Journal Issue 10 on www.csounds.com)
24 */
25
26 <CsoundSynthesizer>
27 <CsOptions>
28 </CsOptions>
29 <CsInstruments>
30
31 sr = 44100
32 ksmps = 128
33 nchnls = 2
34 0dbfs = 1
35
36 instr 2
37 kFreq expon 100, 5, 1000 ; kFreq is used to carry the 'expon' output as k-type
38 aOut oscili 0.2, kFreq, 1 ; aOut carries the 'oscil' output as a-type
39 outvalue "freqsweep", kFreq ; k-type values can be displayed on widgets
40 outs aOut, aOut ; a-type values can be played by the computers audio output
41 endin
42
43
44 </CsInstruments>
45 <CsScore>
46 f 1 0 1024 10 1 ; this function table contains the sine information
47 i 2 0 5 ; the instrument is called and plays for 5 seconds
48 e
49 </CsScore>
50 </CsoundSynthesizer>
51 ; written by Alex Hofmann (Nov. 2009) - Incontri HMT-Hannover
52
53 <bsbPanel>
54 <label>Widgets</label>
55 <objectName/>
56 <x>1013</x>
57 <y>279</y>
58 <width>563</width>
59 <height>397</height>
60 <visible>true</visible>
61 <uuid/>
62 <bgcolor mode="background">
63 <r>162</r>
64 <g>143</g>
65 <b>151</b>
66 </bgcolor>
67 <bsbObject version="2" type="BSBDisplay">
68 <objectName>freqsweep</objectName>
69 <x>108</x>
70 <y>37</y>
71 <width>144</width>
72 <height>29</height>
73 <uuid>{e0798988-168d-430b-a9b7-b8f2313ca7bf}</uuid>
74 <visible>true</visible>
75 <midichan>0</midichan>
76 <midicc>-3</midicc>
77 <label>999.1507</label>
78 <alignment>center</alignment>
79 <font>Helvetica</font>
80 <fontsize>18</fontsize>
81 <precision>3</precision>
82 <color>
83 <r>0</r>
84 <g>0</g>
85 <b>0</b>
86 </color>
87 <bgcolor mode="background">
88 <r>182</r>
89 <g>109</g>
90 <b>0</b>
91 </bgcolor>
92 <bordermode>border</bordermode>
93 <borderradius>1</borderradius>
94 <borderwidth>1</borderwidth>
95 </bsbObject>
96 <bsbObject version="2" type="BSBScope">
97 <objectName/>
98 <x>22</x>
99 <y>365</y>
100 <width>255</width>
101 <height>150</height>
102 <uuid>{98a4c895-a461-408e-9ab2-543b97475130}</uuid>
103 <visible>true</visible>
104 <midichan>0</midichan>
105 <midicc>-3</midicc>
106 <value>-255.00000000</value>
107 <type>scope</type>
108 <zoomx>2.00000000</zoomx>
109 <zoomy>1.00000000</zoomy>
110 <dispx>1.00000000</dispx>
111 <dispy>1.00000000</dispy>
112 <mode>0.00000000</mode>
113 </bsbObject>
114 <bsbObject version="2" type="BSBLabel">
115 <objectName/>
116 <x>21</x>
117 <y>7</y>
118 <width>248</width>
119 <height>71</height>
120 <uuid>{6b72ecb9-3089-4674-b08a-8adc73a46b3e}</uuid>
121 <visible>true</visible>
122 <midichan>0</midichan>
123 <midicc>-3</midicc>
124 <label>This label displays the current frequency:</label>
125 <alignment>left</alignment>
126 <font>Lucida Grande</font>
127 <fontsize>14</fontsize>
128 <precision>3</precision>
129 <color>
130 <r>0</r>
131 <g>0</g>
132 <b>0</b>
133 </color>
134 <bgcolor mode="nobackground">
135 <r>255</r>
136 <g>255</g>
137 <b>255</b>
138 </bgcolor>
139 <bordermode>noborder</bordermode>
140 <borderradius>1</borderradius>
141 <borderwidth>1</borderwidth>
142 </bsbObject>
143 <bsbObject version="2" type="BSBLabel">
144 <objectName/>
145 <x>22</x>
146 <y>313</y>
147 <width>254</width>
148 <height>53</height>
149 <uuid>{5f31db51-4df9-4b43-8f7d-340609938c13}</uuid>
150 <visible>true</visible>
151 <midichan>0</midichan>
152 <midicc>-3</midicc>
153 <label>The scope shows the current output-waveform.</label>
154 <alignment>left</alignment>
155 <font>Lucida Grande</font>
156 <fontsize>14</fontsize>
157 <precision>3</precision>
158 <color>
159 <r>0</r>
160 <g>0</g>
161 <b>0</b>
162 </color>
163 <bgcolor mode="nobackground">
164 <r>255</r>
165 <g>255</g>
166 <b>255</b>
167 </bgcolor>
168 <bordermode>noborder</bordermode>
169 <borderradius>1</borderradius>
170 <borderwidth>1</borderwidth>
171 </bsbObject>
172 <bsbObject version="2" type="BSBGraph">
173 <objectName/>
174 <x>21</x>
175 <y>165</y>
176 <width>251</width>
177 <height>109</height>
178 <uuid>{8ca94d8e-b7f1-42ea-8842-6971bea7aa46}</uuid>
179 <visible>true</visible>
180 <midichan>0</midichan>
181 <midicc>-3</midicc>
182 <value>0</value>
183 <objectName2/>
184 <zoomx>1.00000000</zoomx>
185 <zoomy>1.00000000</zoomy>
186 <dispx>1.00000000</dispx>
187 <dispy>1.00000000</dispy>
188 <modex>auto</modex>
189 <modey>auto</modey>
190 <all>true</all>
191 </bsbObject>
192 <bsbObject version="2" type="BSBLabel">
193 <objectName/>
194 <x>21</x>
195 <y>105</y>
196 <width>251</width>
197 <height>61</height>
198 <uuid>{78869346-10bb-48e9-91c8-84e4b7e3e2f1}</uuid>
199 <visible>true</visible>
200 <midichan>0</midichan>
201 <midicc>-3</midicc>
202 <label>The pure waveform used by the oscillator is visable in the Graph display.</label>
203 <alignment>left</alignment>
204 <font>Lucida Grande</font>
205 <fontsize>14</fontsize>
206 <precision>3</precision>
207 <color>
208 <r>0</r>
209 <g>0</g>
210 <b>0</b>
211 </color>
212 <bgcolor mode="nobackground">
213 <r>255</r>
214 <g>255</g>
215 <b>255</b>
216 </bgcolor>
217 <bordermode>noborder</bordermode>
218 <borderradius>1</borderradius>
219 <borderwidth>1</borderwidth>
220 </bsbObject>
221 <bsbObject version="2" type="BSBDisplay">
222 <objectName>freqsweep</objectName>
223 <x>108</x>
224 <y>37</y>
225 <width>144</width>
226 <height>29</height>
227 <uuid>{2a0e9cca-d3b3-4fbc-8e24-374c23d39941}</uuid>
228 <visible>true</visible>
229 <midichan>0</midichan>
230 <midicc>-3</midicc>
231 <label>999.1507</label>
232 <alignment>center</alignment>
233 <font>Helvetica</font>
234 <fontsize>18</fontsize>
235 <precision>3</precision>
236 <color>
237 <r>0</r>
238 <g>0</g>
239 <b>0</b>
240 </color>
241 <bgcolor mode="background">
242 <r>182</r>
243 <g>109</g>
244 <b>0</b>
245 </bgcolor>
246 <bordermode>border</bordermode>
247 <borderradius>1</borderradius>
248 <borderwidth>1</borderwidth>
249 </bsbObject>
250 <bsbObject version="2" type="BSBScope">
251 <objectName/>
252 <x>22</x>
253 <y>365</y>
254 <width>255</width>
255 <height>150</height>
256 <uuid>{a1a2b99b-4f02-465a-8725-e03da3c9c551}</uuid>
257 <visible>true</visible>
258 <midichan>0</midichan>
259 <midicc>-3</midicc>
260 <value>-255.00000000</value>
261 <type>scope</type>
262 <zoomx>2.00000000</zoomx>
263 <zoomy>1.00000000</zoomy>
264 <dispx>1.00000000</dispx>
265 <dispy>1.00000000</dispy>
266 <mode>0.00000000</mode>
267 </bsbObject>
268 <bsbObject version="2" type="BSBLabel">
269 <objectName/>
270 <x>21</x>
271 <y>7</y>
272 <width>248</width>
273 <height>71</height>
274 <uuid>{17ce6c00-b473-4ea4-9bf4-44a0304a85a6}</uuid>
275 <visible>true</visible>
276 <midichan>0</midichan>
277 <midicc>-3</midicc>
278 <label>This label displays the current frequency:</label>
279 <alignment>left</alignment>
280 <font>Lucida Grande</font>
281 <fontsize>14</fontsize>
282 <precision>3</precision>
283 <color>
284 <r>0</r>
285 <g>0</g>
286 <b>0</b>
287 </color>
288 <bgcolor mode="nobackground">
289 <r>255</r>
290 <g>255</g>
291 <b>255</b>
292 </bgcolor>
293 <bordermode>noborder</bordermode>
294 <borderradius>1</borderradius>
295 <borderwidth>1</borderwidth>
296 </bsbObject>
297 <bsbObject version="2" type="BSBLabel">
298 <objectName/>
299 <x>22</x>
300 <y>313</y>
301 <width>254</width>
302 <height>53</height>
303 <uuid>{ee5ec7fb-9af7-44f6-b84e-3a7d91d19d68}</uuid>
304 <visible>true</visible>
305 <midichan>0</midichan>
306 <midicc>-3</midicc>
307 <label>The scope shows the current output-waveform.</label>
308 <alignment>left</alignment>
309 <font>Lucida Grande</font>
310 <fontsize>14</fontsize>
311 <precision>3</precision>
312 <color>
313 <r>0</r>
314 <g>0</g>
315 <b>0</b>
316 </color>
317 <bgcolor mode="nobackground">
318 <r>255</r>
319 <g>255</g>
320 <b>255</b>
321 </bgcolor>
322 <bordermode>noborder</bordermode>
323 <borderradius>1</borderradius>
324 <borderwidth>1</borderwidth>
325 </bsbObject>
326 <bsbObject version="2" type="BSBGraph">
327 <objectName/>
328 <x>21</x>
329 <y>165</y>
330 <width>251</width>
331 <height>109</height>
332 <uuid>{ef1ce543-98ba-4cf3-8f83-7404ec9981e1}</uuid>
333 <visible>true</visible>
334 <midichan>0</midichan>
335 <midicc>-3</midicc>
336 <value>0</value>
337 <objectName2/>
338 <zoomx>1.00000000</zoomx>
339 <zoomy>1.00000000</zoomy>
340 <dispx>1.00000000</dispx>
341 <dispy>1.00000000</dispy>
342 <modex>auto</modex>
343 <modey>auto</modey>
344 <all>true</all>
345 </bsbObject>
346 <bsbObject version="2" type="BSBLabel">
347 <objectName/>
348 <x>21</x>
349 <y>105</y>
350 <width>251</width>
351 <height>61</height>
352 <uuid>{8ac76c90-0fcc-4387-a913-ee6318a09765}</uuid>
353 <visible>true</visible>
354 <midichan>0</midichan>
355 <midicc>-3</midicc>
356 <label>The pure waveform used by the oscillator is visable in the Graph display.</label>
357 <alignment>left</alignment>
358 <font>Lucida Grande</font>
359 <fontsize>14</fontsize>
360 <precision>3</precision>
361 <color>
362 <r>0</r>
363 <g>0</g>
364 <b>0</b>
365 </color>
366 <bgcolor mode="nobackground">
367 <r>255</r>
368 <g>255</g>
369 <b>255</b>
370 </bgcolor>
371 <bordermode>noborder</bordermode>
372 <borderradius>1</borderradius>
373 <borderwidth>1</borderwidth>
374 </bsbObject>
375 </bsbPanel>
376 <bsbPresets>
377 </bsbPresets>
378 <EventPanel name="" tempo="60.00000000" loop="8.00000000" x="320" y="218" width="596" height="322" visible="true" loopStart="0" loopEnd="0"> </EventPanel>