#N canvas 502 38 525 784 12;
#X declare -stdpath ./;
#X obj 133 478 mtof;
#X obj 141 390 notein;
#X obj 224 536 line~;
#X msg 224 505 \$1 100;
#X obj 133 700 output~;
#X obj 133 623 *~;
#X obj 133 505 phasor~;
#X obj 133 529 -~ 0.5;
#X obj 133 571 cos~;
#X obj 206 592 *~;
#X obj 133 595 +~ 1;
#X obj 206 640 cos~;
#X text 92 457 pitch;
#X obj 133 656 *~;
#X obj 224 478 / 127;
#X obj 206 616 *~ 2;
#X obj 224 565 +~ 0.5;
#X text 279 529 envelope generator now controls amplitude as well as grain size, f 22;
#X obj 305 721 declare -stdpath ./;
#X text 54 245 The synthesis technique is the same as in the previous patch \, done in a simpler (but less general) way with a [cos~] object replacing the wavetable lookup., f 58;
#X obj 107 428 poly 1 1;
#X text 210 447 velocity;
#X msg 155 326 55 64;
#X msg 248 326 55 0;
#X msg 107 326 48 64;
#X msg 205 326 48 0;
#X msg 53 326 48 128;
#X listbox 107 362 7 0 0 0 - - - 0;
#X text 54 144 The [poly] object is actually better suited to handle polyphony \, but you can set it to a single voice with the first argument and ignore the left outlet output. The second argument sets the object to "voice stealing" so new pressed notes will replace previous ones that are still pressed (which can then get released without interfering)., f 58;
#X text 295 318 These simulate MIDI messages, f 15;
#X text 54 53 This patch shows how to make a monophonic synthesizer that could be controlled from a MIDI keyboard. First \, at top \, incoming MIDI notes are parsed via the [poly] object and used to set pitch and trigger an attack/release envelope. You can use your MIDI keyboard with [notein] to test it or the messages below.;
#X text 250 601 This replaces the [tabread4~] in the previous patch (the [+~ 0.5] and [*~ 2] are fudge factors)., f 33;
#X obj 69 14 cnv 5 5 25 empty empty Monophonic\ MIDI\ Synth 15 13 0 16 #dfdfdf #202020 0;
#X connect 0 0 6 0;
#X connect 1 0 20 0;
#X connect 1 1 20 1;
#X connect 2 0 13 1;
#X connect 2 0 16 0;
#X connect 3 0 2 0;
#X connect 5 0 13 0;
#X connect 6 0 7 0;
#X connect 7 0 9 0;
#X connect 7 0 8 0;
#X connect 8 0 10 0;
#X connect 9 0 15 0;
#X connect 10 0 5 0;
#X connect 11 0 5 1;
#X connect 13 0 4 0;
#X connect 14 0 3 0;
#X connect 15 0 11 0;
#X connect 16 0 9 1;
#X connect 20 1 0 0;
#X connect 20 2 14 0;
#X connect 22 0 27 0;
#X connect 23 0 27 0;
#X connect 24 0 27 0;
#X connect 25 0 27 0;
#X connect 26 0 27 0;
#X connect 27 0 20 0;
