Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placing lyrics above #1434

Open
olin256 opened this issue Aug 4, 2023 · 0 comments
Open

Placing lyrics above #1434

olin256 opened this issue Aug 4, 2023 · 0 comments

Comments

@olin256
Copy link

olin256 commented Aug 4, 2023

As per musicxml specification, each <lyric> element may have a placement attribute determining whether the text should be placed above or below the note (below is the default). OSMD places the lyrics always below.

Now after digging into MusicSheetCalculator, I've managed to put the lyrics above in a slightly hacky way – first by setting LyricsYMarginToBottomLine to something akin minus infinity (to ensure that lyricsStartYPosition is always chosen the same) and then by setting LyricsYOffsetToStaffHeight to an appropriate negative value.

This produces acceptable results most of the time; however, a perfect solution would take into account the actual skyline. Furthermore, there are genuine use cases when one wants lyrics both above and below (see e.g. this sheet).

My solution would be to split the lyrics into the "above" ones and "below" ones and handle those two branches separately; everything should be pretty much the same up to a couple of if's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant