From 27a2980a5624d117f07bff816c9af6b0911dcc31 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Fri, 14 May 2021 15:10:24 +0100 Subject: [PATCH] Restore original behaviour of pre-fill/start-skip --- src/StretcherImpl.cpp | 7 +++---- src/StretcherProcess.cpp | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/StretcherImpl.cpp b/src/StretcherImpl.cpp index 7869d08..0794156 100644 --- a/src/StretcherImpl.cpp +++ b/src/StretcherImpl.cpp @@ -64,7 +64,7 @@ const size_t RubberBandStretcher::Impl::m_defaultFftSize = 2048; int -RubberBandStretcher::Impl::m_defaultDebugLevel = 2; +RubberBandStretcher::Impl::m_defaultDebugLevel = 0; static bool _initialised = false; @@ -740,12 +740,11 @@ RubberBandStretcher::Impl::configure() // number of onset detector chunks will be the number of audio // samples input, divided by the input increment, plus one. - //!!! // In real-time mode, we don't do this prefill -- it's better to // start with a swoosh than introduce more latency, and we don't // want gaps when the ratio changes. -// if (!m_realtime) { + if (!m_realtime) { if (m_debugLevel > 1) { cerr << "Not real time mode: prefilling with " << m_aWindowSize/2 << " samples" << endl; } @@ -753,7 +752,7 @@ RubberBandStretcher::Impl::configure() m_channelData[c]->reset(); m_channelData[c]->inbuf->zero(m_aWindowSize/2); } -// } + } } diff --git a/src/StretcherProcess.cpp b/src/StretcherProcess.cpp index 87ab89c..cf6f545 100644 --- a/src/StretcherProcess.cpp +++ b/src/StretcherProcess.cpp @@ -1152,12 +1152,10 @@ RubberBandStretcher::Impl::writeOutput(RingBuffer &to, float *from, size_ // samples, because the first chunk is centred on the start of the // output. In RT mode we didn't apply any pre-padding in // configure(), so we don't want to remove any here. -//!!! + size_t startSkip = 0; 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) {