Unsure how to move text outside of staff in LilyPond
I'm attempting to notate a choral psalm where only certain refrains are sung in four-part harmony, with the first few refrains are just the unison psalm melody sung by all parts. I'm attempting to do this by placing text between the instrument names before the staves on the first line, as with this example:
This is what I have so far: pastebin.com/Tu7tW27X
So far, I've attempted to do this by placing a boxed text object above the lower staff and then moving it left, but this still leaves an unsightly gap between the staves that I can't seem to remove. Is there a way to either directly print this text between the instrument names or move it from elsewhere without disturbing the spacing between the staves?
2 Comments
Sorted by latest first Latest Oldest Best
The cleanest way to do this is to create a new StaffGroup for your SA and TB staves, and give it its own instrumentName. That will automatically center the boxed text between the staves, without having to manually raise it by the correct amount depending on how Lilypond formats the music on the first system of the score.
You need to suppress the extra bracket around the new StaffGroup.
This is a basic skeleton. Personally I prefer to put all the instrument names in the score block, rather than scattered around the rest of the input, but whoever wrote the MuseScore-to-Lilypond converter did it differently!
score {
<<
context ChoirStaff = B {
<<
context Staff = ATrpartA {
set Staff.instrumentName = #"Discantus."
<<
context Voice = ATrvoiceAA { }
>>
}
new StaffGroup {
set StaffGroup.systemStartDelimiter = #'SystemStartBar
set StaffGroup.instrumentName = markup {
box center-column { "SATB"{"after v.3 & 4"} } }
<<
context Staff = ASpartB {
set Staff.instrumentName = #"Soprano & Alto."
ASpartB
}
context Staff = ABpartC {
set Staff.instrumentName = #"Tenor & Bass."
ABpartC
}
>> }
>> } % end of StaffGroupB
>> } % end of score-block
Instrument names can contain markups, so you can put the box inside one.
markup {
{
center-column {
raise #5 box center-column {
"SATB"{"after v.3 & 4"}
}
"Tenor & Bass." " " " " " "}
}
}
Terms of Use Privacy policy Contact About Cancellation policy © freshhoot.com2026 All Rights reserved.