#N canvas 424 19 448 637 10;
#X obj 22 484 mtof;
#X obj 22 433 stripnote;
#X obj 173 489 select;
#X obj 164 383 float;
#X obj 173 351 t b f;
#X obj 173 457 float;
#X text 215 340 f - store pitch below;
#X text 208 383 velocity stored here;
#X text 137 429 off;
#X text 213 456 recall pitch;
#X obj 22 310 unpack;
#X obj 22 243 notein;
#X obj 22 270 pack;
#X obj 103 540 line~;
#X msg 103 514 \$1 100;
#X msg 173 515 0 1000;
#X text 20 79 First \, at top \, incoming MIDI notes are parsed and
used to set pitch and trigger an ADSR envelope. Second \, the envelope
generator itself has been extended to offer controls over the time
and target values via number boxes.;
#X text 19 36 This patch shows how to make a monophonic synthesizer
that could be controlled from a MIDI or voltage-control keyboard--in
this example we assume MIDI.;
#X msg 161 260 55 64;
#X msg 161 286 55 0;
#X msg 104 261 48 64;
#X msg 104 287 48 0;
#X text 20 132 The note-off testing is complicated by the fact that
we have to test both that the velocity is zero \, and further that
the note-off pitch matches the pitch that is now playing (the most
recent note-on pitch.);
#X text 215 356 b - bang to recall velocity;
#X obj 164 412 sel 0;
#X text 186 433 on;
#X obj 25 682 output~;
#X obj 24 658 hip~ 5;
#X obj 23 612 *~;
#X obj 22 511 phasor~;
#X obj 22 535 -~ 0.5;
#X obj 23 563 cos~;
#X obj 111 587 *~;
#X obj 23 587 +~ 1;
#X obj 111 635 cos~;
#X msg 104 238 48 128;
#X text 27 461 pitch;
#X text 28 413 messages;
#X text 209 412 test for note on or off;
#X text 220 490 test against latest;
#X text 263 505 note-on pitch;
#X text 27 377 filter;
#X text 28 395 note-on;
#X obj 24 634 *~;
#X obj 103 487 / 127;
#X text 19 185 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.;
#X text 145 540 envelope generator now controls amplitude;
#X text 284 558 as well as grain size;
#X obj 111 611 *~ 2;
#X obj 132 564 +~ 0.5;
#X text 157 657 The +~ 0.5 and *~ 2 are fudge factors.;
#X text 157 618 This replaces the tabread4~;
#X text 155 638 in the previous patch.;
#X text 201 260 These buttons simulate MIDI input.;
#X obj 1 1 cnv 15 445 20 empty \$0-pddp.cnv.header monophonic_MIDI_synth
20 10 1 18 -261139 -33289 0;
#X obj 407 2 pddp/pddplink http://puredata.info/dev/pddp -text pddp
;
#X obj 1 747 cnv 15 445 20 empty \$0-pddp.cnv.footer empty 20 12 0
14 -233017 -33289 0;
#N canvas 44 246 494 284 META 0;
#X text 12 125 WEBSITE http://crca.ucsd.edu/~msp/;
#X text 12 105 AUTHOR Miller Puckette;
#X text 12 85 LIBRARY PDDP;
#X text 12 5 GENRE tutorial;
#X text 12 45 LICENSE SIBSD;
#X text 12 145 HELP_PATCH_AUTHORS Updated for release 0.37. Jonathan
Wilkes revised the patch to conform to the PDDP template for Pd version
0.42.;
#X text 12 25 KEYWORDS MIDI;
#X text 12 65 DESCRIPTION monophonic MIDI synth;
#X restore 392 749 pd META;
#N canvas 13 202 428 190 References 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -261139 -33289 0;
#X text 19 37 links:;
#X text 7 2 MIDI synth- Related Help Documents;
#X restore 103 749 pd References;
#X obj 6 749 pddp/pddplink ../5.reference/pddp/help.pd -text help;
#X connect 0 0 29 0;
#X connect 1 0 2 1;
#X connect 1 0 0 0;
#X connect 2 0 15 0;
#X connect 3 0 24 0;
#X connect 4 0 3 0;
#X connect 4 1 5 1;
#X connect 5 0 2 0;
#X connect 10 0 1 0;
#X connect 10 0 4 0;
#X connect 10 1 1 1;
#X connect 10 1 3 1;
#X connect 11 0 12 0;
#X connect 11 1 12 1;
#X connect 12 0 10 0;
#X connect 13 0 43 1;
#X connect 13 0 49 0;
#X connect 14 0 13 0;
#X connect 15 0 13 0;
#X connect 18 0 10 0;
#X connect 19 0 10 0;
#X connect 20 0 10 0;
#X connect 21 0 10 0;
#X connect 24 0 5 0;
#X connect 24 1 44 0;
#X connect 27 0 26 0;
#X connect 27 0 26 1;
#X connect 28 0 43 0;
#X connect 29 0 30 0;
#X connect 30 0 32 0;
#X connect 30 0 31 0;
#X connect 31 0 33 0;
#X connect 32 0 48 0;
#X connect 33 0 28 0;
#X connect 34 0 28 1;
#X connect 35 0 10 0;
#X connect 43 0 27 0;
#X connect 44 0 14 0;
#X connect 48 0 34 0;
#X connect 49 0 32 1;
