#N canvas 375 23 848 693 12;
#X declare -stdpath ./;
#N canvas 0 0 450 300 (subpatch) 0;
#X array table21 44103 float 0;
#X coords 0 1.02 44100 -1.02 200 130 1;
#X restore 559 296 graph;
#X obj 373 544 loadbang;
#X obj 81 551 hip~ 5;
#X floatatom 47 262 6 0 0 0 - - - 0;
#X obj 47 297 * 441;
#X obj 47 427 +~ 1;
#X obj 371 419 adc~ 1;
#X obj 371 444 hip~ 5;
#X obj 81 515 *~;
#X obj 143 427 line~;
#X obj 143 377 * 441;
#X floatatom 143 352 0 0 0 0 - - - 0;
#X obj 143 402 pack 0 100;
#X obj 81 456 +~;
#X obj 143 452 samphold~;
#X obj 47 352 samphold~;
#X obj 47 322 sig~;
#X obj 47 402 *~;
#X text 28 5 CALCULATING LOOP FREQUENCY AS FUNCTION OF TRANSPOSITION
;
#X obj 228 475 r~ phase;
#X obj 29 216 s~ phase;
#X obj 107 323 r~ phase;
#X obj 65 379 r~ phase;
#X obj 203 428 r~ phase;
#X obj 188 322 s chunk-size;
#X floatatom 29 62 5 0 0 0 - - - 0;
#X obj 188 297 * 0.01;
#X text 284 302 chunk size;
#X text 284 324 in seconds;
#X obj 40 117 r chunk-size;
#X obj 40 142 t b f;
#X obj 29 166 /;
#X text 89 143 divide speed change by chunk;
#X text 87 164 size to get loop frequency;
#X text 371 56 The transposition is frequency in Hz. divided by chunk
size in seconds. This patch calculates the loop frequency as a function
of desired transposition;
#X text 373 107 Notice now that we get Doppler effects when the chunk
size changes. You can suppress that if you don't want it \, by converting
the chunk size to an audio signal \, sampling and holding it. But then
there would be more work to deal with very low frequencies never triggering
the sample and hold...;
#X obj 373 598 soundfiler;
#X obj 29 39 loadbang;
#X obj 228 499 -~ 0.5;
#X obj 228 523 *~ 0.5;
#X obj 228 546 cos~;
#X obj 61 596 output~;
#X obj 81 481 tabread4~ table21;
#X text 466 551 v-- re-read original table;
#X text 621 627 updated for Pd version 0.37;
#X text 592 430 --- 44103 samples ---;
#X obj 29 87 expr pow(2 \, $f1/120);
#X text 218 87 speed change;
#X text 376 189 You might also want to have a way to retrigger the
loop to sync it with some other process. By the time we had all this
built the patch would be fairly involved. For now \, we'll move on
to the next topic...;
#X obj 29 190 phasor~;
#X obj 371 499 tabwrite~ table21;
#X msg 373 571 read ../sound/voice.wav table21;
#X text 101 261 <= chunk size (100ths of a second);
#X text 180 352 <= read point in 100ths of a second;
#X text 71 62 <= transposition (10ths of a halftone);
#X text 410 471 <= record;
#X obj 635 17 declare -stdpath ./;
#X obj 386 472 bng 17 250 50 0 empty empty empty 17 7 0 10 #dfdfdf
#000000 #000000;
#X connect 1 0 51 0;
#X connect 2 0 41 0;
#X connect 2 0 41 1;
#X connect 3 0 4 0;
#X connect 3 0 26 0;
#X connect 4 0 16 0;
#X connect 5 0 13 0;
#X connect 6 0 7 0;
#X connect 7 0 50 0;
#X connect 8 0 2 0;
#X connect 9 0 14 0;
#X connect 10 0 12 0;
#X connect 11 0 10 0;
#X connect 12 0 9 0;
#X connect 13 0 42 0;
#X connect 14 0 13 1;
#X connect 15 0 17 0;
#X connect 16 0 15 0;
#X connect 17 0 5 0;
#X connect 19 0 38 0;
#X connect 21 0 15 1;
#X connect 22 0 17 1;
#X connect 23 0 14 1;
#X connect 25 0 46 0;
#X connect 26 0 24 0;
#X connect 29 0 30 0;
#X connect 30 0 31 0;
#X connect 30 1 31 1;
#X connect 31 0 49 0;
#X connect 37 0 25 0;
#X connect 38 0 39 0;
#X connect 39 0 40 0;
#X connect 40 0 8 1;
#X connect 42 0 8 0;
#X connect 46 0 31 0;
#X connect 49 0 20 0;
#X connect 51 0 36 0;
#X connect 57 0 50 0;
