From 180c1d77591e50d64d0daa7715dbdeec336cd302 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 17 Nov 2021 10:51:23 -0700 Subject: [PATCH] tempo map: slight reorganization of ::get_grid This avoids resetting beats based on superclocks in case where we already do the opposite. --- libs/temporal/tempo.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index f4ecbc3e14..30c9f2df0a 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -1954,7 +1954,11 @@ TempoMap::get_grid (TempoMapPoints& ret, superclock_t start, superclock_t end, u if (bar_mod == 0) { - /* Advance by the meter note value size */ + /* Advance beats by the meter note value size, and + * then recompute the BBT and superclock + * position corresponding to that musical time + */ + beats += metric.tempo().note_type_as_beats (); bbt = metric.bbt_at (beats); start = metric.superclock_at (beats); @@ -2886,8 +2890,8 @@ double TempoMap::quarters_per_minute_at (timepos_t const & pos) const { TempoPoint const & tp (tempo_at (pos)); + cerr << "Get gpm using " << tp << " where sc-per-nt at " << pos << " = " << tp.superclocks_per_note_type_at (pos) << endl; const double val = tp.note_types_per_minute_at_DOUBLE (pos) * (4.0 / tp.note_type()); - std::cerr << "qpm @ " << pos << " using " << tp << " = " << val << std::endl; return val; }