Debian Codegraph @

src/Examples/McCurdy Collection/PhysicalModels/wgbrass.csd

raw
1 ;Written by Iain McCurdy, 2009
2
3 ;Modified for QuteCsound by René, March 2011
4 ;Tested on Ubuntu 10.04 with csound-float 5.13.0 and QuteCsound svn rev 817
5
6
7 ;Notes on modifications from original csd:
8 ; Add tables for exp slider
9 ; INIT instrument added
10
11
12 ;my flags on Ubuntu: -odac -b1024 -B2048 -+rtaudio=alsa -+rtmidi=null -m0
13 <CsoundSynthesizer>
14 <CsOptions>
15
16 </CsOptions>
17 <CsInstruments>
18 sr = 44100 ;SAMPLE RATE
19 ksmps = 100 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE
20 nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO)
21 0dbfs = 1 ;MAXIMUM AMPLITUDE REGARDLESS OF BIT DEPTH
22
23
24 givfn ftgen 0, 0, 256, 10, 1 ;VIBRATO WAVEFORM (A SINE WAVE)
25 giExp1 ftgen 0, 0, 129, -25, 0, 20.0, 128, 20000.0 ;TABLE FOR EXP SLIDER
26 giExp2 ftgen 0, 0, 129, -25, 0, 0.0001, 128, 2.0 ;TABLE FOR EXP SLIDER
27
28
29 instr 10 ;GUI
30 ktrig metro 10
31 if (ktrig == 1) then
32 gkamp invalue "Amp"
33 kfreq invalue "Freq"
34 gkfreq tablei kfreq, giExp1, 1
35 outvalue "Freq_Value", gkfreq
36 gktens invalue "Tension"
37 katt invalue "Attack"
38 gkatt tablei katt, giExp2, 1
39 outvalue "Attack_Value", gkatt
40 gkvibf invalue "VibFreq"
41 gkvamp invalue "VibAmp"
42 endif
43 endin
44
45 instr 1 ;WGBRASS INSTRUMENT
46 iporttime = 0.03
47 kporttime linseg 0, 0.001, iporttime, 1, iporttime
48 kfreq portk gkfreq, kporttime
49 ktens portk gktens, kporttime
50
51 ares wgbrass gkamp, kfreq, ktens, i(gkatt), gkvibf, gkvamp, givfn
52 outs ares, ares ;SEND AUDIO TO OUTPUTS
53 endin
54
55 instr 2 ;INIT
56 outvalue "Amp" , 0.18
57 outvalue "Freq" , 0.4337
58 outvalue "Tension" , 0.4
59 outvalue "Attack" , 0.46
60 outvalue "VibFreq" , 5.0
61 outvalue "VibAmp" , 0.01
62 endin
63 </CsInstruments>
64 <CsScore>
65 ;INSTR | START | DURATION
66 i 10 0 3600 ;GUI
67 i 2 0 0.1 ;INIT
68 </CsScore>
69 </CsoundSynthesizer>
70 <bsbPanel>
71 <label>Widgets</label>
72 <objectName/>
73 <x>739</x>
74 <y>233</y>
75 <width>783</width>
76 <height>336</height>
77 <visible>true</visible>
78 <uuid/>
79 <bgcolor mode="background">
80 <r>241</r>
81 <g>226</g>
82 <b>185</b>
83 </bgcolor>
84 <bsbObject version="2" type="BSBLabel">
85 <objectName/>
86 <x>2</x>
87 <y>2</y>
88 <width>511</width>
89 <height>330</height>
90 <uuid>{aa607456-d368-4d59-8497-d16d608404c3}</uuid>
91 <visible>true</visible>
92 <midichan>0</midichan>
93 <midicc>0</midicc>
94 <label>wgbrass</label>
95 <alignment>center</alignment>
96 <font>Liberation Sans</font>
97 <fontsize>18</fontsize>
98 <precision>3</precision>
99 <color>
100 <r>0</r>
101 <g>0</g>
102 <b>0</b>
103 </color>
104 <bgcolor mode="background">
105 <r>147</r>
106 <g>154</g>
107 <b>255</b>
108 </bgcolor>
109 <bordermode>border</bordermode>
110 <borderradius>5</borderradius>
111 <borderwidth>2</borderwidth>
112 </bsbObject>
113 <bsbObject version="2" type="BSBLabel">
114 <objectName/>
115 <x>8</x>
116 <y>76</y>
117 <width>220</width>
118 <height>30</height>
119 <uuid>{640b50b7-7200-4f81-8394-89d9843ae939}</uuid>
120 <visible>true</visible>
121 <midichan>0</midichan>
122 <midicc>0</midicc>
123 <label>Amplitude</label>
124 <alignment>left</alignment>
125 <font>Liberation Sans</font>
126 <fontsize>10</fontsize>
127 <precision>3</precision>
128 <color>
129 <r>0</r>
130 <g>0</g>
131 <b>0</b>
132 </color>
133 <bgcolor mode="nobackground">
134 <r>255</r>
135 <g>255</g>
136 <b>255</b>
137 </bgcolor>
138 <bordermode>noborder</bordermode>
139 <borderradius>1</borderradius>
140 <borderwidth>1</borderwidth>
141 </bsbObject>
142 <bsbObject version="2" type="BSBHSlider">
143 <objectName>Amp</objectName>
144 <x>8</x>
145 <y>54</y>
146 <width>500</width>
147 <height>27</height>
148 <uuid>{5585fa6f-0f63-4ac3-bf1b-809c2b1d9134}</uuid>
149 <visible>true</visible>
150 <midichan>0</midichan>
151 <midicc>0</midicc>
152 <minimum>0.00000000</minimum>
153 <maximum>1.00000000</maximum>
154 <value>0.18000001</value>
155 <mode>lin</mode>
156 <mouseControl act="jump">continuous</mouseControl>
157 <resolution>-1.00000000</resolution>
158 <randomizable group="0">false</randomizable>
159 </bsbObject>
160 <bsbObject version="2" type="BSBDisplay">
161 <objectName>Amp</objectName>
162 <x>448</x>
163 <y>76</y>
164 <width>60</width>
165 <height>30</height>
166 <uuid>{b731b52e-e14a-476a-a583-f3b2bd885539}</uuid>
167 <visible>true</visible>
168 <midichan>0</midichan>
169 <midicc>0</midicc>
170 <label>0.180</label>
171 <alignment>right</alignment>
172 <font>Liberation Sans</font>
173 <fontsize>9</fontsize>
174 <precision>3</precision>
175 <color>
176 <r>0</r>
177 <g>0</g>
178 <b>0</b>
179 </color>
180 <bgcolor mode="nobackground">
181 <r>255</r>
182 <g>255</g>
183 <b>255</b>
184 </bgcolor>
185 <bordermode>noborder</bordermode>
186 <borderradius>1</borderradius>
187 <borderwidth>1</borderwidth>
188 </bsbObject>
189 <bsbObject version="2" type="BSBLabel">
190 <objectName/>
191 <x>515</x>
192 <y>2</y>
193 <width>265</width>
194 <height>330</height>
195 <uuid>{74928ed2-b701-4668-9a11-74763d317e9b}</uuid>
196 <visible>true</visible>
197 <midichan>0</midichan>
198 <midicc>0</midicc>
199 <label>wgbrass</label>
200 <alignment>center</alignment>
201 <font>Liberation Sans</font>
202 <fontsize>18</fontsize>
203 <precision>3</precision>
204 <color>
205 <r>0</r>
206 <g>0</g>
207 <b>0</b>
208 </color>
209 <bgcolor mode="background">
210 <r>147</r>
211 <g>154</g>
212 <b>255</b>
213 </bgcolor>
214 <bordermode>border</bordermode>
215 <borderradius>5</borderradius>
216 <borderwidth>2</borderwidth>
217 </bsbObject>
218 <bsbObject version="2" type="BSBLabel">
219 <objectName/>
220 <x>516</x>
221 <y>28</y>
222 <width>261</width>
223 <height>292</height>
224 <uuid>{d4bdb5ce-87d8-4c8c-9c64-40ec2eed6f5a}</uuid>
225 <visible>true</visible>
226 <midichan>0</midichan>
227 <midicc>0</midicc>
228 <label>--------------------------------------------------------------
229 'wgbrass' creates a physical model of a brass instrument.
230 It seems rather unstable. Experimentation with the settings for 'Frequency' and 'Lip Tension' are sometimes required in order to get the instrument to sound.
231 Perhaps it will be improved in future releases of Csound.</label>
232 <alignment>left</alignment>
233 <font>Liberation Sans</font>
234 <fontsize>14</fontsize>
235 <precision>3</precision>
236 <color>
237 <r>0</r>
238 <g>0</g>
239 <b>0</b>
240 </color>
241 <bgcolor mode="nobackground">
242 <r>255</r>
243 <g>255</g>
244 <b>255</b>
245 </bgcolor>
246 <bordermode>noborder</bordermode>
247 <borderradius>1</borderradius>
248 <borderwidth>1</borderwidth>
249 </bsbObject>
250 <bsbObject version="2" type="BSBButton">
251 <objectName/>
252 <x>8</x>
253 <y>16</y>
254 <width>120</width>
255 <height>30</height>
256 <uuid>{04d44ebe-12eb-4bb0-a3f5-9e4fd3e7830e}</uuid>
257 <visible>true</visible>
258 <midichan>0</midichan>
259 <midicc>0</midicc>
260 <type>event</type>
261 <pressedValue>1.00000000</pressedValue>
262 <stringvalue/>
263 <text> On / Off</text>
264 <image>/</image>
265 <eventLine>i 1 0 -1</eventLine>
266 <latch>true</latch>
267 <latched>false</latched>
268 </bsbObject>
269 <bsbObject version="2" type="BSBLabel">
270 <objectName/>
271 <x>8</x>
272 <y>121</y>
273 <width>220</width>
274 <height>30</height>
275 <uuid>{6e0c35ca-d489-456c-a3c8-7b02cf334c36}</uuid>
276 <visible>true</visible>
277 <midichan>0</midichan>
278 <midicc>0</midicc>
279 <label>Frequency</label>
280 <alignment>left</alignment>
281 <font>Liberation Sans</font>
282 <fontsize>10</fontsize>
283 <precision>3</precision>
284 <color>
285 <r>0</r>
286 <g>0</g>
287 <b>0</b>
288 </color>
289 <bgcolor mode="nobackground">
290 <r>255</r>
291 <g>255</g>
292 <b>255</b>
293 </bgcolor>
294 <bordermode>noborder</bordermode>
295 <borderradius>1</borderradius>
296 <borderwidth>1</borderwidth>
297 </bsbObject>
298 <bsbObject version="2" type="BSBHSlider">
299 <objectName>Freq</objectName>
300 <x>8</x>
301 <y>99</y>
302 <width>500</width>
303 <height>27</height>
304 <uuid>{28514f48-2718-4dab-b43c-78c3cc4fba09}</uuid>
305 <visible>true</visible>
306 <midichan>0</midichan>
307 <midicc>0</midicc>
308 <minimum>0.00000000</minimum>
309 <maximum>1.00000000</maximum>
310 <value>0.45600000</value>
311 <mode>lin</mode>
312 <mouseControl act="jump">continuous</mouseControl>
313 <resolution>-1.00000000</resolution>
314 <randomizable group="0">false</randomizable>
315 </bsbObject>
316 <bsbObject version="2" type="BSBDisplay">
317 <objectName>Freq_Value</objectName>
318 <x>448</x>
319 <y>121</y>
320 <width>60</width>
321 <height>30</height>
322 <uuid>{1ad30bb1-9a2f-461a-bf9e-cc7cc6c9d678}</uuid>
323 <visible>true</visible>
324 <midichan>0</midichan>
325 <midicc>0</midicc>
326 <label>466.851</label>
327 <alignment>right</alignment>
328 <font>Liberation Sans</font>
329 <fontsize>9</fontsize>
330 <precision>3</precision>
331 <color>
332 <r>0</r>
333 <g>0</g>
334 <b>0</b>
335 </color>
336 <bgcolor mode="nobackground">
337 <r>255</r>
338 <g>255</g>
339 <b>255</b>
340 </bgcolor>
341 <bordermode>noborder</bordermode>
342 <borderradius>1</borderradius>
343 <borderwidth>1</borderwidth>
344 </bsbObject>
345 <bsbObject version="2" type="BSBLabel">
346 <objectName/>
347 <x>8</x>
348 <y>166</y>
349 <width>220</width>
350 <height>30</height>
351 <uuid>{b6d928a2-0d92-4eaa-b1e8-9f3091c5794c}</uuid>
352 <visible>true</visible>
353 <midichan>0</midichan>
354 <midicc>0</midicc>
355 <label>Lip Tension</label>
356 <alignment>left</alignment>
357 <font>Liberation Sans</font>
358 <fontsize>10</fontsize>
359 <precision>3</precision>
360 <color>
361 <r>0</r>
362 <g>0</g>
363 <b>0</b>
364 </color>
365 <bgcolor mode="nobackground">
366 <r>255</r>
367 <g>255</g>
368 <b>255</b>
369 </bgcolor>
370 <bordermode>noborder</bordermode>
371 <borderradius>1</borderradius>
372 <borderwidth>1</borderwidth>
373 </bsbObject>
374 <bsbObject version="2" type="BSBHSlider">
375 <objectName>Tension</objectName>
376 <x>8</x>
377 <y>144</y>
378 <width>500</width>
379 <height>27</height>
380 <uuid>{49a6777a-6ac7-430b-b827-547dc2686e49}</uuid>
381 <visible>true</visible>
382 <midichan>0</midichan>
383 <midicc>0</midicc>
384 <minimum>0.00000000</minimum>
385 <maximum>1.00000000</maximum>
386 <value>0.58000000</value>
387 <mode>lin</mode>
388 <mouseControl act="jump">continuous</mouseControl>
389 <resolution>-1.00000000</resolution>
390 <randomizable group="0">false</randomizable>
391 </bsbObject>
392 <bsbObject version="2" type="BSBDisplay">
393 <objectName>Tension</objectName>
394 <x>448</x>
395 <y>166</y>
396 <width>60</width>
397 <height>30</height>
398 <uuid>{fca8b154-9112-4b23-8054-469dafd66230}</uuid>
399 <visible>true</visible>
400 <midichan>0</midichan>
401 <midicc>0</midicc>
402 <label>0.580</label>
403 <alignment>right</alignment>
404 <font>Liberation Sans</font>
405 <fontsize>9</fontsize>
406 <precision>3</precision>
407 <color>
408 <r>0</r>
409 <g>0</g>
410 <b>0</b>
411 </color>
412 <bgcolor mode="nobackground">
413 <r>255</r>
414 <g>255</g>
415 <b>255</b>
416 </bgcolor>
417 <bordermode>noborder</bordermode>
418 <borderradius>1</borderradius>
419 <borderwidth>1</borderwidth>
420 </bsbObject>
421 <bsbObject version="2" type="BSBLabel">
422 <objectName/>
423 <x>8</x>
424 <y>211</y>
425 <width>220</width>
426 <height>30</height>
427 <uuid>{55089f0d-6978-4aca-b682-ae666b30683e}</uuid>
428 <visible>true</visible>
429 <midichan>0</midichan>
430 <midicc>0</midicc>
431 <label>Attack Time</label>
432 <alignment>left</alignment>
433 <font>Liberation Sans</font>
434 <fontsize>10</fontsize>
435 <precision>3</precision>
436 <color>
437 <r>0</r>
438 <g>0</g>
439 <b>0</b>
440 </color>
441 <bgcolor mode="nobackground">
442 <r>255</r>
443 <g>255</g>
444 <b>255</b>
445 </bgcolor>
446 <bordermode>noborder</bordermode>
447 <borderradius>1</borderradius>
448 <borderwidth>1</borderwidth>
449 </bsbObject>
450 <bsbObject version="2" type="BSBHSlider">
451 <objectName>Attack</objectName>
452 <x>8</x>
453 <y>189</y>
454 <width>500</width>
455 <height>27</height>
456 <uuid>{3439fd43-d6bf-41ba-88ab-efcbcda0122c}</uuid>
457 <visible>true</visible>
458 <midichan>0</midichan>
459 <midicc>0</midicc>
460 <minimum>0.00000000</minimum>
461 <maximum>1.00000000</maximum>
462 <value>0.46000001</value>
463 <mode>lin</mode>
464 <mouseControl act="jump">continuous</mouseControl>
465 <resolution>-1.00000000</resolution>
466 <randomizable group="0">false</randomizable>
467 </bsbObject>
468 <bsbObject version="2" type="BSBDisplay">
469 <objectName>Attack_Value</objectName>
470 <x>448</x>
471 <y>211</y>
472 <width>60</width>
473 <height>30</height>
474 <uuid>{d78b9853-b96c-4bc2-a2d5-375b6a4869ae}</uuid>
475 <visible>true</visible>
476 <midichan>0</midichan>
477 <midicc>0</midicc>
478 <label>0.010</label>
479 <alignment>right</alignment>
480 <font>Liberation Sans</font>
481 <fontsize>9</fontsize>
482 <precision>3</precision>
483 <color>
484 <r>0</r>
485 <g>0</g>
486 <b>0</b>
487 </color>
488 <bgcolor mode="nobackground">
489 <r>255</r>
490 <g>255</g>
491 <b>255</b>
492 </bgcolor>
493 <bordermode>noborder</bordermode>
494 <borderradius>1</borderradius>
495 <borderwidth>1</borderwidth>
496 </bsbObject>
497 <bsbObject version="2" type="BSBLabel">
498 <objectName/>
499 <x>8</x>
500 <y>256</y>
501 <width>220</width>
502 <height>30</height>
503 <uuid>{d8273459-fbc3-40c2-b202-003f954906f6}</uuid>
504 <visible>true</visible>
505 <midichan>0</midichan>
506 <midicc>0</midicc>
507 <label>Vibrato Frequency (hertz)</label>
508 <alignment>left</alignment>
509 <font>Liberation Sans</font>
510 <fontsize>10</fontsize>
511 <precision>3</precision>
512 <color>
513 <r>0</r>
514 <g>0</g>
515 <b>0</b>
516 </color>
517 <bgcolor mode="nobackground">
518 <r>255</r>
519 <g>255</g>
520 <b>255</b>
521 </bgcolor>
522 <bordermode>noborder</bordermode>
523 <borderradius>1</borderradius>
524 <borderwidth>1</borderwidth>
525 </bsbObject>
526 <bsbObject version="2" type="BSBHSlider">
527 <objectName>VibFreq</objectName>
528 <x>8</x>
529 <y>234</y>
530 <width>500</width>
531 <height>27</height>
532 <uuid>{ab819133-79c9-448f-a33b-8cbd65c8d6af}</uuid>
533 <visible>true</visible>
534 <midichan>0</midichan>
535 <midicc>0</midicc>
536 <minimum>0.00000000</minimum>
537 <maximum>16.00000000</maximum>
538 <value>5.00000000</value>
539 <mode>lin</mode>
540 <mouseControl act="jump">continuous</mouseControl>
541 <resolution>-1.00000000</resolution>
542 <randomizable group="0">false</randomizable>
543 </bsbObject>
544 <bsbObject version="2" type="BSBDisplay">
545 <objectName>VibFreq</objectName>
546 <x>448</x>
547 <y>256</y>
548 <width>60</width>
549 <height>30</height>
550 <uuid>{22ea767e-1d44-46df-a57d-1b39aeeeaa04}</uuid>
551 <visible>true</visible>
552 <midichan>0</midichan>
553 <midicc>0</midicc>
554 <label>5.000</label>
555 <alignment>right</alignment>
556 <font>Liberation Sans</font>
557 <fontsize>9</fontsize>
558 <precision>3</precision>
559 <color>
560 <r>0</r>
561 <g>0</g>
562 <b>0</b>
563 </color>
564 <bgcolor mode="nobackground">
565 <r>255</r>
566 <g>255</g>
567 <b>255</b>
568 </bgcolor>
569 <bordermode>noborder</bordermode>
570 <borderradius>1</borderradius>
571 <borderwidth>1</borderwidth>
572 </bsbObject>
573 <bsbObject version="2" type="BSBLabel">
574 <objectName/>
575 <x>8</x>
576 <y>301</y>
577 <width>220</width>
578 <height>30</height>
579 <uuid>{eb9ca396-c5b9-439b-a2d6-173005d43519}</uuid>
580 <visible>true</visible>
581 <midichan>0</midichan>
582 <midicc>0</midicc>
583 <label>Vibrato Amplitude</label>
584 <alignment>left</alignment>
585 <font>Liberation Sans</font>
586 <fontsize>10</fontsize>
587 <precision>3</precision>
588 <color>
589 <r>0</r>
590 <g>0</g>
591 <b>0</b>
592 </color>
593 <bgcolor mode="nobackground">
594 <r>255</r>
595 <g>255</g>
596 <b>255</b>
597 </bgcolor>
598 <bordermode>noborder</bordermode>
599 <borderradius>1</borderradius>
600 <borderwidth>1</borderwidth>
601 </bsbObject>
602 <bsbObject version="2" type="BSBHSlider">
603 <objectName>VibAmp</objectName>
604 <x>8</x>
605 <y>279</y>
606 <width>500</width>
607 <height>27</height>
608 <uuid>{8efddf99-5c6c-4272-8941-b63cbfa97d8e}</uuid>
609 <visible>true</visible>
610 <midichan>0</midichan>
611 <midicc>0</midicc>
612 <minimum>0.00000000</minimum>
613 <maximum>0.10000000</maximum>
614 <value>0.01000000</value>
615 <mode>lin</mode>
616 <mouseControl act="jump">continuous</mouseControl>
617 <resolution>-1.00000000</resolution>
618 <randomizable group="0">false</randomizable>
619 </bsbObject>
620 <bsbObject version="2" type="BSBDisplay">
621 <objectName>VibAmp</objectName>
622 <x>448</x>
623 <y>301</y>
624 <width>60</width>
625 <height>30</height>
626 <uuid>{f23ee963-c062-4762-86c4-6695f28e2b01}</uuid>
627 <visible>true</visible>
628 <midichan>0</midichan>
629 <midicc>0</midicc>
630 <label>0.010</label>
631 <alignment>right</alignment>
632 <font>Liberation Sans</font>
633 <fontsize>9</fontsize>
634 <precision>3</precision>
635 <color>
636 <r>0</r>
637 <g>0</g>
638 <b>0</b>
639 </color>
640 <bgcolor mode="nobackground">
641 <r>255</r>
642 <g>255</g>
643 <b>255</b>
644 </bgcolor>
645 <bordermode>noborder</bordermode>
646 <borderradius>1</borderradius>
647 <borderwidth>1</borderwidth>
648 </bsbObject>
649 </bsbPanel>
650 <bsbPresets>
651 </bsbPresets>
652 <EventPanel name="" tempo="60.00000000" loop="8.00000000" x="913" y="162" width="655" height="346" visible="true" loopStart="0" loopEnd="0"> </EventPanel>