musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
11.94k stars 2.58k forks source link

Enhance Lilypond Lyrics to handle MU3 syntax #17366

Open MarcSabatella opened 1 year ago

MarcSabatella commented 1 year ago

Your idea

Adding the Lilypond Lyrics plugin to the distribution is great. However, the syntax one needs to use in order to enter lyrics is something that is going to seem extremely unnatural to anyone not actually accustomed to LilyPond. We could try to invent what we think is the ideal syntax, but the syntax used in MU3 is as good as anything, I think. So I propose we support that more directly (in addition to the LilyPond format - see below).

Problem to be solved

We want to make it as easy as possible for people to enter lyrics. The plugins is a great step, but I want to make the syntax easier to use, especially for users accustomed to the MU3 format.

Prior art

MuseScore 3 used a syntax where hyphens were simply typed normally ("Ma-ry had a lit-tle lamb"), with no need to double them up or surround them with spaces. Underscores similarly worked more simply than the LilyPond syntax. The MU3 format is based more on how someone might normally type.

Additional context

While we could modify the main parsing code, we probably don't want to lose the LilyPond compatibility either. Plus I think it supports some things MU3 didn't in terms of embedded spaces, hyphens, or underscores within syllables.

So instead I suggest we leave the main code alone but leverage the existing "Expand" and "Condense" functionality to achieve the MU3 compatibility. These already do the right thing with hyphens; they just don't handle underscores in the way they would need to. So I think a simple change to the expandLyrics() and condenseLyrics() functions would take care of that.

I would also propose we simplify the usage further by making the MU3 (collapsed) format the default. I think that could be accomplished with minimal change by simply calling expandLyrics() automatically on Paste, and collapseLyrics() automatically on Dump.

I'm not quite sure right now what Merge really does, but I assume it would not be difficult to adapt either.

Assuming these changes are OK with the team, I am sure I or others in the community could implement them in short order.

Jojo-Schmitz commented 1 year ago

Related to #13215

ZingenmetJan commented 1 year ago

I really would appreciate it when this feature could be implemented this way! Thanks in advance.