The quest for the red curve (ADSR)

    * The quest for the red curve of the ADSR node *

    It took me some time to realize that the red curve shape of the ADSR node was not the actual shape but that the node output was linear instead. And I wanted that shape so I decided to try something.

    In this thread, I define this shape as log-exp-exp (log for A and exp for D and R).

    A popular way to create "exponential" shapes on this forum is to multiply the node output by itself. This is very effective and cheap cpu-wise but it's only satisfactory for very fast attacks and low or high sustain. See the next figure:


    On the first row, the ADSR node output. On the second row, the multiply trick. The release shape is correct but the attack section is exp instead of log and the decay is almost linear (something that is not true anymore for a very low sustain).

    I also tried other users EGs without luck (but perhaps I just couldn't understand how they work?).

    This red curve shape comes from the RC filters used in analog envelope generators. So I started this project by doing an EG using the 1-pole LP filter node. It works but it's not very handy, since you lose control on the timing and curve shapes. However I used this model to fit very simple polynomial functions of the general form (t/X)^s (with t:time, X: the section time and s: the curve shape parameter). This produces an ADSR with a timing control similar to the ADSR node + curve shaping control. The red curve shape is correctly reproduced, with the added benefit of a WYSIWYG interface (for default curve settings, see the third row). The min values for A is 0.5 ms and 1 ms for D and R.

    On the lower part of the figure are displayed the whole ranges of curve shapes you can choose for each sections. Note that the timing is identical whatever you choose.


    I also added some bonuses:

    - punch: adds a short pulse to the attack section. Inactive for A > 10 ms. Efficient for filter EGs.
    - oomph: inspired from the retrigger response of the minimoog. See this link:

    "the re-trigger behaviour is quite unique, multiple retriggering increases the output level so that either the volume increases incrementally or the filter opens incrementally with each extra key press"

    See the second figure (first the punch mode, then the retrigger response control)

    Contrary to the hardware, you have control on that retriggering response, from subtle to over the top, depending on the sound you're working on.

    *Warning* This ADSR can and will produce signals above 1. Be careful and protect accordingly your patch/speakers.

    I really like this setting, it adds dynamic to the sound without even using velocity. From Gordon Reid's review of the model D reissue:

    "Many players seem unaware of this, but it can be a huge benefit because, to an extent, it imitates the way that players of acoustic instruments such as brass, woodwind and strings tend to play a bit louder and a bit more brightly when playing rapidly."

    - multi-trigger: if active, as long as the trigger input gets a key trigger signal, the EG will be triggered each time a key is pressed. Otherwise, the EG will only be triggered if all keys have been released before a new note is played. For this mode to work you have to connect a key trigger generator to the trigger input. There is one below, but perhaps something else exists already.

    Use this mode for fast, non-legato mono-synth plays. See synth secrets #7 and figure 8 for more explanations.

    Please note that this ADSR is cpu heavy, so use it only when truly needed (or if cpu is not a problem!).

    In the first audio example, both punch and oomph modes are used. Note the extra dynamic without using velocity. On the second audio example, exp-log-exp ADSR shapes are used to give some interesting evolutions to the sound. Everything is 100% Audulus, recorded on iOS.

    Edit: changed the title for a better one
    1536 x 2048 - 306K
    Key trigger.audulus
    2048 x 1536 - 228K
    Adjustable ADSR.audulus
  • Brilliant!

    Not sure which I enjoy the most - the ADSR that feels "old school" (or better!) to me, or the explanation I can understand!! :-)

    Thank you SansNom!

  • Thanks @DS_in_the_ATX (very fast read BTW ;) )

    There are bugs though in the shortcuts in the text, I can't figure out what's the prb.
  • VERY NICE! Thanks for sharing :) I've been wondering how to do this myself for a long time...
  • @SansNom Thanks for the excellent tool! The retriggering is also a nice touch. What I find interesting is that these old moog envelope generators have an exponential response but display a log-exp-exp shape. @Lagomorph said elsewhere on these forums that the shape wasn't really logarithmic but inverted exponential behavior, I'm not sure what that even means really but it is consistent with how AHJ describes the behavior. BUT on the 0-Coast the exponential parameter symmetrically affects rising and falling voltages such that they look like you have multiplied the linear envelope by itself. On the whole I like the wysiwyg approach and I will be sure to play with this guy soon :)

  • @biminiroad - Thanks, it took me some time as well...
    @RobertSyrett - Thanks for your comments. Yes I've seen Lagomorph comments but to me it's just a terminology issue. That's why I define my own terms in the thread. The actual shapes are the same.
  • My copy seems to be truncating the release and I can't quite make sense of the subpatch. Can you help me out?
    Screen Shot 2017-07-20 at 4.29.26 PM.png
    1298 x 356 - 52K
  • Oops sorry, something was disconnected. You can reload the patch from the first post.