Adding notes deletes contents of unrelated staff if linked staves present

• Mar 17, 2015 - 03:40
S2 - Critical

Ubuntu 14.04, GIT commit: f953fe7

1) new score, flute + guitar, add linked staff to guitar staff
2) add note to flute staff

Result: the measure rest is deleted from the top guitar staff

Similarly, adding note to top guitar staff removes the measure rest from the flute staff

Somewhere we must be off by one with a staff index?


Somehow, the initial rests for all three staves are linked together. It's always one staff above the two staves that gets mixed up in this. Even you have additional staves above the flute, it's still only the flute that has issues with the guitar.

Looks like this was broken at the RC, but was working last month.

This appears to be a result of the re-architecting of new score creation a few weeks ago. The problem is here:

If I understand correctly, the idea is to link the rests we insert for linked staves, which makes sense. But the problem is, when we get to the first linked staff, rest is non-null from the previous staff, so we link that too.

Solution would seem to be simple - set "rest" back to null at the end of the loop for non-linked staves, so their rests don't get re-used. I see there was some back and forth regarding this very section code, so I'll look to see if there isn't something else that makes more sense. But so far, just adding that seems to fix it.

This issue appears likely on March 3

I receive this correct result on this Nightly on March 1 (the last one of this day I think, no nightly on March2) : 1d90b26

With result:
result March1.jpg

I get a fail with this one: 19e8f45

result March3.jpg

After checking, the second mentionned Nigthly doesn't seem involved?
Furthermore, I see two commits (except oblivion of my part) between this two nightlies. And I don't understand for the moment where might be the problem with those ?


Or? -…

EDIT: I had sent my message before to verify in the thread the previous message of Marc :(

I think the problem is, there were actually a whole bunch of commits made in a short period of time relating to the change to how scores are created, and probably no nightlies were available for some of them.

The same problem exists for pickup measures, btw, even if I make the change I proposed above. I think I need to add similar code elsewhere. Still investigating.

Status (old) active patch (code needs review)

Works for both regular and pickup measures (tested with 3/8) in my tests. Looks from the code like there is allowance for the possibility that different staves might have different numbers of rest, but I have no idea how to generate that condition, so I can't say for sure what would happen.