ADSR...well sort of

This topic covers an experimental ADSR patch uploaded to patchstorage, giving a few details and describing its current limitations.


Intro
There have been a few requests for native ADSR pipe or similar (mostly recently here and here, I think).
Users like @ahnatek have also wondered about a workaround in the meantime.

This patch is my first attempt to get Midihub to produce an ADSR CC envelope like this:

or this:

UPDATE: skip to here to see details on updated version
(overlapping notes issues described below solved)




It ain’t perfect
There are current limitations, however, which stop it being widely useful in its current form.

These include...



An envelope must ‘complete’ before the next one starts:
Ideally, a new note would behave like this…


…where a new envelope would “cut off” any currently running one.

This is what happens instead:


!


It’s (obviously?) monophonic!
As it outputs one set CC, even if the above issue were solved the envelope would apply to both notes, so amp & filter envelopes wouldn’t behave as we might expect in a polyphonic setting.

LFO output limits resolution
The max LFO resolution is 128Hz. This means that, once a “ramp” is less than a sec, the LFO will have fewer steps and become more “bitty”.
It also means finding the best “threshold” to transition from Attack → Decay is a bit approximate

If you think this limited solution might be for you, read on!

1 Like

Here’s the briefest of details for how the patch (sort of) works:

Inputs

4 CC controls Ch16 77-80: Attack Time, Decay Time, Sustain Level, Release Time to set
(easily changed by CC Remap in Line 3&4)

A note_on, note_off pair to trigger envelope.

Output

CC envelope using Ch1 CC3


pipeline sketch description:

now partly out of date

Modifiers
Equalizer pipes in LFO lines can be enabled/disable/changed to give non-linear ramps
Equalizer pipe in “ADR time” line is critically linked to the “Attack → Decay” threshold value and both will need tweaking if changed!


I’ll give more detail if requested, but won’t bother for now as it takes time…

Feedback welcome!

not least if you come across this bug giving unexpectedly results (think I can fix that)

UPDATE: version1

The patch now should follow the rules with overlapping notes:

Here’s some shots from my DAW…

As I said in my patch notes, not tested much yet, but this is moving toward a workable “proof of concept” at least.


the mappings to get this far get pretty nasty

I’ll write a proper explanation if requested, but in the mean-time…

...here's the debug diagram I made for myself...

With the diagram in post 1 it’s possible to figure out what the hell’s going on