Jump to content

Force clef change in alternatives: Difference between revisions

From LilyPond wiki
No edit summary
m New category
Tags: Mobile edit Mobile web edit
 
Line 24: Line 24:
[[Category:Staff notation]]
[[Category:Staff notation]]
[[Category:Editorial annotations]]
[[Category:Editorial annotations]]
[[Category:Workaround]][[Category:Snippet]]
[[Category:Workaround]]
[[Category:Snippet]]

Latest revision as of 23:24, 21 November 2025

This snippet shows how to force the appearance of a callback clef during a repeat.

\version "2.24"

%% => http://lilypond-french-users.1298960.n2.nabble.com/Changement-de-cle-avant-reprise-td7590078.html

\relative c' {
  \repeat volta 2 {
     c4 d e f g1 \clef bass g,4 a b c
  } 
  \alternative {
    { d1 \clef treble }
    { 
      \grace s4
      \once \override Staff.Clef.extra-spacing-width = #'(-1.5 . 0)
      \clef bass
      d4 c b a 
    }
  } 
  g1
}