From 46f2dba306dc79ffa67c663ea8601c246186bf9a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 13 Aug 2025 10:50:46 -0600 Subject: [PATCH] temporal: fix Meter::to_quarters (BBT_Offset) Because Paul can't do math --- libs/temporal/tempo.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index e970f1de48..cc2d89826d 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -402,10 +402,9 @@ Meter::round_to_beat (Temporal::BBT_Time const & bbt) const Temporal::Beats Meter::to_quarters (Temporal::BBT_Offset const & offset) const { - int64_t ticks = 0; + int64_t ticks = (Beats::PPQN * offset.bars * _divisions_per_bar * 4) / _note_value; - ticks += (Beats::PPQN * offset.bars * _divisions_per_bar * _note_value) / 4; - ticks += (Beats::PPQN * offset.beats * _note_value) / 4; + ticks += (Beats::PPQN * offset.beats * 4) / _note_value; /* "parts per bar division" */