4

I would like to center a line of lyrics on a staff so that the lyrics go inside of the empty space. Right now I have this:

<<
    \new Lyrics \lyricmode {
        1
        \markup \column {
            "Vertically"
            "center"
            "on staff"
        }1
        1
    }
    
    \new Staff {
        c1 | \stopStaff s1 \startStaff | c1
    }
>>

But it just prints the lyrics above the staff. What can I do to put the lyrics inside so that they push the next measure horizontally instead of vertically?

I would also be fine with adding markup, as long as I can put the markup inside of a staff too.

1
  • If I understand your question correctly, check out music.stackexchange.com/q/124776/21766. It asks a different question, but the premise of the question (that of using a \dynamics staff) may explain what you're looking for.
    – Richard
    Commented Dec 6, 2023 at 4:00

1 Answer 1

3

Theoretically you can to that by using 0 distance and negative padding:

<<
    \new Lyrics \with {
      \override VerticalAxisGroup.nonstaff-unrelatedstaff-spacing.basic-distance = 0
      \override VerticalAxisGroup.nonstaff-unrelatedstaff-spacing.padding = #-inf.0
    } \lyricmode {
        1
        \markup \vcenter \column {
            "Vertically"
            "center"
            "on staff"
        }1
        1
    }
    
    \new Staff {
        c1 | \stopStaff s1 \startStaff | c1
    }
>>

which would probably not be the best way to get what you want. Rather the least esoteric way to do it if you do not strictly need lyrics is to use a markup

\new Staff {
    c1 |
    \stopStaff
    \once\textLengthOn
    s1-\tweak outside-staff-priority ##f -\tweak Y-offset 0 -\markup \vcenter \column {
        "Vertically"
        "center"
        "on staff"
    } \startStaff | c1
}

If you do for some reason need this to be Lyrics you could simply make the staff handle lyrics events:

\new Staff \with {
  \consists Lyric_engraver
} {
    c1 |
    \stopStaff
    \lyricmode {
        \markup \vcenter \column {
            "Vertically"
            "center"
            "on staff"
        }1
        These4 are ac -- tu -- |
        al ly -- rics2
    }
    \startStaff | c1
}
2
  • These are all great! Any thoughts on how I might be able to use \wordwrap instead of \column? I couldn't get it to work for some reason.
    – DWW256
    Commented Dec 5, 2023 at 23:11
  • @DWW256 You probably forgot to override the linewidth-property to something that makes sense. The default would be the whole line, so you only wrap after filling the line. Use e.g. \override #'(line-width . 10) \wordwrap ....
    – Lazy
    Commented Dec 6, 2023 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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