tuplet brackets connected to two staves, moved up a staff, causing score corruption and crashes

• Dec 23, 2018 - 23:10
Reported version
P0 - Critical
S2 - Critical

I suspect this might be related to #278943: Can't copy nested tuplets to last beat of measure.

This score has a lot of nested (three of three) tuplets. Now it looks like every single bracket has somehow moved up at least one staff.

If you look at the one on Violin II, measure 4, I can't drag it down where it belongs, because no matter whether autoplace is checked or not, the staff adjusts to it's placement to keep it above the bottom Vl. II staff and above the top Vl II staff. If I delete it, it deletes the tuplet in the Violas, and corrupts both the Vl. II staff and the Viola staff. Since I can't copy paste, rewriting these tuplets is a lot of work.

All of the invisible brackets are brackets I marked invisible when they were around the tuplet they were supposed to be around. They were fine then.

Attachment Size
Goetterdammerung.mscz 39.1 KB


I just tried deleting entirely and redoing some of the tuplets. It looked fine until I started adding notes to a new part, then the brackets decided they belong to other staves again.

Why does deleting result in deleting tuplets in a corruption causing way, anyway? Why not just let people delete a bracket if they don't want it? is it tied to tuplet duration somehow?

Alright, so I've found a lot.

Create a nested tuplet. Make a new staff. Add some notes. The brackets for the tuplet will switch staves. The smaller threes will disappear - move down about 40 sp.

Create a nested tuplet. Copy it. The small threes will disappear/move down 40 sp. Paste it, more oddness. I actually have a score were trying to paste a tuplet causes a crash every time - attached. It's at measure 61, the staccato one.

I've also seen other things getting duplicated on higher staves - hairpins, dynamics, staff text, lines. I think it's related.

Attachment Size
Gotterdammerung1.mscz 46.29 KB
Status active PR created

I managed to reproduce from scratch:
1- Create a new score
2- Format -> Style... -> Tuplets uncheck "avoid staves"
3- Create a tuplet and fill it with nested tuplets, so that the outermost tuplet contains only tuplets as its elements
4- Edit -> Instruments... insert a staff before the one containing the tuplets

When inserting the new staff, each element in the following staves are processed with a setTrack instruction to update its track to the new value, but tuplets are not processed among these elements, so the new track is propagated from a note/rest only to its closest parent tuplet, while the track of a tuplet containing only tuplets remains the same (i.e. it is not updated); step -2- is necessary to trigger the bug because if "Avoid staves" is checked, the tuplet track is later updated during the tuplet layout.

OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.0.0., revision: 1cf599c

Proposed PR:

In reply to by ABL

As a workaround for the already corrupted score, I think it is enough to check "avoid staves" in Format -> Style... -> Tuplets and then trigger a relayout by for example selecting all (ctrl+A). Then "avoid staves" can be unchecked again.

Fix version