#N canvas 367 20 625 517 10;
#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 388 248 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 299 52 graph;
#X text 386 379 ---- 0.02 seconds ----;
#X text 295 185 0;
#X text 334 204 -- partial number --;
#X text 561 172 0;
#X text 558 49 0.5;
#X floatatom 22 42 0 0 100 0 - - -;
#N canvas 329 22 680 421 pulse-train 0;
#X obj 184 348 line~;
#X obj 39 317 cos~;
#X obj 184 324 pack 0 50;
#X obj 39 245 -~ 0.5;
#X obj 39 269 *~;
#X obj 184 252 / 10;
#X obj 184 276 moses 0;
#X msg 184 300 0;
#X obj 39 293 clip~ -0.5 0.5;
#X obj 184 372 +~ 1;
#X obj 39 341 +~ 1;
#X obj 184 228 inlet;
#X obj 39 389 outlet~;
#X obj 39 365 *~ 0.5;
#X text 53 5 This is a modified version of the pulse train generator
from two examples back.;
#X text 107 140 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 multpplying with.;
#X text 276 262 otherwise it's the same as before.;
#X obj 40 85 phasor~;
#X obj 40 58 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 22 67 pd pulse-train;
#X text 54 42 <-- bandwidth;
#X obj 22 200 *~;
#X text 68 114 <-- modulation frequency as;
#X text 107 128 multiple of fundamental;
#X obj 22 275 output~;
#X obj 21 244 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 69 243 pd fft;
#X obj 102 199 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 102 220 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X text 123 219 <-- repeatedly;
#X text 124 199 <-- graph once;
#X text 327 185 2;
#X text 359 185 4;
#X text 391 185 6;
#X text 423 185 8;
#X text 456 185 10;
#X text 488 185 12;
#X text 519 185 14;
#X text 593 243 1;
#X text 593 367 -1;
#X text 19 332 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.;
#X floatatom 38 114 0 0 100 0 - - -;
#X obj 38 173 osc~;
#X obj 38 148 *;
#X obj 72 148 r freq;
#X text 18 406 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.;
#X text 117 66 <-- pulse train;
#X text 153 78 generator from before;
#X obj 1 1 cnv 15 445 20 empty \$0-pddp.cnv.header ring_modulated_pulse_trains
20 10 1 18 -261139 -33289 0;
#X obj 407 2 pddp/pddplink http://puredata.info/dev/pddp -text pddp
;
#X text 74 173 modulating oscillator;
#X obj 1 494 cnv 15 445 20 empty \$0-pddp.cnv.footer empty 20 12 0
14 -233017 -33289 0;
#N canvas 44 246 494 284 META 0;
#X text 12 125 WEBSITE http://crca.ucsd.edu/~msp/;
#X text 12 105 AUTHOR Miller Puckette;
#X text 12 85 LIBRARY PDDP;
#X text 12 5 GENRE tutorial;
#X text 12 45 LICENSE SIBSD;
#X text 12 145 HELP_PATCH_AUTHORS Updated for release 0.37. Jonathan
Wilkes revised the patch to conform to the PDDP template for Pd version
0.42.;
#X text 12 25 KEYWORDS signal;
#X text 12 65 DESCRIPTION ring modulated pulse trains;
#X restore 392 496 pd META;
#N canvas 13 202 428 190 References 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -261139 -33289 0;
#X text 7 2 pulse trains- Related Help Documents;
#X text 19 37 links:;
#X restore 103 496 pd References;
#X obj 6 496 pddp/pddplink ../5.reference/pddp/help.pd -text help;
#X connect 7 0 8 0;
#X connect 8 0 10 0;
#X connect 10 0 14 0;
#X connect 10 0 15 0;
#X connect 14 0 13 0;
#X connect 14 0 13 1;
#X connect 16 0 15 1;
#X connect 17 0 15 2;
#X connect 30 0 32 0;
#X connect 31 0 10 1;
#X connect 32 0 31 0;
#X connect 33 0 32 1;
