When the envelope crosses -60 dB, an intermediate variable diff was not continuous. This PR makes diff continuous for the whole envelope range as drawn in the figure below.
Swaps attack and release calculation for the upward compressor.
The attack time should be effective when the input amplitude is increasing and the release time should be effective when the input amplitude is decreasing. This is opposite to the normal expander.
I checked the behavior of gain in the upward compressor applying to a -6 dB 440 Hz tone on -66 dB white noise floor. All parameters are default; the attack time is 10 ms, the release time is 50 ms. With this PR, I confirmed the gain responds faster when the tone starts at 0.5 s in the figure below and the gain responds slower when the tone stops at 1.5 s. So, I think this modification selects the right attack and release time for the upward compressor.
This PR contains two changes.
When the envelope crosses -60 dB, an intermediate variable
diff
was not continuous. This PR makesdiff
continuous for the whole envelope range as drawn in the figure below.Swaps attack and release calculation for the upward compressor. The attack time should be effective when the input amplitude is increasing and the release time should be effective when the input amplitude is decreasing. This is opposite to the normal expander. I checked the behavior of
gain
in the upward compressor applying to a -6 dB 440 Hz tone on -66 dB white noise floor. All parameters are default; the attack time is 10 ms, the release time is 50 ms. With this PR, I confirmed the gain responds faster when the tone starts at 0.5 s in the figure below and the gain responds slower when the tone stops at 1.5 s. So, I think this modification selects the right attack and release time for the upward compressor.