Can't copy nested tuplets to last beat of measure

• Nov 28, 2018 - 13:19
Reported version
3.0
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project

This issue was reported here: https://musescore.org/en/node/278934.

Open the attached file. Copy the complete tuplet on beat 1 and try to paste it onto beat 4. MuseScore will complain the the tuplet crosses the bar line, even though it should fit in the measure.

Attachment Size
paste-tuplet.mscz 3.75 KB

Comments

Status closed active

and it happened again. 36e6246. create a >8 tuplet, copy paste to last beat of measure, get the 'tuplet cannot cross barlines' error.

Attachment Size
test.mscz 8.24 KB

I've been staring at the code, though I don't see any changes to what matt did. It looks like afrac() means 'actual fraction' take the starting tick and return the fraction of the measure used? Though, with this:

Fraction Fraction::fromTicks(int ticks)
{
return Fraction(ticks, MScore::division * 4).reduced();
}
Isn't that assuming that a measure is 4 beats long? So afrac is (ticksused)/(ticksin4/4measure)?

Also, it looks like paste.cpp is checking rfrac, not afrac. rfrac... if measure, rfrac = afrac - m->afrac, is that then accounting for time signatures that have other than four beats per measure? and then... rtick is tick - parent->tick. So starting tick of the tuplet, minus what? Who is the parent? The measure/amount highlighted?

Do we have documentation for the code? It'd make it easier. I can't find any.

Title Can't copy tuplet to last beat of measure Can't copy nested tuplets to last beat of measure

A straight nine-let works fine, its only the nested version that is doing it's math correctly.

Laurelin, let me try to answer some of your questions.

A whole note is defined as 4 beats, no matter the time signature.
The parent of a tuplet is the measure that contains the tuplet.
rfrac() is the "relative fraction", or the beat relative to the beginning of the measure, in terms of a fraction of a whole note.
afrac() is the "absolute fraction", or the beat relative to the beginning of the score, in terms of a fraction of a whole note.

Oh, and the documentation for the code is the code itself.