#N canvas 282 231 743 420 10;
#N canvas 511 112 616 776 fft-analysis 0;
#X obj 51 477 *~;
#X obj 18 477 *~;
#X obj 18 499 -~;
#X obj 167 475 *~;
#X obj 136 475 *~;
#X obj 136 497 +~;
#X obj 109 193 *~;
#X obj 78 193 *~;
#X obj 50 193 *~;
#X obj 19 193 *~;
#X obj 19 218 +~;
#X obj 127 379 *~;
#X obj 20 622 *~;
#X obj 236 175 rfft~;
#X obj 108 161 rfft~;
#X obj 19 564 rifft~;
#X obj 21 646 outlet~;
#X obj 97 379 *~;
#X obj 97 401 +~;
#X obj 124 218 -~;
#X obj 18 431 *~;
#X obj 51 432 *~;
#X obj 21 728 block~;
#X obj 19 349 +~ 1e-015;
#X obj 19 598 *~;
#X obj 52 598 tabreceive~ \$0-hann;
#X obj 127 643 expr 2/(3*$f1);
#X obj 415 626 loadbang;
#X msg 21 703 set \$1 4;
#X obj 97 425 q8_rsqrt~;
#X obj 121 69 *~;
#X obj 89 69 *~;
#X obj 89 91 +~;
#X obj 159 94 q8_rsqrt~;
#X obj 159 71 +~ 1e-020;
#X obj 73 119 *~;
#X obj 19 118 *~;
#X obj 29 245 lrshift~ 1;
#X obj 24 269 lrshift~ -1;
#X obj 141 245 lrshift~ 1;
#X obj 133 269 lrshift~ -1;
#X obj 35 300 *~;
#X obj 159 312 *~;
#X obj 19 325 +~;
#X obj 125 331 +~;
#N canvas 139 105 520 694 read-windows 0;
#X obj 18 358 line~;
#X obj 16 523 outlet~;
#X obj 125 531 outlet~;
#X text 220 313 "back" window 1/4 cycle behind "front" one;
#X obj 16 441 vd~ \$0-input;
#X obj 123 443 vd~ \$0-input;
#X obj 18 266 pack f f;
#X obj 31 143 t b f;
#X obj 31 184 -;
#X obj 90 145 *;
#X obj 90 114 - 1;
#X obj 90 57 mtof;
#X obj 90 77 / 440;
#X obj 90 38 + 69;
#X obj 353 123 samplerate~;
#X obj 328 102 t f b;
#X obj 328 141 /;
#X obj 328 163 * 1000;
#X obj 90 16 * 0.01;
#X text 376 163 window size (ms);
#X obj 18 207 f;
#X obj 164 468 tabreceive~ \$0-hann;
#X obj 16 492 *~;
#X obj 124 503 *~;
#X obj 18 75 bang~;
#X obj 197 286 *;
#X obj 206 263 t b f;
#X text 235 288 stretched window size (ms);
#X obj 90 -6 r \$0-transpo;
#X obj 328 81 r \$0-window-size;
#X obj 220 210 / 4;
#X text 252 207 computation time for an overlap of 4;
#X obj 18 230 / 4;
#X obj 71 229 / 4;
#X obj 17 393 +~;
#X obj 193 310 / 4;
#X obj 135 369 / 4;
#X text 47 395 '+' since a bigger value in vd~ means 'earlier'.;
#X text 114 110 subtract speed of read-out \, when;
#X text 114 122 delay-time is static;
#X text 134 37 convert cents of halftones to read-out speed;
#X text 41 229 *);
#X text 93 229 *);
#X text 162 367 *);
#X text 67 336 *);
#X obj 18 287 t l b;
#X obj 43 333 / 4;
#X text 57 165 initial delay (ms);
#X text 71 307 initial delay (ms);
#X text 21 556 *);
#X text 24 572 it seems that if a time is specified in ms instead of
samples \, the value has to be divided by the overlap factor (4 in
this case) in order for the vd~ to read out the desired amount of samples.
i'm still unsure what the reason for this might be.;
#X obj 31 164 20;
#X obj 43 309 20;
#X connect 0 0 5 0;
#X connect 0 0 34 0;
#X connect 4 0 22 0;
#X connect 5 0 23 0;
#X connect 6 0 45 0;
#X connect 7 0 51 0;
#X connect 7 1 8 1;
#X connect 8 0 20 1;
#X connect 9 0 7 0;
#X connect 10 0 9 0;
#X connect 11 0 12 0;
#X connect 12 0 10 0;
#X connect 12 0 25 0;
#X connect 13 0 11 0;
#X connect 14 0 16 1;
#X connect 15 0 16 0;
#X connect 15 1 14 0;
#X connect 16 0 17 0;
#X connect 17 0 9 1;
#X connect 17 0 26 0;
#X connect 17 0 30 0;
#X connect 18 0 13 0;
#X connect 20 0 32 0;
#X connect 21 0 23 1;
#X connect 21 0 22 1;
#X connect 22 0 1 0;
#X connect 23 0 2 0;
#X connect 24 0 20 0;
#X connect 25 0 35 0;
#X connect 26 0 25 0;
#X connect 26 1 25 1;
#X connect 28 0 18 0;
#X connect 29 0 15 0;
#X connect 30 0 33 0;
#X connect 32 0 6 0;
#X connect 33 0 6 1;
#X connect 34 0 4 0;
#X connect 35 0 36 0;
#X connect 36 0 34 1;
#X connect 45 0 0 0;
#X connect 45 1 52 0;
#X connect 46 0 0 0;
#X connect 51 0 8 0;
#X connect 52 0 46 0;
#X restore 379 86 pd read-windows;
#X obj 137 543 tabsend~ \$0-prev-imag;
#X obj 136 567 tabsend~ \$0-prev-real;
#X obj 73 29 tabreceive~ \$0-prev-imag;
#X obj 20 8 tabreceive~ \$0-prev-real;
#X obj 415 648 \$0;
#X obj 21 679 r \$0-window-size;
#X obj 127 622 r \$0-window-size;
#X text 231 333 the left part is taken from miller puckette's audio
example I07.phase.vocoder.pd from the doc.;
#X obj 187 290 r \$0-lock;
#X msg 415 669 \; \$1-window-size 2048 \; \$1-transpo 0 \; \$1-lock
1 \;;
#X connect 0 0 2 1;
#X connect 1 0 2 0;
#X connect 2 0 15 0;
#X connect 2 0 47 0;
#X connect 3 0 5 1;
#X connect 4 0 5 0;
#X connect 5 0 15 1;
#X connect 5 0 46 0;
#X connect 6 0 19 1;
#X connect 7 0 19 0;
#X connect 8 0 10 1;
#X connect 9 0 10 0;
#X connect 10 0 38 0;
#X connect 10 0 37 0;
#X connect 10 0 43 0;
#X connect 11 0 18 1;
#X connect 12 0 16 0;
#X connect 13 0 1 1;
#X connect 13 0 3 1;
#X connect 13 1 0 1;
#X connect 13 1 4 1;
#X connect 14 0 9 1;
#X connect 14 0 7 1;
#X connect 14 1 6 1;
#X connect 14 1 8 1;
#X connect 15 0 24 0;
#X connect 17 0 18 0;
#X connect 18 0 29 0;
#X connect 19 0 39 0;
#X connect 19 0 40 0;
#X connect 19 0 44 0;
#X connect 20 0 1 0;
#X connect 20 0 4 0;
#X connect 21 0 0 0;
#X connect 21 0 3 0;
#X connect 23 0 17 1;
#X connect 23 0 17 0;
#X connect 23 0 20 0;
#X connect 24 0 12 0;
#X connect 25 0 24 1;
#X connect 26 0 12 1;
#X connect 27 0 50 0;
#X connect 28 0 22 0;
#X connect 29 0 20 1;
#X connect 29 0 21 1;
#X connect 30 0 32 1;
#X connect 31 0 32 0;
#X connect 32 0 34 0;
#X connect 33 0 35 1;
#X connect 33 0 36 1;
#X connect 34 0 33 0;
#X connect 35 0 8 0;
#X connect 35 0 7 0;
#X connect 36 0 9 0;
#X connect 36 0 6 0;
#X connect 37 0 41 0;
#X connect 38 0 41 0;
#X connect 39 0 42 0;
#X connect 40 0 42 0;
#X connect 41 0 43 1;
#X connect 42 0 44 1;
#X connect 43 0 23 0;
#X connect 44 0 11 0;
#X connect 44 0 11 1;
#X connect 44 0 21 0;
#X connect 45 0 14 0;
#X connect 45 1 13 0;
#X connect 48 0 30 1;
#X connect 48 0 30 0;
#X connect 48 0 35 0;
#X connect 49 0 31 1;
#X connect 49 0 31 0;
#X connect 49 0 36 0;
#X connect 50 0 55 0;
#X connect 51 0 28 0;
#X connect 52 0 26 0;
#X connect 54 0 41 1;
#X connect 54 0 42 1;
#X restore 205 145 pd fft-analysis;
#N canvas 260 22 667 789 phase-tables 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-prev-imag 4096 float 0;
#X coords 0 1000 4096 -1000 400 300 1;
#X restore 169 326 graph;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-prev-real 4096 float 0;
#X coords 0 500 4096 -500 400 300 1;
#X restore 170 17 graph;
#X restore 328 174 pd phase-tables;
#N canvas 0 110 400 404 hann-window 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-hann 2048 float 0;
#X coords 0 1 2047 0 300 100 1;
#X restore 36 253 graph;
#X obj 288 130 osc~;
#X obj 288 155 *~ -0.5;
#X obj 288 179 +~ 0.5;
#X obj 241 212 tabwrite~ \$0-hann;
#X obj 26 118 samplerate~;
#X obj 26 142 /;
#X msg 161 71 resize \$1;
#X obj 161 95 s \$0-hann;
#X msg 292 95 0;
#X obj 240 96 t f b;
#X obj 26 67 r \$0-window-size;
#X obj 26 166 s \$0-window-hz;
#X obj 240 70 r \$0-window-hz;
#X obj 26 94 t b f f;
#X text 22 8 calculate Hann window table (variable window size) and
constants window-hz (fundamental frequency of analysis).;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 5 0 6 0;
#X connect 6 0 12 0;
#X connect 7 0 8 0;
#X connect 9 0 1 1;
#X connect 10 0 1 0;
#X connect 10 1 4 0;
#X connect 10 1 9 0;
#X connect 11 0 14 0;
#X connect 13 0 10 0;
#X connect 14 0 5 0;
#X connect 14 1 6 1;
#X connect 14 2 7 0;
#X restore 328 198 pd hann-window;
#X obj 204 105 delwrite~ \$0-input 1000;
#X obj 204 33 inlet~;
#X obj 206 232 outlet~;
#X obj 376 111 s \$0-transpo;
#X obj 285 36 inlet;
#X text 330 34 transposition in cents;
#X obj 517 107 s \$0-window-size;
#X obj 492 36 inlet;
#X obj 376 87 f;
#X obj 492 59 t b f;
#X text 535 35 window size in samples;
#X text 534 51 (e.g. 512 \, 1024 \, 2048 4096);
#X text 537 67 init-value is 2048;
#X obj 96 90 != 0;
#X obj 101 285 switch~;
#X obj 88 127 route 1;
#X msg 70 243 1;
#X msg 126 243 0;
#X msg 95 191 stop;
#X obj 68 158 t b b;
#X obj 126 219 delay;
#X msg 127 155 200;
#X text 51 309 Trick to clear the delay buffer before subpatch get
switched off;
#X connect 0 0 5 0;
#X connect 4 0 3 0;
#X connect 7 0 11 0;
#X connect 7 0 16 0;
#X connect 10 0 12 0;
#X connect 11 0 6 0;
#X connect 12 0 11 0;
#X connect 12 1 9 0;
#X connect 16 0 18 0;
#X connect 18 0 22 0;
#X connect 18 1 24 0;
#X connect 19 0 17 0;
#X connect 20 0 17 0;
#X connect 21 0 23 0;
#X connect 22 0 19 0;
#X connect 22 1 21 0;
#X connect 23 0 20 0;
#X connect 24 0 23 0;
