3

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.

  • You can add a Dynamics context below your staves and add the engraver to it that renders the bar numbers. Equally, you can try to shift the chord names using \consists. I will give an answer later when I have proper internet – Jasper Habicht Oct 14 at 21:10
4

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 
    }
  }
}

enter image description here

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'
  } 
  >>
}

enter image description here

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.