#N canvas 72 0 668 530 12;
#N canvas 147 0 795 617 fft-analysis 0;
#X obj 94 511 *~;
#X obj 55 511 *~;
#X obj 413 356 *~;
#X obj 372 356 *~;
#X obj 372 379 +~;
#X obj 54 183 *~;
#X obj 54 158 inlet~;
#X obj 54 206 rfft~;
#X obj 54 560 *~;
#X obj 141 245 *~;
#X obj 372 333 rfft~;
#X obj 54 535 rifft~;
#X obj 54 583 outlet~;
#X obj 107 245 *~;
#X obj 107 268 +~;
#X text 458 408 modulus;
#X obj 107 420 *~;
#X obj 600 13 block~ 1024 4;
#X obj 107 398 clip~;
#X obj 87 184 tabreceive~ \$0-hann;
#X obj 599 53 loadbang;
#X obj 148 346 r squelch;
#X obj 147 369 expr 0.01*$f1*$f1;
#X obj 107 294 +~ 1e-20;
#X obj 108 480 *~ 0.00065;
#X obj 87 560 tabreceive~ \$0-hann;
#X obj 373 307 *~;
#X obj 373 282 inlet~;
#X obj 406 308 tabreceive~ \$0-hann;
#X obj 107 321 q8_rsqrt~;
#X obj 372 402 q8_sqrt~;
#X text 458 425 of control;
#X text 456 442 amplitude;
#X text 196 248 reciprocal;
#X text 199 267 modulus of;
#X text 195 287 filter input;
#X text 196 306 amplitude;
#X msg 599 76 \; pd dsp 1 \; window-size 1024 \; squelch 30 \; squelch-set
set 30;
#X text 115 159 filter input;
#X text 438 282 control source;
#X text 434 332 Fourier transform;
#X text 28 17 Internal workings of the timbre stamping algorithm. First
the "filter input" is treated as in the compressor patch \, multiplying
each channel amplitude by one over its modulus (but limited by the
"squelch" parameter.) It is then multiplied by the modulus of the channel
amplitude for the control source (which is Fourier analyzed in parallel
with the filter input.);
#X text 145 422 multiply the two amplitude;
#X text 143 439 factors (for compression;
#X text 145 455 and to apply new timbre);
#X connect 0 0 11 1;
#X connect 1 0 11 0;
#X connect 2 0 4 1;
#X connect 3 0 4 0;
#X connect 4 0 30 0;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X connect 7 0 13 0;
#X connect 7 0 13 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 12 0;
#X connect 9 0 14 1;
#X connect 10 0 3 0;
#X connect 10 0 3 1;
#X connect 10 1 2 0;
#X connect 10 1 2 1;
#X connect 11 0 8 0;
#X connect 13 0 14 0;
#X connect 14 0 23 0;
#X connect 16 0 24 0;
#X connect 18 0 16 0;
#X connect 19 0 5 1;
#X connect 20 0 37 0;
#X connect 21 0 22 0;
#X connect 22 0 18 2;
#X connect 23 0 29 0;
#X connect 24 0 0 1;
#X connect 24 0 1 1;
#X connect 25 0 8 1;
#X connect 26 0 10 0;
#X connect 27 0 26 0;
#X connect 28 0 26 1;
#X connect 29 0 18 0;
#X connect 30 0 16 1;
#X restore 86 444 pd fft-analysis;
#X text 137 12 CORT&ZACK's SECRET;
#X text 27 422 filter;
#X text 29 437 input;
#X text 232 441 source;
#X text 233 422 control;
#X floatatom 53 300 0 0 500 0 - squelch-set -;
#X obj 53 324 s squelch;
#X obj 86 468 output~;
#X msg 157 278 ../sound/bell.aiff;
#X msg 157 303 ../sound/voice.wav;
#X msg 157 328 ../sound/voice2.wav;
#X obj 157 354 s read-sound1;
#X msg 373 280 ../sound/bell.aiff;
#X msg 373 305 ../sound/voice.wav;
#X msg 373 330 ../sound/voice2.wav;
#X obj 373 355 s read-sound2;
#X text 386 256 control source;
#X text 169 255 filter input;
#X text 255 231 change input sounds;
#X floatatom 454 409 5 0 0 0 - #0-samp-msec -;
#X obj 87 394 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 215 395 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#N canvas 190 43 661 593 test-signals 0;
#X obj 90 444 line~;
#X obj 90 369 f;
#X obj 90 524 outlet~;
#X msg 90 423 0 \, \$1 \$2;
#X obj 90 397 pack 0 0;
#X obj 190 344 /;
#X obj 249 325 * 0.001;
#X obj 90 497 hip~ 5;
#X obj 35 246 loadbang;
#X msg 90 322 1;
#X obj 90 344 metro 1000;
#X obj 191 302 t b b f;
#X obj 117 270 t b f;
#X obj 90 469 tabread4~ \$0-sample;
#X text 21 28 test signal: looped sample playback;
#X obj 51 159 hip~ 5;
#X obj 51 135 adc~ 1;
#X obj 113 159 s insamprate;
#X obj 40 99 inlet;
#X obj 113 135 samplerate~;
#X obj 116 246 r \$0-samplength;
#X obj 191 276 r \$0-insamprate;
#X obj 40 182 tabwrite~ \$0-sample;
#X obj 398 437 line~;
#X obj 398 362 f;
#X obj 398 517 outlet~;
#X msg 398 416 0 \, \$1 \$2;
#X obj 398 390 pack 0 0;
#X obj 498 337 /;
#X obj 557 318 * 0.001;
#X obj 398 490 hip~ 5;
#X obj 343 239 loadbang;
#X msg 398 315 1;
#X obj 398 337 metro 1000;
#X obj 499 295 t b b f;
#X obj 425 263 t b f;
#X obj 360 152 hip~ 5;
#X obj 360 128 adc~ 1;
#X obj 348 91 inlet;
#X obj 422 128 samplerate~;
#X obj 422 152 s insamprate2;
#X obj 348 175 tabwrite~ \$0-sample2;
#X obj 424 239 r \$0-samplength2;
#X obj 499 269 r \$0-insamprate2;
#X obj 398 462 tabread4~ \$0-sample2;
#X connect 0 0 13 0;
#X connect 1 0 4 0;
#X connect 3 0 0 0;
#X connect 4 0 3 0;
#X connect 5 0 4 1;
#X connect 5 0 10 1;
#X connect 6 0 5 1;
#X connect 7 0 2 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 10 0 1 0;
#X connect 11 0 9 0;
#X connect 11 1 5 0;
#X connect 11 2 6 0;
#X connect 12 0 9 0;
#X connect 12 1 5 0;
#X connect 12 1 1 1;
#X connect 13 0 7 0;
#X connect 15 0 22 0;
#X connect 16 0 15 0;
#X connect 18 0 19 0;
#X connect 18 0 22 0;
#X connect 19 0 17 0;
#X connect 20 0 12 0;
#X connect 21 0 11 0;
#X connect 23 0 44 0;
#X connect 24 0 27 0;
#X connect 26 0 23 0;
#X connect 27 0 26 0;
#X connect 28 0 27 1;
#X connect 28 0 33 1;
#X connect 29 0 28 1;
#X connect 30 0 25 0;
#X connect 31 0 32 0;
#X connect 32 0 33 0;
#X connect 33 0 24 0;
#X connect 34 0 32 0;
#X connect 34 1 28 0;
#X connect 34 2 29 0;
#X connect 35 0 32 0;
#X connect 35 1 28 0;
#X connect 35 1 24 1;
#X connect 36 0 41 0;
#X connect 37 0 36 0;
#X connect 38 0 39 0;
#X connect 38 0 41 0;
#X connect 39 0 40 0;
#X connect 42 0 35 0;
#X connect 43 0 34 0;
#X connect 44 0 30 0;
#X restore 87 415 pd test-signals;
#X text 104 393 <- record ->;
#N canvas 388 86 722 350 insample2 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-sample2 62079 float 0;
#X coords 0 1 62078 -1 400 150 1;
#X restore 298 24 graph;
#X obj 19 74 unpack s f;
#X obj 19 184 soundfiler;
#X text 356 250 read a sample;
#X obj 276 249 loadbang;
#X obj 19 100 t s b;
#X obj 19 135 pack s s;
#X msg 19 160 read -resize \$1 \$2;
#X obj 74 46 44100;
#X obj 19 47 t a b;
#X obj 19 247 /;
#X obj 19 271 * 1000;
#X obj 19 23 r read-sound2;
#X obj 116 74 s \$0-insamprate2;
#X obj 75 99 symbol \$0-sample2;
#X obj 29 208 s \$0-samplength2;
#X obj 57 247 r \$0-insamprate2;
#X obj 19 294 s \$0-samp2-msec;
#X msg 276 273 \; read-sound2 ../sound/voice.wav;
#X connect 1 0 5 0;
#X connect 1 1 13 0;
#X connect 2 0 10 0;
#X connect 2 0 15 0;
#X connect 4 0 18 0;
#X connect 5 0 6 0;
#X connect 5 1 14 0;
#X connect 6 0 7 0;
#X connect 7 0 2 0;
#X connect 8 0 13 0;
#X connect 9 0 1 0;
#X connect 9 1 8 0;
#X connect 10 0 11 0;
#X connect 11 0 17 0;
#X connect 12 0 9 0;
#X connect 14 0 6 1;
#X connect 16 0 10 1;
#X restore 334 430 pd insample2;
#N canvas 388 86 722 350 insample1 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-sample 155948 float 0;
#X coords 0 1 155947 -1 400 150 1;
#X restore 259 24 graph;
#X obj 19 74 unpack s f;
#X obj 19 184 soundfiler;
#X text 356 250 read a sample;
#X obj 276 249 loadbang;
#X obj 19 100 t s b;
#X obj 75 99 symbol \$0-sample;
#X obj 19 135 pack s s;
#X msg 19 160 read -resize \$1 \$2;
#X obj 74 46 44100;
#X obj 19 47 t a b;
#X obj 29 208 s \$0-samplength;
#X obj 116 74 s \$0-insamprate;
#X obj 19 247 /;
#X obj 19 271 * 1000;
#X obj 19 294 s \$0-samp-msec;
#X obj 57 247 r \$0-insamprate;
#X obj 19 23 r read-sound1;
#X msg 276 273 \; read-sound1 ../sound/bell.aiff;
#X connect 1 0 5 0;
#X connect 1 1 12 0;
#X connect 2 0 11 0;
#X connect 2 0 13 0;
#X connect 4 0 18 0;
#X connect 5 0 7 0;
#X connect 5 1 6 0;
#X connect 6 0 7 1;
#X connect 7 0 8 0;
#X connect 8 0 2 0;
#X connect 9 0 12 0;
#X connect 10 0 1 0;
#X connect 10 1 9 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 16 0 13 1;
#X connect 17 0 10 0;
#X restore 334 408 pd insample1;
#X floatatom 453 432 5 0 0 0 - #0-samp2-msec -;
#N canvas 0 110 565 454 hann-window 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-hann 1024 float 0;
#X coords 0 1 1023 0 300 100 1;
#X restore 82 311 graph;
#X obj 378 165 osc~;
#X obj 378 190 *~ -0.5;
#X obj 378 214 +~ 0.5;
#X obj 331 247 tabwrite~ \$0-hann;
#X obj 37 88 r window-size;
#X obj 38 173 /;
#X obj 127 142 samplerate~;
#X obj 38 251 s window-sec;
#X obj 177 204 swap;
#X obj 177 228 /;
#X obj 177 252 s window-hz;
#X obj 49 201 * 1000;
#X obj 49 228 s window-msec;
#X obj 38 115 t f b f;
#X msg 173 92 resize \$1;
#X obj 173 116 s \$0-hann;
#X obj 330 105 r window-hz;
#X msg 382 130 0;
#X obj 330 131 t f b;
#X text 15 8 calculate Hann window table (variable window size) and
constants window-hz (fundamental frequency of analysis) \, window-sec
and window-msec (analysis window size in seconds and msec).;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 5 0 14 0;
#X connect 6 0 8 0;
#X connect 6 0 12 0;
#X connect 7 0 6 1;
#X connect 7 0 9 1;
#X connect 9 0 10 0;
#X connect 9 1 10 1;
#X connect 10 0 11 0;
#X connect 12 0 13 0;
#X connect 14 0 6 0;
#X connect 14 0 9 0;
#X connect 14 1 7 0;
#X connect 14 2 15 0;
#X connect 15 0 16 0;
#X connect 17 0 19 0;
#X connect 18 0 1 1;
#X connect 19 0 1 0;
#X connect 19 1 4 0;
#X connect 19 1 18 0;
#X restore 334 455 pd hann-window;
#X text 509 412 sample lengths \,;
#X text 510 427 msec;
#X text 27 35 This is a Fourier-based "vocoder" (perhaps better called
a "timbre stamp") like the one the Convolution brothers use. The "control
source" is analyzed to get its spectral envelope \, which is then stamped
onto the "filter input" by adjusting the amplitudes of its Fourier
transform. The "filter input" is first whitened by the compression
algorithm from the previous patch in this series. The best value of
"squelch" to use depends critically on what kind of sounds are used
for the filter input and the control source.;
#X text 402 498 updated for Pd version 0.39;
#X connect 0 0 8 0;
#X connect 0 0 8 1;
#X connect 6 0 7 0;
#X connect 9 0 12 0;
#X connect 10 0 12 0;
#X connect 11 0 12 0;
#X connect 13 0 16 0;
#X connect 14 0 16 0;
#X connect 15 0 16 0;
#X connect 21 0 23 0;
#X connect 22 0 23 1;
#X connect 23 0 0 0;
#X connect 23 1 0 1;
