#N canvas 320 21 755 628 10;
#N canvas 0 0 450 300 (subpatch) 0;
#X array E02-signal 882 float 0;
#X coords 0 5 882 -5 200 130 1;
#X restore 361 66 graph;
#X obj 15 392 hip~ 5;
#N canvas 0 0 450 300 (subpatch) 0;
#X array E02-spectrum 128 float 0;
#X coords 0 4300 127 -40 257 130 1;
#X restore 295 271 graph;
#N canvas 45 83 558 569 fft 0;
#X obj 19 61 inlet~;
#X obj 95 214 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 192 166 delay two samples;
#X text 191 182 for better graphing;
#X obj 16 425 samplerate~;
#X obj 16 402 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X floatatom 16 472 5 0 0 0 - - -, f 5;
#X obj 16 448 / 256;
#X obj 16 378 loadbang;
#X floatatom 16 541 5 0 0 0 - - -, f 5;
#X obj 24 494 s fundamental;
#X obj 16 517 ftom;
#X text 14 319 At load time \, calculate a good choice of fundamental
frequency for showing spectra: the 16th bin in a 4096-point spectrum
\, so SR*16/4096 or SR/256.;
#X text 145 216 "bang" into this inlet to graph it;
#X floatatom 191 480 5 0 0 0 - - -, f 5;
#X obj 191 456 / 4096;
#X text 187 425 One bin is SR/4096:;
#X text 72 540 <-just out of curiosity \, here's the fundamental pitch
;
#X obj 191 502 s freq-step;
#X obj 95 248 tabwrite~ E02-spectrum;
#X obj 20 281 tabwrite~ E02-signal;
#X connect 0 0 2 0;
#X connect 0 0 31 0;
#X connect 1 0 30 0;
#X connect 1 0 31 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 30 0;
#X connect 15 0 18 0;
#X connect 15 0 26 0;
#X connect 16 0 15 0;
#X connect 17 0 21 0;
#X connect 17 0 22 0;
#X connect 18 0 17 0;
#X connect 19 0 16 0;
#X connect 22 0 20 0;
#X connect 25 0 29 0;
#X connect 26 0 25 0;
#X restore 23 365 pd fft;
#X text 391 198 ---- 0.02 seconds ----;
#X obj 84 366 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 15 420 output~;
#X text 326 404 1;
#X text 360 404 2;
#X text 392 404 3;
#X text 424 404 4;
#X text 457 404 5;
#X text 487 404 6;
#X text 518 404 7;
#X text 294 404 0;
#X text 366 423 -- partial number --;
#X text 563 120 0;
#X obj 18 54 r fundamental;
#X obj 18 116 osc~;
#X obj 32 141 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X obj 17 166 *~;
#X obj 61 116 osc~;
#X obj 75 141 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X obj 60 166 *~;
#X obj 104 116 osc~;
#X obj 118 141 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 103 166 *~;
#X obj 104 93 * 2;
#X obj 147 116 osc~;
#X obj 161 141 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 146 166 *~;
#X obj 190 116 osc~;
#X obj 204 141 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 189 166 *~;
#X obj 233 116 osc~;
#X obj 247 141 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 232 166 *~;
#X obj 18 93 * 0;
#X obj 61 93 * 1;
#X obj 147 93 * 3;
#X obj 190 93 * 4;
#X obj 233 93 * 5;
#X text 275 140 <-- On/Off;
#X text 425 46 WAVEFORM;
#X text 388 249 SPECTRUM;
#X text 555 387 0;
#X text 553 266 1;
#X text 554 325 0.5;
#X text 563 60 5;
#X text 564 180 -5;
#X obj 16 261 *~;
#X text 293 124 partials;
#X obj 154 292 osc~;
#X floatatom 154 232 3 0 200 0 - - -, f 3;
#X obj 154 261 *;
#X obj 186 261 r freq-step;
#X text 226 199 modulation;
#X text 222 214 frequency in;
#X text 185 231 <-- "steps" of f/16;
#X obj 84 321 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X text 107 365 <-- graph once;
#X obj 84 343 metro 500;
#X text 107 320 <-- graph repeatedly;
#X text 12 474 Now we ring modulate the signal by multiplying it by
another sinusoid. The modulation frequency is controlled in steps of
f/16 where "f" is the fundamental frequency \, giving roughly 11 Hz.
per step. Note that if the modulation frequency is set to zero we can't
predict the overall amplitude because it depends on what phase the
modulation oscillator happened to have at that moment.;
#X text 12 560 If you choose a multiple of the fundamental as a modulation
frequency (16 \, 32 \, 48 \, 64 \, ... "steps") the result is again
periodic at the original frequency. If you select a half-integer times
the fundamental (8 \, 24 \, 40 \, ... steps) the pitch drops by an
octave and you get only odd partials. For most other settings you'll
get an inharmonic complex of tones. These are sometimes heard as separate
pitches and other times they seem to fuse into a single timbre with
indeterminate pitch.;
#X obj 1 1 cnv 15 445 20 empty \$0-pddp.cnv.header ring_modulation:
20 10 1 18 -261139 -33289 0;
#X obj 407 2 pddp/pddplink http://puredata.info/dev/pddp -text pddp
;
#X text 91 27 multiplying a complex tone by a sinusoid;
#X obj 1 681 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 65 DESCRIPTION ring modulation;
#X text 12 25 KEYWORDS signal;
#X restore 392 683 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 ring modulation- Related Help Documents;
#X text 19 37 links:;
#X restore 103 683 pd References;
#X obj 6 683 pddp/pddplink ../5.reference/pddp/help.pd -text help;
#X connect 1 0 6 0;
#X connect 1 0 6 1;
#X connect 5 0 3 1;
#X connect 17 0 37 0;
#X connect 17 0 38 0;
#X connect 17 0 27 0;
#X connect 17 0 39 0;
#X connect 17 0 40 0;
#X connect 17 0 41 0;
#X connect 18 0 20 0;
#X connect 19 0 20 1;
#X connect 20 0 50 0;
#X connect 21 0 23 0;
#X connect 22 0 23 1;
#X connect 23 0 50 0;
#X connect 24 0 26 0;
#X connect 25 0 26 1;
#X connect 26 0 50 0;
#X connect 27 0 24 0;
#X connect 28 0 30 0;
#X connect 29 0 30 1;
#X connect 30 0 50 0;
#X connect 31 0 33 0;
#X connect 32 0 33 1;
#X connect 33 0 50 0;
#X connect 34 0 36 0;
#X connect 35 0 36 1;
#X connect 36 0 50 0;
#X connect 37 0 18 0;
#X connect 38 0 21 0;
#X connect 39 0 28 0;
#X connect 40 0 31 0;
#X connect 41 0 34 0;
#X connect 50 0 3 0;
#X connect 50 0 1 0;
#X connect 52 0 50 1;
#X connect 53 0 54 0;
#X connect 54 0 52 0;
#X connect 55 0 54 1;
#X connect 59 0 61 0;
#X connect 61 0 5 0;
