The Quest for the Hidden Feature (Text centered on barlines)
There is not one, not two, not three, but FOUR DIFFERENT features within MuseScore's code that are all doing the same simple thing: centering text on a barline. And they all fall flat on their face, hard. They're not actually achieving their task, they're just trying to, and not very hard at that. That's incredible commitment. You'd think one would get it right. (Okay, what you'd actually think is it gets coded once, used in all instances, and either be bad or good.)
The core issue is that barlines are not zero-width objects of metaphysical fairy dust. Especially when we're talking about double barlines, etc. They are fat. And that's a fat problem. Because double barlines and text above barlines are creatures that very much like to live together.
Feature One: Any common text entity. Centers to the left edge of the barline. (Behind the scenes: If anchored to the zeroth position of a measure, that's where they center to. It's just that the zeroth position is precisely where the last measure ended, i.e. the left edge of the barline.)
Feature Two: Jump markers. Centers to the right edge of the barline. (Behind the scenes: This one's the weirdest. Jump markers anchor to a measure instead of a position within it, and they can either be right-aligned (used for D.S., etc. markers), centered (not used by anything by default), or left-aligned: Same button as any text entity, BUT has its very own special code. This mislabeled little button does not left-align anything, it's actually a specifically dedicated "center on left barline" button. Used for segno and coda markers. But sadly the reference point is not the barline, it's the left edge of what they're anchored to: the measure. So what they actually center to is the right edge of the barline.)
Feature Three: Rehearsal marks. Centers to the right edge of the barline. (Behind the scenes: If anchored to the first position in a measure, they're actually offset to the left by the leading space of that position. Which makes them crash-land right on the right edge of the barline. But only in this special case. The offset is not applied in any other position. And it's also an invisible offset, there's 0 horizontal offset under appearance when you look. It's so weird I love it.)
Feature Four: Measure numbers, honorary mention. Centers to the right edge of the barline. (Behind the scenes: They're hard-anchored to the upper left corner of a measure and left-aligned by default, but you can center them and that's almost centered on the barline. You can also right-align them if you're weird and want to confuse people.)
I just want ONE feature that actually does what it set out to do. Maybe there is a fifth one that I just haven't found yet. But then the question becomes, why all this duct tape coding and not just use the working feature in all instances?
How jump markers work is a good start. There should be an additional option for all staff text entities under alignment: "center on left barline". (And perhaps "center on right barline" too, but that's only necessary for the final barline, and I don't know who would ever use that.) Rehearsal marks and segno/coda markers could use this by default, cutting down on the one-off workarounds. And if someone wanted to e.g. put a metric modulation above a barline (as many engravers do), they would have a handy little feature that does it for them consistently.
This requires that barlines get a defined center for the purposes of centering text on them. I don't think it should just be the center of their width, i.e. dots of the repeat signs should be ignored.
(The attached score (and screenshot thereof) showcases the behavior of different text entities “centered” on barlines; text replaced by downarrows and text properties equalized for clarity where possible.)
Attachment | Size |
---|---|
center_on_barline.mscz | 20.45 KB |
center_on_barline.png | 30.88 KB |
Comments
Another related observation is MuseScore doesn't center text on anything. For example. A lyric under a quarter note is off to the left roughly two clicks of the right arrow key.
In reply to Another related observation… by bobjp
What is not properly centered here?