Forever sustaining envelope

bbell's icon

Hey,

Quick question - how do I keep an [adsr~] object always open?

I'd prefer it to be always open and not a work around like [adsr~ 2. 1. 999999. 1.]

Thanks,
Brandon

dnk777's icon

hi,

could you explain how is that workaround meant? maybe i don't get what you are trying to do, or maybe you don't understand fully how ADSR envelopes work....
anyway, in ADSR, the Attack, Decay and Release numbers are time, while the Sustain value is a gain / amplitude at which it sustains until you release a key (until the ADSR~ object receives "0" value)
The envelope won't stay "open" longer if you write there 999999 for sustain.
The ADSR envelope stays open as long as you're holding a key. if you want it to sustain forever, then you just don't send the 0 after sending it 1. (but that doesn't make much sense to me, while you wouldn't need the envelope object at all probably. you could use some constant number in messagebox instead... maybe you want to prolong the release period? or?

brendan mccloskey's icon

Hi
you may need to use the [function] object instead as it provides for sustain points (if you ctl or shift click on a point I think).

Brendan

Mark Durham's icon

If you just want the attack can't you just use line~

?

bbell's icon

Yea I'm new to max so I'm probably not using the object properly. What I'm trying to do is have a 2-3 second attack so I can avoid this large amplitude spike that happens every time I used the csound~ object. I tried applying an envelope in my Csound code but I'm still occasionally getting the spike so I figure if I put it last in the chain before plugout~ it would help. After the initial attack though I want the envelope to stay open for the remainder of the time the plug-in is processing audio.

Thanks for the help

$Adam's icon

Then indeed [line~] is your friend...

Mark Durham's icon
Max Patch
Copy patch and select New From Clipboard in Max.

So you can do this:

And then have a [loadbang] trigger the fade up when the patch is loaded. I do this sometimes although I get the feeling it might be bad practice. Presuming the problem with csound~ can't be solved I'd be interested to know if anyone has a better solution.

bbell's icon

Thanks for the help guys.

Unfortunately I'm still having loud amplitude spikes when the patch loads... I have the line object fading in slowly right before the plugout~ object but it's not helping.... I'm not sure how to fix this and it's pretty annoying hearing the audio shoot into the red every time I load the plugin

Anyone else know of any tricks around this csound~/max4live error?

Roman Thilenius's icon

yeah, use line~or several of them if you want to build something ... custom.

adsr~ is more ... a workaround :)

-110

Peter McCulloch's icon

You want to post the csound~ code? Maybe something weird happening at init rate?

Mark Durham's icon

Forgot to mention that you can use [delay] to delay the bang to fade up. Better if you can fix the source of the problem though.