#N canvas 343 57 720 680 10;
#N canvas 0 0 450 300 (subpatch) 0;
#X array tab28 176403 float 0;
#X coords 0 1.02 176403 -1.02 200 130 1;
#X restore 479 189 graph;
#X obj 150 321 loadbang;
#X obj 23 270 hip~ 5;
#X obj 230 194 adc~ 1;
#X obj 230 216 hip~ 5;
#X msg 218 163 bang;
#X text 214 319 v-- re-read the original sample;
#X obj 23 248 *~;
#X obj 53 226 r cutoff;
#X obj 23 158 r phase;
#X msg 22 42 bang;
#X obj 112 74 delay 5;
#X text 75 42 <-- play the sample;
#X msg 22 113 \; cutoff 0 5;
#X text 30 77 cut the;
#X text 30 92 sound off;
#X text 169 65 Wait for the;
#X text 168 80 cutoff to finish;
#X text 288 97 set the upper line~ to start;
#X text 288 112 at the first sample and go;
#X text 288 127 forever (until the next trigger);
#X text 256 162 <-- record;
#X obj 285 241 line~;
#X obj 230 268 *~;
#X text 507 320 ------ 4 seconds ------;
#X obj 285 194 del 3990;
#X msg 285 216 0 10;
#X text 322 216 <--stop recording;
#X text 19 592 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 146 400 this is.;
#X text 147 385 My apologies to Jonathan Harvey whose bell;
#X obj 150 365 soundfiler;
#X obj 53 248 vline~;
#X obj 22 299 output~;
#X obj 23 180 vline~;
#X obj 218 290 tabwrite~ tab28;
#X msg 150 343 read ../sound/bell.aiff tab28;
#X obj 23 202 tabread4~ tab28;
#X msg 112 100 \; phase 1 \, 4.41e+08 1e+07 \; cutoff 1;
#X msg 166 216 0 \, 1 5;
#X obj 1 1 cnv 15 445 20 empty \$0-pddp.cnv.header one-shot_sampler_using_line~_as_phase
20 10 1 18 -261139 -33289 0;
#X obj 407 2 pddp/pddplink http://puredata.info/dev/pddp -text pddp
;
#X text 19 453 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 539 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 obj 1 658 cnv 15 445 20 empty \$0-pddp.cnv.footer empty 20 12 0
14 -233017 -33289 0;
#N canvas 44 246 494 284 META 0;
#X text 12 125 WEBSITE http://crca.ucsd.edu/~msp/;
#X text 12 105 AUTHOR Miller Puckette;
#X text 12 85 LIBRARY PDDP;
#X text 12 5 GENRE tutorial;
#X text 12 45 LICENSE SIBSD;
#X text 12 145 HELP_PATCH_AUTHORS Updated for release 0.37. Jonathan
Wilkes revised the patch to conform to the PDDP template for Pd version
0.42.;
#X text 12 65 DESCRIPTION one-shot sampler using line~ as phase;
#X text 12 25 KEYWORDS signal;
#X restore 392 660 pd META;
#N canvas 13 202 428 190 References 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -261139 -33289 0;
#X text 19 37 links:;
#X text 7 2 one-shot sampler- Related Help Documents;
#X restore 103 660 pd References;
#X obj 6 660 pddp/pddplink ../5.reference/pddp/help.pd -text help;
#X text 20 423 Here's how to make a sampler with a [line~] object \,
instead of a [phasor~] \, to generate the read location signal.;
#X connect 1 0 36 0;
#X connect 2 0 33 0;
#X connect 2 0 33 1;
#X connect 3 0 4 0;
#X connect 4 0 23 0;
#X connect 5 0 25 0;
#X connect 5 0 39 0;
#X connect 5 0 35 0;
#X connect 7 0 2 0;
#X connect 8 0 32 0;
#X connect 9 0 34 0;
#X connect 10 0 13 0;
#X connect 10 0 11 0;
#X connect 11 0 38 0;
#X connect 22 0 23 1;
#X connect 23 0 35 0;
#X connect 25 0 26 0;
#X connect 26 0 22 0;
#X connect 32 0 7 1;
#X connect 34 0 37 0;
#X connect 36 0 31 0;
#X connect 37 0 7 0;
#X connect 39 0 22 0;
