What are my options for curved envelopes
Hi,
I am looking for an adsr~ but with a curved logarithmic response. Is there a way to do this with out resorting to externals? I have been trying to cobble something together with curve~ but my lack of Max-fu is seriously letting me down, any masters care to lend a hand?
use buffers for each of the segments, then you can do the math totally in max.
Hi withakay
oooh curved envelopes, hours of endless fun. I'm certainly no master of Max-fu (maybe white belt). If you want a dynamically variable envelope, then the [curve~] object is cool. There are several variants on the hanning window approach - filling a buffer with samples to generate a curved window, and you can even roll your own. I've attached a patch demonstrating these three approaches, with citations too natch.
No doubt there are numerous other methods, but option anxiety is the killer!
Brendan
thanks for your replies, I shall investigate...
Here's a way to use [function] with [curve~] to set different curves for breakpoint transition, hopefully you'll find it useful!
@Luke
I think this is the closest to I want a want - or at least what I *think* I want ;)
Thanks
hi withakay. problem is none of the examples above are signal rate. just stick a [pow~] after the [adsr~] and use the the [adsr~] data to shift between 1. values. although if all you want is a steep exp slope to segments, [*~] the [adsr~] output with itself. in Max6 you will want to look at the rather fantastic [gen~] example "gen~.7_segment_envelope.maxpat". if signal rate does not matter, all the above are excellent examples. my fave for gui interface is to write the curve of [ej.function] to a [buffer~] and read through it with [index~] or whatever, or just a simple message to [curve~]. it is possible to build a very intricate adsr-like schedular driven system for use in midi-triggered poly~s etc with just [curve~].
well you must use the distortion funcction always on the given range, for example for the range
between volume of hold and volume of release (1.1 to 0.0)
it looks like Toshiro Yamada's sa.function might be useful.
starting points:
but you should really get gen~ - supersimple and awesome in gen~...
@pid
wow, very comprehensive! I actually discovered [change~] whilst I was trying to make a frequency divider and realised I could use that to simulate a signal rate 'bang' when the envelope move to a new stage I wasn't sure about how to do it, but you have an example in your pow-by-sections!
I am a little baffled by the sqrt example (I know it is a bad example anyway but), I don't see where you are getting a root from. Oh, I suppose selector input 1 is the root of input 2?
Anyway, I really appreciate the input (from everyone!) I have a lot to grok
just for laughs I present the naive solution I came up with before seeing the latest responses
in case you don't already have enough options, you should also check out the new jit.path object, which allows you define a series of points and will automatically calculate a spline path through those points.
you can also edit and visualize the path with the corresponding jit.gl.path object.
the help file should be enough to get you started.
let me know if you have any questions.
here is one solution with curve~. you can easily modify the attack, decay and release slopes. they can be either logarithmic or exponential, so it is no problem to generate an envelope from your picture. and it also has a sustain mode:)
Hi,
I made an external some time ago called [sadam.envelopeGenerator] to create curved functions automatically for the [function] object, which can be connected to [line~] then. You have to enter your function in [expr]-style and then the external will update your [function] accordingly. You can access it as part of the sadam library here: http://www.sadam.hu/software
Hope that helps,
Ádám