#N canvas 107 -33 731 710 12;
#X declare -stdpath ./;
#X obj 364 224 loadbang;
#X obj 90 325 hip~ 5;
#X obj 488 136 adc~ 1;
#X obj 364 279 soundfiler;
#X obj 68 369 output~;
#X obj 488 185 tabwrite~ E03-table;
#X msg 364 251 read ../sound/voice.wav E03-table;
#X obj 157 231 osc~;
#X obj 89 232 *~;
#X obj 157 180 mtof;
#X obj 157 208 *;
#X msg 206 156 0.5;
#X floatatom 206 185 3 0 0 0 - - - 0;
#X msg 244 156 15;
#N canvas 403 128 429 212 (subpatch) 0;
#X obj 273 42 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000
0 1;
#X obj 170 24 inlet~;
#X obj 170 87 *~;
#X obj 170 159 outlet~;
#X connect 0 0 2 1;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X coords 0 0 100 100 40 18 1 250 40;
#X restore 44 281 pd;
#X obj 90 255 *~ 2;
#X obj 206 131 loadbang;
#N canvas 414 195 543 299 looper 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array E03-table 44103 float 0;
#X coords 0 1.02 44103 -1.02 200 130 1;
#X restore 257 54 graph;
#X text 265 193 ---- 44103 samples ----;
#X obj 66 115 +~ 1;
#X obj 66 63 phasor~ 1;
#X obj 66 88 *~ 44100;
#X obj 66 144 tabread4~ E03-table;
#X obj 66 170 outlet~;
#X text 112 235 one-second sample reader loop. You can replace this
with an adc~ if you want to go live., f 46;
#X connect 2 0 5 0;
#X connect 3 0 4 0;
#X connect 4 0 2 0;
#X connect 5 0 6 0;
#X restore 129 49 pd looper;
#X text 448 230 re-read original sample;
#X obj 499 162 bng 15 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000
#000000;
#N canvas 300 203 576 337 delay 0;
#X obj 43 250 outlet~;
#X obj 42 38 inlet~;
#X obj 43 119 loadbang;
#X obj 42 66 delwrite~ E03-del 40;
#X obj 43 223 delread~ E03-del;
#X obj 43 180 expr 1000*1024/$f1;
#X obj 43 145 samplerate~;
#X text 194 59 write to delay line which has enough memory to hold
40 msec, f 30;
#X text 153 145 get sample rate at load time;
#X text 186 174 divide 1024 by sample rate to give time in seconds
\; multiply by 1000 to convert to milliseconds.;
#X text 196 225 read from the delay line at the calculated delay;
#X text 272 274 1024-sample delay;
#X connect 1 0 3 0;
#X connect 2 0 6 0;
#X connect 4 0 0 0;
#X connect 5 0 4 0;
#X connect 6 0 5 0;
#X restore 43 124 pd delay;
#X text 169 264 on/off for original;
#X text 185 334 This patch demonstrates using ring modulation to alias
a sound down one octave. The ring modulation itself ("osc~" and multiplier)
is easy. (We step it up by a factor of 2 to balance the original better.)
, f 70;
#X text 187 538 About fiddle~ \, suffice it to say that the third outlet
contains (pitch \, amplitude) pairs. We unpack the pitch and strip
out any zeros (when fiddle~ fails to find a pitch it outputs zero but
we'd rather stick with the most recent good one). This is converted
from MIDI to Hertz \, and multiplied by 1/2 to control the modulation
oscillator. (You can also try large-ish integers which leave the pitch
intact but introduce funny formants.), f 70;
#X text 518 160 <= record a sample;
#X text 140 280 <= and processed sounds;
#X text 277 156 <= choose an effect;
#N canvas 403 128 429 212 (subpatch) 0;
#X obj 273 42 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000
0 1;
#X obj 170 24 inlet~;
#X obj 170 87 *~;
#X obj 170 159 outlet~;
#X connect 0 0 2 1;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X coords 0 0 100 100 40 18 1 250 40;
#X restore 90 281 pd;
#X obj 502 25 declare -stdpath ./;
#X text 496 655 updated for Pd version 0.51;
#X obj 130 107 moses 1;
#X obj 129 79 sigmund~ -npts 2048;
#X text 273 79 track pitch;
#X text 192 105 reject low numbers indicating no pitch found;
#X text 186 386 Harder is getting the fundamental frequency of the
original sound. We do this with the complicated "sigmund~" object \,
which puts out a stream of analysis data for an incoming signal. The
"-npts 2048" argument specifies the analysis window size. The analysis
is most closely aligned with what the sound was doing at the middle
of the window \, i.e. \, 1024 samples ago. The "pd delay" window delays
the signal itself 1024 samples so it will be as tightly synchronized
with the analysis data as possible. (If you're doing this on a real-time
input \, you might drop the delay and settle for less perfect synchronization.)
, f 70;
#X text 89 16 OCTAVE DIVIDING BY RING MODULATION;
#X connect 0 0 6 0;
#X connect 1 0 4 0;
#X connect 1 0 4 1;
#X connect 2 0 5 0;
#X connect 6 0 3 0;
#X connect 7 0 8 1;
#X connect 8 0 15 0;
#X connect 9 0 10 0;
#X connect 10 0 7 0;
#X connect 11 0 12 0;
#X connect 12 0 10 1;
#X connect 13 0 12 0;
#X connect 14 0 1 0;
#X connect 15 0 27 0;
#X connect 16 0 11 0;
#X connect 17 0 20 0;
#X connect 17 0 31 0;
#X connect 19 0 5 0;
#X connect 20 0 14 0;
#X connect 20 0 8 0;
#X connect 27 0 1 0;
#X connect 30 1 9 0;
#X connect 31 0 30 0;
