function~ as adsr with flonums as parameters

Mar 31, 2009 at 6:51pm

function~ as adsr with flonums as parameters

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

#43126
Mar 31, 2009 at 11:33pm

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

#154638
Mar 31, 2009 at 11:38pm

Great !

Thank you !

#154639
Apr 1, 2009 at 8:35am
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

#154640
Apr 1, 2009 at 5:27pm

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. –
#154641
Apr 7, 2009 at 5:47pm

Great!

Thank you very much!

Is it possible to make this generate exponential curves?

#154642
Apr 7, 2009 at 6:20pm

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/

#154643
Apr 7, 2009 at 7:17pm
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

#154644
Apr 9, 2009 at 7:19pm
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

#154645
Apr 9, 2009 at 8:55pm

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. –
#154646
Apr 14, 2009 at 6:24pm

Thanks a lot!

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

Cheers

#154647
Apr 14, 2009 at 7:14pm

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

lh

#154648
Apr 14, 2009 at 7:29pm
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.

#154649
Apr 14, 2009 at 8:38pm

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. –
#154650
Apr 15, 2009 at 10:24am

This is so helpful!

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

#154651
Apr 15, 2009 at 11:25am

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

You must be logged in to reply to this topic.