#N canvas 468 38 654 755 12;
#X declare -stdpath ./;
#X floatatom 102 134 5 0 0 0 - - - 0;
#X obj 102 160 mtof;
#X obj 61 457 output~;
#X msg 102 108 60;
#X obj 60 226 osc~;
#X obj 102 202 * 2;
#X obj 102 226 osc~;
#X obj 166 226 osc~;
#X obj 166 202 * 3;
#X obj 230 226 osc~;
#X obj 230 202 * 4;
#X obj 166 251 *~ 0.2;
#X obj 61 391 +~;
#X obj 102 371 *~;
#X obj 120 340 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X obj 102 282 +~;
#X obj 102 309 +~;
#N canvas 0 0 450 300 (subpatch) 0;
#X array fusion 882 float 0;
#X coords 0 1.02 881 -1.02 200 130 1 0 0;
#X restore 398 331 graph;
#X text 289 201 frequencies of harmonics;
#X text 289 225 four oscillators;
#X text 293 250 adjust amplitudes;
#X text 137 308 add the three overtones together;
#X text 421 482 ---- 0.02 seconds ----;
#X obj 102 251 *~ 0.1;
#X obj 230 251 *~ 0.5;
#X obj 451 128 declare -stdpath ./;
#X obj 201 425 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X text 145 339 <-- overtones ON/OFF;
#X text 138 108 <-- reset to middle C;
#X obj 102 80 loadbang;
#X text 145 135 <-- choose a different pitch;
#X text 78 687 To hear the output \, choose a pitch (at top) \, optionally click the "overtones" control \, and mouse up the output volume. Click the "bang" button to graph it., f 74;
#X obj 201 457 tabwrite~ fusion;
#X obj 47 25 cnv 5 5 25 empty empty Adding\ Sinusoids\ to\ make\ a\ Complex\ Tone 15 13 0 16 #dfdfdf #202020 0;
#X text 78 540 A simple way to build non-sinusoidal \, periodic musical tones is to sum a series of harmonically tuned sinusoids. Here the four oscillators have frequencies in a 1:2:3:4 ratio (the three [*] objects compute the second \, third \, and fourth one). The amplitudes are adjusted by the [*~ 0.1] \, etc. \, objects. Note that \, since the frequency (from [mtof]) is a control message \, a [*] box suffices to operate on it \, but the oscillator's output \, being an audio signal \, needs [*~] instead. The control marked "overtones ON/OFF" is a toggle switch. Click to turn it on and off. Of the overtones are "off" you hear only a sinusoid from the first oscillator. If on \, you hear all four., f 74;
#X obj 201 396 metro 500;
#X obj 201 370 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X text 226 369 <-- graph repeatedly;
#X text 231 424 <-- graph once;
#X text 173 80 <-- send a bang when loading the patch;
#X connect 0 0 1 0;
#X connect 1 0 4 0;
#X connect 1 0 5 0;
#X connect 1 0 8 0;
#X connect 1 0 10 0;
#X connect 3 0 0 0;
#X connect 4 0 12 0;
#X connect 5 0 6 0;
#X connect 6 0 23 0;
#X connect 7 0 11 0;
#X connect 8 0 7 0;
#X connect 9 0 24 0;
#X connect 10 0 9 0;
#X connect 11 0 15 1;
#X connect 12 0 2 0;
#X connect 12 0 32 0;
#X connect 13 0 12 1;
#X connect 14 0 13 1;
#X connect 15 0 16 0;
#X connect 16 0 13 0;
#X connect 23 0 15 0;
#X connect 24 0 16 1;
#X connect 26 0 32 0;
#X connect 29 0 3 0;
#X connect 35 0 26 0;
#X connect 36 0 35 0;
