#N canvas 371 139 1004 655 12; #X obj 105 111 inlet; #X obj 435 151 inlet; #X text 101 86 trigger; #X obj 105 139 sel 0; #X obj 244 155 t b; #X obj 166 264 f \$1; #X obj 166 289 pack 0 \$2; #X obj 492 151 inlet; #X obj 438 281 del \$2; #X obj 458 429 line~; #X obj 462 304 f \$4; #X obj 501 379 pack 0 \$3; #X obj 554 151 inlet; #X obj 616 151 inlet; #X obj 689 150 inlet; #X msg 105 170 stop; #X obj 612 306 pack 0 \$5; #X text 435 129 level; #X obj 501 355 * \$1; #X obj 458 454 outlet~; #X text 102 378 and pack with; #X text 103 398 attack time; #X text 31 126 if zero; #X text 32 143 release; #X text 12 160 and cancel; #X text 43 177 decay; #X text 284 272 on attack \, set a; #X text 278 305 recall sustain value; #X text 315 378 pack with decay time; #X text 605 332 on release ramp; #X text 606 349 back to zero; #X obj 462 329 * 0.01; #X text 47 567 Objects such as "f" and "pack" can be given dollar sign arguments to initialize their contents from adsr's creation arguments. Inlets are supplied to change them on the fly.; #X text 13 2 ADSR ENVELOPE; #X text 488 129 attack; #X text 555 128 decay; #X text 609 129 sustain; #X text 686 129 release; #X text 202 71 attack; #X obj 204 92 moses; #X obj 194 122 t b b; #X msg 128 290 0; #X text 20 273 optionally; #X text 10 291 bash to zero; #X text 25 246 ATTACK:; #X text 49 477 When you send this patch a positive trigger it schedules a line~ to do an attack and decay \, and if zero \, it starts the release ramp.; #X text 495 629 Updated for Pd version 0.37; #X text 255 89 test for negative trigger; #X text 253 113 if so \, zero; #X text 254 129 the output; #X text 278 165 in any case; #X text 303 355 multiply by peak level; #X text 280 286 delay for sustain; #X text 276 328 convert from percent; #X text 155 340 ... then; #X text 103 359 recall peak level; #X text 439 113 peak; #X text 281 149 ... do this; #X text 47 529 Negative triggers cause the output to jump to zero and then attack (instead of attacking from the current location).; #X text 208 1 Arguments: level \, attack time \, decay time \, sustain level \, release time. A \, D \, and R are in msec and S is in percent. This patch is used as an abstraction in various examples.; #X connect 0 0 3 0; #X connect 1 0 5 1; #X connect 1 0 18 1; #X connect 3 0 15 0; #X connect 3 0 16 0; #X connect 3 1 39 0; #X connect 4 0 5 0; #X connect 4 0 8 0; #X connect 5 0 6 0; #X connect 6 0 9 0; #X connect 7 0 6 1; #X connect 7 0 8 1; #X connect 8 0 10 0; #X connect 9 0 19 0; #X connect 10 0 31 0; #X connect 11 0 9 0; #X connect 12 0 11 1; #X connect 13 0 10 1; #X connect 14 0 16 1; #X connect 15 0 8 0; #X connect 16 0 9 0; #X connect 18 0 11 0; #X connect 31 0 18 0; #X connect 39 0 40 0; #X connect 39 1 4 0; #X connect 40 0 4 0; #X connect 40 1 41 0; #X connect 41 0 9 0;