Skip to content

Commit

Permalink
fix #136681: Corrupted scores with complex tuplet
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Oct 10, 2016
1 parent 2df77e9 commit 24c05a2
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2031,14 +2031,20 @@ void Measure::checkMeasure(int staffIdx)
int ticks = seg->tick() - stick;

while (seg) {
if (ticks > 1) {
Fraction f = Fraction::fromTicks(ticks);

Rest* rest = new Rest(score());
rest->setDuration(f);
rest->setTrack(track);
rest->setGap(true);
score()->undoAddCR(rest, this, stick);
// !HACK, it was > 1, but for some tuplets it can happen to have 1 tick difference...
// 4 is a 512th...
if (ticks > 3) {
TDuration d;
d.setVal(ticks);
if (d.isValid()) {
Fraction f = Fraction::fromTicks(ticks);
Rest* rest = new Rest(score());
rest->setDuration(f);
rest->setDurationType(d);
rest->setTrack(track);
rest->setGap(true);
score()->undoAddCR(rest, this, stick);
}
}

pseg = seg;
Expand Down

0 comments on commit 24c05a2

Please sign in to comment.