#N canvas 132 125 924 885 10; #X obj 224 777 dac~; #X obj 295 222 bng 15 250 50 0 empty empty trigger_envelope 17 7 0 10 -262144 -1 -1; #X obj 224 233 +~; #X floatatom 422 243 5 0 1000 1 attack_time_(linear) - -; #X floatatom 422 323 5 0 0 1 decay_time_(logarithmical) - -; #X obj 295 243 t b b; #X obj 407 423 f; #X floatatom 624 557 5 21 127 1 sustain_value_(midi) - -; #X obj 525 359 vsl 15 128 21 127 0 0 empty empty filter_max 20 3 1 9 -262144 -1 -1 10064 1; #X text 466 90 Warning : there are cold and hot inputs in some Pd objects ; #X text 465 109 The float object [f ] only outputs a value if the hot (left) inlet is triggered. Sending a value through the cold (right) inlet will only store it \, not output it.; #X obj 224 648 lop~; #X obj 224 675 lop~; #X obj 224 699 lop~; #X obj 224 723 lop~; #X obj 397 470 line; #X obj 397 680 *; #X obj 397 737 +; #X obj 397 534 *; #X obj 397 512 t f f; #X obj 397 578 *; #X obj 397 556 t f f; #X obj 624 596 t b f; #X obj 624 576 mtof; #X floatatom 676 593 5 0 0 1 sustain_freq - -; #X floatatom 565 490 5 21 127 1 filter_max_(midi) - -; #X obj 525 500 mtof; #X floatatom 565 517 6 0 0 1 filter_max_freq - -; #X msg 407 443 1 \, 0 \$1; #X msg 362 290 stop; #X obj 525 643 -; #X text 571 637 Subtract sustain value from filter_max; #X text 571 647 so sustain value doesn't affect the max setting; #X text 421 736 Add sustain value at the end; #X obj 750 199 loadbang; #X msg 760 306 3000; #X msg 750 540 60; #X text 392 289 stop decay when retriggering; #X msg 466 43 \; pd dsp 1; #X text 434 509 this; #X text 434 529 makes; #X text 434 539 the; #X text 434 549 curve; #X text 434 559 logarithmic; #X text 434 519 multiplication; #X obj 15 32 notein; #X obj 37 86 mtof; #X obj 57 133 nroute 0 2; #X obj 57 113 pack; #X msg 57 159 0; #X msg 114 159 \$1; #X text 6 133 note off; #X text 121 133 note on; #X obj 114 179 t b f; #X obj 15 59 poly 1 1; #X text 794 226 attack; #X text 794 305 decay; #X text 794 340 filter freq; #X text 794 540 filter sustain; #X text 67 54 use to retrigger; #X text 67 64 without cutting off; #X text 204 442 always add starting value of line; #X msg 760 226 0; #X text 144 808 you should still add a release which works the same as the decay and gets triggered by the note off.; #X obj 224 48 cnv 15 220 160 empty empty empty 20 12 0 14 -233017 -66577 0; #X obj 244 156 phasor~; #X floatatom 244 81 5 0 0 1 osc_freq - -; #X obj 322 156 phasor~; #X obj 322 176 -~ 0.5; #X obj 244 176 -~ 0.5; #X obj 322 136 *~; #X floatatom 337 80 5 -25 25 1 osc2_detune - -; #X obj 337 119 +~ 1; #X obj 337 99 /~ 1000; #X obj 337 26 loadbang; #X msg 244 53 220; #X text 13 9 MIDI IN; #X msg 337 53 7; #X obj 8 441 cnv 15 190 310 empty empty empty 20 12 0 14 -261682 -66577 0; #X obj 46 721 *~ 1; #X obj 46 522 *~; #X floatatom 124 486 5 0 200 0 - - -; #X obj 124 505 / 100; #X obj 67 659 *; #X obj 67 637 t f f; #X obj 67 701 *; #X obj 67 679 t f f; #X obj 46 542 hip~ 300; #X text 16 489 frequences; #X obj 67 617 *; #X obj 67 595 t f f; #X text 104 599 this; #X text 104 619 makes; #X text 104 629 the; #X text 104 639 curve; #X text 104 609 multiplication; #X text 104 659 logarithmic; #X text 104 649 extremely; #X text 16 449 add this; #X text 16 479 on lower filter; #X text 16 459 attack bypass for; #X text 16 469 extra attacks; #X obj 534 198 cnv 15 210 30 empty empty empty 20 12 0 14 -257985 -66577 0; #X text 542 199 attack uses a linear curve; #X text 542 209 decay uses a logarithmical curve; #X msg 760 340 105; #X obj 295 7 bng 15 250 50 0 empty empty hit_to_trigger_envelope_and_make_sound 17 7 0 10 -258113 -1 -1; #X obj 282 276 cnv 15 70 140 empty empty attack 20 12 1 12 -233017 -66577 0; #X obj 295 299 f; #X obj 295 339 line; #X obj 295 359 t f f; #X obj 295 386 sel 1; #X msg 295 319 0 \, 1 \$1; #X text 78 314 always add starting value of line; #X text 78 324 to retrigger envelope from start; #X text 184 385 start decay on 1; #X text 144 838 in this case make sure the note off gets delayed by the release time on the way to the phasor frequency "0".; #X connect 1 0 5 0; #X connect 2 0 11 0; #X connect 2 0 80 0; #X connect 3 0 108 1; #X connect 4 0 6 1; #X connect 5 0 108 0; #X connect 5 1 29 0; #X connect 6 0 28 0; #X connect 7 0 23 0; #X connect 8 0 25 0; #X connect 8 0 26 0; #X connect 11 0 12 0; #X connect 12 0 13 0; #X connect 13 0 14 0; #X connect 14 0 0 0; #X connect 14 0 0 1; #X connect 15 0 19 0; #X connect 16 0 17 0; #X connect 17 0 12 1; #X connect 17 0 13 1; #X connect 17 0 14 1; #X connect 17 0 11 1; #X connect 18 0 21 0; #X connect 19 0 18 0; #X connect 19 1 18 1; #X connect 20 0 16 0; #X connect 20 0 90 0; #X connect 21 0 20 0; #X connect 21 1 20 1; #X connect 22 0 17 0; #X connect 22 0 30 0; #X connect 22 1 17 1; #X connect 22 1 30 1; #X connect 23 0 22 0; #X connect 23 0 24 0; #X connect 26 0 27 0; #X connect 26 0 30 0; #X connect 28 0 15 0; #X connect 29 0 15 0; #X connect 30 0 16 1; #X connect 34 0 62 0; #X connect 34 0 35 0; #X connect 34 0 105 0; #X connect 34 0 36 0; #X connect 35 0 4 0; #X connect 36 0 7 0; #X connect 45 0 54 0; #X connect 45 1 54 1; #X connect 46 0 48 0; #X connect 47 0 49 0; #X connect 47 1 50 0; #X connect 48 0 47 0; #X connect 49 0 66 0; #X connect 50 0 53 0; #X connect 53 0 1 0; #X connect 53 1 66 0; #X connect 54 1 46 0; #X connect 54 2 48 1; #X connect 62 0 3 0; #X connect 65 0 69 0; #X connect 66 0 65 0; #X connect 66 0 70 0; #X connect 67 0 68 0; #X connect 68 0 2 1; #X connect 69 0 2 0; #X connect 70 0 67 0; #X connect 71 0 73 0; #X connect 72 0 70 1; #X connect 73 0 72 0; #X connect 74 0 77 0; #X connect 74 0 38 0; #X connect 75 0 66 0; #X connect 77 0 71 0; #X connect 79 0 0 0; #X connect 79 0 0 1; #X connect 80 0 87 0; #X connect 81 0 82 0; #X connect 82 0 80 1; #X connect 83 0 86 0; #X connect 84 0 83 0; #X connect 84 1 83 1; #X connect 85 0 79 1; #X connect 86 0 85 0; #X connect 86 1 85 1; #X connect 87 0 79 0; #X connect 89 0 84 0; #X connect 90 0 89 0; #X connect 90 1 89 1; #X connect 105 0 8 0; #X connect 106 0 75 0; #X connect 106 0 1 0; #X connect 108 0 112 0; #X connect 109 0 110 0; #X connect 110 0 111 0; #X connect 110 1 16 0; #X connect 110 1 79 1; #X connect 111 0 6 0; #X connect 112 0 109 0;