ADSR experiment preset

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

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:


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.


CC envelope using Ch1 CC3

pipeline sketch description:

now partly out of date

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)
EDIT: bug since fixed

UPDATE: version1

29/04/24: now replaced by Version2

The patch now should follow the rules with overlapping notes:

Here’s some shots from my DAW…

notes separate

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…'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

See post 5

Version 2.1: Virtual Mappings and feature switches

Below are notes on the new Virtual Mapping version of the 2023 physical loopback ASDR patch

This version uses virtual mappings throughout which (as well as freeing up two ports) brings some extra advantages mentioned below

It keeps all the previous features, such as:

Being able to control ADR times and Sustain Level

and envelopes that behave predictably when…

… either released at different points in the timing…

… or interrupted by new notes:

In addition, existing features such as “curve style” and “scaling-by-velocity” have been made more accessible by adding virtual mapping switching.

This means 3 keys (default: note#124=Attack, 125=Decay, 126=Release) can each be pressed to cycle through the curve styles…

…while the ADSR amplitude can be left at 0-127 or scaled by the note velocity…

…by toggling another key (default: note#127)


The switching additions are quite expensive (21/77 pipes in total) but the live functionality may be worth it.
If pipes need to be saved, this line can just be removed or replaced with a multiple -stage mappings controlled by a 3 knobs)

In the next entry, I’ll discuss aspects of the virtual mapping set-up which I hope make it easier for users to adapt to their own controllers

1 Like

Virtual mapping set-up

there are some aspects of the virtual mappings that maybe worth noting:

“Anonymous Mappings”

In the past, mappings were “hard-wired” (as it were) to external ports and so to specific channels and CC numbers.

Virtual Mappings give us more freedom by letting us change these mapping messages in the patch itself.

This diagram hints how:

(see Note 1 below)

“Cycled State” mapping

The switches for the A/D/R “styles” work from a single key each.
This uses a technique involving Scale Remap where Attack, Decay & Release use up 3 “setting-notes” each.

As Scale Remap has 12 “setting-notes” available, this allows for four EQ settings for each stage should you want to augment the patch
(see Note 2 below)

Everything is self-contained

A brief glance at the patch shows two key aspects:

Firstly, all setting and trigger messages enter pipelines that end in Virtual G-OUT.
( Virtual G-IN is never used in the preset)
Secondly, all lines which create outgoing ADSR CC messages have no inputs (they all start with Generator LFOs).

This means that the preset is entirely self-contained: as long as any other use of Virtual G is either avoided (or filtered with care!), one need not worry about any interplay of CCs within the system.


Note 1

  • The 4-note range in the 3 Note Range Filters will match the In Low|High values in the Note Remap

  • Change the CC Remap In Low|High values to match your CCs. The second CC Remap refers to the 3rd CC value (this creates the Ch16 CC79 Sustain value.

  • CC Channels are unimportant as they’re remapped to CH16

Note 2

  • Transforms after the Scale Remap are in groups of 3:
    • First a ‘Disable’ + Next Note Ch16 CC,
    • next a Ch15 CC to enable one EQ then
    • finally a Ch14 CC to enable the other EQ

  • As hinted above, there is space for 4 different EQs should users wish. Extras can follow the same pattern.
    (In this patch the ADR generator lines share identical EQs. There may maybe use-cases where different EQs are best)

1 Like

Just been reminded to pick this up by @sdk75

…basically I had two ideas for further development seeing that a number of users have at least downloaded the VM version.

Basically, I know that patches like this are a bit intricate and so hard to extend or adapt, so I wanted to see if there is enough interest in any of the new idea to make it worth my while building them.

Now sdk75 has given me a 3rd, I’ll describe these each in the next posts and go by the number of likes as to which one (if any) to spend time on…

click more than one if you like

1 Like

Idea 1: @sdk75’s AD curve

@sdk75 will correct me if I’m wrong, but being an AD curve this one is:

  • not waiting for a Note Off release, just going straight into Decay

  • I’m assuming this decay would be back to zero so anyone wanting to have AD from and back to some other level would just do a Rescale afterward

  • assume also that would still be options for different EQ curves and velocity scaling

Obviously, this would allow losing of a couple of pipelines, but also (I think) some interconnecting mappings (things like “I’ve finished” and “I was at this level when I got interrupted”) which would make it simpler still.

Click :heart_decoration: if you’d fancy using this.

1 Like

Idea 2: Paraphonic ADSR

The current version is “monophonic” in that any new note will interrupt the previous curve if it’s still in progress.

A possible enhancement would be:

  • to use Dispatcher to allocate notes to more than one channel

  • each channel would have it’s own group of LFOs (which obviously then can run concurrently)

  • but would be the groups would be based on the same settings lines
    (ie. same EQ choices, timings, Sustain level, etc)

With this approach, I’d probably build 3 groups of LFOs and look at dropping some of the luxuries if it looked too big

Click :heart_decoration: if it sounds useful

Idea 3: Parallel ADSR

This is different from Idea 2 in that the patch is still monophonic but Note On triggers two independent ADSR curves with independent settings.

So this version might be used to to run curves on say cut-off frequency and resolution.
This patch could get big quick as it would seem to lend itself to other cool stuff like a delay for a given curve before it Attacks

Click :heart_decoration: if this sounds like your cup of tea!

PS. I’m aware that there are combinations like Idea2 with AD/ASR. Feel free to chip in…

3 posts were split to a new topic: Attack-Release Preset for Sidechain Simulation

I thought @sdk75’s project was sufficiently interesting to warrant of topic of it’s own