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;