The unmusical linear adhsr device...

…it has no curvature, and sounds a bit clumsy when modulating reso filters with it. No dials to make the curve round, can’t be fixed, or…

Modulations have a multiplication option, so when you multiply two adhsr with the same settings, you get a really nice exponential curve with smooth transitions where the envelope makes a bend. Also linear envelopes with straight lines can work much better this way. The sustain needs to be compensated, though.

I have created a little synth patch to demonstrate this, and I’ve pushed it even further with a dial to fade in/out additional multiplications with attack/decay.

The macros should be self explanatory. ADSR with Env for Filter and reso, A, D and R are partially also followed by the amp env, the reso is also faded in/out with A and R stages. The last dial turns on/off filter release to zero cutoff (attack is always from zero cutoff), as the filters floor at 40 hz and when reso is high the release stage could often become a low ringing that doesn’t always work well. The A/D Curve dial defines the shape of the attack peak to errr…exponential from even more exponential…

I have to say I stumbled into a limit in renoise, each modulation slot (vol, cutoff, …) seems to only house a maximum of 12 devices in it. Too sad, I tried to make the curves even more configurable and experiment with the division options, but had to stop because of the limit. Sorry if the example is a bit complicated, I admit I got carried away with it.

But just watch the cutoff a/d shapes, they look nice and sound a lot better than the straight lines the adhsr device would usually come with!

For the record, this is how bending the lines also works the other way round with division, and also making the exponent easier to control via automating the multiplication floor.

Look at the cutoff mod, play with the curve knob…

My examples are probably ott, but you mostly only need to apply some setting statically to get a certain sound.

You know I have created a special topic about ’ all things enevelope ’ etc …

It’s indeed cumbersome to add a fader device just to get some curves .

The fader device and and adsr are in essence just the regular ( points ) envelope , with all it’s shortcomings ( speed ) , the developers have just adde some handy shortcuts ( AHDSR ) to change the underlying envelope engine .

It wouldn’t surprise me if these ( ahdsr , fader ) are LUA scripts .

It wouldn’t surprise me if these ( ahdsr , fader ) are LUA scripts .

No, that would be terrible for performance. A single voice taking advantage of all modulation sets could require almost 60 continuously evaluated devices (maximum of 12 per modulation chain). And with a theoretical maximum of almost a thousand virtually unlimitedvoices per instrument, you can see where that would lead…So, C/++ all the way.

The only places lua exists in Renoise are the obvious places: Tools, GlobalMIDI/OSCActions.lua and the Formula device.

Back to topic: yes, the current design could be improved without breaking the existing implementation: a shape parameter could be used for each of the stages, and the default “shape” would simply be 50% == linear (as current).

Is the advanced pattern tools not written in LUA btw?

Nope. Like I said, lua is only present in those places where you actually see (and can edit) code.

For Renoise, there isn’t really a huge advantage to creating native features in lua - if something changes between versions, you still need to maintain the code. And worse, with scripting you don’t get the advantages of a big IDE like Visual Studio that assists in navigating huge source trees, refactoring stuff and such. So if something breaks in Y because you modified X, you’re less likely to discover this in time.

A simple solution for getting some nice curves on the AHDSR is to make a chain of two instances of the AHDSR and use macros to control them both at once (same values). If both is set to multiply you should get a logarithmic curve because the AHDSR is multiplied by itself.

Yes, I just wanted to demonstrate some tricks on how to tune/tweak the curves (with 2 operands mul and add in the chain or by tweaking the from/to parameters) to get custom shapes. I don’t want to always make them automatable like this, also because of the 12 devices limit and because it is big brainfuck.

A parameter to bend each adhsr segment and faders and maybe line envelopes, LFO, Automation and all this would be cool, yes. I imagine it like my second little example, but by default with a 0.5 centered slider associated with each segment.

And haha high res modulation via lua is not the thing I’d want to put on my cpu. Even pure C can be slow in this, if you don’t approximate stuff like divisions, logarithms, pow and such by multiplication only silimar curves - the audio difference will be little, and for a filter cutoff or amp env I’d not really need the exact curves, just the same tendency and snapness.

Also I found no way yet to use the division trick on the release stage, while here such a log curve that first starts reducing slow and then faster to the end would be a very natural thing for me