Debian Codegraph @

src/Examples/McCurdy Collection/Miscellaneous/Samphold.csd

raw
1 ;Written by Iain McCurdy, 2010
2
3 ;Modified for QuteCsound by René, February 2011
4 ;Tested on Ubuntu 10.04 with csound-float 5.13.0 and QuteCsound svn rev 817
5
6 ;Notes on modifications from original csd:
7 ; Add table for exp slider
8
9
10 ;my flags on Ubuntu: -odac -b1024 -B2048 -+rtaudio=alsa -+rtmidi=null -m0
11 <CsoundSynthesizer>
12 <CsOptions>
13
14 </CsOptions>
15 <CsInstruments>
16 sr = 44100 ;SAMPLE RATE
17 ksmps = 32 ;NUMBER OF AUDIO SAMPLES IN EACH CONTROL CYCLE
18 nchnls = 2 ;NUMBER OF CHANNELS (2=STEREO)
19 0dbfs = 1 ;MAXIMUM AMPLITUDE REGARDLESS OF BIT DEPTH
20
21
22 gisine ftgen 0,0,4096,10,1 ;SINE WAVE
23
24 ;TABLES FOR EXP SLIDER
25 giExp1 ftgen 0, 0, 129, -25, 0, 0.1 , 128, 50.0
26 giExp2 ftgen 0, 0, 129, -25, 0, 0.01, 128, 10.0
27 giExp3 ftgen 0, 0, 129, -25, 0, 0.05, 128, 3.0
28
29
30 instr 10 ;GUI
31 ktrig metro 10
32 if (ktrig == 1) then
33 ;SWITCHES
34 gkEnvOnOff invalue "EnvOnOff"
35 ;SLIDERS
36 kSHrate invalue "SHrate"
37 gkSHrate tablei kSHrate, giExp1, 1
38 outvalue "SHrate_Value", gkSHrate
39 kLFOrate invalue "LFOrate"
40 gkLFOrate tablei kLFOrate, giExp2, 1
41 outvalue "LFOrate_Value", gkLFOrate
42 gkLFOrange invalue "LFOrange"
43 gkLFOoffset invalue "LFOoffset"
44 kEnvDur invalue "EnvDur"
45 gkEnvDur tablei kEnvDur, giExp3, 1
46 outvalue "EnvDur_Value", gkEnvDur
47 ;MENU
48 gkSourceType invalue "SourceType"
49 endif
50 endin
51
52 instr 1 ;SAMPLE AND HOLD NOTE SEQUENCER
53 ;MAKE VARIOUS SETTINGS BASED ON LFO TYPE CHOICE
54 if gkSourceType=0 then
55 kLFOtype=0 ;SINE WAVE
56 elseif gkSourceType=1 then
57 kLFOtype=1 ;TRIANGLE
58 elseif gkSourceType=2 then
59 kLFOtype=5 ;SAWTOOTH DOWN (UNIPOLAR)
60 elseif gkSourceType=3 then
61 kLFOtype=4 ;SAWTOOTH UP (UNIPOLAR)
62 endif
63 if gkSourceType=4 then
64 aoct noise gkLFOrange, 0 ;NOISE WAVEFORM
65 else
66 ktrig changed kLFOtype ;GENERATE A 'BANG' TRIGGER (MOMENTARY '1') IF LFO TYPE SELECTION IS CHANGED
67 if ktrig=1 then ;IF 'BANG' IS RECEIVED...
68 reinit RESTART_LFO ;BEGIN A REINITIALISATION PASS BEGINNING FROM LABEL 'RESTART_LFO'
69 endif ;END OF CONDITIONAL BRANCH
70
71 RESTART_LFO: ;LABEL
72 aoct lfo gkLFOrange, gkLFOrate, i(kLFOtype) ;LFO GENERATES FREQUENCY VALUES FOR OSCILLATOR
73 rireturn ;RETURN FROM REINITIALISATION PASS
74 if gkSourceType=2||gkSourceType=3 then ;SAWTOOTH WAVEFORMS WITH lfo OPCODE ARE UNIPOLAR. WE WILL RE-RANGE LFO OUTPUT SO THAT IT IS BI-POLAR IF EITHER OF THESE TYPES HAS BEEN SELECTED
75 aoct = (aoct * 2) - gkLFOrange ;RE-RANGE LFO
76 endif ;END OF CONDITIONAL BRANCH
77 endif ;END OF CONDITIONAL BRANCH
78 kgate metro gkSHrate ;TRAIN OF GATE TRIGGERS TO BE USED BY SAMPLE AND HOLD MECHANISM
79 if gkEnvOnOff=1 then ;IF 'ENVELOPE' OPTION HAS BEEN SELECTED...
80 ;ALSO RESTART A PERCUSSIVE ENVELOPE WHENEVER A GATE TRIGGER IS RECEIVED TO ARTICULATE CHANGES IN PITCH IN THE OSCILLATOR
81 if kgate=1 then ;IF TRIGGER IS RECEIVED (I.E. = 1)...
82 reinit RESTART_ENVELOPE ;RE-INITIALISE FROM LABEL 'RESTART_ENVELOPE'
83 endif ;END OF CONDITIONAL BRANCH
84
85 RESTART_ENVELOPE: ;A LABEL
86 aenv expseg 0.001,0.01,1,i(gkEnvDur),0.0001 ;PERCUSSIVE TYPE AMPLITUDE ENVELOPE
87 rireturn ;RETURN FROM RE-INITIALISATION PASS TO NORMAL PERFORMANCE PASSES
88 aenv tone aenv, 500 ;SMOOTH AMPLITUDE ENVELOPE A LITTLE (TO REMOVE CLICKS WHENEVER AN ENVELOPE IS INTERRUPTED BY A RE-INITIALISATION)
89 else ;OTHERWISE...
90 aenv = 1 ;AMPLITUDE IS A CONSTANT (NO ENVELOPE)
91 endif ;END OF CONDITIONAL BRANCH
92
93 aoct samphold aoct + gkLFOoffset, kgate ;APPLY SAMPLE-AND-HOLD TO THE LFO GENERATED FREQUENCY VALUES (AND ADD AN OFFSET)
94 asig poscil 0.4*aenv, cpsoct(aoct), gisine ;AUDIO OSCILLATOR
95 outs asig, asig ;SEND AUDIO TO OUPUTS
96 endin
97 </CsInstruments>
98 <CsScore>
99 ;INSTR | START | DURATION
100 i 10 0 3600 ;GUI
101 </CsScore>
102 </CsoundSynthesizer>
103 <bsbPanel>
104 <label>Widgets</label>
105 <objectName/>
106 <x>704</x>
107 <y>206</y>
108 <width>913</width>
109 <height>381</height>
110 <visible>true</visible>
111 <uuid/>
112 <bgcolor mode="background">
113 <r>241</r>
114 <g>226</g>
115 <b>185</b>
116 </bgcolor>
117 <bsbObject version="2" type="BSBLabel">
118 <objectName/>
119 <x>2</x>
120 <y>2</y>
121 <width>513</width>
122 <height>378</height>
123 <uuid>{aa607456-d368-4d59-8497-d16d608404c3}</uuid>
124 <visible>true</visible>
125 <midichan>0</midichan>
126 <midicc>0</midicc>
127 <label>Sample And Hold</label>
128 <alignment>center</alignment>
129 <font>Liberation Sans</font>
130 <fontsize>18</fontsize>
131 <precision>3</precision>
132 <color>
133 <r>255</r>
134 <g>255</g>
135 <b>255</b>
136 </color>
137 <bgcolor mode="background">
138 <r>5</r>
139 <g>27</g>
140 <b>150</b>
141 </bgcolor>
142 <bordermode>border</bordermode>
143 <borderradius>5</borderradius>
144 <borderwidth>2</borderwidth>
145 </bsbObject>
146 <bsbObject version="2" type="BSBButton">
147 <objectName/>
148 <x>8</x>
149 <y>8</y>
150 <width>120</width>
151 <height>30</height>
152 <uuid>{55273d97-d39a-441c-8da6-87ea139493b6}</uuid>
153 <visible>true</visible>
154 <midichan>0</midichan>
155 <midicc>0</midicc>
156 <type>event</type>
157 <pressedValue>1.00000000</pressedValue>
158 <stringvalue/>
159 <text> Note On / Off</text>
160 <image>/</image>
161 <eventLine>i 1 0 -1</eventLine>
162 <latch>true</latch>
163 <latched>false</latched>
164 </bsbObject>
165 <bsbObject version="2" type="BSBLabel">
166 <objectName/>
167 <x>8</x>
168 <y>64</y>
169 <width>200</width>
170 <height>30</height>
171 <uuid>{5cde19f3-b356-4945-9c8b-43dd67c604dd}</uuid>
172 <visible>true</visible>
173 <midichan>0</midichan>
174 <midicc>0</midicc>
175 <label>Sample and Hold Rate</label>
176 <alignment>left</alignment>
177 <font>Liberation Sans</font>
178 <fontsize>10</fontsize>
179 <precision>3</precision>
180 <color>
181 <r>255</r>
182 <g>255</g>
183 <b>255</b>
184 </color>
185 <bgcolor mode="nobackground">
186 <r>255</r>
187 <g>255</g>
188 <b>255</b>
189 </bgcolor>
190 <bordermode>noborder</bordermode>
191 <borderradius>1</borderradius>
192 <borderwidth>1</borderwidth>
193 </bsbObject>
194 <bsbObject version="2" type="BSBHSlider">
195 <objectName>SHrate</objectName>
196 <x>8</x>
197 <y>41</y>
198 <width>500</width>
199 <height>27</height>
200 <uuid>{d6d73a88-8d82-47de-a067-758f1917a3f2}</uuid>
201 <visible>true</visible>
202 <midichan>0</midichan>
203 <midicc>0</midicc>
204 <minimum>0.00000000</minimum>
205 <maximum>1.00000000</maximum>
206 <value>0.51800000</value>
207 <mode>lin</mode>
208 <mouseControl act="jump">continuous</mouseControl>
209 <resolution>-1.00000000</resolution>
210 <randomizable group="0">false</randomizable>
211 </bsbObject>
212 <bsbObject version="2" type="BSBDisplay">
213 <objectName>SHrate_Value</objectName>
214 <x>448</x>
215 <y>64</y>
216 <width>60</width>
217 <height>30</height>
218 <uuid>{073ad371-9227-46fa-a005-ac10a210db79}</uuid>
219 <visible>true</visible>
220 <midichan>0</midichan>
221 <midicc>0</midicc>
222 <label>2.501</label>
223 <alignment>right</alignment>
224 <font>Liberation Sans</font>
225 <fontsize>9</fontsize>
226 <precision>3</precision>
227 <color>
228 <r>255</r>
229 <g>255</g>
230 <b>255</b>
231 </color>
232 <bgcolor mode="nobackground">
233 <r>255</r>
234 <g>255</g>
235 <b>255</b>
236 </bgcolor>
237 <bordermode>noborder</bordermode>
238 <borderradius>1</borderradius>
239 <borderwidth>1</borderwidth>
240 </bsbObject>
241 <bsbObject version="2" type="BSBLabel">
242 <objectName/>
243 <x>8</x>
244 <y>223</y>
245 <width>200</width>
246 <height>30</height>
247 <uuid>{b6afbe1e-677c-44a6-ba84-4c32dc21b0a7}</uuid>
248 <visible>true</visible>
249 <midichan>0</midichan>
250 <midicc>0</midicc>
251 <label>LFO Offset</label>
252 <alignment>left</alignment>
253 <font>Liberation Sans</font>
254 <fontsize>10</fontsize>
255 <precision>3</precision>
256 <color>
257 <r>255</r>
258 <g>255</g>
259 <b>255</b>
260 </color>
261 <bgcolor mode="nobackground">
262 <r>255</r>
263 <g>255</g>
264 <b>255</b>
265 </bgcolor>
266 <bordermode>noborder</bordermode>
267 <borderradius>1</borderradius>
268 <borderwidth>1</borderwidth>
269 </bsbObject>
270 <bsbObject version="2" type="BSBHSlider">
271 <objectName>LFOoffset</objectName>
272 <x>8</x>
273 <y>200</y>
274 <width>500</width>
275 <height>27</height>
276 <uuid>{859d1ded-b337-4ee7-ac9b-48a1b5f77d16}</uuid>
277 <visible>true</visible>
278 <midichan>0</midichan>
279 <midicc>0</midicc>
280 <minimum>5.00000000</minimum>
281 <maximum>11.00000000</maximum>
282 <value>8.22800000</value>
283 <mode>lin</mode>
284 <mouseControl act="jump">continuous</mouseControl>
285 <resolution>-1.00000000</resolution>
286 <randomizable group="0">false</randomizable>
287 </bsbObject>
288 <bsbObject version="2" type="BSBDisplay">
289 <objectName>LFOoffset</objectName>
290 <x>448</x>
291 <y>223</y>
292 <width>60</width>
293 <height>30</height>
294 <uuid>{95f6cb02-77ec-46fe-876b-a93efac3c5e5}</uuid>
295 <visible>true</visible>
296 <midichan>0</midichan>
297 <midicc>0</midicc>
298 <label>8.228</label>
299 <alignment>right</alignment>
300 <font>Liberation Sans</font>
301 <fontsize>9</fontsize>
302 <precision>3</precision>
303 <color>
304 <r>255</r>
305 <g>255</g>
306 <b>255</b>
307 </color>
308 <bgcolor mode="nobackground">
309 <r>255</r>
310 <g>255</g>
311 <b>255</b>
312 </bgcolor>
313 <bordermode>noborder</bordermode>
314 <borderradius>1</borderradius>
315 <borderwidth>1</borderwidth>
316 </bsbObject>
317 <bsbObject version="2" type="BSBLabel">
318 <objectName/>
319 <x>8</x>
320 <y>170</y>
321 <width>180</width>
322 <height>30</height>
323 <uuid>{7fd47947-fd0d-4964-85e5-682fed1916c7}</uuid>
324 <visible>true</visible>
325 <midichan>0</midichan>
326 <midicc>0</midicc>
327 <label>LFO Range</label>
328 <alignment>left</alignment>
329 <font>Liberation Sans</font>
330 <fontsize>10</fontsize>
331 <precision>3</precision>
332 <color>
333 <r>255</r>
334 <g>255</g>
335 <b>255</b>
336 </color>
337 <bgcolor mode="nobackground">
338 <r>255</r>
339 <g>255</g>
340 <b>255</b>
341 </bgcolor>
342 <bordermode>noborder</bordermode>
343 <borderradius>1</borderradius>
344 <borderwidth>1</borderwidth>
345 </bsbObject>
346 <bsbObject version="2" type="BSBHSlider">
347 <objectName>LFOrange</objectName>
348 <x>8</x>
349 <y>147</y>
350 <width>500</width>
351 <height>27</height>
352 <uuid>{475cdd64-a4ca-4ebc-a000-90448e932478}</uuid>
353 <visible>true</visible>
354 <midichan>0</midichan>
355 <midicc>0</midicc>
356 <minimum>0.01000000</minimum>
357 <maximum>4.00000000</maximum>
358 <value>1.34266000</value>
359 <mode>lin</mode>
360 <mouseControl act="jump">continuous</mouseControl>
361 <resolution>-1.00000000</resolution>
362 <randomizable group="0">false</randomizable>
363 </bsbObject>
364 <bsbObject version="2" type="BSBDisplay">
365 <objectName>LFOrange</objectName>
366 <x>448</x>
367 <y>170</y>
368 <width>60</width>
369 <height>30</height>
370 <uuid>{dc75acc2-c015-4b8d-8fb2-467b9fb96d42}</uuid>
371 <visible>true</visible>
372 <midichan>0</midichan>
373 <midicc>0</midicc>
374 <label>1.343</label>
375 <alignment>right</alignment>
376 <font>Liberation Sans</font>
377 <fontsize>9</fontsize>
378 <precision>3</precision>
379 <color>
380 <r>255</r>
381 <g>255</g>
382 <b>255</b>
383 </color>
384 <bgcolor mode="nobackground">
385 <r>255</r>
386 <g>255</g>
387 <b>255</b>
388 </bgcolor>
389 <bordermode>noborder</bordermode>
390 <borderradius>1</borderradius>
391 <borderwidth>1</borderwidth>
392 </bsbObject>
393 <bsbObject version="2" type="BSBLabel">
394 <objectName/>
395 <x>8</x>
396 <y>117</y>
397 <width>200</width>
398 <height>30</height>
399 <uuid>{3ebc1139-1fdb-48dc-9150-49ee8dfdbd4a}</uuid>
400 <visible>true</visible>
401 <midichan>0</midichan>
402 <midicc>0</midicc>
403 <label>LFO Rate</label>
404 <alignment>left</alignment>
405 <font>Liberation Sans</font>
406 <fontsize>10</fontsize>
407 <precision>3</precision>
408 <color>
409 <r>255</r>
410 <g>255</g>
411 <b>255</b>
412 </color>
413 <bgcolor mode="nobackground">
414 <r>255</r>
415 <g>255</g>
416 <b>255</b>
417 </bgcolor>
418 <bordermode>noborder</bordermode>
419 <borderradius>1</borderradius>
420 <borderwidth>1</borderwidth>
421 </bsbObject>
422 <bsbObject version="2" type="BSBHSlider">
423 <objectName>LFOrate</objectName>
424 <x>8</x>
425 <y>94</y>
426 <width>500</width>
427 <height>27</height>
428 <uuid>{2cf97843-5b49-438e-8034-62a459597e86}</uuid>
429 <visible>true</visible>
430 <midichan>0</midichan>
431 <midicc>0</midicc>
432 <minimum>0.00000000</minimum>
433 <maximum>1.00000000</maximum>
434 <value>0.51200000</value>
435 <mode>lin</mode>
436 <mouseControl act="jump">continuous</mouseControl>
437 <resolution>-1.00000000</resolution>
438 <randomizable group="0">false</randomizable>
439 </bsbObject>
440 <bsbObject version="2" type="BSBDisplay">
441 <objectName>LFOrate_Value</objectName>
442 <x>448</x>
443 <y>117</y>
444 <width>60</width>
445 <height>30</height>
446 <uuid>{e54486c5-f9aa-4d0e-9a67-6506dae3c790}</uuid>
447 <visible>true</visible>
448 <midichan>0</midichan>
449 <midicc>0</midicc>
450 <label>0.344</label>
451 <alignment>right</alignment>
452 <font>Liberation Sans</font>
453 <fontsize>9</fontsize>
454 <precision>3</precision>
455 <color>
456 <r>255</r>
457 <g>255</g>
458 <b>255</b>
459 </color>
460 <bgcolor mode="nobackground">
461 <r>255</r>
462 <g>255</g>
463 <b>255</b>
464 </bgcolor>
465 <bordermode>noborder</bordermode>
466 <borderradius>1</borderradius>
467 <borderwidth>1</borderwidth>
468 </bsbObject>
469 <bsbObject version="2" type="BSBDropdown">
470 <objectName>SourceType</objectName>
471 <x>153</x>
472 <y>342</y>
473 <width>120</width>
474 <height>30</height>
475 <uuid>{8ea371ed-50f1-450f-b078-4a586bcef87b}</uuid>
476 <visible>true</visible>
477 <midichan>0</midichan>
478 <midicc>0</midicc>
479 <bsbDropdownItemList>
480 <bsbDropdownItem>
481 <name>Sine</name>
482 <value>0</value>
483 <stringvalue/>
484 </bsbDropdownItem>
485 <bsbDropdownItem>
486 <name>Triangle</name>
487 <value>1</value>
488 <stringvalue/>
489 </bsbDropdownItem>
490 <bsbDropdownItem>
491 <name>Saw Down</name>
492 <value>2</value>
493 <stringvalue/>
494 </bsbDropdownItem>
495 <bsbDropdownItem>
496 <name>Saw Up</name>
497 <value>3</value>
498 <stringvalue/>
499 </bsbDropdownItem>
500 <bsbDropdownItem>
501 <name>Noise</name>
502 <value>4</value>
503 <stringvalue/>
504 </bsbDropdownItem>
505 </bsbDropdownItemList>
506 <selectedIndex>0</selectedIndex>
507 <randomizable group="0">false</randomizable>
508 </bsbObject>
509 <bsbObject version="2" type="BSBLabel">
510 <objectName/>
511 <x>25</x>
512 <y>345</y>
513 <width>120</width>
514 <height>24</height>
515 <uuid>{6decaf4d-be74-4edb-8815-51176aca4329}</uuid>
516 <visible>true</visible>
517 <midichan>0</midichan>
518 <midicc>0</midicc>
519 <label>LFO Type:</label>
520 <alignment>right</alignment>
521 <font>Liberation Sans</font>
522 <fontsize>10</fontsize>
523 <precision>3</precision>
524 <color>
525 <r>255</r>
526 <g>255</g>
527 <b>255</b>
528 </color>
529 <bgcolor mode="nobackground">
530 <r>255</r>
531 <g>255</g>
532 <b>255</b>
533 </bgcolor>
534 <bordermode>noborder</bordermode>
535 <borderradius>1</borderradius>
536 <borderwidth>1</borderwidth>
537 </bsbObject>
538 <bsbObject version="2" type="BSBLabel">
539 <objectName/>
540 <x>7</x>
541 <y>253</y>
542 <width>504</width>
543 <height>82</height>
544 <uuid>{d37234db-d91e-450d-bc21-bba6b0826922}</uuid>
545 <visible>true</visible>
546 <midichan>0</midichan>
547 <midicc>0</midicc>
548 <label>Envelope On / Off</label>
549 <alignment>left</alignment>
550 <font>Liberation Sans</font>
551 <fontsize>10</fontsize>
552 <precision>3</precision>
553 <color>
554 <r>255</r>
555 <g>255</g>
556 <b>255</b>
557 </color>
558 <bgcolor mode="nobackground">
559 <r>255</r>
560 <g>255</g>
561 <b>255</b>
562 </bgcolor>
563 <bordermode>border</bordermode>
564 <borderradius>4</borderradius>
565 <borderwidth>2</borderwidth>
566 </bsbObject>
567 <bsbObject version="2" type="BSBLabel">
568 <objectName/>
569 <x>8</x>
570 <y>305</y>
571 <width>200</width>
572 <height>30</height>
573 <uuid>{36f72746-0095-4c05-ad45-fbc397bce489}</uuid>
574 <visible>true</visible>
575 <midichan>0</midichan>
576 <midicc>0</midicc>
577 <label>Envelope Duration</label>
578 <alignment>left</alignment>
579 <font>Liberation Sans</font>
580 <fontsize>10</fontsize>
581 <precision>3</precision>
582 <color>
583 <r>255</r>
584 <g>255</g>
585 <b>255</b>
586 </color>
587 <bgcolor mode="nobackground">
588 <r>255</r>
589 <g>255</g>
590 <b>255</b>
591 </bgcolor>
592 <bordermode>noborder</bordermode>
593 <borderradius>1</borderradius>
594 <borderwidth>1</borderwidth>
595 </bsbObject>
596 <bsbObject version="2" type="BSBHSlider">
597 <objectName>EnvDur</objectName>
598 <x>8</x>
599 <y>282</y>
600 <width>500</width>
601 <height>27</height>
602 <uuid>{d44369e1-e38b-42fc-901b-69d08689159c}</uuid>
603 <visible>true</visible>
604 <midichan>0</midichan>
605 <midicc>0</midicc>
606 <minimum>0.00000000</minimum>
607 <maximum>1.00000000</maximum>
608 <value>0.79400000</value>
609 <mode>lin</mode>
610 <mouseControl act="jump">continuous</mouseControl>
611 <resolution>-1.00000000</resolution>
612 <randomizable group="0">false</randomizable>
613 </bsbObject>
614 <bsbObject version="2" type="BSBDisplay">
615 <objectName>EnvDur_Value</objectName>
616 <x>448</x>
617 <y>305</y>
618 <width>60</width>
619 <height>30</height>
620 <uuid>{6fb48ef9-27f2-44c8-835e-4d9180c2c3bc}</uuid>
621 <visible>true</visible>
622 <midichan>0</midichan>
623 <midicc>0</midicc>
624 <label>1.291</label>
625 <alignment>right</alignment>
626 <font>Liberation Sans</font>
627 <fontsize>9</fontsize>
628 <precision>3</precision>
629 <color>
630 <r>255</r>
631 <g>255</g>
632 <b>255</b>
633 </color>
634 <bgcolor mode="nobackground">
635 <r>255</r>
636 <g>255</g>
637 <b>255</b>
638 </bgcolor>
639 <bordermode>noborder</bordermode>
640 <borderradius>1</borderradius>
641 <borderwidth>1</borderwidth>
642 </bsbObject>
643 <bsbObject version="2" type="BSBCheckBox">
644 <objectName>EnvOnOff</objectName>
645 <x>108</x>
646 <y>258</y>
647 <width>20</width>
648 <height>20</height>
649 <uuid>{9ec30c3a-5171-4c13-962b-34d0fd722062}</uuid>
650 <visible>true</visible>
651 <midichan>0</midichan>
652 <midicc>0</midicc>
653 <selected>true</selected>
654 <label/>
655 <pressedValue>1</pressedValue>
656 <randomizable group="0">false</randomizable>
657 </bsbObject>
658 <bsbObject version="2" type="BSBLabel">
659 <objectName/>
660 <x>515</x>
661 <y>2</y>
662 <width>395</width>
663 <height>378</height>
664 <uuid>{f9c3ef4b-39de-4eaf-8439-c3edbc81f874}</uuid>
665 <visible>true</visible>
666 <midichan>0</midichan>
667 <midicc>0</midicc>
668 <label>Sample And Hold</label>
669 <alignment>center</alignment>
670 <font>Liberation Sans</font>
671 <fontsize>18</fontsize>
672 <precision>3</precision>
673 <color>
674 <r>255</r>
675 <g>255</g>
676 <b>255</b>
677 </color>
678 <bgcolor mode="background">
679 <r>5</r>
680 <g>27</g>
681 <b>150</b>
682 </bgcolor>
683 <bordermode>border</bordermode>
684 <borderradius>5</borderradius>
685 <borderwidth>2</borderwidth>
686 </bsbObject>
687 <bsbObject version="2" type="BSBLabel">
688 <objectName/>
689 <x>520</x>
690 <y>23</y>
691 <width>385</width>
692 <height>357</height>
693 <uuid>{e41f02b8-6ad4-46dc-805c-0b2eeafbd476}</uuid>
694 <visible>true</visible>
695 <midichan>0</midichan>
696 <midicc>0</midicc>
697 <label>---------------------------------------------------------------------------------------------
698 Sample and hold is a technique whereby a the instantaneous value of a continuously varying signal is held for a defined period of time before the signal is sampled again and the process is repeated. Analog to digital conversion involves the technique of sample and hold but, when used with a much slower rate of resampling, it is also used frequently in synthesis.
699 The 'samphold' opcode take an a or k-rate signal and allows it to pass through unaffected while its gate input is non-zero but holds the instantaneous value whenever its gate input is zero.
700 In this example the frequency of an audio oscillator is modulated by an LFO but the signal from the LFO is first passed through 'samphold'. The user can choose between a a variety of LFO waveform shapes including random. The trigger for the sample and hold gate is a simple metronome (metro opcode). The rate of both the gate trigger and the source LFO can be varied. The relationship between these two should be explored to discover how different motivic patterns can be created. An envelope can be applied to each 'hold' period to further articulate each step.</label>
701 <alignment>left</alignment>
702 <font>Liberation Sans</font>
703 <fontsize>14</fontsize>
704 <precision>3</precision>
705 <color>
706 <r>255</r>
707 <g>255</g>
708 <b>255</b>
709 </color>
710 <bgcolor mode="nobackground">
711 <r>255</r>
712 <g>255</g>
713 <b>255</b>
714 </bgcolor>
715 <bordermode>noborder</bordermode>
716 <borderradius>1</borderradius>
717 <borderwidth>1</borderwidth>
718 </bsbObject>
719 </bsbPanel>
720 <bsbPresets>
721 </bsbPresets>
722 <EventPanel name="" tempo="60.00000000" loop="8.00000000" x="913" y="162" width="655" height="346" visible="true" loopStart="0" loopEnd="0"> </EventPanel>