#N canvas 464 47 743 743 12;
#X declare -stdpath ./;
#X declare -stdpath ./;
#N canvas 0 0 450 300 (subpatch) 0;
#X array E02-signal 882 float 0;
#X coords 0 6 882 -6 257 131 1 0 0;
#X restore 404 206 graph;
#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 402 415 graph;
#X obj 189 493 bng 19 250 50 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000;
#X obj 115 538 output~;
#X text 433 548 1;
#X text 467 548 2;
#X text 499 548 3;
#X text 531 548 4;
#X text 564 548 5;
#X text 594 548 6;
#X text 625 548 7;
#X text 401 548 0;
#X text 666 263 0;
#X obj 29 256 osc~;
#X obj 29 306 *~;
#X obj 73 256 osc~;
#X obj 73 306 *~;
#X obj 116 256 osc~;
#X obj 116 306 *~;
#X obj 116 233 * 2;
#X obj 159 256 osc~;
#X obj 159 306 *~;
#X obj 202 256 osc~;
#X obj 202 306 *~;
#X obj 245 256 osc~;
#X obj 245 306 *~;
#X obj 29 233 * 0;
#X obj 73 233 * 1;
#X obj 159 233 * 3;
#X obj 202 233 * 4;
#X obj 245 233 * 5;
#X text 562 176 WAVEFORM;
#X text 550 392 SPECTRUM;
#X text 662 531 0;
#X text 660 410 1;
#X text 661 469 0.5;
#X obj 116 383 *~;
#X text 307 264 partials;
#X obj 234 414 osc~;
#X floatatom 234 354 4 0 200 0 - - - 0;
#X obj 234 383 *;
#X obj 267 383 r freq-step;
#X obj 189 445 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X obj 189 469 metro 500;
#X text 63 628 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 89;
#N canvas 436 82 547 365 fft 0;
#X obj 86 90 inlet~;
#X obj 162 243 inlet;
#X obj 96 121 rfft~;
#X obj 96 154 *~;
#X obj 128 154 *~;
#X obj 96 184 sqrt~;
#X obj 96 210 biquad~ 0 0 0 0 1;
#X text 160 122 Fourier series;
#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 212 245 "bang" into this inlet to graph it;
#X obj 162 277 tabwrite~ E02-spectrum;
#X obj 87 310 tabwrite~ E02-signal;
#X obj 399 138 block~ 4096;
#X text 398 113 Window size;
#X text 163 157 calculate magnitude, f 9;
#X text 227 203 delay two samples for better graphing, f 19;
#X connect 0 0 2 0;
#X connect 0 0 12 0;
#X connect 1 0 11 0;
#X connect 1 0 12 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 6 0;
#X connect 6 0 11 0;
#X restore 128 481 pd fft;
#X obj 490 27 declare -stdpath ./;
#X text 212 444 <-- graph repeatedly;
#X text 212 492 <-- graph once;
#X text 289 280 <-- On/Off;
#X obj 47 281 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X obj 91 281 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X obj 134 281 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X obj 177 281 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X obj 220 281 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X obj 263 281 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X text 666 200 6;
#X text 667 325 -6;
#X text 433 579 ------ partial number --------;
#X text 432 343 ------ 0.02 seconds ------;
#X text 43 66 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 88;
#X obj 85 21 cnv 5 5 25 empty empty Ring\ Modulation 15 13 0 16 #dfdfdf #202020 0;
#X text 294 310 modulation frequency in "steps" of f/16, f 10;
#X text 268 353 <--;
#X floatatom 274 411 5 0 0 0 - - - 0;
#X obj 116 171 r fundamental;
#X floatatom 116 198 10 0 0 0 - - - 0;
#N canvas 876 61 416 495 init 0;
#X obj 84 196 samplerate~;
#X obj 84 170 bng 18 250 50 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000;
#X floatatom 84 248 8 0 0 0 - - - 0;
#X obj 84 221 / 256;
#X obj 84 146 loadbang;
#X floatatom 84 330 9 0 0 0 - - - 0;
#X obj 92 276 s fundamental;
#X obj 84 303 ftom;
#X text 44 54 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 42;
#X text 161 330 <-- just out of curiosity \, here's the pitch, f 18;
#X obj 109 423 declare -stdpath ./;
#X text 198 275 <-- send to number box, f 11;
#X text 43 16 This subpatch initializes the patch \,;
#X connect 0 0 3 0;
#X connect 1 0 0 0;
#X connect 2 0 6 0;
#X connect 2 0 7 0;
#X connect 3 0 2 0;
#X connect 4 0 1 0;
#X connect 7 0 5 0;
#X restore 295 184 pd init;
#X connect 2 0 45 1;
#X connect 13 0 14 0;
#X connect 14 0 36 0;
#X connect 15 0 16 0;
#X connect 16 0 36 0;
#X connect 17 0 18 0;
#X connect 18 0 36 0;
#X connect 19 0 17 0;
#X connect 20 0 21 0;
#X connect 21 0 36 0;
#X connect 22 0 23 0;
#X connect 23 0 36 0;
#X connect 24 0 25 0;
#X connect 25 0 36 0;
#X connect 26 0 13 0;
#X connect 27 0 15 0;
#X connect 28 0 20 0;
#X connect 29 0 22 0;
#X connect 30 0 24 0;
#X connect 36 0 45 0;
#X connect 36 0 3 0;
#X connect 38 0 36 1;
#X connect 39 0 40 0;
#X connect 40 0 38 0;
#X connect 41 0 40 1;
#X connect 41 0 64 0;
#X connect 42 0 43 0;
#X connect 43 0 2 0;
#X connect 50 0 14 1;
#X connect 51 0 16 1;
#X connect 52 0 18 1;
#X connect 53 0 21 1;
#X connect 54 0 23 1;
#X connect 55 0 25 1;
#X connect 65 0 66 0;
#X connect 66 0 26 0;
#X connect 66 0 27 0;
#X connect 66 0 19 0;
#X connect 66 0 28 0;
#X connect 66 0 29 0;
#X connect 66 0 30 0;
