Parse verse number out of lyric and align lyric properly

• Oct 11, 2014 - 14:14
Type
Functional
Severity
S5 - Suggestion
Status
closed
Project

Comments

I always assume any automatic scheme would produce results other than exactly what the user desires at least some of the time. So my preference is usually for simple algorithms that provide predictable defaults, and expect that users will sometimes need to adjust manually from there. Which is to say, I don't expect perfection, but hope for something that works well in the usual case and doesn't make it difficult to manually adjust for the unusual case.

In this situation, I think what makes sense to me is a simple algorithm that says something like, "if syllable begins with a digit, left align on first non-digit (whether punctuation, space, or letter)". So in a syllable like "1. The" (with a "hard" space), the "." would be aligned under the note, the "1" to the left of that. I think this is more or less standard, although I'm no expert on this. If you've got something that needs different alignment, you could just adjust manually to get it how you like it.

We could also consider adding an option to suppress this automatic left alignment - and perhaps apply it also to melisma.

Status (old) active patch (ready to commit)

https://github.com/musescore/MuseScore/pull/1391

If a lyric syllable has leading digits, they are treated as a verse number, and the lyric is left-aligned on the first "word" character (somethng other than digit, punctuation, or space). Lyrics consisting of digits and punctuation *only* are not affected.

Also, leading punction is ignored, although the lyric is still centered - see #24856: Ignore "parenthesized expressions" that precede lyric syllables.

Here is the vtest:

lyrics-3-ref.png

Attachment Size
lyrics-3-ref.png 9.69 KB

That seems to be a Qt size.calculation issue. It's often off just a little. But it really is aligning after the space in theory, as you can see if you put in multiple spaces.

How about something like

1. One
2. <some break symbol here>
3. three

(Just in case I find out how to enter such a break symbol in the first place ;-))

The important thing is to right-align the verse numbers. The alignment of the the lyrics themselves is a secondary factor. Both MuseScore (with my PR) and LilyPond achieve the primary goal; they just have different approaches to the secondary factor. I have seen both in published music. I went with the approach of left aligning the lyric because:

a) that's how it was already being done with the previous implementation using Verse Number elements
b) the point of this scheme was to avoid breaking up the number and syllable into separate elements, and that's what LilyPond is doing (automatically changing the amount of space between the number and syllable)
c) if we wish to avoid use of the Verse Number element, achieving the LilyPond effect would require layout of one syllable to be dependent on content of other verses, which is something we cannot do right now.

If we decided it was important to go with the LilyPond style, it *is* possible, but it would pretty much require us to go back to using separate Verse Number elements. Advantage, I guess, would be you could have the special text style. It would be possible to still parse the verse number automatically - that is, we could still avoid the need for the Verse Number element on the palette..