#N canvas 366 23 709 658 12;
#X declare -stdpath ./;
#X obj 53 527 output~;
#X obj 96 120 moses 1;
#X obj 141 152 mtof;
#X text 172 396 on/off for original;
#X text 160 23 OCTAVE DOUBLING VIA VARIABLE COMB FILTER;
#X obj 53 479 +~;
#X obj 194 204 samplerate~;
#X obj 141 200 t f b;
#X obj 114 62 delwrite~ G06-del 100;
#X obj 96 270 delread~ G06-del, f 8;
#X obj 114 356 vd~ G06-del;
#X obj 96 382 +~;
#X obj 176 258 +;
#X obj 141 175 expr 500/$f1;
#X obj 176 312 line~;
#X obj 176 287 pack 0 20;
#X text 180 152 fundamental frequency;
#X text 239 174 1/2 period \, in msec;
#X obj 194 230 expr 2048000/$f1;
#X obj 490 64 declare -stdpath ./;
#X obj 53 17 adc~ 1;
#X obj 96 96 sigmund~ -npts 2048;
#X text 469 617 updated for Pd version 0.53;
#X text 241 96 track pitch;
#X text 158 120 reject low numbers indicating no pitch found;
#X text 187 450 We already saw how to use ring modulation to alias a pitched sound down one octave. Here we do the reverse: filter out all odd harmonics using a variable-delay comb filter tuned one octave above the incoming sound. We use two taps into the delay line. The fixed one (delread~) adjusts for the delayed output of sigmund~. The variable one (vd~) adds to this an additional delay equal to 1/2 the measured period of the incoming sound. These two are added. Odd harmonics are 180 degrees out of phase at the two taps and cancel. Even harmonics get through - so the sound goes up an octave \, without denaturing the timbre as a speed-up would., f 67;
#X obj 114 412 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X obj 96 439 *~;
#X obj 71 412 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X obj 53 439 *~;
#X text 322 223 estimate [sigmund~] delay as one window (in msec), f 25;
#X text 140 412 <-- and processed sounds;
#X connect 1 1 2 0;
#X connect 2 0 13 0;
#X connect 5 0 0 0;
#X connect 6 0 18 0;
#X connect 7 0 12 0;
#X connect 7 1 6 0;
#X connect 9 0 11 0;
#X connect 10 0 11 1;
#X connect 11 0 27 0;
#X connect 12 0 15 0;
#X connect 13 0 7 0;
#X connect 14 0 10 0;
#X connect 15 0 14 0;
#X connect 18 0 12 1;
#X connect 18 0 9 0;
#X connect 20 0 8 0;
#X connect 20 0 21 0;
#X connect 20 0 29 0;
#X connect 21 0 1 0;
#X connect 26 0 27 1;
#X connect 27 0 5 1;
#X connect 28 0 29 1;
#X connect 29 0 5 0;
