Adjusted the gain compensation to not lose gain due to applied pan stages (Issue #1086)
This commit is contained in:
parent
9b38c0bbc2
commit
9dac3cbd60
1 changed files with 7 additions and 3 deletions
|
|
@ -980,6 +980,10 @@ void Voice::Impl::panStageMono(AudioSpan<float> buffer) noexcept
|
|||
(*modulationSpan)[i] += mod[i];
|
||||
}
|
||||
pan(*modulationSpan, leftBuffer, rightBuffer);
|
||||
|
||||
// add +3dB (10^(3/20)) to compensate for the pan stage (-3dB per stage)
|
||||
applyGain1(1.4125375446227544f, leftBuffer);
|
||||
applyGain1(1.4125375446227544f, rightBuffer);
|
||||
}
|
||||
|
||||
void Voice::Impl::panStageStereo(AudioSpan<float> buffer) noexcept
|
||||
|
|
@ -1020,9 +1024,9 @@ void Voice::Impl::panStageStereo(AudioSpan<float> buffer) noexcept
|
|||
}
|
||||
pan(*modulationSpan, leftBuffer, rightBuffer);
|
||||
|
||||
// add +3dB to compensate for the 2 pan stages (-3dB each stage)
|
||||
applyGain1(1.4125375446227544f, leftBuffer);
|
||||
applyGain1(1.4125375446227544f, rightBuffer);
|
||||
// add +6dB (10^(6/20)) to compensate for the 2 pan stages (-3dB per stage)
|
||||
applyGain1(1.9952623149688797f, leftBuffer);
|
||||
applyGain1(1.9952623149688797f, rightBuffer);
|
||||
}
|
||||
|
||||
void Voice::Impl::filterStageMono(AudioSpan<float> buffer) noexcept
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue