Behaviour in ADSREnvelope decay and sustain curves

Post Reply
User avatar
AndyMac
Posts: 128
Joined: Wed Sep 05, 2018 6:16 pm
Location: Wirral UK
Contact:

Behaviour in ADSREnvelope decay and sustain curves

Post by AndyMac » Sat Jul 27, 2019 6:10 am

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 :)
Last edited by AndyMac on Mon Jul 29, 2019 7:06 pm, edited 2 times in total.
Andrew Macaulay

User avatar
Captain
Posts: 91
Joined: Sat Aug 25, 2018 11:12 am

Re: Bug in the ADSREnvelope decay and sustain times?

Post by Captain » Mon Jul 29, 2019 11:15 am

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?
Attachments
Screenshot 2019-07-29 at 14.09.49.png
Screenshot 2019-07-29 at 14.09.49.png (34.78 KiB) Viewed 2320 times

User avatar
AndyMac
Posts: 128
Joined: Wed Sep 05, 2018 6:16 pm
Location: Wirral UK
Contact:

Re: Bug in the ADSREnvelope decay and sustain times?

Post by AndyMac » Mon Jul 29, 2019 1:20 pm

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.
Last edited by AndyMac on Mon Jul 29, 2019 6:58 pm, edited 1 time in total.
Andrew Macaulay

User avatar
AndyMac
Posts: 128
Joined: Wed Sep 05, 2018 6:16 pm
Location: Wirral UK
Contact:

Re: Bug in the ADSREnvelope decay and sustain times?

Post by AndyMac » Mon Jul 29, 2019 4:03 pm

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 2311 times
Attachments
Module to Test ADSR Timing.zip
(37.98 KiB) Downloaded 102 times
Last edited by AndyMac on Mon Jul 29, 2019 7:04 pm, edited 1 time in total.
Andrew Macaulay

User avatar
Captain
Posts: 91
Joined: Sat Aug 25, 2018 11:12 am

Re: Bug in the ADSREnvelope decay and sustain times?

Post by Captain » Mon Jul 29, 2019 5:48 pm

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.

User avatar
AndyMac
Posts: 128
Joined: Wed Sep 05, 2018 6:16 pm
Location: Wirral UK
Contact:

Re: Bug in the ADSREnvelope decay and sustain times?

Post by AndyMac » Mon Jul 29, 2019 7:05 pm

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!
Andrew Macaulay

User avatar
Captain
Posts: 91
Joined: Sat Aug 25, 2018 11:12 am

Re: Behaviour in ADSREnvelope decay and sustain curves

Post by Captain » Mon Jul 29, 2019 7:30 pm

Good to know, thx! :)

creart
Posts: 33
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

Re: Behaviour in ADSREnvelope decay and sustain curves

Post by creart » Mon Dec 28, 2020 7:36 am

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

Post Reply