Apply a small base gain to avoid clipping
This commit is contained in:
parent
02a8b56ce1
commit
35ad102a6a
3 changed files with 9 additions and 1 deletions
|
|
@ -59,7 +59,7 @@ namespace Default
|
|||
inline constexpr Range<uint8_t> ccTriggerValueRange{ 0, 127 };
|
||||
|
||||
// Performance parameters: amplifier
|
||||
inline constexpr float volume { 0.0 };
|
||||
inline constexpr float volume { -3.0 };
|
||||
inline constexpr Range<float> volumeRange { -144.0, 6.0 };
|
||||
inline constexpr Range<float> volumeCCRange { -144.0, 6.0 };
|
||||
inline constexpr float amplitude { 100.0 };
|
||||
|
|
|
|||
|
|
@ -88,6 +88,12 @@ public:
|
|||
::applyGain<Type>(gain, rightBuffer);
|
||||
}
|
||||
|
||||
void applyGain(Type gain) noexcept
|
||||
{
|
||||
::applyGain<Type>(gain, leftBuffer);
|
||||
::applyGain<Type>(gain, rightBuffer);
|
||||
}
|
||||
|
||||
void readInterleaved(absl::Span<const Type> input) noexcept
|
||||
{
|
||||
ASSERT(input.size() <= static_cast<size_t>(numChannels * numFrames));
|
||||
|
|
|
|||
|
|
@ -135,6 +135,8 @@ public:
|
|||
egEnvelope.getBlock(tempSpan1.first(numSamples));
|
||||
buffer.applyGain(tempSpan1);
|
||||
|
||||
buffer.applyGain(baseGain);
|
||||
|
||||
if (!egEnvelope.isSmoothing())
|
||||
reset();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue