Forums > MaxMSP

function~ as adsr with flonums as parameters

March 31, 2009 | 6:51 pm

Hi,

Anyone help me with this?

Just want the function to be an adsr, and have flonums connected to it that I can modulate with velocity,lfos,stepsequencers etc

cheers


March 31, 2009 | 11:33 pm

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.

lh


March 31, 2009 | 11:38 pm

Great !

Thank you !


April 1, 2009 | 8:35 am
thereishopeforus@hotmail.com wrote on Tue, 31 March 2009 17:33
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.

lh

Hey,

Could I use a combination of append, prepend and set or setdomain?

Or something like pak and setrange?

Cheers


April 1, 2009 | 5:27 pm

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. –

April 7, 2009 | 5:47 pm

Great!

Thank you very much!

Is it possible to make this generate exponential curves?


April 7, 2009 | 6:20 pm

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.

lh

http://www.e–j.com/


April 7, 2009 | 7:17 pm
thereishopeforus@hotmail.com wrote on Tue, 07 April 2009 14:20

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.

http://www.e–j.com/

I recommend using this along with mxjcurve, too. This combination is the heart of a lot of my patches and I really appreciate the work emmanuel and martin put into them.

http://www.cycling74.com/twiki/bin/view/Share/MartinRobinson


April 9, 2009 | 7:19 pm
thereishopeforus@hotmail.com wrote on Tue, 07 April 2009 12:20
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.

lh

http://www.e–j.com/

Thanks,

Could you please show how you would "bend it" with curve~?

Would it also be possible to get visual feedback of this?

Cheers @ happey easter


April 9, 2009 | 8:55 pm

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. –

April 14, 2009 | 6:24 pm

Thanks a lot!

One tiny question, what object is best to use if I want to replace the sprintf object with something else?

Cheers


April 14, 2009 | 7:14 pm

Have a look at [pak]. Something like [pak 3 0. 0] with the [flonum] connected to the second inlet should do it.

lh


April 14, 2009 | 7:29 pm
Quote:
Is it possible to make this generate exponential curves?

this question comes up often here.

the easiest way would be to simply scale the output values.


April 14, 2009 | 8:38 pm

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. –

April 15, 2009 | 10:24 am

This is so helpful!

Is it possible to have only the decay stage exponential, and the
attack and release linear?


April 15, 2009 | 11:25 am

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. –

Viewing 16 posts - 1 through 16 (of 16 total)