Start updating LADSPA plugin for proper timing

This commit is contained in:
Chris Cannam
2021-05-14 11:35:08 +01:00
parent 478d9233fe
commit d9dfc0a84c
5 changed files with 74 additions and 69 deletions

View File

@@ -469,7 +469,7 @@ StretchCalculator::calculateSingle(double timeRatio,
if (divergence > 1000 || divergence < -1000) {
recovery = divergence / ((m_sampleRate / 10.0) / increment);
} else if (divergence > 100 || divergence < -100) {
recovery = divergence / ((m_sampleRate / 25.0) / increment);
recovery = divergence / ((m_sampleRate / 20.0) / increment);
} else {
recovery = divergence / 4.0;
}

View File

@@ -868,7 +868,8 @@ size_t
RubberBandStretcher::Impl::getLatency() const
{
if (!m_realtime) return 0;
return int((m_aWindowSize/2) / m_pitchScale + 1);
return lrint((m_aWindowSize/2) / m_pitchScale);
// return int(m_aWindowSize/2);
}
void

View File

@@ -1154,11 +1154,11 @@ RubberBandStretcher::Impl::writeOutput(RingBuffer<float> &to, float *from, size_
// configure(), so we don't want to remove any here.
//!!!
size_t startSkip = 0;
// if (!m_realtime) {
if (!m_realtime) {
//!!! lock down the latency to this initial value in RT mode
startSkip = lrintf((m_sWindowSize/2) / m_pitchScale);
// startSkip = m_sWindowSize/2;
// }
}
if (outCount > startSkip) {