Good evening everyone,

when compiling the attached document, in the first staff the clef change is
ignored for the lower voice after moving the ottavation spanner to the
voice context as suggested in the snippets-document. This seems to happen
only if one or more notes are located between the "\ottava 0" and the
"\clef bass" command (see the third staff which compiles correctly).

In the default setup (second staff), the ottavation and clef change work
correctly, but the ottavation is applied to all voices in the staff (as by
design, but not intended here).

The usage of several voices is not necessary: In a single voice example,
the bug manifests irrespective of the presence of extra notes between the
\ottava and \clef commands (see staffs 4 and 5).

I noticed this behavior with version 2.24.0, but it is the same with
version 2.24.1 and 2.25.5.

Best regards,
Heiko
\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 } }
  }
}

Reply via email to