From 04fdfc4de21d4c42f32a06584709dbb62f4cfec0 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Sun, 15 Nov 2020 01:00:06 +0100 Subject: [PATCH] Remove old clock code which suffers rounding errors --- src/sfizz/BeatClock.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/sfizz/BeatClock.cpp b/src/sfizz/BeatClock.cpp index 3b35f4e7..f9ef6c14 100644 --- a/src/sfizz/BeatClock.cpp +++ b/src/sfizz/BeatClock.cpp @@ -191,25 +191,6 @@ void BeatClock::fillBufferUpTo(unsigned delay) // quantization to nearest for prevention of rounding errors beatData[fill] = dequantize(quantize(clientPos.toBeats(sig))); - -#if 0 - BBT oldClientPos = clientPos; - - // quantization to nearest for prevention of rounding errors - qbeats_t oldQbeats = quantize(oldClientPos.toBeats(sig)); - qbeats_t qbeats = quantize(clientPos.toBeats(sig)); - - int oldBeatNumber = dequantize(oldQbeats); - int beatNumber = dequantize(qbeats); - - int beatIncrement = std::max(0, beatNumber - oldBeatNumber); - int beatDistanceToNextBar = sig.beatsPerBar - (oldBeatNumber % sig.beatsPerBar); - int barIncrement = (beatIncrement < beatDistanceToNextBar) ? 0 : - (1 + (beatIncrement - beatDistanceToNextBar) / sig.beatsPerBar); - - beatData[fill] = beatIncrement; - barData[fill] = barIncrement; -#endif } currentCycleFill_ = fill;