#N canvas 291 25 769 686 12;
#X declare -stdpath ./;
#X floatatom 101 72 6 0 0 0 - - - 0;
#X obj 101 443 *~;
#X obj 224 369 line~;
#X floatatom 224 124 6 0 0 0 - - - 0;
#X text 358 19 PITCH SHIFTER;
#X obj 224 98 r window;
#X obj 101 46 r transpose;
#X obj 101 128 exp;
#X floatatom 101 154 6 0 0 0 - - - 0;
#X obj 101 244 /;
#X obj 149 181 * 0.001;
#X obj 287 433 line~;
#X floatatom 287 357 0 0 0 0 - - - 0;
#X obj 287 331 r delay;
#X obj 101 480 +~;
#X obj 45 495 cos~;
#X obj 45 522 *~;
#X obj 165 566 +~;
#X obj 165 369 wrap~;
#X obj 241 428 *~;
#X obj 269 488 +~;
#X obj 183 505 cos~;
#X obj 183 532 *~;
#X msg 617 177 \; transpose 0 \; window 100 \; delay 0;
#X obj 617 151 loadbang;
#X obj 149 207 t b f;
#X floatatom 101 270 6 0 0 0 - - - 0;
#X obj 165 342 +~ 0.5;
#X obj 45 443 -~ 0.5;
#X obj 45 469 *~ 0.5;
#X obj 183 428 -~ 0.5;
#X obj 183 477 *~ 0.5;
#X obj 101 181 - 1;
#X obj 101 102 * 0.05776;
#X obj 101 207 * -1;
#X text 54 148 speed;
#X text 47 162 change;
#X text 29 261 tape head;
#N canvas 514 161 608 645 test-input 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array array1 155944 float 0;
#X coords 0 1 155943 -1 200 150 1;
#X restore 94 136 graph;
#X obj 163 503 tabread4~ array1;
#X obj 135 315 r totsamps;
#X obj 163 398 /;
#X obj 163 450 *~ 0;
#X obj 163 424 phasor~ 0;
#X obj 163 477 +~ 1;
#X msg 135 371 44100;
#X obj 135 345 t b f, f 7;
#X obj 206 454 r totsamps;
#X text 177 523 sample loop for;
#X text 177 540 test signal;
#X obj 105 25 loadbang;
#X obj 163 575 outlet~;
#X obj 337 164 r readfile;
#X obj 337 194 symbol;
#X msg 336 223 read -resize \$1 array1;
#X obj 336 251 soundfiler;
#X obj 336 279 s totsamps;
#X msg 105 59 \; readfile ../sound/bell.aiff;
#X connect 1 0 13 0;
#X connect 2 0 8 0;
#X connect 3 0 5 0;
#X connect 4 0 6 0;
#X connect 5 0 4 0;
#X connect 6 0 1 0;
#X connect 7 0 3 0;
#X connect 8 0 7 0;
#X connect 8 1 3 1;
#X connect 9 0 4 1;
#X connect 12 0 19 0;
#X connect 14 0 15 0;
#X connect 15 0 16 0;
#X connect 16 0 17 0;
#X connect 17 0 18 0;
#X restore 392 179 pd test-input;
#X obj 165 594 output~;
#X obj 101 301 phasor~;
#X obj 287 384 max 1.5;
#X text 290 290 delay;
#X text 287 308 (msec);
#X obj 224 151 max 1;
#X text 29 274 rotation freq, f 9;
#X obj 392 210 delwrite~ G09-del 5000;
#X obj 536 79 declare -stdpath ./;
#X obj 269 517 delread4~ G09-del, f 9;
#X obj 101 506 delread4~ G09-del, f 9;
#X text 519 617 updated for Pd version 0.52;
#X text 275 124 <-- window (msec);
#X msg 224 342 \$1 200;
#X msg 287 408 \$1 200;
#X text 151 72 <-- transposition in halftones;
#X text 372 282 This is a classic rotating-tape-head style pitch shifter using the [delread4~] variable delay object. There are two moving tape heads \, each of which is loudest at the middle of its trajectory \, and enveloped out at the moment it has to jump back (or forward) to start another scratch. Most of the brain work is in computing how fast the tape heads have to move to get the desired transposition., f 52;
#X text 371 512 The [cos~] objects compute the fadein and fadeout of the two delay line outputs. They each traverse the positive half of the cosine waveform (phase -0.25 to +0.25) over the time the phase goes from one end to the other., f 52;
#X text 371 416 The "window size" is the total trajectory of the read points in the delay line \, in milliseconds. The delay times are controlled by a [phasor~] object. The second delay time \, 180 degrees out of phase from the first one \, is computed using the [wrap~] object., f 52;
#X connect 0 0 33 0;
#X connect 1 0 14 0;
#X connect 2 0 1 1;
#X connect 2 0 19 1;
#X connect 3 0 44 0;
#X connect 5 0 3 0;
#X connect 6 0 0 0;
#X connect 7 0 8 0;
#X connect 8 0 32 0;
#X connect 9 0 26 0;
#X connect 10 0 25 0;
#X connect 11 0 14 1;
#X connect 11 0 20 1;
#X connect 12 0 41 0;
#X connect 13 0 12 0;
#X connect 14 0 49 0;
#X connect 15 0 16 0;
#X connect 16 0 17 0;
#X connect 17 0 39 0;
#X connect 18 0 19 0;
#X connect 18 0 30 0;
#X connect 19 0 20 0;
#X connect 20 0 48 0;
#X connect 21 0 22 0;
#X connect 22 0 17 1;
#X connect 24 0 23 0;
#X connect 25 0 9 0;
#X connect 25 1 9 1;
#X connect 26 0 40 0;
#X connect 27 0 18 0;
#X connect 28 0 29 0;
#X connect 29 0 15 0;
#X connect 30 0 31 0;
#X connect 31 0 21 0;
#X connect 32 0 34 0;
#X connect 33 0 7 0;
#X connect 34 0 9 0;
#X connect 38 0 46 0;
#X connect 40 0 1 0;
#X connect 40 0 28 0;
#X connect 40 0 27 0;
#X connect 41 0 53 0;
#X connect 44 0 10 0;
#X connect 44 0 52 0;
#X connect 48 0 22 1;
#X connect 49 0 16 1;
#X connect 52 0 2 0;
#X connect 53 0 11 0;
