A time signature change deletes all voices >1 in Tab staff with linked staves
Nightly 8911cdd or MuseScore 2.0.1 / Windows7
1) Load this file: test file.mscz
This is the start point:
2) Drag and drop a new time signature e.g. 2/4 in the first measure
Result: all the voices 2, 3, and 4 are deleted in the tab staff
Additionnal notes :
- same result in Tab staff type common and full
- if you copy-paste (in the test file) the first measure (EDIT: i.e. after the change in 2/4) into an other, the voices >1 return in the tab staff. But drag in this measure a new time signature removes that.
Comments
New title: this issue is related to linked staves.
Load this file to verify that it works if the content of the first staff (standard) has been pasted in the the second staff (Tab) : test file2.mscz
Well, after checking, this issue goes back to 6 months :(
On November 13
- This Nightly works: bbe146b
With result:
- Not this one: 3486e76
Result:
So, the "candidate" is most likely in the previous commit: https://github.com/musescore/MuseScore/commit/4196bd1ca96239d251e26554f…
To fix: #38341: Changing time signature with two differents clefs in linked staves causes false "transposition"
I'm looking at this and I do understand what is going wrong. I have a proposed solution, although I'm not super confident about it.
The November 13 change referred to above had a number of effects, but I think the most relevant is the fact that ScoreRange::read() now iterates over uniqueStaves rather than all staves. This has the effect of not copying both linked staves, but only the first. The second staff is then recreated on the fly from the first via cloneStaff2(). Unfortunately, this happens after only the first track of the staff has been written, so the voices 2-4 never get cloned.
My proposed fix is to simply do the clone after the *last* track of the staff, rather than the first. Simly changing "if ((track & VOICES) == 0)" to "if ((track % VOICES) == VOICES - 1)" works in the test case and a couple of others I tried. I guess my worry is, I could imagine cases where the track list for the ScoreRange doesn't actually contain entries for voice 2-4, so track would only ever be multiples of 4. But this didn't seem to ever happen in the cases I tried, even when there was absolutely nothing in any voice but 0.
I also have to say I'm not overly thrilled with the fact that we end up recreating the linked staff on the fly. It means we lose any manual adjustments that were made before the change. Eg, add an accent mark to any note, drag it to a new position in the tab staff, then make the time signature change. The manual adjustment in the tab staff is lost. Not the end of the world I guess, but it does make me a little uncomfortable with the whole idea of this approach.
Anyhow, I'll be submitting a PR soon.
This also affects linked parts, and the resuling file could then be considered corrupt - notes in one linked staff not linked to the other staff. This can lead to all sorts of other problems. So I'm upgrading this to critical.
Here is my proposed fix:
https://github.com/musescore/MuseScore/pull/2107
I created another issue to address the manual adjustment loss #68021: Changing time signature with linked staves overrides manual adjustments
Fixed in branch master, commit 990c79266a
fix #60791: timesig change deletes voices 2-4 in linked staves
Fixed in branch master, commit a1dc572e5c
Merge pull request #2107 from MarcSabatella/60791-timesig-link-staff
fix #60791: timesig change deletes voices 2-4 in linked staves
Fixed in branch 2.0.2, commit 28ace48040
fix #60791: timesig change deletes voices 2-4 in linked staves
Automatically closed -- issue fixed for 2 weeks with no activity.