Help With AD envelope

I am trying to build a simple Attack Decay envelope and get it to work on the mod.

The decay part is working as expected, however when I open the Attack, no sound comes through anymore.

The patch works in PD on a desktop when I use slider/button elements and a testtone

#X obj 119 379 *~;
#X obj 119 459 dac~;
#X obj 279 319 line~;
#X msg 259 259 1 \$2;
#X obj 249 158 pack f f;
#X msg 339 259 0 \$2;
#X obj 408 213 pack f f;
#X obj 359 159 delay \$2;
#X obj 279 359 pow~ 3;
#X obj 278 20 r attack @hv_param 1 1000 500;
#X obj 99 227 adc~;
#X obj 187 389 *~;
#X obj 72 20 r trigger @hv_param 0 1 0 trig;
#X obj 492 22 r decay @hv_param 1 1000 500;
#X connect 0 0 1 0 empty;
#X connect 2 0 8 0 empty;
#X connect 3 0 2 0 empty;
#X connect 4 0 3 0 empty;
#X connect 5 0 2 0 empty;
#X connect 6 0 5 0 empty;
#X connect 7 0 6 0 empty;
#X connect 8 0 0 1 empty;
#X connect 8 0 11 1 empty;
#X connect 9 0 4 1 empty;
#X connect 9 0 7 1 empty;
#X connect 10 0 0 0 empty;
#X connect 10 1 11 0 empty;
#X connect 11 0 1 1 empty;
#X connect 12 0 4 0 empty;
#X connect 12 0 7 0 empty;
#X connect 13 0 6 1 empty;

and this is the version with sliders to test:
#X obj 465 425 *~;
#X obj 465 505 dac~;
#X obj 625 365 line~;
#X msg 605 305 1 \$2;
#X obj 595 204 pack f f;
#X msg 685 305 0 \$2;
#X obj 754 259 pack f f;
#X obj 705 205 delay \$2;
#X obj 625 405 pow~ 3;
#X obj 533 435 *~;
#X obj 704 33 vsl 17 128 0 1000 0 0 empty empty empty 0 -9 0 10 #e4e4e4 #4d4d4d #4d4d4d 0 1;
#X obj 804 32 vsl 17 128 0 1000 0 0 empty empty empty 0 -9 0 10 #e4e4e4 #4d4d4d #4d4d4d 0 1;
#X obj 571 75 bng 25 250 50 0 empty empty empty 17 7 0 10 #e4e4e4 #4d4d4d #4d4d4d;
#X obj 386 191 noise~;
#X connect 0 0 1 0 empty;
#X connect 2 0 8 0 empty;
#X connect 3 0 2 0 empty;
#X connect 4 0 3 0 empty;
#X connect 5 0 2 0 empty;
#X connect 6 0 5 0 empty;
#X connect 7 0 6 0 empty;
#X connect 8 0 0 1 empty;
#X connect 8 0 9 1 empty;
#X connect 9 0 1 1 empty;
#X connect 10 0 4 1 empty;
#X connect 10 0 7 1 empty;
#X connect 11 0 6 1 empty;
#X connect 12 0 4 0 empty;
#X connect 12 0 7 0 empty;
#X connect 13 0 0 0 empty;
#X connect 13 0 9 0 empty;

Why are you using [pack] when you only care about one of the numbers? Just use a plain [f] instead?

it’s an adaption of miller pucketts examples/tutorials:

switching it to f doesn’t work.

Sorry but I don’t see it. Maybe start by doing something much simpler.

By the way the [delay $2] is never going to work. This $2 is normally used when initializing an abstraction, but your patch is not being initialized with any such number.

Learn about the difference of “dollar” in objects and messages here: Dollar signs in objects and messages | PURE DATA forum~

I inserted a bang after the trig and now it works perfectly. It seems the mod/heacy trigger param is not working the same way as the regular trigger.

This is the link:

1 Like

This is because it’s not supposed to. This “type” is to make the plugin-side behave a certain way. Nowhere is it said that it will output a bang event. It outputs a number, either 0 or 1.

As I said I don’t see how your patch relates to Millers ADSR tutorial.
And as you can clearly see he uses a [sel 0] on the “trigger” input, which will exactly output a bang when the number 0 is entered. (in this case I’d do a [sel 1] so you have a “rising edge” response)

Maybe try to actually follow this tutorial instead of randomly making changes that don’t make any sense?

And as I also said your use of $2 will not do anything (or rather it will initialize with the number 0).