From f86395688ec3983db6bc68b92c19ae5842690d91 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 31 Jan 2021 17:30:12 -0700 Subject: [PATCH] libtemporal: Beats::round_to_subdivision() was incorectly folding the "beats" part of the value back into the answer. The "beats" value is already implicit in the "ticks" we actually do the math with --- libs/temporal/beats.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/temporal/beats.cc b/libs/temporal/beats.cc index 3e48f477bc..da669248c3 100644 --- a/libs/temporal/beats.cc +++ b/libs/temporal/beats.cc @@ -57,7 +57,6 @@ Beats::round_to_subdivision (int subdivision, RoundMode dir) const { uint32_t ticks = to_ticks(); const uint32_t ticks_one_subdivisions_worth = ticks_per_beat / subdivision; uint32_t mod = ticks % ticks_one_subdivisions_worth; - uint32_t beats = _beats; DEBUG_TRACE (DEBUG::SnapBBT, string_compose ("%4 => round-nearest, ticks %1 1 div of ticks %2 mod %3\n", ticks, ticks_one_subdivisions_worth, mod, *this)); @@ -111,12 +110,11 @@ Beats::round_to_subdivision (int subdivision, RoundMode dir) const { */ ticks = int_div_round (ticks, ticks_one_subdivisions_worth) * ticks_one_subdivisions_worth; - beats = 0; } - DEBUG_TRACE (DEBUG::SnapBBT, string_compose ("return %1 from %2 : %3\n", Beats (beats, ticks), beats, ticks)); - return Beats (beats, ticks); + DEBUG_TRACE (DEBUG::SnapBBT, string_compose ("return %1 from %2 : %3\n", Beats (0, ticks), ticks)); + return Beats (0, ticks); } std::istream&