From 4b4c93c53b8d689185955fd6bf5b821c9694126d Mon Sep 17 00:00:00 2001 From: Roman Pudashkin Date: Fri, 9 Aug 2024 17:54:45 +0300 Subject: [PATCH] fix #23933: fixed rounding error --- src/engraving/playback/renderers/tremolorenderer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engraving/playback/renderers/tremolorenderer.cpp b/src/engraving/playback/renderers/tremolorenderer.cpp index ad40932331448..67a6dd576d849 100644 --- a/src/engraving/playback/renderers/tremolorenderer.cpp +++ b/src/engraving/playback/renderers/tremolorenderer.cpp @@ -90,7 +90,12 @@ void TremoloRenderer::doRender(const EngravingItem* item, const mpe::Articulatio } // ... and use that here - int stepsCount = overallDurationTicks / stepDurationTicks; + const int stepsCount = std::round(overallDurationTicks / (float)stepDurationTicks); + if (stepsCount == 0) { + return; + } + + stepDurationTicks = overallDurationTicks / stepsCount; if (tremolo.two) { const Chord* firstTremoloChord = tremolo.two->chord1();