Offset the time so that the envelopes "end" on the correct value
The envelope start is always considered to be the value before the current ramp started
This commit is contained in:
parent
19540e821a
commit
4d87716a30
1 changed files with 1 additions and 1 deletions
|
|
@ -165,11 +165,11 @@ void FlexEnvelope::Impl::process(absl::Span<float> out)
|
|||
const Curve& curve = *stageCurve_;
|
||||
size_t framesDone = 0;
|
||||
while ((time < stageEndTime || sustained) && frameIndex < maxFrameIndex) {
|
||||
time += samplePeriod;
|
||||
float x = time * (1.0f / stageEndTime);
|
||||
float c = curve.evalNormalized(x);
|
||||
level = sourceLevel + c * (targetLevel - sourceLevel);
|
||||
out[frameIndex++] = level;
|
||||
time += samplePeriod;
|
||||
++framesDone;
|
||||
}
|
||||
currentLevel_ = level;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue