Sextuplets display as triplet, corruption on copy/paste

• Apr 17, 2019 - 18:44
Reported version
3.0
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

A regression in master compared to 3.0.5, presumably due to the Fraction change.

1) new score in 4/4
2) note input mode
3) 5 Ctrl+6 to create a sextuplet in the space of a quarter

Result: the sextuplet created shows six sixteenths but a "3" in the bracket instead of a "6".

4) enters notes to replaces the sixteenth rests
5) copy the full tuplet
6) paste to the next beat

Result: the fourth note is missing, replaced by an eighth rest, thus indicating a corruption (and further corruptions if you undo, or copy the copy, etc)

According to the object debugger, the baselen is 16th, which seems correct, but the ratio is 3:2. This probably should have been left 6:4 and not reduced. And sure enough, if I use Add / Tuplet / Other to enter 6:4 as the ratio explicitly, then it works correctly - the 6 is displayed in the bracket, and copy/paste works normally.


Comments

The *= (and *) operators for Fractions always reduce, there's even a comment in the code saying it should be OK. But here (in cmdTuplet, calculating the ratio), it's not. Might be the only place it's not, but still. Probably there should be a non-reduced-multiply and divide in Fraction class, but the simplest fix for the case at hand would be to do the math inline. I'll submit a PR for that, someone else can worry about the more general case.

Fix version
3.1.0