From c1c913be9d24446cd88f31dca4d1b84e59ae060d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 19 Feb 2023 16:58:11 +0100 Subject: [PATCH] Fix MClk generator position --- libs/temporal/tempo.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/temporal/tempo.cc b/libs/temporal/tempo.cc index 7f20754a37..40645b4a6b 100644 --- a/libs/temporal/tempo.cc +++ b/libs/temporal/tempo.cc @@ -3559,7 +3559,13 @@ TempoMap::midi_clock_beat_at_or_after (samplepos_t const pos, samplepos_t& clk_p * (compare to 14da117bc88) */ clk_pos = PBD::muldiv_round (superclock_at (b), TEMPORAL_SAMPLE_RATE, superclock_ticks_per_second ()); - clk_beat = b.get_beats () * 24; + + /* Each MIDI Beat spans 6 MIDI Clocks. + * In other words, each MIDI Beat is a 16th note (since there are 24 MIDI + * Clocks in a quarter note, therefore 4 MIDI Beats also fit in a quarter). + * So, a master can sync playback to a resolution of any particular 16th note. + */ + clk_beat = b.get_beats () * 4 ; // 4 = 24 / 6; assert (clk_pos >= pos); }