From 1b5f7e9f3509c8af81507470e44fc632591a1cdf Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 29 Aug 2023 12:09:00 +0200 Subject: [PATCH] Fix last commit Signed-off-by: falkTX --- source/backend/plugin/CarlaPluginCLAP.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/backend/plugin/CarlaPluginCLAP.cpp b/source/backend/plugin/CarlaPluginCLAP.cpp index 56a8ef3d5..27c25da56 100644 --- a/source/backend/plugin/CarlaPluginCLAP.cpp +++ b/source/backend/plugin/CarlaPluginCLAP.cpp @@ -2058,11 +2058,12 @@ public: CARLA_SAFE_ASSERT_INT(timeInfo.bbt.bar > 0, timeInfo.bbt.bar); CARLA_SAFE_ASSERT_INT(timeInfo.bbt.beat > 0, timeInfo.bbt.beat); + const double barStart = static_cast(timeInfo.bbt.beatsPerBar) * (timeInfo.bbt.bar - 1); const double positionBeats = static_cast(timeInfo.frame) / (sampleRate * 60 / timeInfo.bbt.beatsPerMinute); // Bar/Beats - clapTransport.bar_start = static_cast(timeInfo.bbt.beatsPerBar) * (timeInfo.bbt.bar - 1); + clapTransport.bar_start = std::round(CLAP_BEATTIME_FACTOR * barStart); clapTransport.bar_number = timeInfo.bbt.bar - 1; clapTransport.song_pos_beats = std::round(CLAP_BEATTIME_FACTOR * positionBeats); clapTransport.flags |= CLAP_TRANSPORT_HAS_BEATS_TIMELINE;