#N canvas 345 295 743 348 10; #X obj 140 75 vsl 20 128 0 100 0 0 \$0-a \$0-ain attack 20 -8 1729 8 -355 -260818 -143491 1270 1; #X obj 219 75 vsl 20 128 0 200 0 0 \$0-d \$0-din decay 20 -8 1729 8 -355 -260818 -143491 12700 1; #X obj 289 75 vsl 20 128 0 1 0 0 \$0-s \$0-sin sustain 20 -8 1729 8 -355 -260818 -143491 6350 1; #X obj 362 75 vsl 20 128 0 500 0 0 \$0-r \$0-rin release 20 -8 1729 8 -355 -260818 -143491 7620 1; #X floatatom 140 213 5 0 0; #X floatatom 219 213 5 0 0; #X floatatom 289 213 5 0 0; #X floatatom 362 213 5 0 0; #X obj 24 434 inlet; #X obj 24 484 outlet~; #X obj 539 71 hsl 128 15 0 1 0 0 \$0-level \$0-levelin level 20 8 1729 8 -62784 -228992 -262144 12581 1; #X floatatom 536 93 5 0 0; #X obj 233 461 inlet; #X obj 332 461 inlet; #X obj 404 461 inlet; #X obj 476 461 inlet; #X obj 547 461 inlet; #X obj 233 486 s \$0-levelin; #X obj 332 486 s \$0-ain; #X obj 404 486 s \$0-din; #X obj 476 486 s \$0-sin; #X obj 547 486 s \$0-rin; #X floatatom 140 38 5 0 0; #X floatatom 219 38 5 0 0; #X floatatom 289 38 5 0 0; #X floatatom 362 38 5 0 0; #X obj 349 388 loadbang; #X obj 349 435 unpack 0 0 0 0 0; #X obj 349 411 pack \$1 \$2 \$3 \$4 \$5; #N canvas 0 0 600 400 envelope 0; #X obj 173 134 r \$0-level; #X obj 252 135 r \$0-a; #X obj 307 134 r \$0-d; #X obj 361 133 r \$0-s; #X obj 413 132 r \$0-r; #X obj 117 169 inlet; #X obj 176 292 outlet~; #N canvas 231 224 600 400 adsr 0; #X text 52 50 This patch is used as an abstraction in 25.envelope.pd ; #X obj 95 108 inlet; #X obj 298 111 inlet; #X text 91 79 trigger; #X obj 95 138 sel 0; #X obj 144 138 t b; #X obj 104 334 f \$1; #X obj 104 359 pack 0 \$2; #X obj 362 112 inlet; #X obj 309 301 del \$2; #X obj 371 422 line~; #X obj 338 324 f \$4; #X obj 371 369 pack 0 \$3; #X obj 410 112 inlet; #X obj 459 111 inlet; #X obj 504 111 inlet; #X msg 95 191 stop; #X obj 517 360 pack 0 \$5; #X text 378 86 Traditional A \, D \, S \, R; #X text 296 88 level; #X obj 364 346 * \$1; #X text 32 302 ATTACK; #X obj 371 449 outlet~; #X text 7 325 recall level; #X text 7 345 and pack with; #X text 8 365 attack time; #X text 28 124 if zero; #X text 29 141 release; #X text 17 183 and cancel; #X text 17 199 decay; #X text 148 120 bang if attack; #X text 183 294 on attack \, set a; #X text 147 307 delay to go to sustain; #X text 189 324 recall sustain value; #X text 185 347 multiply by overall level; #X text 220 370 pack with decay time; #X text 510 386 on release ramp; #X text 511 403 back to zero; #X text 63 12 adsr - arguments: level \, attack time \, decay time \, sustain level \, release time; #X text 17 487 When you send this patch a nonzero trigger it schedules a line~ to do an attack and decay \, and if zero \, it starts the release ramp.; #X text 18 533 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 update them on the fly.; #X connect 1 0 4 0; #X connect 2 0 6 1; #X connect 2 0 20 1; #X connect 4 0 16 0; #X connect 4 0 17 0; #X connect 4 1 5 0; #X connect 5 0 6 0; #X connect 5 0 9 0; #X connect 6 0 7 0; #X connect 7 0 10 0; #X connect 8 0 7 1; #X connect 8 0 9 1; #X connect 9 0 11 0; #X connect 10 0 22 0; #X connect 11 0 20 0; #X connect 12 0 10 0; #X connect 13 0 12 1; #X connect 14 0 11 1; #X connect 15 0 17 1; #X connect 16 0 9 0; #X connect 17 0 10 0; #X connect 20 0 12 0; #X restore 176 238 pd adsr -----------; #X connect 0 0 7 1; #X connect 1 0 7 2; #X connect 2 0 7 3; #X connect 3 0 7 4; #X connect 4 0 7 5; #X connect 5 0 7 0; #X connect 7 0 6 0; #X restore 24 459 pd envelope; #X connect 0 0 4 0; #X connect 1 0 5 0; #X connect 2 0 6 0; #X connect 3 0 7 0; #X connect 8 0 29 0; #X connect 10 0 11 0; #X connect 12 0 17 0; #X connect 13 0 18 0; #X connect 14 0 19 0; #X connect 15 0 20 0; #X connect 16 0 21 0; #X connect 22 0 0 0; #X connect 23 0 1 0; #X connect 24 0 2 0; #X connect 25 0 3 0; #X connect 26 0 28 0; #X connect 27 0 17 0; #X connect 27 1 18 0; #X connect 27 2 19 0; #X connect 27 3 20 0; #X connect 27 4 21 0; #X connect 28 0 27 0; #X connect 29 0 9 0;