Prior to commitb5de1d50e, audible zipper artifacts were present when using the PeakController on a bus to control the volume of another bus for sidechain compression. The bus that had its volume reduced was the one which produced audible artifacts. Commitb5de1d50eintroduced LERP to PeakController to smooth out its signal, which eliminated the zipper artifacts. However, this had the side effect of increased latency even when both attack and decay settings were set to zero. Until a more robust solution is implemented, reverting this change eliminates the latency by eliminating the lerp, but reintroduces audible zipper artifacts.
This commit is contained in:
@@ -80,7 +80,9 @@ void PeakController::updateValueBuffer()
|
||||
{
|
||||
if( m_coeffNeedsUpdate )
|
||||
{
|
||||
m_coeff = 100.0f / Engine::audioEngine()->outputSampleRate();
|
||||
const float ratio = 44100.0f / Engine::audioEngine()->outputSampleRate();
|
||||
m_attackCoeff = 1.0f - powf( 2.0f, -0.3f * ( 1.0f - m_peakEffect->attackModel()->value() ) * ratio );
|
||||
m_decayCoeff = 1.0f - powf( 2.0f, -0.3f * ( 1.0f - m_peakEffect->decayModel()->value() ) * ratio );
|
||||
m_coeffNeedsUpdate = false;
|
||||
}
|
||||
|
||||
@@ -95,7 +97,14 @@ void PeakController::updateValueBuffer()
|
||||
for( f_cnt_t f = 0; f < frames; ++f )
|
||||
{
|
||||
const float diff = ( targetSample - m_currentSample );
|
||||
m_currentSample += diff * m_coeff;
|
||||
if( m_currentSample < targetSample ) // going up...
|
||||
{
|
||||
m_currentSample += diff * m_attackCoeff;
|
||||
}
|
||||
else if( m_currentSample > targetSample ) // going down
|
||||
{
|
||||
m_currentSample += diff * m_decayCoeff;
|
||||
}
|
||||
values[f] = m_currentSample;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user