#N canvas 598 66 668 473 12;
#X declare -stdpath ./;
#X floatatom 499 253 0 1 100 0 - - - 0;
#N canvas 263 241 966 450 guts 0;
#X obj 604 251 +~;
#X obj 280 250 loadbang;
#N canvas 443 23 575 507 fft-analysis 0;
#X obj 274 324 *~;
#X obj 235 324 *~;
#X obj 122 139 *~;
#X obj 83 132 *~;
#X obj 83 158 +~;
#X obj 233 80 *~;
#X obj 270 80 inlet~;
#X obj 233 106 rfft~;
#X obj 59 347 *~;
#X obj 347 153 *~;
#X obj 83 80 *~;
#X obj 120 80 inlet~;
#X obj 62 41 tabreceive~ hanning;
#X obj 83 106 rfft~;
#X obj 235 350 rifft~;
#X obj 59 423 outlet~;
#X obj 310 153 *~;
#X obj 310 179 +~;
#X text 137 185 modulus;
#X obj 83 184 sqrt~;
#X obj 292 264 *~;
#X obj 445 132 r squelch;
#X obj 310 205 rsqrt~;
#X obj 354 179 sig~ 1e-20;
#X obj 310 231 clip~;
#X obj 445 220 * 0.01;
#X obj 445 165 max 1;
#X obj 445 246 max 0;
#X obj 292 290 *~ 0.001;
#X obj 399 367 block~;
#X obj 399 304 r window-size;
#X msg 399 335 set \$1 4;
#X obj 445 194 pow 2;
#X connect 0 0 14 1;
#X connect 1 0 14 0;
#X connect 2 0 4 1;
#X connect 3 0 4 0;
#X connect 4 0 19 0;
#X connect 5 0 7 0;
#X connect 6 0 5 1;
#X connect 7 0 16 0;
#X connect 7 0 16 1;
#X connect 7 0 1 0;
#X connect 7 1 9 0;
#X connect 7 1 9 1;
#X connect 7 1 0 0;
#X connect 8 0 15 0;
#X connect 9 0 17 1;
#X connect 10 0 13 0;
#X connect 11 0 10 1;
#X connect 12 0 10 0;
#X connect 12 0 5 0;
#X connect 12 0 8 0;
#X connect 13 0 3 0;
#X connect 13 0 3 1;
#X connect 13 1 2 0;
#X connect 13 1 2 1;
#X connect 14 0 8 1;
#X connect 16 0 17 0;
#X connect 17 0 22 0;
#X connect 19 0 20 0;
#X connect 20 0 28 0;
#X connect 21 0 26 0;
#X connect 22 0 24 0;
#X connect 23 0 22 0;
#X connect 24 0 20 1;
#X connect 25 0 27 0;
#X connect 26 0 32 0;
#X connect 27 0 24 2;
#X connect 28 0 0 1;
#X connect 28 0 1 1;
#X connect 30 0 31 0;
#X connect 31 0 29 0;
#X connect 32 0 25 0;
#X restore 446 207 pd fft-analysis;
#N canvas 287 79 718 470 hanning-window 0;
#X obj 122 213 phasor~;
#X obj 122 251 cos~;
#X obj 31 376 tabwrite~ hanning;
#X msg 50 160 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array hanning 1024 float 0;
#X coords 0 1 1023 0 400 150 1 0 0;
#X restore 227 213 graph;
#X text 156 153 sample rate / window size;
#X obj 124 106 samplerate~;
#X obj 31 31 r window-size;
#X obj 123 155 /;
#X msg 225 101 \; hanning resize \$1;
#X obj 31 70 t b f f, f 16;
#X obj 121 281 *~ -0.5;
#X obj 121 307 +~ 0.5;
#X text 157 37 CALCULATE HANNING WINDOW TABLE;
#X connect 0 0 1 0;
#X connect 1 0 11 0;
#X connect 3 0 0 1;
#X connect 6 0 8 0;
#X connect 7 0 10 0;
#X connect 8 0 0 0;
#X connect 10 0 6 0;
#X connect 10 0 3 0;
#X connect 10 0 2 0;
#X connect 10 1 8 1;
#X connect 10 2 9 0;
#X connect 11 0 12 0;
#X connect 12 0 2 0;
#X restore 278 317 pd hanning-window;
#X msg 359 189 \; pd dsp 1;
#X msg 280 274 \; window-size 1024 \;;
#X obj 604 374 outlet~;
#X obj 728 88 savepanel;
#X obj 728 280 soundfiler;
#X obj 751 197 savepanel;
#X obj 728 62 r \$0-save;
#X obj 751 171 r \$0-save-normalized;
#X obj 728 113 list append \$0-output;
#X obj 751 222 list append \$0-output;
#X msg 728 139 write \$1 \$2;
#X msg 751 247 write \$1 \$2;
#X obj 55 84 openpanel;
#X obj 55 56 r \$0-read;
#X msg 55 141 read -resize \$1 \$2;
#X obj 55 113 list append \$0-input;
#X obj 55 174 soundfiler;
#X obj 215 84 openpanel;
#X msg 215 141 read -resize \$1 \$2;
#X obj 215 174 soundfiler;
#X obj 215 113 list append \$0-anal;
#X obj 146 256 min;
#X obj 145 214 t b f;
#X msg 146 284 resize \$1;
#X obj 215 56 r \$0-read-2;
#X obj 446 161 tabplay~ \$0-input, f 8;
#X obj 548 161 tabplay~ \$0-anal, f 8;
#X obj 622 149 r \$0-hear;
#X obj 436 88 r \$0-run;
#X obj 436 256 tabwrite~ \$0-output, f 9;
#X obj 622 180 tabplay~ \$0-output, f 9;
#X obj 146 313 s \$0-output;
#X connect 0 0 6 0;
#X connect 1 0 5 0;
#X connect 2 0 0 0;
#X connect 2 0 33 0;
#X connect 7 0 12 0;
#X connect 9 0 13 0;
#X connect 10 0 7 0;
#X connect 11 0 9 0;
#X connect 12 0 14 0;
#X connect 13 0 15 0;
#X connect 14 0 8 0;
#X connect 15 0 8 0;
#X connect 16 0 19 0;
#X connect 17 0 16 0;
#X connect 18 0 20 0;
#X connect 19 0 18 0;
#X connect 20 0 25 0;
#X connect 21 0 24 0;
#X connect 22 0 23 0;
#X connect 23 0 26 0;
#X connect 24 0 22 0;
#X connect 25 0 27 0;
#X connect 26 0 25 0;
#X connect 26 1 25 1;
#X connect 27 0 35 0;
#X connect 28 0 21 0;
#X connect 29 0 2 0;
#X connect 30 0 2 1;
#X connect 31 0 34 0;
#X connect 32 0 29 0;
#X connect 32 0 30 0;
#X connect 32 0 4 0;
#X connect 32 0 33 0;
#X connect 34 0 0 1;
#X restore 152 340 pd guts;
#X text 90 23 (old-fashioned) VOCODER;
#X text 85 61 This takes in two soundfiles and uses the first to "vocode"
the second. The resulting sound is as long as the shorter of the two
inputs., f 71;
#X obj 499 278 s squelch;
#X text 544 247 1-100 or so;
#X obj 152 388 output~;
#X text 94 119 click below to:;
#X obj 122 148 bng 18 250 50 0 \$0-read dummy Input -45 9 0 13 #dfdfdf
#000000 #202020;
#X obj 122 199 bng 18 250 50 0 \$0-run dummy Run -31 9 0 13 #dfdfdf
#000000 #000000;
#X obj 122 227 bng 18 250 50 0 \$0-hear dummy Hear -40 9 0 13 #dfdfdf
#000000 #000000;
#X obj 122 251 bng 18 250 50 0 \$0-save dummy Save -40 9 0 13 #dfdfdf
#000000 #000000;
#X obj 122 276 bng 18 250 50 0 \$0-save-normalized dummy Normalized
-87 9 0 13 #dfdfdf #000000 #000000;
#X text 151 198 (run the transformation);
#X text 151 226 (hear the output sample);
#X text 151 250 (save the output sample);
#X text 151 275 (save the output sample normalized to 1);
#X obj 122 166 bng 18 250 50 0 \$0-read-2 dummy Anal -38 9 0 13 #dfdfdf
#000000 #202020;
#X obj 306 349 table \$0-input;
#X obj 299 405 table \$0-output;
#X text 416 350 input sample;
#X text 415 404 output sample;
#X obj 313 368 table \$0-anal;
#X text 416 369 analysis sample;
#X msg 499 228 70;
#X obj 499 203 loadbang;
#X text 151 146 (load sound file to be processed \, like a speech)
;
#X text 151 166 (load analysis sound file \, like a tonal);
#X obj 473 20 declare -stdpath ./;
#X connect 0 0 4 0;
#X connect 1 0 6 0;
#X connect 1 0 6 1;
#X connect 24 0 0 0;
#X connect 25 0 24 0;
