Skip to content

Commit

Permalink
Merge pull request #3527 from mattmcclinch/269998-tuplet-element-dura…
Browse files Browse the repository at this point in the history
…tion

fix #222181, fix #269998: Dotted rhythms within tuplets
  • Loading branch information
lasconic committed Mar 16, 2018
2 parents c2f0b8b + 30c5b79 commit 0e866f6
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 @@ -962,7 +962,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 @@ -290,11 +290,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 0e866f6

Please sign in to comment.