From 69e287bc2e4473e67670c985a89d8e665035f0f6 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Fri, 1 Apr 2022 12:00:13 +0100 Subject: [PATCH] ADSR: Restore the previous behaviour and clarify the documentation This partially reverts d9c25ec17dda8d42a1ba5fd474636abf800e8b7d. --- modules/juce_audio_basics/utilities/juce_ADSR.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_basics/utilities/juce_ADSR.h b/modules/juce_audio_basics/utilities/juce_ADSR.h index 35957ebe78..c015a8403c 100644 --- a/modules/juce_audio_basics/utilities/juce_ADSR.h +++ b/modules/juce_audio_basics/utilities/juce_ADSR.h @@ -31,6 +31,10 @@ namespace juce with setParameters() then call getNextSample() to get the envelope value to be applied to each audio sample or applyEnvelopeToBuffer() to apply the envelope to a whole buffer. + Do not change the parameters during playback. If you change the parameters before the + release stage has completed then you must call reset() before the next call to + noteOn(). + @tags{Audio} */ class JUCE_API ADSR @@ -115,7 +119,6 @@ public: { if (attackRate > 0.0f) { - envelopeVal = 0.0f; state = State::attack; } else if (decayRate > 0.0f)