Clef change at the beginning of a piece (alternative)

Revision as of 18:46, 16 November 2025 by Jean Abou Samra (talk | contribs) (Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series)

When changing the clef at the beginning of the first measure, Lilypond just changes the clef for the staff. This is how to keep the staff clef and add an extra clef after the time signature and before the first note.

\version "2.24"

% LSR: http://lsr.di.unimi.it/LSR/Item?id=956
%% => http://lilypond.1069038.n5.nabble.com/Clef-change-at-the-beginning-of-a-staff-tc168090.html 
%% see also: http://lsr.di.unimi.it/LSR/Item?id=792

\relative c' {
  %%  Start with a bass clef :
  \clef bass
  %%  Use a hidden grace note:
  \once\hideNotes\grace c64
  %%  Adjust the clef spacing:
  \once\override Staff.Clef.X-extent = #'(1 . 2)
  %%  Put in the treble clef:
  \clef treble
  c4 c c c | c1
}