If you want to visualise your adsr with [function] then you can change the values of existing points with a list of three numbers "
" as mentioned in the helpfile. You might want to set up some logic so that a point cannot pass another point, a "minimum"/"maximum" message to a [flonum] would achieve this.

Here’s an example of using the [function] object as a display and [flonum] boxes to set the points. The logic doesn’t allow a point to get too close to the next or previous point. If you want the [flonum]s to be modulated by an lfo, for example, you might want to look into using [scale] as well.

lh

– Pasted Max Patch, click to expand. –

Copy all of the following text. Then, in Max, select New From Clipboard.

Use [line~] or [curve~] on the [function] output and this will alter the envelope. If you want to display curved envelopes then perhaps you should look at Emmanuel Jourdan’s ej.function javascript which loads into a [jsui] it’s pretty special.

Use [line~] or [curve~] on the [function] output and this will alter the envelope. If you want to display curved envelopes then perhaps you should look at Emmanuel Jourdan’s ej.function javascript which loads into a [jsui] it’s pretty special.

Something like the patch below should work. The message formatting for [curve~] is detailed in the help file. It shouldn’t be too difficult if you want to set a different curve value for each break point too. The [scope~] object will give you some visual feedback if that’s what you’re after. There isn’t a built in way of showing the curves on something like [function] apart from the ej.function javascript I mentioned previously. You could try writing your own drawing instructions to an [lcd] though.

lh

– Pasted Max Patch, click to expand. –

Copy all of the following text. Then, in Max, select New From Clipboard.

I often just use [*~] on the output of [line~], essentially squaring the output to give a curvier envelope. However this means that the [function] object is showing misleading values on the y axis.

This made me think a bit about how to do something similar with the signal yet keep the points in [function] display as an accurate representation of the envelope level. Here’s what I’ve come up with. It uses two [function] objects, one as an input device and accurate display and another which isn’t, but will generate the correct signal when passed through [pow~].

lh

– Pasted Max Patch, click to expand. –

Copy all of the following text. Then, in Max, select New From Clipboard.

Probably best to head back to [curve~] to do this, the trick is to get the list you send to [curve~] correct. Here’s an example patch. Another cool thing is that you can get s-curves if you place a breakpoint midway on the diagonal lines and set the first curve factor positive and the second negative, for an exponential then logarithmic curve respectively. Obviously you need to add another inlet to your [pak] for each breakpoint there is in the [function] object. You could script this if you wanted it done automatically, or simply just set a maximum number and don’t use the extra inputs.

lh

– Pasted Max Patch, click to expand. –

Copy all of the following text. Then, in Max, select New From Clipboard.