Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 97 lines (96 sloc) 2.74 KB
#N canvas 92 24 823 714 10;
#X obj 125 131 inlet;
#X obj 455 171 inlet;
#X text 121 106 trigger;
#X obj 125 159 sel 0;
#X obj 264 175 t b;
#X obj 186 284 f \$1;
#X obj 186 309 pack 0 \$2;
#X obj 512 171 inlet;
#X obj 458 301 del \$2;
#X obj 478 449 line~;
#X obj 482 324 f \$4;
#X obj 521 399 pack 0 \$3;
#X obj 574 171 inlet;
#X obj 636 171 inlet;
#X obj 709 170 inlet;
#X msg 125 190 stop;
#X obj 632 326 pack 0 \$5;
#X text 455 149 level;
#X obj 521 375 * \$1;
#X obj 478 474 outlet~;
#X text 122 398 and pack with;
#X text 123 418 attack time;
#X text 51 146 if zero;
#X text 52 163 release;
#X text 32 180 and cancel;
#X text 63 197 decay;
#X text 304 292 on attack \, set a;
#X text 298 325 recall sustain value;
#X text 335 398 pack with decay time;
#X text 625 352 on release ramp;
#X text 626 369 back to zero;
#X obj 482 349 * 0.01;
#X text 67 587 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 33 22 ADSR ENVELOPE;
#X text 508 149 attack;
#X text 575 148 decay;
#X text 629 149 sustain;
#X text 706 149 release;
#X text 222 91 attack;
#X obj 224 112 moses;
#X obj 214 142 t b b;
#X msg 148 310 0;
#X text 40 293 optionally;
#X text 30 311 bash to zero;
#X text 45 266 ATTACK:;
#X text 69 497 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 515 649 Updated for Pd version 0.37;
#X text 275 107 test for negative trigger;
#X text 273 133 if so \, zero;
#X text 274 149 the output;
#X text 298 185 in any case;
#X text 323 375 multiply by peak level;
#X text 300 306 delay for sustain;
#X text 296 348 convert from percent;
#X text 175 360 ... then;
#X text 123 379 recall peak level;
#X text 459 133 peak;
#X text 301 169 ... do this;
#X text 67 549 Negative triggers cause the output to jump to zero and
then attack (instead of attacking from the current location).;
#X text 228 21 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;