LETS TALK ABOUT: ADSR and why simple things are sometimes not simple


as you may or not know i am working on a pedal emulation. And after a few days of fooling with samplers and stuff i finally got to a point where i could start thinking and patching volume envelopes. That part of a synth or a patch that you seem to put off until last simply because well, it’s usually the last thing before the dac~
well i went down a rabbit hole of insanity with ADSRs


i investigated a bunch of them
Vanilla. Chocolate the whole gamut
eadsr~ looked cool but i think the person who made the help patch was disturbed.
It disturbed me. I found really nice ones that behaved and even looked like what you would expect but they all want a bang or a midi note to envelope sound

Not sure what you expect of the envelope you are looking for?

Have also researched a bunch and actually just end up using Millers adsr example. And then multiply it with itself to get a curved envelope shape.

1 Like

something that does operations like an envelope without a MIDI note to trigger it

You can trigger the envelope with out a midi note like this. Well it simulates midi note on/off, but it is not mdi note:


Note on turns it on and the delayed bang turns the note off again after X ms.

Could that do it? One could for example in a sequencer with 16 steps have 1 of these mechanisms for each step and set note length for each step.

no it needs a bang
so what i really want/need is not a traditional ADSR because if we are not using midi to bang that note on/off how does it do it? Amplitude? I found threshold~ or perhaps env~ with a < …should not be this hard

Using amplitude to trigger the bang would be an envelope follower:

You set a threshold and when the audio input is above that threshold, the envelope follower sends out a bang or a trigger that you can use to trigger the envelope. That is a classic envelope follower.

Here is one I made, this one got attack/decay stages:



bless you bless you bless you 20 times


You could combine this last one with the first one i posted: Use the bang from the envelope follower and then use the toggle thing from first post to turn the adsr envelope on/off.

Ps I think i turned the < the wrong way. I think it should be > But also depends how one wants it to work.

One thing I also wonder with envelopes is how to get rid of hanging notes… On the miller adsr if you trigger the envelope again, before the last note has ended, it can sometimes lead to hanging notes. I think I need to edit it a bit. I think there is an examplein the pd examples that shoe how to get and envelope that is reset fully on every hit. It can be pretty problematic with hanging notes in the middle of a live session. Anyway, will figure it out eventually.

This post was very helpful, is there any chance @Jaffasplaffa you are still active with Pure Data? I have a drum machine project I am working on for school and have a question about implementing an ADSR. Please let me know if you are willing to help, thank you! Feel free to email me at sauterclay@gmail.com if so.

1 Like

@claysauter I have send you an email.

We can also do it here, it is up to you.

Here is a very simple ADSR envelope implemented as an abstraction:

I found a youtube video with this implementation, this thread seems like a good place to post it. As I was copying and trying to understand I thought that it was clever how stripnote is really only being used to pass notes when velocity is nonzero. Also, that note is merely used as a bang for the pack object below (notice how $1 is not used in the symbol!).

This is inside an abstraction, hence the $0- prefixes on the variables. makes it easier to look at (but perhaps not to follow!)

EDIT: This implementation doesn’t have re-triggering from 0 on new noteon with nonzero velocity, but would be easy to add.


How would you guys go about triggering an envelope with a step sequencer?

not quite sure i understand the question…
it would be exactly the same way as when you trigger it from a note - in fact id assume the sequencer was giving you notes anyway - no?

if the sequence is just gates, then you could just ‘falsify’ a note (you dont care about note number)
or in the above example you could rip out the stuff above stripnote,
replace with [r - $0-v]-> [sel 1]

(you can then remove the [inlet] -> [s $0-n] , as this inlet is redundant]