0

LilyPond produces strange, overlapping staves if a VoiceFollower crosses a page break. Consider the following code:

\version "2.24.3"
\language "italiano"

\paper {
    #(set-paper-size '(cons (* 195 mm) (* 120 mm)))
}

\score {
    \new PianoStaff <<
        \new Staff = "right" \relative do'' {
            <>
            \key re \minor
            \numericTimeSignature
            \time 3/4
            <<
                {
                    sold8-- (sol16 sold la4) r4
                    \pageBreak
                    \oneVoice
                    <sib re mi sol sib>8-> [
                    <la dod mi sol la>->
                    <fad do' re fad>->]
                    <sol, do! sol'>16-- [(la' <fad, do' fad>8--)] r8
                }\\
                {
                    re'4~ 16 dod (mi sol la dod mi sol)
                }\\
                {
                    s2 s8 s16
                    \change Staff = "left"
                    \stemDown
                    \hideNotes
                    la,
                    \override VoiceFollower.breakable = ##t
                    \showStaffSwitch
                    \once \omit Stem
                    \once \omit Flag
                    \change Staff = "right"
                    sib8
                    \hideStaffSwitch
                    \unHideNotes
                }
            >>
            <<
                {
                    r16 do' (sib la sol4~-- 8) la
                    \break
                    fa4~-- 8 sol (mib re)
                }\\
                {
                    r4 re,4 do~ 4 sib'8 lab sol4
                }
            >>
        }
        \new Staff = "left" \relative do {
            \key re \minor
            \clef bass
            <<
                {
                    fa4 (mi)
                }\\
                {
                    la,2
                }
            >>
            \clef treble
            dod'16 mi sol la
            <sol, re' mi sol>8_> [<la dod mi sol>_> \clef bass <re, la' re>_>]
            <la mib'>_- [<re, la' re>_- ] \clef treble
            la'''16 sib
            \mergeDifferentlyDottedOn
            <<
                {
                    do fad, sol la sib--
                    la sol la sol8 fa16 sol
                    la16-- sol fa sol <fa>4 r4
                }\\
                {
                    s16 fad8. fa4 mib~ 4
                    <re>8 do16 re mib re sib do
                }
            >>
        }
    >>
}

Here is the result: enter image description here

If you delete \showStaffSwitch, the result will be: enter image description here

As a proof of concept, everything works as expected if you remove all extra breaks: enter image description here

1

0

Your Answer

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

Browse other questions tagged or ask your own question.