#N canvas 456 29 747 766 12;
#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 482 84 graph;
#X obj 115 370 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 403 280 graph;
#X text 500 215 ---- 0.02 seconds ----;
#X obj 189 348 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 115 401 output~;
#X text 506 721 updated for Pd version 0.37;
#X text 434 413 1;
#X text 468 413 2;
#X text 500 413 3;
#X text 532 413 4;
#X text 565 413 5;
#X text 595 413 6;
#X text 626 413 7;
#X text 402 413 0;
#X text 457 432 -- partial number --;
#X text 684 138 0;
#X obj 117 54 r fundamental;
#X obj 30 112 osc~;
#X obj 48 137 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X obj 30 162 *~;
#X obj 74 112 osc~;
#X obj 92 137 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
;
#X obj 74 162 *~;
#X obj 117 112 osc~;
#X obj 135 137 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X obj 117 162 *~;
#X obj 117 89 * 2;
#X obj 160 112 osc~;
#X obj 178 137 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X obj 160 162 *~;
#X obj 203 112 osc~;
#X obj 221 137 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X obj 203 162 *~;
#X obj 246 112 osc~;
#X obj 264 137 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X obj 246 162 *~;
#X obj 30 89 * 0;
#X obj 74 89 * 1;
#X obj 160 89 * 3;
#X obj 203 89 * 4;
#X obj 246 89 * 5;
#X text 572 55 WAVEFORM;
#X text 514 257 SPECTRUM;
#X text 663 396 0;
#X text 661 275 1;
#X text 662 334 0.5;
#X text 684 78 5;
#X text 685 198 -5;
#X obj 116 239 *~;
#X text 298 120 partials;
#X obj 234 270 osc~;
#X floatatom 234 210 3 0 200 0 - - -;
#X obj 234 239 *;
#X obj 267 239 r freq-step;
#X text 293 177 modulation;
#X text 289 192 frequency in;
#X text 42 14 RING MODULATION: multiplying a complex tone by a sinusoid
;
#X obj 189 303 tgl 18 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X obj 189 325 metro 500;
#X text 71 487 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., f 71;
#X text 71 581 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., f 71;
#X text 265 209 <= "steps" of f/16;
#X text 290 136 <= On/Off;
#X text 212 302 <= graph repeatedly;
#X text 212 347 <= graph once;
#N canvas 436 82 601 665 fft 0;
#X obj 86 90 inlet~;
#X obj 162 243 inlet;
#X obj 96 121 rfft~;
#X obj 96 154 *~;
#X obj 127 154 *~;
#X obj 96 184 sqrt~;
#X obj 399 138 block~ 4096 1;
#X obj 96 210 biquad~ 0 0 0 0 1;
#X text 160 122 Fourier series;
#X text 165 175 magnitude;
#X text 163 160 calculate;
#X text 64 24 This subpatch computes the spectrum of the incoming signal
with a (rectangular windowed) FFT. FFTs aren't properly introduced
until much later.;
#X text 150 90 signal to analyze;
#X text 235 202 delay two samples;
#X text 234 218 for better graphing;
#X obj 91 466 samplerate~;
#X obj 91 443 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X floatatom 91 523 5 0 0 0 - - -;
#X obj 91 499 / 256;
#X obj 91 419 loadbang;
#X floatatom 91 592 5 0 0 0 - - -;
#X obj 99 545 s fundamental;
#X obj 91 568 ftom;
#X text 70 353 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., f 62;
#X text 212 245 "bang" into this inlet to graph it;
#X floatatom 230 531 5 0 0 0 - - -;
#X obj 230 507 / 4096;
#X text 226 476 One bin is SR/4096:;
#X obj 230 553 s freq-step;
#X obj 162 277 tabwrite~ E02-spectrum;
#X obj 87 310 tabwrite~ E02-signal;
#X text 147 591 <= just out of curiosity \, here's the fundamental
pitch;
#X connect 0 0 2 0;
#X connect 0 0 30 0;
#X connect 1 0 29 0;
#X connect 1 0 30 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 29 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 28 0;
#X connect 26 0 25 0;
#X restore 128 337 pd fft;
#X connect 1 0 5 0;
#X connect 1 0 5 1;
#X connect 4 0 66 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 49 0;
#X connect 21 0 23 0;
#X connect 22 0 23 1;
#X connect 23 0 49 0;
#X connect 24 0 26 0;
#X connect 25 0 26 1;
#X connect 26 0 49 0;
#X connect 27 0 24 0;
#X connect 28 0 30 0;
#X connect 29 0 30 1;
#X connect 30 0 49 0;
#X connect 31 0 33 0;
#X connect 32 0 33 1;
#X connect 33 0 49 0;
#X connect 34 0 36 0;
#X connect 35 0 36 1;
#X connect 36 0 49 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 49 0 1 0;
#X connect 49 0 66 0;
#X connect 51 0 49 1;
#X connect 52 0 53 0;
#X connect 53 0 51 0;
#X connect 54 0 53 1;
#X connect 58 0 59 0;
#X connect 59 0 4 0;
