Commit 52dca0f9 authored by Miller Puckette's avatar Miller Puckette
Browse files

set up git repository

parents
#N canvas 180 71 562 473 12;
#X obj 155 348 output~;
#X text 310 443 updated for Pd version 0.37;
#X text 56 2 FOLDOVER IN SAWTOOTH WAVES;
#X obj 154 320 clip~ 0 1;
#X obj 155 153 mtof;
#X floatatom 155 131 3 0 0 0 - - -;
#X obj 155 269 *~ 20;
#X obj 155 295 -~ 19;
#X obj 155 177 phasor~;
#N canvas 0 0 560 183 /SUBPATCH/ 0;
#X obj 25 74 loadbang;
#X msg 25 99 61;
#X obj 25 124 outlet;
#X text 7 6 This sets the pitch initially to 61 when the patch is first
opened.;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X restore 155 105 pd;
#X text 190 130 <--pitch;
#X obj 164 206 output~;
#X text 237 205 <--sawtooth amplitude;
#X text 233 373 <--pulse train amplitude;
#X text 28 406 We'll explain more about making pulses later on... this
example is mostly intended as ear training.;
#X text 19 23 In more ordinary kinds of waveforms \, foldover comes
across as a "cheap synth" sound. You can hear the foldover clearly
in the pulse train here \, and less clearly (but still audibly) in
the straight sawtooth \, especially at high pitches.;
#X connect 3 0 0 0;
#X connect 3 0 0 1;
#X connect 4 0 8 0;
#X connect 5 0 4 0;
#X connect 6 0 7 0;
#X connect 7 0 3 0;
#X connect 8 0 6 0;
#X connect 8 0 11 0;
#X connect 8 0 11 1;
#X connect 9 0 5 0;
#N canvas 298 115 555 414 12;
#X obj 42 349 output~;
#X text 302 376 updated for Pd version 0.37;
#X text 56 2 ZIPPER NOISE;
#X obj 43 321 *~;
#X obj 125 350 output~;
#X obj 126 322 *~;
#X obj 65 262 line;
#X obj 149 262 line~;
#N canvas 0 0 450 300 metro 0;
#X obj 88 39 loadbang;
#X msg 87 65 1;
#X obj 87 96 metro 500;
#X obj 87 131 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
;
#X obj 87 153 sel 0 1;
#X obj 87 190 outlet;
#X obj 151 192 outlet;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 4 1 6 0;
#X restore 65 170 pd metro;
#X obj 65 198 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 132 199 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X msg 65 219 1 300;
#X msg 132 221 0 300;
#X obj 72 290 osc~ 880;
#X text 30 28 Here is a related issue: if we use a (control) line object
to change an amplitude \, it sends ramping control messages \, once
every 20 msec by default. At left we use this to control the amplitude
of a sinusoid. In effect we're multiplying the sinusoid by a staircase
signal (50 increments per second.) Using the signal version \, line~
\, fixes the problem. Line~ outputs a ramp that is incremented every
sample.;
#X connect 3 0 0 0;
#X connect 3 0 0 1;
#X connect 5 0 4 0;
#X connect 5 0 4 1;
#X connect 6 0 3 1;
#X connect 7 0 5 1;
#X connect 8 0 9 0;
#X connect 8 1 10 0;
#X connect 9 0 11 0;
#X connect 10 0 12 0;
#X connect 11 0 6 0;
#X connect 11 0 7 0;
#X connect 12 0 6 0;
#X connect 12 0 7 0;
#X connect 13 0 3 0;
#X connect 13 0 5 0;
#N canvas 215 77 561 455 12;
#X text 14 7 CONVERTING CONTROL TO SIGNALS;
#X obj 29 350 output~;
#X obj 107 352 output~;
#N canvas 0 0 450 300 metro 0;
#X obj 88 39 loadbang;
#X msg 87 65 1;
#X obj 87 131 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X obj 87 153 sel 0 1;
#X obj 87 190 outlet;
#X obj 151 192 outlet;
#X obj 87 96 metro 2;
#X connect 0 0 1 0;
#X connect 1 0 6 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 1 5 0;
#X connect 6 0 2 0;
#X restore 30 242 pd metro;
#X msg 30 268 1 2;
#X msg 97 270 0 2;
#X obj 30 305 line~;
#X obj 108 306 vline~;
#X text 13 107 Here we try out line~ and vline~ as triangle wave generators.
The subpatch is still sending alternating bangs as in the last patch
\, but now at an audible frequency \, every 2 msec.;
#X text 17 172 The effect of line~ rounding breakpoints to the nearest
block (on the order of a millisecond) is that each 4-millisecond-long
cycle has a different shape. Using vline~ resolves the problem.;
#X text 385 437 Updated for Pd 0.37;
#X text 16 411 Sometimes you will want to use vline~ in place of sig~
for the same reason.;
#X text 15 27 For controlling amplitudes \, line~ \, with its block-aligned
breakpoints \, is accurate enough for most purposes. But certain usages
\, such as this patch \, demand more accuracy. The vline~ object \,
somewhat more expensive than line~ \, can handle breakpoints to sub-sample
accuracy.;
#X connect 3 0 4 0;
#X connect 3 1 5 0;
#X connect 4 0 6 0;
#X connect 4 0 7 0;
#X connect 5 0 6 0;
#X connect 5 0 7 0;
#X connect 6 0 1 0;
#X connect 6 0 1 1;
#X connect 7 0 2 0;
#X connect 7 0 2 1;
#N canvas 34 0 985 746 12;
#N canvas 0 0 450 300 graph1 0;
#X array tab28 176403 float 0;
#X coords 0 1.02 176403 -1.02 200 130 1;
#X restore 740 126 graph;
#X obj 577 486 loadbang;
#X obj 31 340 hip~ 5;
#X obj 587 345 adc~ 1;
#X obj 587 375 hip~ 5;
#X msg 558 306 bang;
#X text 681 492 v-- re-read the original sample;
#X text 20 6 ONE-SHOT SAMPLER USING LINE~ AS PHASE;
#X obj 31 306 *~;
#X obj 71 279 r cutoff;
#X obj 31 194 r phase;
#X msg 24 37 bang;
#X obj 124 92 delay 5;
#X text 77 37 <-- play the sample;
#X msg 24 128 \; cutoff 0 5;
#X text 34 85 cut the;
#X text 34 104 sound off;
#X text 204 77 Wait for the;
#X text 202 97 cutoff to finish;
#X text 349 121 set the upper line~ to start;
#X text 349 140 at the first sample and go;
#X text 348 161 forever (until the next trigger);
#X text 18 486 To start a note \, first we have to mute the output
in case ther's already something playing---otherwise we'll get a click.
The "cutoff" line~ then takes 5 msec to get to zero. After that amount
of delay \, we reset the phase to sample number 1 and set it in motion.
We want the line~ output to increase by 1 each sample of output \,
so we ask for it to do 4.41e+08 samples in 1e+07 milliseconds.;
#X text 18 602 The cutoff mechanism is still safe if we happen to ask
for two notes in under 5 msec. The second request would reset the delay
\, so that there's no way the delay can possibly fire without the cutoff
line~ at zero.;
#X text 596 305 <-- record;
#X obj 622 405 line~;
#X obj 587 410 *~;
#X text 738 267 ------ 4 seconds ------;
#X obj 655 342 del 3990;
#X msg 655 370 0 10;
#X text 706 371 <--stop recording;
#X text 19 672 We avoid clicking at the end of the table by getting
the table's own contents to go smoothly to zero. To do this we added
a level control to the recording patch that cuts off just before the
recording reaches the end of the table.;
#X text 576 599 this is.;
#X text 578 575 My apologies to Jonathan Harvey whose bell;
#X obj 577 545 soundfiler;
#X text 19 443 Here's how to make a sampler with a line~ object \,
instead of a phasor~ \, to generate the read location signal.;
#X obj 71 306 vline~;
#X obj 30 369 output~;
#X obj 31 224 vline~;
#X obj 558 439 tabwrite~ tab28;
#X msg 577 516 read ../sound/bell.aiff tab28;
#X obj 31 254 tabread4~ tab28;
#X msg 124 127 \; phase 1 \, 4.41e+08 1e+07 \; cutoff 1;
#X msg 497 386 0 \, 1 5;
#X text 719 717 updated for Pd version 0.37;
#X connect 1 0 40 0;
#X connect 2 0 37 0;
#X connect 2 0 37 1;
#X connect 3 0 4 0;
#X connect 4 0 26 0;
#X connect 5 0 28 0;
#X connect 5 0 43 0;
#X connect 5 0 39 0;
#X connect 8 0 2 0;
#X connect 9 0 36 0;
#X connect 10 0 38 0;
#X connect 11 0 14 0;
#X connect 11 0 12 0;
#X connect 12 0 42 0;
#X connect 25 0 26 1;
#X connect 26 0 39 0;
#X connect 28 0 29 0;
#X connect 29 0 25 0;
#X connect 36 0 8 1;
#X connect 38 0 41 0;
#X connect 40 0 34 0;
#X connect 41 0 8 0;
#X connect 43 0 25 0;
#N canvas 215 77 561 455 12;
#N canvas 0 0 269 179 metro 0;
#X obj 88 39 loadbang;
#X msg 87 65 1;
#X obj 87 128 outlet;
#X obj 87 96 metro 100;
#X msg 178 70 \; pd dsp 1;
#X connect 0 0 1 0;
#X connect 0 0 4 0;
#X connect 1 0 3 0;
#X connect 3 0 2 0;
#X restore 41 247 pd metro;
#X text 374 425 Updated for Pd 0.37;
#X obj 41 316 snapshot~;
#X obj 66 286 phasor~ 1;
#X floatatom 41 347 5 0 0 0 - - -;
#X text 14 7 CONVERTING SIGNALS TO CONTROLS;
#X text 15 35 The snapshot~ object allows you to convert from signals
back to control streams (float messages) -- an opposite of signal~.
The value output is always the end of the most recently computed audio
block \, so that even if you bang it metronomically (as here) it need
not give you samples that are exactly evenly spaced.;
#X connect 0 0 2 0;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#N canvas 66 7 617 909 12;
#X text 164 5 ENVELOPE FOLLOWERS;
#X text 10 25 The env~ object reports ths RMS signal level over the
last 256 samples (by default) or any other power of 2 that's at least
twice the block size. The analysis is done in an overlapped fashion
so that results appear every N/2 points if N is the analysis window
size. So the larger the window \, the stabler the result and the less
frequently it appears. Computation time doesn't depend heavily on N.
;
#X text 11 135 Envelope followers are frequently used to detect attacks
and periods of silence. (There are fancier attack detectors out there
\, though.) Here is a simple threshold-based attack and rest detector.
;
#X obj 102 297 dbtorms;
#X obj 23 293 osc~ 440;
#X obj 23 339 env~;
#X floatatom 78 329 0 0 0 0 - - -;
#X floatatom 102 274 0 0 0 0 - - -;
#X msg 451 320 \; pd dsp 1;
#X obj 119 380 t b f;
#X floatatom 119 403 0 0 0 0 - - -;
#X obj 126 458 pack;
#X obj 126 481 route 0 1;
#X obj 126 504 > 55;
#X obj 176 504 < 45;
#X obj 126 527 sel 1;
#X obj 176 527 sel 1;
#X msg 90 538 1;
#X msg 90 516 0;
#X obj 126 564 print attack;
#X obj 119 435 != 0;
#X obj 24 612 t b f;
#X floatatom 15 638 0 0 0 0 - - -;
#X obj 27 688 pack;
#X obj 27 711 route 0 1;
#X obj 27 749 sel 1;
#X msg 6 856 1;
#X msg 7 879 0;
#X obj 20 666 != 0;
#X obj 58 639 < 45;
#X obj 31 783 timer;
#X obj 113 712 sel 0;
#X obj 95 832 sel 0;
#X obj 45 832 sel 1;
#X obj 45 873 print rest;
#X obj 31 806 > 1000;
#X text 162 403 state -- 1 if waiting for low threshold \,;
#X text 199 418 0 if we've attained it and now want the;
#X text 202 434 high one.;
#X text 209 480 route the RMS value according to state;
#X text 239 506 if off \, 55 dB means attack. If on \, 45;
#X text 240 527 dB or less means state changes to off.;
#X text 132 359 ATTACK DETECTION;
#X text 40 594 REST DETECTION;
#X text 100 637 Here we always will test RMS against a low value;
#X text 125 654 but as before we route the result according to;
#X text 147 671 our state \, 1 if "resting" \, 0 if not.;
#X text 163 709 regardless of state \, when RMS isn't low;
#X text 185 724 reset the timer;
#X text 202 846 RMS isn't low enough.;
#X text 120 744 If we're not in rest \, and the RMS is low \,;
#X text 143 761 check elapsed time sinse RMS last wasn't low.;
#X text 122 802 If more than 1 second \, report a rest.;
#X text 170 828 If we're at rest \, pop out of it when;
#X text 11 201 Both detectors are state machines with two states \,
on and off. If on \, a test is run to determine whether to turn off
\, and vice versa. The tests are run at each output of the rms~ object.
;
#X text 355 884 updated for Pd version 0.37;
#X text 109 320 note 3.01 dB difference between;
#X text 113 336 peak and RMS amplitudes.;
#X obj 451 297 loadbang;
#X obj 23 316 *~;
#X connect 3 0 59 1;
#X connect 4 0 59 0;
#X connect 5 0 6 0;
#X connect 5 0 9 0;
#X connect 5 0 21 0;
#X connect 7 0 3 0;
#X connect 9 0 10 0;
#X connect 9 1 11 1;
#X connect 10 0 20 0;
#X connect 11 0 12 0;
#X connect 12 0 13 0;
#X connect 12 1 14 0;
#X connect 13 0 15 0;
#X connect 14 0 16 0;
#X connect 15 0 17 0;
#X connect 15 0 19 0;
#X connect 16 0 18 0;
#X connect 17 0 10 0;
#X connect 18 0 10 0;
#X connect 20 0 11 0;
#X connect 21 0 22 0;
#X connect 21 1 29 0;
#X connect 22 0 28 0;
#X connect 23 0 24 0;
#X connect 24 0 25 0;
#X connect 24 1 32 0;
#X connect 25 0 30 1;
#X connect 26 0 22 0;
#X connect 27 0 22 0;
#X connect 28 0 23 0;
#X connect 29 0 23 1;
#X connect 29 0 31 0;
#X connect 30 0 35 0;
#X connect 31 0 30 0;
#X connect 32 0 27 0;
#X connect 33 0 26 0;
#X connect 33 0 34 0;
#X connect 35 0 33 0;
#X connect 58 0 8 0;
#X connect 59 0 5 0;
#N canvas 57 74 829 559 12;
#N canvas 0 0 450 300 (subpatch) 0;
#X array 29-sequence 9 float 3;
#A 0 110 550 385 495 165 385 495 275 615;
#X coords 0 500 9 0 200 100 1;
#X restore 621 42 graph;
#X obj 27 426 *~;
#X obj 27 454 hip~ 5;
#N canvas 0 0 450 300 (subpatch) 0;
#X array 29-envelope 103 float 1;
#A 0 -0.0199988 1.0673e-06 0.0500008 0.13 0.16 0.28 0.5 0.6 0.7 0.8
1.01111 1 0.988889 0.977778 0.966667 0.955556 0.944444 0.933333 0.922222
0.911111 0.9 0.888889 0.797778 0.737777 0.677777 0.647777 0.617777
0.557777 0.487777 0.467777 0.447776 0.417776 0.397776 0.387776 0.377776
0.367776 0.347776 0.327776 0.317776 0.297776 0.277776 0.267776 0.257776
0.257776 0.277776 0.297776 0.327776 0.357776 0.377776 0.397776 0.407776
0.427776 0.437776 0.387776 0.367776 0.347776 0.337776 0.287776 0.277776
0.277776 0.277776 0.267776 0.267776 0.267776 0.297776 0.317776 0.347776
0.367776 0.367776 0.357776 0.347776 0.337776 0.307776 0.287776 0.257776
0.227776 0.197776 0.167776 0.167776 0.167776 0.167776 0.167776 0.157776
0.157776 0.157776 0.157776 0.147776 0.147776 0.147776 0.137776 0.137776
0.111111 0.1 0.0888889 0.0777778 0.0666667 0.0555556 0.0444444 0.0333333
0.0222222 0.0111111 0 -0.0111111;
#X coords 0 1 102 0 200 100 1;
#X restore 622 146 graph;
#N canvas 0 0 450 300 (subpatch) 0;
#X array 29-sample 259 float 1;
#A 0 0.989177 1 0.989177 0.95694 0.903989 0.83147 0.740952 0.634394
0.514103 0.382684 0.242981 0.0980184 -0.0490663 -0.195089 -0.336888
-0.471395 -0.595698 -0.707105 -0.803206 -0.88192 -0.941543 -0.980785
-0.998795 -0.995185 -0.970032 -0.923881 -0.85773 -0.773013 -0.671561
-0.555573 -0.427558 -0.290288 -0.146734 -3.98038e-06 0.146726 0.290281
0.427551 0.555566 0.671556 0.773007 0.857726 0.923878 0.97003 0.995184
0.998796 0.980786 0.941546 0.881924 0.803211 0.707111 0.595704 0.471402
0.336896 0.195097 0.0490743 -0.0980105 -0.242974 -0.382677 -0.514097
-0.634388 -0.740946 -0.831465 -0.903986 -0.956938 -0.989175 -1 -0.989178
-0.956943 -0.903993 -0.831474 -0.740957 -0.6344 -0.51411 -0.382692
-0.242989 -0.0980263 0.0490584 0.195081 0.336881 0.471388 0.595691
0.7071 0.803202 0.881916 0.941541 0.980783 0.998795 0.995186 0.970034
0.923884 0.857734 0.773018 0.671567 0.55558 0.427566 0.290296 0.146742
1.19412e-05 -0.146719 -0.290273 -0.427544 -0.55556 -0.67155 -0.773002
-0.857722 -0.923875 -0.970028 -0.995183 -0.998796 -0.980788 -0.941549
-0.881928 -0.803216 -0.707117 -0.595711 -0.471409 -0.336903 -0.195104
-0.0490822 0.0980025 0.242966 0.38267 0.51409 0.634382 0.740941 0.831461
0.903983 0.956936 0.989174 1 0.989179 0.956945 0.903996 0.831479 0.740962
0.634406 0.514117 0.382699 0.242997 0.0980342 -0.0490504 -0.195073
-0.336873 -0.471381 -0.595685 -0.707094 -0.803197 -0.881913 -0.941538
-0.980782 -0.998795 -0.995187 -0.970036 -0.923887 -0.857738 -0.773023
-0.671573 -0.555586 -0.427573 -0.290303 -0.14675 -1.99019e-05 0.146711
0.290265 0.427537 0.555553 0.671544 0.772997 0.857718 0.923872 0.970026
0.995183 0.998797 0.980789 0.941551 0.881931 0.803221 0.707122 0.595717
0.471416 0.336911 0.195112 0.0490902 -0.0979946 -0.242958 -0.382662
-0.514083 -0.634375 -0.740936 -0.831457 -0.903979 -0.956933 -0.989173
-1 -0.98918 -0.956947 -0.904 -0.831483 -0.740968 -0.634412 -0.514124
-0.382706 -0.243004 -0.0980421 0.0490425 0.195065 0.336866 0.471374
0.595679 0.707088 0.803192 0.881909 0.941535 0.98078 0.998794 0.995187
0.970038 0.92389 0.857742 0.773028 0.671579 0.555593 0.42758 0.290311
0.146758 2.78627e-05 -0.146703 -0.290258 -0.42753 -0.555547 -0.671538
-0.772992 -0.857714 -0.923868 -0.970024 -0.995182 -0.998797 -0.980791
-0.941554 -0.881935 -0.803225 -0.707128 -0.595723 -0.471423 -0.336918
-0.19512 -0.0490981 0.0979867 0.24295 0.382655 0.514076 0.634369 0.74093
0.831452 0.903976 0.956931 0.989172 1 0.989181;
#X coords 0 1 258 -1 200 100 1;
#X restore 619 281 graph;
#X text 566 533 updated for Pd version 0.37;
#X obj 26 218 tabread~ 29-sequence;
#X obj 106 241 wrap~;
#X obj 106 265 *~ 100;
#X obj 106 289 +~ 1;
#X obj 26 242 phasor~;
#X obj 26 266 -~ 0.5;
#X obj 27 377 cos~;
#X obj 84 336 *~;
#X obj 28 488 output~;
#X obj 84 408 tabread4~ 29-sample;
#X obj 106 313 tabread4~ 29-envelope;
#X obj 84 360 *~ 128;
#X obj 84 384 +~ 129;
#X obj 27 401 +~ 1;
#X obj 26 194 *~ 9;
#N canvas 328 85 609 424 make-tables 0;
#X msg 109 52 bang;
#X obj 109 77 t b b;
#X obj 152 134 f;
#X obj 190 134 + 1;
#X msg 174 106 0;
#X obj 109 103 until;
#X obj 152 162 t f f;
#X obj 27 190 moses 10;
#X obj 18 272 tabwrite 29-envelope;
#X obj 75 159 sel 102;
#X obj 23 218 expr ($f1-1)/10;
#X obj 35 243 expr (101-$f1)/90;
#X msg 120 380 \; 29-sample cosinesum 256 0 0 0 0 0 0 1;
#X msg 120 338 \; 29-sequence 0 55 550 385 495 165 385 495 275 615
;
#X text 30 8 bang to recalculate the envelope table (I did this but
then went in and changed it with the mouse afterward.);
#X text 84 299 The sequence is just a list of specified frequencies
\; the wavetable is a cosine.;
#X connect 0 0 1 0;
#X connect 1 0 5 0;
#X connect 1 1 4 0;
#X connect 2 0 3 0;
#X connect 2 0 6 0;
#X connect 2 0 9 0;
#X connect 3 0 2 1;
#X connect 4 0 2 1;
#X connect 5 0 2 0;
#X connect 6 0 7 0;
#X connect 6 1 8 1;
#X connect 7 0 10 0;
#X connect 7 1 11 0;
#X connect 9 0 5 1;
#X connect 10 0 8 0;
#X connect 11 0 8 0;
#X restore 689 401 pd make-tables;
#X text 46 1 ANALOG-SYNTH-STYLE SEQUENCER;
#X obj 26 170 phasor~ 0.6;
#X text 97 194 main loop: sawtooth of amplitude 9;
#X text 218 219 read frequency sequence;
#X text 162 241 9x original frequency sawtooth;
#X text 173 266 adjust for reading;
#X text 346 266 envelope sample;
#X text 123 336 multiply envelope by audio-frequency sawtooth;
#X text 147 361 adjust amplitude and center for wavetable;
#X text 62 428 multiply by raised-cosine smoothing function;
#X text 478 401 how to make the tables:;
#X text 27 27 Some control operations can be carried out entirely by
tilde objects passing audio signals around. Here is an imitation of
an analog sequencer and envelope generator. A phasor~ loops through
the "sequence" table at 0.6 Hz \, generating 9 frequencies. Simultaneously
\, by multiplying by 9 and wrapping \, we create a sawtooth at 9*0.6=5.4
Hz \, which reads a second table for an envelope shape. This becomes
the grain size for a sampler based on the 18.sampler.looped example
earlier.;
#X connect 1 0 2 0;
#X connect 2 0 14 0;
#X connect 2 0 14 1;
#X connect 6 0 10 0;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 16 0;
#X connect 10 0 11 0;
#X connect 11 0 13 0;
#X connect 11 0 12 0;
#X connect 12 0 19 0;
#X connect 13 0 17 0;
#X connect 15 0 1 1;
#X connect 16 0 13 1;
#X connect 17 0 18 0;
#X connect 18 0 15 0;
#X connect 19 0 1 0;
#X connect 20 0 6 0;
#X connect 20 0 7 0;
#X connect 23 0 20 0;
#N canvas 120 85 930 452 12;
#N canvas 0 0 450 300 graph1 0;
#X array samphold 44100 float 0;
#X coords 0 1 44100 0 300 200 1;
#X restore 606 36 graph;
#N canvas 0 0 439 429 tables 0;
#N canvas 0 0 450 300 graph1 0;
#X array dbtorms 123 float 1;
#A 0 0 0 1.25893e-05 1.41254e-05 1.58489e-05 1.77828e-05 1.99526e-05
2.23872e-05 2.51189e-05 2.81838e-05 3.16228e-05 3.54813e-05 3.98107e-05
4.46684e-05 5.01187e-05 5.62341e-05 6.30957e-05 7.07946e-05 7.94328e-05
8.91251e-05 1e-04 0.000112202 0.000125893 0.000141254 0.000158489 0.000177828
0.000199526 0.000223872 0.000251189 0.000281838 0.000316228 0.000354813
0.000398107 0.000446684 0.000501187 0.000562341 0.000630957 0.000707946
0.000794328 0.000891251 0.001 0.00112202 0.00125893 0.00141254 0.00158489
0.00177828 0.00199526 0.00223872 0.00251189 0.00281838 0.00316228 0.00354813
0.00398107 0.00446684 0.00501187 0.00562341 0.00630957 0.00707946 0.00794328
0.00891251 0.01 0.0112202 0.0125893 0.0141254 0.0158489 0.0177828 0.0199526
0.0223872 0.0251189 0.0281838 0.0316228 0.0354813 0.0398107 0.0446684
0.0501187 0.0562341 0.0630957 0.0707946 0.0794328 0.0891251 0.1 0.112202
0.125893 0.141254 0.158489 0.177828 0.199526 0.223872 0.251189 0.281838
0.316228 0.354813 0.398107 0.446684 0.501187 0.562341 0.630957 0.707946
0.794328 0.891251 1 1.12202 1.25893 1.41254 1.58489 1.77828 1.99526
2.23872 2.51189 2.81838 3.16228 3.54813 3.98107 4.46684 5.01187 5.62341
6.30957 7.07946 7.94328 8.91251 10 11.2202 12.5893;
#X coords 0 10 123 0 200 100 1;
#X restore 78 55 graph;
#X text 280 148 0;
#X text 282 48 10;
#X text 97 158 ------ 123 samples ------;
#N canvas 0 0 450 300 graph2 0;
#X array mtof 130 float 1;
#A 0 8.1758 8.66196 9.17702 9.72272 10.3009 10.9134 11.5623 12.2499
12.9783 13.75 14.5676 15.4339 16.3516 17.3239 18.354 19.4454 20.6017
21.8268 23.1247 24.4997 25.9565 27.5 29.1352 30.8677 32.7032 34.6478
36.7081 38.8909 41.2034 43.6535 46.2493 48.9994 51.9131 55 58.2705
61.7354 65.4064 69.2957 73.4162 77.7817 82.4069 87.3071 92.4986 97.9989
103.826 110 116.541 123.471 130.813 138.591 146.832 155.563 164.814
174.614 184.997 195.998 207.652 220 233.082 246.942 261.626 277.183
293.665 311.127 329.628 349.228 369.994 391.995 415.305 440 466.164
493.883 523.251 554.365 587.33 622.254 659.255 698.456 739.989 783.991
830.609 880 932.328 987.767 1046.5 1108.73 1174.66 1244.51 1318.51
1396.91 1479.98 1567.98 1661.22 1760 1864.66 1975.53 2093 2217.46 2349.32
2489.02 2637.02 2793.83 2959.96 3135.96 3322.44 3520 3729.31 3951.07
4186.01 4434.92 4698.64 4978.03 5274.04 5587.65 5919.91 6271.93 6644.88
7040 7458.62 7902.13 8372.02 8869.84 9397.27 9956.06 10548.1 11175.3
11839.8 12543.9 13289.8 14080;
#X coords 0 12000 130 0 200 100 1;
#X restore 85 232 graph;
#X text 95 340 ------ 130 samples ------;
#X text 294 325 0;
#X text 296 225 12000;
#X restore 648 280 pd tables;
#X text 67 8 SAMPLE AND HOLD;
#X obj 141 266 phasor~ 5;
#X obj 44 241 phasor~ 7;
#X obj 44 266 samphold~;
#X floatatom 44 216 0 0 0 0 - - -;
#X floatatom 141 211 0 0 0 0 - - -;
#X obj 216 319 tabwrite~ samphold;
#X msg 216 294 bang;
#X obj 44 341 tabread4~ mtof;
#X obj 44 291 *~ 48;
#X obj 44 316 +~ 36;
#X obj 44 366 osc~;
#X msg 216 236 0;
#X text 259 293 <--graph output;
#X obj 44 191 unpack;
#X text 254 233 <-- reset phase;
#X msg 311 131 32 96.33;
#X msg 124 131 5 7;
#X msg 44 131 1 5;
#X msg 78 131 2 11;
#X msg 161 131 3.7 8.8;
#X msg 235 131 3.4 8.9;
#X text 16 31 Another analog favorite \, the sample and hold unit freezes
an audio signal on command. In the Pd version \, the second input of
samphold~ triggers it \, and the first input becomes the output's new
value whenever the trigger decreases from one sample to the next. This
is ideal for updating values when a phasor wraps around.;
#X text 679 428 updated for Pd version 0.37;
#X obj 44 392 output~;
#X connect 3 0 5 1;
#X connect 4 0 5 0;
#X connect 5 0 11 0;
#X connect 5 0 8 0;
#X connect 6 0 4 0;
#X connect 7 0 3 0;
#X connect 9 0 8 0;
#X connect 10 0 13 0;
#X connect 11 0 12 0;
#X connect 12 0 10 0;
#X connect 13 0 26 0;
#X connect 13 0 26 1;
#X connect 14 0 3 1;
#X connect 14 0 4 1;
#X connect 16 0 6 0;
#X connect 16 1 7 0;
#X connect 18 0 16 0;
#X connect 19 0 16 0;
#X connect 20 0 16 0;