Honor the base gain and volume before modifiers
This commit is contained in:
parent
1b5a841d97
commit
9b11530331
1 changed files with 2 additions and 0 deletions
|
|
@ -360,12 +360,14 @@ void sfz::Voice::amplitudeEnvelope(absl::Span<float> modulationSpan) noexcept
|
||||||
egEnvelope.getBlock(modulationSpan);
|
egEnvelope.getBlock(modulationSpan);
|
||||||
|
|
||||||
// Amplitude envelope
|
// Amplitude envelope
|
||||||
|
applyGain1<float>(baseGain, modulationSpan);
|
||||||
if (float* mod = mm.getModulationByKey(amplitudeKey)) {
|
if (float* mod = mm.getModulationByKey(amplitudeKey)) {
|
||||||
for (size_t i = 0; i < numSamples; ++i)
|
for (size_t i = 0; i < numSamples; ++i)
|
||||||
modulationSpan[i] *= normalizePercents(mod[i]);
|
modulationSpan[i] *= normalizePercents(mod[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Volume envelope
|
// Volume envelope
|
||||||
|
applyGain1<float>(db2mag(baseVolumedB), modulationSpan);
|
||||||
if (float* mod = mm.getModulationByKey(volumeKey)) {
|
if (float* mod = mm.getModulationByKey(volumeKey)) {
|
||||||
for (size_t i = 0; i < numSamples; ++i)
|
for (size_t i = 0; i < numSamples; ++i)
|
||||||
modulationSpan[i] *= db2mag(mod[i]);
|
modulationSpan[i] *= db2mag(mod[i]);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue