Regroup Rhythms doesn't work when measure starts with tuplet segment

• Mar 5, 2020 - 08:56
Reported version
3.4
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project

Reproducing the issue:
1. Attach a simple score starting with a tuplet of rests.
example.JPG
2. Regroup the score.
3. The score remains unaffected.

However, in the example it should regroup the tuplet with the second quarter count rest, to form half a count rest.

The root cause is Score::regroupNotesAndRests() doesn't take tuplets into account when it is the starting segment. When simple changing the if (curr->isRest() && !(curr -> tuplet()) && !(toRest(curr) -> isGap())) case by removing the !(curr->tuplet()) condition, it will no longer work for tuplets containing a note or a nested tuplet, because the loop will then also consider the second segment in the tuplet and recursively handle this.

Attachment Size
regroup-starting-tuplet.mscz 2.5 KB