Skip to content

Release section of envelope issues #4672

Open
@YurkoFlisk

Description

@YurkoFlisk

This problem may be similar to #3086, but more general I think.
When the release section of envelope is entered (whether it's for volume or not) and AMT knob is somewhere between 0 and 1, there's a click even with nonzero release time, which is well noticeable if AMT is around 0.5 and sustain value is at max. Zip with 2 example presets is attached: one for volume envelope, second for cutoff envelope (with volume envelope set to AMT 1 so that it doesn't cause problems).

The issue seems to be in EnvelopeAndLfoParameters.cpp and is the way m_rEnv is computed in void EnvelopeAndLfoParameters::updateSampleVars. In particular, void EnvelopeAndLfoParameters::fillLevel function suggests that this array is used for calculating envelope levels during release period, and it's values are multiplied by the envelope value from which the release began (m_pahdEnv[_release_begin] or m_sustainLevel, depending on release beginning time). So, for a continuous transition, at the first release frame this value should be multiplied by 1 (or very close to that), so m_rEnv[0] should be 1, whereas, by the way it's filled in updateSampleVars function, m_rEnv[0] is m_amount. This also explains why there's no problem when AMT is 1.
What's interesting is that if m_rEnv is calculated starting from 1, release period should always start smoothly, so even if m_amount is 0 we will have release from actual value. In particular, since for the volume section default release time is already nonzero, there won't be click at the end by default, so this should resolve #3086 as well.

So, it seems like change here from
const float rfI = ( 1.0f / m_rFrames ) * m_amount;
to
const float rfI = ( 1.0f / m_rFrames );
should fix the problems. I'll try to setup compilation process and test whether this will fix the problem and not introduce other ones.

ClickExamples.zip

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions