Breath mark and caesura appears before next note on any staff, not next note on current staff

• Feb 4, 2015 - 17:46
S4 - Minor

Ubuntu 14.04, GIT commit: bad0f6f

1) score for two intruments, 4/4
2) top staff: quarter quarter notes
3) bottom staff: dotted half, quarter
4) place breath mark after dotted half in second staff

Result: it appears very close to the dotted half - the segment is inserted before the segment for the second quarter note. Instead, we should be searching out the next chordrest segment with an element *in this staff*.

Playback is already correct, BTW - I changed it to work this way a few days ago.


Right now, the breath segment is added with the same tick as the *preceding* note. This is unfortunate. For one thing, it complicates the playback code - this was the fix I made recently, although I'd be happy to simplify it again. But it also means you can't have breaths in the same segment for all staves unless they have the same rhythm, and it means you get incorrect layout as is the case here.

I would be happy to reimplement it so that the the breath segment has the tick of the *following* chord and comes before that chord, which would solve these problems. But I am not sure I'd want to have to deal with the compatibility concerns for older scores.

I think compatibility might not be so bad. It would mean a version number bump, and older builds wouldn't be able to handle newer scores, but of course we don't guarantee that anyhow. It think it would work as follows: on read of older scores, we would not add the breaths right away but instead queue them up. After reading the measure, we fix up the ticks and add the segments then. The change when adding new breath marks would not be in the layout but in the drop. We'd basically take the code I added to fixTicks() to calculate an appropriate tick and move it here.

Status (old) active patch (code needs review)

Here is the PR:

I'm working on adding a test, and will of course fix any that fail as a result of the change.