#N canvas 728 250 890 618 12; #X obj 287 57 ctlin; #X obj 287 155 pack f f; #X obj 287 124 f; #X obj 287 92 t b f; #X obj 287 191 route 1 2 3 4; #X text 342 94 Gymnastics to ensure a control byte is packed with controller number first, f 28; #X obj 201 76 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1; #X obj 201 96 sel 1 0; #X obj 250 295 pack f f f; #X obj 250 265 f; #X msg 250 325 0 \, 1 \$1 \, \$3 \$2 \$1; #X text 388 310 Attack \, Decay and Sustain stage \; Immediately from 0 to 1 in A ms \; Then drop to S in D ms after waiting A ms; #X msg 335 426 0 \$1; #X text 388 425 Release stage \; Drop to 0 in R ms; #X obj 251 489 vline~; #X text 61 74 Note On/Off toggle; #X text 394 185 Route controller values by their CC# \; Arbitrary controller numbers chosen here \; Change to fit your setup \; Here they are interpreted as A \, D \, S \, R \, in that order; #X obj 335 398 f; #X connect 0 0 3 0; #X connect 0 1 2 1; #X connect 1 0 4 0; #X connect 2 0 1 0; #X connect 3 0 2 0; #X connect 3 1 1 1; #X connect 4 0 9 1; #X connect 4 1 8 1; #X connect 4 2 8 2; #X connect 4 3 17 1; #X connect 6 0 7 0; #X connect 7 0 9 0; #X connect 7 1 17 0; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 10 0 14 0; #X connect 12 0 14 0; #X connect 17 0 12 0;