Skip to content

Commit

Permalink
ENG-66: Repeat text on incorrect side of barline
Browse files Browse the repository at this point in the history
Sometimes, repeat text (Codas and Segnos) are exported on the incorrect
side of the barline (i.e. end of mm. 29 vs. beginning of mm. 30). Since
MuseScore is unable to place these at a specific tick (and rather attach
them to the right or left side of the measure), this commit adds a more
thorough inference of which measure was originally intended.

Duplicate of musescore#8623
  • Loading branch information
iveshenry18 authored and Jojo-Schmitz committed Jul 27, 2021
1 parent 6f9d5ba commit 10fc696
Show file tree
Hide file tree
Showing 5 changed files with 862 additions and 4 deletions.
16 changes: 12 additions & 4 deletions importexport/musicxml/importmxmlpass2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3293,11 +3293,19 @@ void MusicXMLParserDirection::handleRepeats(Measure* measure, const int track, c
_wordsText = "";
}
else tb->setVisible(false);
// Some Markers and Jumps align to the right of a measure.
// These may be recorded in the XML as occurring at the beginning
// of the following measure. This fixes that.
if (tb->tid() == Tid::REPEAT_RIGHT && tick == measure->tick())

// Sometimes Jumps and Markers are exported on the incorrect side
// of the barline (i.e. end of mm. 29 vs. beginning of mm. 30).
// This fixes that.
bool closerToLeft = tick - measure->tick() < measure->endTick() - tick;
if (tb->tid() == Tid::REPEAT_RIGHT
&& closerToLeft
&& measure->prevMeasure())
measure = measure->prevMeasure();
else if (tb->tid() == Tid::REPEAT_LEFT
&& !closerToLeft
&& measure->nextMeasure())
measure = measure->nextMeasure();
measure->add(tb);
}
}
Expand Down
Loading

0 comments on commit 10fc696

Please sign in to comment.