From 40c1a7016a0a60d7eca65982f2548fc1142d33b5 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 15 Dec 2021 15:39:28 -0700 Subject: [PATCH] triggerbox: NOOP - add explanatory comment --- libs/ardour/triggerbox.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 7864562225..1f8d75c01a 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -828,6 +828,12 @@ AudioTrigger::determine_tempo () const double quarters = (seconds / 60.) * _apparent_tempo; _barcnt = quarters / metric.meter().divisions_per_bar(); + /* now check the determined tempo and force it to a value that gives us + an integer bar/quarter count. This is a heuristic that tries to + avoid clips that slightly over- or underrun a quantization point, + resulting in small or larger gaps in output if they are repeating. + */ + if ((_apparent_tempo != 0.) && (rint (_barcnt) != _barcnt)) { /* fractional barcnt */ int intquarters = floor (quarters);