Remove ADSR unused variable
This commit is contained in:
parent
a2cbec8c5e
commit
80d350d0c5
2 changed files with 4 additions and 6 deletions
|
|
@ -44,9 +44,8 @@ void ADSREnvelope::reset(const EGDescription& desc, const Region& region, const
|
||||||
this->decayRate = secondsToExpRate(desc.getDecay(state, velocity));
|
this->decayRate = secondsToExpRate(desc.getDecay(state, velocity));
|
||||||
this->releaseRate = secondsToExpRate(desc.getRelease(state, velocity));
|
this->releaseRate = secondsToExpRate(desc.getRelease(state, velocity));
|
||||||
this->hold = secondsToSamples(desc.getHold(state, velocity));
|
this->hold = secondsToSamples(desc.getHold(state, velocity));
|
||||||
this->peak = 1.0;
|
|
||||||
this->sustain = normalizePercents(desc.getSustain(state, velocity));
|
this->sustain = normalizePercents(desc.getSustain(state, velocity));
|
||||||
this->start = this->peak * normalizePercents(desc.getStart(state, velocity));
|
this->start = normalizePercents(desc.getStart(state, velocity));
|
||||||
|
|
||||||
releaseDelay = 0;
|
releaseDelay = 0;
|
||||||
sustainThreshold = this->sustain + config::virtuallyZero;
|
sustainThreshold = this->sustain + config::virtuallyZero;
|
||||||
|
|
@ -90,10 +89,10 @@ void ADSREnvelope::getBlock(absl::Span<Float> output) noexcept
|
||||||
currentState = State::Attack;
|
currentState = State::Attack;
|
||||||
break;
|
break;
|
||||||
case State::Attack:
|
case State::Attack:
|
||||||
while (count < size && (currentValue += peak * attackStep) < peak)
|
while (count < size && (currentValue += attackStep) < 1)
|
||||||
output[count++] = currentValue;
|
output[count++] = currentValue;
|
||||||
if (currentValue >= peak) {
|
if (currentValue >= 1) {
|
||||||
currentValue = peak;
|
currentValue = 1;
|
||||||
currentState = State::Hold;
|
currentState = State::Hold;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,6 @@ private:
|
||||||
Float releaseRate { 0 };
|
Float releaseRate { 0 };
|
||||||
int hold { 0 };
|
int hold { 0 };
|
||||||
Float start { 0 };
|
Float start { 0 };
|
||||||
Float peak { 0 };
|
|
||||||
Float sustain { 0 };
|
Float sustain { 0 };
|
||||||
Float sustainThreshold { config::virtuallyZero };
|
Float sustainThreshold { config::virtuallyZero };
|
||||||
int releaseDelay { 0 };
|
int releaseDelay { 0 };
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue