Skip to content

Commit

Permalink
fix #269998: Dotted rhythms within tuplets
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmcclinch committed Mar 19, 2018
1 parent c1be1e4 commit a2ef0b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 6 additions & 1 deletion libmscore/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,12 @@ QList<Fraction> Score::splitGapToMeasureBoundaries(ChordRest* cr, Fraction gap)
if (tuplet) {
if (tuplet->tuplet())
return flist; // do no deal with nested tuplets
Fraction rest = Fraction::fromTicks(tuplet->tick() + tuplet->duration().ticks() - cr->segment()->tick()) * tuplet->ratio();
Fraction rest = tuplet->elementsDuration();
for (DurationElement* de : tuplet->elements()) {
if (de == cr)
break;
rest -= de->duration();
}
if (rest < gap)
qDebug("does not fit in tuplet");
else
Expand Down
11 changes: 6 additions & 5 deletions libmscore/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,12 @@ Rest* Score::setRest(int tick, int track, Fraction l, bool useDots, Tuplet* tupl
//
Fraction f;
if (tuplet) {
int ticks = (tuplet->tick() + tuplet->actualTicks()) - tick;

f = Fraction::fromTicks(ticks);
for (Tuplet* t = tuplet; t; t = t->tuplet())
f *= t->ratio();
f = tuplet->baseLen().fraction() * tuplet->ratio().numerator();
for (DurationElement* de : tuplet->elements()) {
if (de->tick() >= tick)
break;
f -= de->duration();
}
//
// restrict to tuplet len
//
Expand Down

0 comments on commit a2ef0b5

Please sign in to comment.