You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
As per musicxml specification, each
<lyric>
element may have aplacement
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 settingLyricsYMarginToBottomLine
to something akin minus infinity (to ensure thatlyricsStartYPosition
is always chosen the same) and then by settingLyricsYOffsetToStaffHeight
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.
The text was updated successfully, but these errors were encountered: