Morphing function envelope

observer's icon

Hi all i'm trying to do morphing envelope with function, what i would like to do is to have one control, from 0 to 10, and start with a sharp attack, when the control is on the 5 the envelope could be a triangle and finally at 10 smooth attack and sharp decay. I post a picture of what i want to do, and a starting patch i made. There is a way to do that? Maybe with pattrstorage, save the envelopes, but it's a bit tricky...

Thanks in advances for your help.

Morphing-function.maxpat
Max Patch
Schermata-2015-10-15-alle-16.11.48.png
png
benniy's icon
Max Patch
Copy patch and select New From Clipboard in Max.

hei observer,
dunno if i really get it, but what you're trying to do sounds like simple interpolation.

observer's icon

Thanks a lot benniy...very useful patch.

observer's icon

But now i've the problem that i would like to create same envelopes of the pic, maybe i have to use expr or something like that to have the right rapports between the envelopes, hope that you understand what i mean, sorry for the noob questions

Roman Thilenius's icon

as long as you want to build exactly what is in your picture and you will never need dozens of variables, expr could be your friend.

but if this is for an audio envelope i would rather do it in all-signal - and just modulate the time/gain parameter pairs of the envelope, like it is done in any digital synthesizer since ever.

observer's icon

Thanks Roman for the answer, yes it's for an audio envelope, i'm trying to re-create the moogerfooger midi murf effect and that's the envelope for each filter, with a control called envelope i want to change it like the picture, i don't know how to do it all-signal, maybe with adsr~?? in fact the time of all the envelope as well have to be variable, cause the envelope is triggered by a 8 step sequencer, and of course as the rate time increases the envelope time decreases...

Roman Thilenius's icon

build it around line msp ... perfect for multi point envelopes. use zl reg to store the list of time/gain pairs, then trigger form there.

observer's icon

You mean using line~ ?? ok i will try with it..

Roman Thilenius's icon

basic envelope generator.
you might want to add a [pak 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] in front of it.
for "list in line format" see line msp help file.

110.envelope.zip
zip
observer's icon

Thanks a lot really helpful patch, but i think i'm missing something, i want to control the morphing of the envelope with just one knob, to do that i have to calculate rapports between the various envelopes of the pic, i mean like when the control is to 0 the signal goes from zero to 1 in (x) seconds and from 1 to 0 in (y) seconds. I really cannot figure how to draw the envelopes like the pic with list.

observer's icon

Ok it's just a question of time, i have to calculate how increase time respectively of attack and release the way to draw the shape that i want, because my envelopes goes always from 0 to 1 and from 1 to 0,

observer's icon

I've a problem, if i increase time do draw the shape envelope, how i can make the rate parameter? i mean like a global time parameter that controls sequencer time and envelope time, if i increase time in the list of [line~] the shape changes, and i want that it changes when i modify the envelope parameter,

observer's icon

Maybe i can use function to do the list in this way i can change the domain as my global envelop time

Roman Thilenius's icon

i know you only want to use one knob. the way to this magic place is to first conrol how the individual points (parameter pairs) should change, then link them.

i am not too fond of the function gui object, but you canuse that at least to check out what the paramters are you want. to do so, set the time of the function to 100, 1000, or 10000 so that you can easily calculate down to 0.-1. or "percent" or whatever you wish.

observer's icon

Sorry for the delay Roman, iìve tried with the function object but it works not good, i tried using the envelope that you post time ago in the forum, which use the zl reg object and the route for the list, but sometimes the envelope doesn't work, and it stays at 1 of decay and let pass all the sound as if there were no envelope...i can post the patch when i finish work so you can take a look