The following snippet illustrates a problem I am having with a collision between a slur and some lyrics:
version "2.24.0"
BassVoice = relative d
{
clef bass
d2 d4 d4 |
}
BassVoiceLyrics = lyricmode
{
Word word word
}
PianoRightHand = relative g'
{
clef treble
s1 |
bar "|."
}
PianoLeftHand = relative g'
{
clef bass
g,8^( change Staff = "up" g'8 d'8^[ d'8 b8 g8 d8] g,8) |
bar "|."
}
score
{
<<
new StaffGroup
<<
new Staff = "Bass"
<<
context Staff
<<
context Voice = "BassVoice" { voiceTwo BassVoice }
new Lyrics with { alignBelowContext = "Bass" }
lyricsto "BassVoice" BassVoiceLyrics
>>
>>
>>
new PianoStaff
<<
context Staff = "up" with { override VerticalAxisGroup.default-staff-staff-spacing =
#'((basic-distance . 100)
(minimum-distance . 100)
(padding . 100)
(stretchability . 100))
}
<<
context Voice = "PianoRightHand" { voiceOne PianoRightHand }
>>
context Staff = "down"
<<
context Voice = "PianoLeftHand" { voiceOne PianoLeftHand }
>>
>>
>>
}
I have tried overriding the default-staff-staff-spacing values, but even bumping all of them up to a ridiculous number like 100 isn’t changing the spacing. So what am I missing? And why didn’t LilyPond detect the collision between the lyrics and the slur in the first place and adjust?
I’m not sure why you are using voiceOne
rather that oneVoice
, or why you have those quavers beamed like you have. But presumably, there is a good reason to do this and you have removed another voice(s) to simplify the example — fair enough.
The current implementation (v2.24) of LilyPond’s change Staff
has some issues. In particular, despite the change of staff, LilyPond is still looking for potential vertical collisions of that voice as if it were in the lower staff; it’s not even checking for collisions with vocal staff — hopefully this gets fixed in a future version.
One (somewhat hacky) way to remedy this bug is by placing a note in the upper piano staff at an appropriate height, and hiding it. In this case you can simply replace that semibreve spacer rest (s1
) with say hideNotes f'''1
.
However, if you are generating a MIDI file this hidden note will still make a sound. This can be overcome using tags.
As a side note, LilyPond questions are on-topic here on Stack Overflow, but they are also on-topic (and much more likely to get answers) on another site on the Stack Exchange Network: Music Practice & Theory.
1