5.1.4 Changing context default settings

The context settings which are to be used by default in Score, Staff and Voice contexts may be specified in a \layout block, as illustrated in the following example. The \layout block should be placed within the \score block to which it is to apply, but outside any music.

Note that the \set command itself and the context must be omitted when the context default values are specified in this way:

\score {
  \relative c'' {
    a4^"Really small, thicker stems, no time signature" a a a
    a a a a
  }
  \layout {
    \context {
      \Staff
      fontSize = #-4
      \override Stem #'thickness = #4.0
      \remove "Time_signature_engraver"
    }
  }
}

[image of music]

In this example, the \Staff command specifies that the subsequent specifications are to be applied to all staves within this score block.

Modifications can be made to the Score context or all Voice contexts in a similar way.

Known issues and warnings

It is not possible to collect context changes in a variable and apply them to a \context definition by referring to that variable.

The \RemoveEmptyStaffContext will overwrite your current \Staff settings. If you wish to change the defaults for a staff which uses \RemoveEmptyStaffContext, you must do so after calling \RemoveEmptyStaffContext, ie

\layout {
  \context {
    \RemoveEmptyStaffContext

    \override Stem #'thickness = #4.0
  }
}

Other languages: français, español.

Notation Reference