Skip to content

Commit

Permalink
fix #24852: ignore inactive segments (TimeTick) when calculating ferm…
Browse files Browse the repository at this point in the history
…ata duration
  • Loading branch information
RomanPudashkin committed Sep 25, 2024
1 parent 4558ed6 commit 87fbbf7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/engraving/dom/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,15 +579,16 @@ void Score::rebuildTempoAndTimeSigMaps(Measure* measure, std::optional<BeatsPerS
}
}
}
if (!RealIsNull(stretch) && !RealIsNull(stretch)) {

if (!RealIsNull(stretch) && !RealIsEqual(stretch, 1.0)) {
BeatsPerSecond otempo = tempomap()->tempo(segment.tick().ticks());
BeatsPerSecond ntempo = otempo.val / stretch;
tempomap()->setTempo(segment.tick().ticks(), ntempo);

Fraction currentSegmentEndTick;

if (segment.next1()) {
currentSegmentEndTick = segment.next1()->tick();
if (const Segment* nextActiveSegment = segment.nextActive()) {
currentSegmentEndTick = nextActiveSegment->tick();
} else {
currentSegmentEndTick = segment.tick() + segment.ticks();
}
Expand Down

0 comments on commit 87fbbf7

Please sign in to comment.