#N canvas 468 23 681 680 12;
#X declare -stdpath ./;
#X floatatom 133 98 5 0 0 0 - - - 0;
#X obj 133 124 mtof;
#X obj 92 396 output~;
#X msg 133 72 60;
#X obj 91 190 osc~;
#X obj 133 166 * 2;
#X obj 133 190 osc~;
#X obj 197 190 osc~;
#X obj 197 166 * 3;
#X obj 261 190 osc~;
#X obj 261 166 * 4;
#X obj 197 215 *~ 0.2;
#X obj 92 325 +~;
#X obj 133 295 *~;
#X obj 168 296 tgl 19 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000 0 1;
#X obj 133 246 +~;
#X obj 133 270 +~;
#N canvas 0 0 450 300 (subpatch) 0;
#X array tab.01.07 882 float 0;
#X coords 0 1.02 881 -1.02 200 130 1;
#X restore 417 261 graph;
#X text 320 165 frequencies of harmonics;
#X text 320 189 four oscillators;
#X text 324 214 adjust amplitudes;
#X text 168 269 add the three overtones together;
#X obj 138 360 tabwrite~ tab.01.07;
#X text 439 399 ---- 0.02 seconds ----;
#X obj 133 215 *~ 0.1;
#X obj 261 215 *~ 0.5;
#X text 77 9 ADDING SINUSOIDS TO MAKE A COMPLEX TONE;
#X obj 489 56 declare -stdpath ./;
#X obj 138 330 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X text 163 330 <-- click to graph;
#X text 188 295 <-- overtones ON/OFF;
#X text 169 72 <-- reset to middle C;
#X obj 133 44 loadbang;
#X text 176 99 <-- choose a different pitch;
#X text 431 650 updated for Pd version 0.4;
#X text 70 467 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 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 76;
#X text 70 603 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 77;
#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 24 0;
#X connect 7 0 11 0;
#X connect 8 0 7 0;
#X connect 9 0 25 0;
#X connect 10 0 9 0;
#X connect 11 0 15 1;
#X connect 12 0 2 0;
#X connect 12 0 22 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 24 0 15 0;
#X connect 25 0 16 1;
#X connect 28 0 22 0;
#X connect 32 0 3 0;
