Per-voice ottavas cause certain clefs to be ignored
From Heiko Schill (https://lists.gnu.org/archive/html/bug-lilypond/2023-06/msg00000.html)
\version "2.25.5"
\markup \left-column {
"The change to bass clef is ignored for the lower voice here, when the" "ottavation spanner is moved from the staff- to the voice-context."
}
\score {
\layout {
\context {
\Staff
\remove Ottava_spanner_engraver
}
\context {
\Voice
\consists Ottava_spanner_engraver
}
}
\new Staff
<<
\new Voice { \clef treble { \relative c' { \voiceOne c'2 c4 c | \clef bass a,1 } } }
\new Voice { \clef treble { \relative c' { \voiceTwo d2 \ottava -1 d,4 \ottava 0 d' | \clef bass d,1 } } }
>>
}
\markup \left-column {
"With the default setup the example compiles correctly, but the" "ottavation entered in the lower voice is applied to both voices" "since the ottavation spanner is added to the staff context."
}
\score {
\new Staff = "one"
<<
\new Voice = "first" { \clef treble { \relative c' { \voiceOne c'2 c4 c | \clef bass a,1 } } }
\new Voice = "second" { \clef treble { \relative c' { \voiceTwo d2 \ottava -1 d,4 \ottava 0 d' | \clef bass d,1 } } }
>>
}
\markup \left-column {
"This example compiles correctly, even with the ottavation spanner moved from the" "staff- to the voice-context."
}
\score {
\layout {
\context {
\Staff
\remove Ottava_spanner_engraver
}
\context {
\Voice
\consists Ottava_spanner_engraver
}
}
\new Staff = "two"
<<
\new Voice = "first" { \clef treble { \relative c' { \voiceOne c'2 c4 c | \clef bass a,1 } } }
\new Voice = "second" { \clef treble { \relative c' { \voiceTwo d2 d4 \ottava -1 d, \ottava 0 | \clef bass d1 } } }
>>
}
\markup \left-column {
"The bug manifests itself also in a single voice example, but here it does not matter"
"if notes are located between the \ottava and \clef commands."
}
\score {
\layout {
\context {
\Staff
\remove Ottava_spanner_engraver
}
\context {
\Voice
\consists Ottava_spanner_engraver
}
}
\new Staff {
\clef treble { \relative c' { d2 d4 \ottava -1 d, \ottava 0 | \clef bass d1 } }
}
}
\markup \left-column {
"This is the intended result with the default setup"
}
\score {
\new Staff {
\clef treble { \relative c' { d2 d4 \ottava -1 d, \ottava 0 | \clef bass d1 } }
}
}