#N canvas 313 19 779 655 10;
#X obj 407 469 metro 100;
#X obj 209 422 phasor~;
#X obj 407 499 snapshot~;
#X obj 20 512 output~;
#X obj 20 416 phasor~;
#X floatatom 20 284 5 -100 1000 0 - - -, f 5;
#X obj 20 473 tabread4~ \$0-tab;
#X msg 302 284 0.5;
#X msg 338 284 0.01;
#X obj 407 403 loadbang;
#X msg 407 425 1;
#X obj 365 575 +;
#X obj 207 615 tabread4~ \$0-tab;
#X obj 396 574 f;
#X obj 338 552 t f f;
#X obj 208 647 output~;
#X floatatom 476 607 8 0 0 0 - - -, f 8;
#X obj 365 610 t f b;
#X obj 398 639 f;
#X obj 365 639 -;
#X floatatom 487 552 8 0 0 0 - - -, f 8;
#X obj 338 666 -;
#X obj 407 450 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 209 443 -~ 0.5;
#X obj 316 740 + 0.5;
#X obj 19 445 *~ 1e+06;
#X floatatom 338 688 8 0 0 0 - - -, f 8;
#X obj 538 462 samplerate~;
#X obj 492 486 /;
#X obj 492 462 t f b;
#X obj 459 529 +;
#X obj 321 716 / 10000;
#X obj 208 465 *~ 10000;
#X obj 492 510 * 10000;
#X obj 452 146 samplerate~;
#X obj 452 170 / 2;
#X obj 441 84 loadbang;
#X obj 441 221 tabwrite~ \$0-tab;
#X obj 452 194 osc~;
#X obj 441 125 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X msg 465 107 \; pd dsp 1;
#X obj 441 249 table \$0-tab 1e+06;
#X text 408 52 and will take about 20 seconds to fill.;
#X text 408 36 *** The table is now 1 million points \,;
#X obj 20 388 / 1e+06;
#X text 58 283 playback speed \, samples/sec;
#X text 86 415 naive way: just;
#X text 86 430 run a phasor;
#X text 85 446 into tabread4~;
#X text 475 620 new onset is phase plus old onset;
#X obj 338 312 * 1e+06;
#X text 487 567 extrapolated phase of next sample;
#X text 430 640 new onset minus old onset;
#X text 397 662 back up phasor output by amount the onset advanced
;
#X text 395 675 (approximately zero but not exactly because of;
#X text 397 689 truncation error!);
#X obj 338 334 t b f;
#X text 397 312 convert to samples;
#X text 379 334 set both last-onset and previous-onset;
#X text 381 355 ... and also reset phasor.;
#X text 372 716 convert phase back to range 0-1;
#X text 211 490 convert phase to;
#X text 211 504 range +/-5000;
#X obj 209 390 / 10000;
#X text 37 365 cycles/sec;
#X text 27 355 convert to;
#X text 208 369 cycles/sec;
#X text 208 357 convert to;
#X text 467 418 in order to change onset to reflect it;
#X text 554 479 extrapolate snapshot of phase by one;
#X text 553 492 sample to sync with next block;
#X text 41 557 BAD;
#X text 226 692 GOOD;
#X msg 338 356 0;
#X text 374 284 <- reset phase. 0.5 causes trouble for the "bad" way.
;
#X obj 1 1 cnv 15 445 20 empty \$0-pddp.cnv.header variable_speed_playback_from_long_tables
20 10 1 18 -261139 -33289 0;
#X obj 407 2 pddp/pddplink http://puredata.info/dev/pddp -text pddp
;
#X text 19 36 Here is how to use the [tabread~] "onset" input to allow
clean varispeed playback from a long table. At left \, a [phasor~]
is naiveley rescaled to the size of the tble. At right \, the [phasor~]
gets only a 10000-point range about a moving "onset". Ten times per
second \, we poll the [phasor~] phase \, sum its value into the onset
\, and back up the phase of the [phasor~] correspondingly.;
#X text 18 122 The tricky bits are \, first \, that we need to poll
the [phasor~] phase one sample into the future (so we add the per-sample
increment into the [snapshot~] result). Second \, we can't just reset
the [phasor~] to a fixed point - instead \, we measure how much the
onset has actually increased (which has truncation error from summing
in the phase snapshot) \, and subtract that increase from the phase
\, giving a value that differs from zero by the truncation error but
reflects the true phase we should reset to for continuity.;
#X text 17 241 The metronome rate is arbitrary but should be fast enough
that the [phasor~] never has time to wrap.;
#X text 467 402 Each 100 msec \, poll phase of [phasor~];
#X obj 1 778 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 25 KEYWORDS;
#X text 12 45 LICENSE SIBSD;
#X text 12 145 HELP_PATCH_AUTHORS Updated for release 0.42. Jonathan
Wilkes revised the patch to conform to the PDDP template for Pd version
0.42.;
#X text 12 65 DESCRIPTION variable speed playback from long tables
;
#X restore 392 780 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 7 2 Hello World- Related Help Documents;
#X text 19 37 Mention the help link \, and the fact that you can basically
click on anything to get a help patch on it. Also be sure to see the
FAQ at puredata.info as you start out with Pd. A link can be found
in the "Help" menu above.;
#X text 18 90 Another hello world can be found in the mailing lists.
You can search for answers to questions on there \, and if you're having
a hard time finding info you can always ask questions \, too. (See
the netiquette page before posting \, though.);
#X text 69 159 rethink calling that an "atom";
#X restore 103 780 pd References;
#X obj 6 780 pddp/pddplink ../5.reference/pddp/help.pd -text help;
#X connect 0 0 2 0;
#X connect 1 0 23 0;
#X connect 2 0 30 0;
#X connect 4 0 25 0;
#X connect 5 0 44 0;
#X connect 5 0 63 0;
#X connect 6 0 3 0;
#X connect 6 0 3 1;
#X connect 7 0 4 1;
#X connect 7 0 50 0;
#X connect 8 0 4 1;
#X connect 8 0 50 0;
#X connect 9 0 10 0;
#X connect 10 0 22 0;
#X connect 11 0 13 0;
#X connect 11 0 17 0;
#X connect 11 0 12 1;
#X connect 11 0 16 0;
#X connect 12 0 15 0;
#X connect 12 0 15 1;
#X connect 13 0 11 1;
#X connect 14 0 21 0;
#X connect 14 1 11 0;
#X connect 17 0 18 1;
#X connect 17 0 19 0;
#X connect 17 1 18 0;
#X connect 18 0 19 1;
#X connect 19 0 21 1;
#X connect 21 0 26 0;
#X connect 21 0 31 0;
#X connect 22 0 0 0;
#X connect 23 0 32 0;
#X connect 24 0 1 1;
#X connect 25 0 6 0;
#X connect 27 0 28 1;
#X connect 28 0 33 0;
#X connect 29 0 28 0;
#X connect 29 1 27 0;
#X connect 30 0 14 0;
#X connect 30 0 20 0;
#X connect 31 0 24 0;
#X connect 32 0 2 0;
#X connect 32 0 12 0;
#X connect 33 0 30 1;
#X connect 34 0 35 0;
#X connect 35 0 38 0;
#X connect 36 0 39 0;
#X connect 36 0 40 0;
#X connect 38 0 37 0;
#X connect 39 0 34 0;
#X connect 39 0 37 0;
#X connect 44 0 4 0;
#X connect 50 0 56 0;
#X connect 56 0 73 0;
#X connect 56 1 18 1;
#X connect 56 1 11 1;
#X connect 63 0 1 0;
#X connect 63 0 29 0;
#X connect 73 0 14 0;
