bell notificationshomepageloginNewPostedit profiledmBox

Hoots : Force bar numbers below the staff and chord names above in LilyPond In the documentation for the bar number engraver, it's quite clear that the bar numbers were only ever intended to go above the staff. How do I override - freshhoot.com

10% popularity   0 Reactions

Force bar numbers below the staff and chord names above in LilyPond
In the documentation for the bar number engraver, it's quite clear that the bar numbers were only ever intended to go above the staff. How do I override that behavior? It would make a part I'm working on look much cleaner (when they're set to the top, they make a habit of floating way above the main staff when the ossia staff is active in a system but not visible). This reddit user also found nothing useful except a suggestion of "make sure the bars line up between staves and fake the measure numbers, which only could work in highly specific cases.

Related, can I force chord names to display above the staff? It looks confusing when they display below the staff. The sample lead sheet and all the surrounding snippets have the chords above the staff, yet my part keeps placing the chord names below the staff. I suspect that the ossia staff is causing issues here as well.

Something from the aligning objects documentation seems like it should be useful in both cases, but I'm not sure how to apply it to the actual project I'm working on.


Load Full (1)

Login to follow hoots

1 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

As for the bar numbers moved below the score, there are two approaches. The first would be to just use override BarNumber.direction = #DOWN to shift the standard bar numbers down. The second approach adds a centred bar number for each bar below the score. This second approach is best described in this snippet.

For the first approach, you can use the following code:

version "2.18.2"

score {
<<
new Staff {
c'4 d' e' f' g' a' b' c' d' e' f' g' a' b' c' d' break
e' f' g' a' b' c' d' e' f' g' a' b' c' d' e' f'
}
>>

layout {
context {
Score
override BarNumber.direction = #DOWN
}
}
}

As for the chord names, you should put your ChordNames context at the correct position and also tell the ossia context to be above or below another context. For example like this (note the named Staff and the reference in the ossia):

version "2.18.2"

score {
<<
new ChordNames {
chordmode {
c1 g d a e b f c
}
}

new Staff = "main" {
c'4 d' e' f' g' a' b' c' d' e' f' g' a' b' c' d'
<<
{ e'4 f' g' a' }
new Staff with {
remove "Time_signature_engraver"
override StaffSymbol.staff-space = #(magstep -3)
override StaffSymbol.thickness = #(magstep -3)
fontSize = #-3
firstClef = ##f
alignAboveContext = #"main"
}
{ e'4 f' g' a' } 
>>
b'4 c' d' e' f' g' a' b' c' d' e' f'
}
>>
}

(Spacing could be nicer, but I hope you get the point.)


Back to top Use Dark theme