#N canvas 433 119 793 595 12;
#N canvas 0 0 450 300 (subpatch) 0;
#X array F05-signal 882 float 0;
#X coords 0 1 882 -1 200 130 1;
#X restore 502 271 graph;
#N canvas 0 0 450 300 (subpatch) 0;
#X array F05-spectrum 256 float 0;
#X coords 0 0.51 255 -0.008 256 130 1;
#X restore 444 48 graph;
#X text 518 404 ---- 0.02 seconds ----;
#X text 542 501 updated for Pd version 0.37;
#X text 440 181 0;
#X text 479 200 -- partial number --;
#X text 706 168 0;
#X text 703 45 0.5;
#X floatatom 89 57 0 0 100 0 - - -;
#N canvas 667 118 574 518 pulse-train 0;
#X obj 229 289 line~;
#X obj 99 368 cos~;
#X obj 229 265 pack 0 50;
#X obj 99 246 -~ 0.5;
#X obj 99 300 *~;
#X obj 183 183 / 10;
#X obj 183 207 moses 0;
#X msg 183 231 0;
#X obj 99 344 clip~ -0.5 0.5;
#X obj 229 313 +~ 1;
#X obj 99 392 +~ 1;
#X obj 183 159 inlet;
#X obj 99 460 outlet~;
#X obj 99 416 *~ 0.5;
#X text 57 23 This is a modified version of the pulse train generator
from two examples back.;
#X text 56 72 We have to add 1/2 and wrap so that the center of the
pulse comes at phase zero (previously it was 1/2 cycle out of phase).
This wasn't a problem before but now we have to be in phase with the
oscillator we're multiplying with.;
#X text 262 160 otherwise it's the same as before.;
#X obj 99 202 phasor~;
#X obj 99 175 r freq;
#X connect 0 0 9 0;
#X connect 1 0 10 0;
#X connect 2 0 0 0;
#X connect 3 0 4 0;
#X connect 4 0 8 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 6 1 2 0;
#X connect 7 0 2 0;
#X connect 8 0 1 0;
#X connect 9 0 4 1;
#X connect 10 0 13 0;
#X connect 11 0 5 0;
#X connect 13 0 12 0;
#X connect 17 0 3 0;
#X connect 18 0 17 0;
#X restore 89 82 pd pulse-train;
#X obj 89 225 *~;
#X text 164 140 multiple of fundamental;
#X obj 89 292 output~;
#X obj 89 255 hip~;
#N canvas 122 211 563 534 fft 0;
#X obj 19 61 inlet~;
#X obj 208 212 inlet;
#X obj 29 92 rfft~;
#X obj 29 125 *~;
#X obj 60 125 *~;
#X obj 29 155 sqrt~;
#X obj 332 109 block~ 4096 1;
#X obj 29 181 biquad~ 0 0 0 0 1;
#X text 93 93 Fourier series;
#X text 98 146 magnitude;
#X text 96 131 calculate;
#X text 21 3 This subpatch computes the spectrum of the incoming signal
with a (rectangular windowed) FFT. FFTs aren't properly introduced
until much later.;
#X text 83 61 signal to analyze;
#X text 193 164 delay two samples;
#X text 191 182 for better graphing;
#X obj 264 434 samplerate~;
#X obj 245 262 metro 500;
#X obj 245 233 inlet;
#X text 298 231 toggle to graph repeatedly;
#X text 262 212 bang to graph once;
#X obj 29 205 /~ 4096;
#X obj 264 409 bang~;
#X obj 264 483 s freq;
#X obj 264 457 / 256;
#X obj 19 295 tabwrite~ F05-signal;
#X obj 245 294 tabwrite~ F05-spectrum;
#X msg 224 321 \; pd dsp 1;
#X connect 0 0 2 0;
#X connect 0 0 24 0;
#X connect 1 0 24 0;
#X connect 1 0 25 0;
#X connect 1 0 26 0;
#X connect 2 0 3 0;
#X connect 2 0 3 1;
#X connect 2 1 4 0;
#X connect 2 1 4 1;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 5 0 7 0;
#X connect 7 0 20 0;
#X connect 15 0 23 0;
#X connect 16 0 24 0;
#X connect 16 0 25 0;
#X connect 17 0 16 0;
#X connect 17 0 26 0;
#X connect 20 0 25 0;
#X connect 21 0 15 0;
#X connect 23 0 22 0;
#X restore 137 254 pd fft;
#X obj 156 228 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 197 254 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X text 472 181 2;
#X text 504 181 4;
#X text 536 181 6;
#X text 568 181 8;
#X text 601 181 10;
#X text 633 181 12;
#X text 664 181 14;
#X text 707 266 1;
#X text 707 390 -1;
#X text 156 196 modulating oscillator;
#X text 64 16 RING MODULATED PULSE TRAINS;
#X text 69 371 Now we take a pulse train and ring modulate it \, which
effectively aliases the spectrum so that it is centered at any desired
partial number. The "bandwidth" control still affects the shape of
the peak \, independently of where it is centered. This generates a
formant centered at the given partial., f 55;
#X floatatom 107 127 0 0 100 0 - - -;
#X obj 107 193 osc~;
#X obj 107 165 *;
#X obj 141 165 r freq;
#X text 69 467 This patch is limited to making formants centered on
harmonics. The center frequency thus can't be moved smoothly up and
down at will (try shift-clicking on modulation frequency to make fractions).
Next we'll look at two techniques for sliding a formant frequency without
losing harmonicity., f 55;
#X text 201 97 generator from before;
#X text 178 228 <= graph once;
#X text 218 253 <= repeatedly;
#X text 124 57 <= bandwidth;
#X text 202 81 <= pulse train;
#X text 143 126 <= modulation frequency as;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 10 0 13 0;
#X connect 10 0 14 0;
#X connect 13 0 12 0;
#X connect 13 0 12 1;
#X connect 15 0 14 1;
#X connect 16 0 14 2;
#X connect 29 0 31 0;
#X connect 30 0 10 1;
#X connect 31 0 30 0;
#X connect 32 0 31 1;
