Shift on each relayout in score with multiple staves and courtesy key signature

• Jan 6, 2016 - 12:09
Type
Functional
Severity
S4 - Minor
Status
closed
Project

When entering notes the screen jumps left the right on the next note entry. Only happens after 150 or so bars and only in Page View mode. Notes are entered accurately but with the view jumping it is hard on the eyes.

Attachment Size
Phantom_Medley.mscz 43.09 KB

Comments

Are you sure this isn't just the normal way the view adjusts to keep the current measure in view at all times? If you think it is something other than that, can you give precise steps to reproduce the problem?

No, it definitely jumps during each note entry. I have made a fix by copying the whole into a new score although this is a pain as it doesn't copy across key changes, tempo marking, time changes etc.

Well, yes, but as I said, jumping is *normal* in order to keep the cursor in view. If the score never moved, you'd end up entering notes you couldn't see. Right now, without further information to go on, I see no reason to assume what you are seeing is anything but this normal motion to keep the cursor in view. If you think there is something different going on, we'd need precise steps to reproduce the problem, and or a video showing what you are seeing.

If it doesn't show using the attached file I can't help now as I have deleted the old copy. I do know the difference between 'normal' and what I am seeing. If I can further describe it, it is as if it needs to reformat to another page but then goes back to the original on further entry. Or when viewing say 4 bars of a score and entering notes in the second, the view will 'jump' and move the bars along so that the view of four bars now includes a bar from the previous view.
If it re-occurs I will attempt to get a video segment, otherwise I think we can close this as we are not getting anywhere. Thanks anyway.

If it doesn't show using the attached file I can't help now as I have deleted the old copy. I do know the difference between 'normal' and what I am seeing. If I can further describe it, it is as if it needs to reformat to another page but then goes back to the original on further entry. Or when viewing say 4 bars of a score and entering notes in the second, the view will 'jump' and move the bars along so that the view of four bars now includes a bar from the previous view.
If it re-occurs I will attempt to get a video segment, otherwise I think we can close this as we are not getting anywhere. Thanks anyway.

If you can give us precise steps to reproduce the issue using the score you posted, we can certainly try to reproduce the problem. So far randomly playing around with it I don't see anything unusual with note input per se, but I think maybe I see the underlying cause of what you are describing.

If I change to Page View and then simply press Ctrl+A, or anything else that forces a relayout, will change the layout starting on page 22. When I first switch to page view, the second system on that page starts with measure 154 and contains four measures. When I press Ctrl+A, a fifth measure appears on that system, and everything after that shifts accordingly. Pressing Shift+A again returns to the original layout.

We do see this sort of thing from time time, and usually it seems to have something to do with trying to calculate if there is enough room for another measure but being thrown off by the possible need for a courtesy key signature. We managed to improvie these calculations greatly for 2.0, but there are still a few corner cases where this sort of thing happens that we have been unable to completely resolve. Sometimes I think it is just floating point round-off error and to some extent unavoidable, other times something else seems to be going on.

Adding an explict line break after the fourth measure will of course prevent MuseScore from ever trying to fit that fifth measure, and with that, it will also stop the ripple effect this was having on subsequent systems.

If this seems to basically explain what you are seeing, and if adding the line break works around it, let us know, and we can changew the title of this issue accordingly and look into it on that basis.

Status (old) needs info active

Hah! I think I figured it out. It's a mistake I made while fixing another similar bug a year ago:

https://github.com/musescore/MuseScore/commit/25e43f2f1b97340027c6c8768…

In particular, right here, I believe I should have added leftMargin *inside* the call to qMax(), not outside. As it is, leftMargin keeps getting added in every time through the loop. The more staves you have, the more we overestimate the width of the courtesy key signature when trying to decide if we can fit another measure on the staff.

Not that this makes sense to anyone not familiar with the code here, but I wanted to put that down now in case anyone else wants to comment.