Page 1 of 1

Behaviour in ADSREnvelope decay and sustain curves

Posted: Sat Jul 27, 2019 6:10 am
by AndyMac
There appears to be a possible bug in the ADSR Envelope audio processing library.

In testing my updates to my envelope-based modules, I was checking my timings were reflected correctly in the oscilloscope and find that when Attack, Hold, Decay and Release times are all set to 30ms (which from other testing is 2 bars on oscilloscope at zoom = 0%) then the attack shows as 2 bars, hold shows as 2 bars BUT decay and release both show as 1 bar, i.e. 15ms which is half the expected amount!

I have also tested the standard Envelope and Super Envelope modules and they show exactly the same behaviour.
UPDATE: confirmed no bugs, just behaviours that have been modelled on real analogue synths. It may be useful to understand this detailed behaviour if using the standard ADSREnvelope within your own modules, especially when testing them :)

Re: Bug in the ADSREnvelope decay and sustain times?

Posted: Mon Jul 29, 2019 11:15 am
by Captain
Strange, I just tested this by counting how many ProcessSample cycles it takes to go from one stage to the next, and looks like it's working just like it should. See the screenshot: whenever the envelope stage changes, it outputs milliseconds since the last stage, and the new stage name (the sustain->release time is whatever it is since I triggered the envelope manually... need more practice to get exactly 30 ms :D ). I also tested with other values, and they also work as expected. How exactly did you test this with the oscilloscope, I didn't quite understand?

Re: Bug in the ADSREnvelope decay and sustain times?

Posted: Mon Jul 29, 2019 1:20 pm
by AndyMac
I'll test it that way as well (good idea) - maybe it's the tail of each stage, but I don't think it was. I'll try to capture the oscilloscope to share.

Re: Bug in the ADSREnvelope decay and sustain times?

Posted: Mon Jul 29, 2019 4:03 pm
by AndyMac
UPDATED: As a follow up, I've now done my own test module, and had some interesting results which have clarified things for me - and having spoken with support who have confirmed the behaviour is based around modelling real world analogue units, now understand the behaviour.

I have attached the screen shot to show the behaviour, and also the module so that people can try to see it easily for yourselves.

Anyway, in summary, the status from the ADSR for each stage as per the setting (i.e. 30ms in my example). The thing that was confusing me when looking at it just on the oscilloscope (when I was testing my latest updates for my modules to check their timings) is that by 1/2 way through the Decay and Sustain the voltage has fallen to just 0.019V over the based (i.e. 19mV for Release, and 2.519V for Decay i.e. 2.5V sustain level + 19mV) which looks (on the oscilloscope with the resolution you get from it) as being so close to 0V as looking like it had already finished.
Screen Shot for ADSR Issue.png
Screen Shot for ADSR Issue.png (273.16 KiB) Viewed 4786 times

Re: Bug in the ADSREnvelope decay and sustain times?

Posted: Mon Jul 29, 2019 5:48 pm
by Captain
Thanks, gotcha! Yeah, you are right, the curve drops very quickly. Maybe it's modelled after some specific ADSR curve, or emulates some "analog" behaviour, or something? Of course it's not too difficult to make a custom ADSR object from scratch to produce any kind of envelope, but it would sure be cool to have some control over the curvature in Voltage ADSR.

Re: Bug in the ADSREnvelope decay and sustain times?

Posted: Mon Jul 29, 2019 7:05 pm
by AndyMac
Yes, just updated my main post on the forum - the curves are modelled on analogue kit, and so everything is fine. Just confused me when I was testing my updates to my modules ready to push them into the release process - and was using the oscilloscope to check on timings!

Re: Behaviour in ADSREnvelope decay and sustain curves

Posted: Mon Jul 29, 2019 7:30 pm
by Captain
Good to know, thx! :)

Re: Behaviour in ADSREnvelope decay and sustain curves

Posted: Mon Dec 28, 2020 7:36 am
by creart
Hey Andrew

I was interested to see your module in action but got an error while trying to unzip it?
Is it protected?
cheers Hans