| [ << Changing defaults ] | [Top][Contents][Index] | [ Notation manual tables >> ] |
| [ < Changing context default settings ] | [ Up : Changing context default settings ] | [ Changing just one specific context > ] |
Changing all contexts of the same type
The default context settings which are to be used for typesetting in
Score, Staff, Voice and other contexts may be
specified in a \context block within any \layout
block.
Settings for Midi output as opposed to typesetting will have to be
separately specified in \midi blocks (see Output definitions – blueprints for contexts).
The \layout block should be placed within the \score
block to which it is to apply, after the music.
\layout {
\context {
\Voice
[context settings for all Voice contexts]
}
\context {
\Staff
[context settings for all Staff contexts]
}
}
The following types of settings may be specified:
- An
\overridecommand, but with the context name omitted\score { \relative { a'4^"Thicker stems" a a a a4 a a\ff a } \layout { \context { \Staff \override Stem.thickness = 4.0 } } }
- Directly setting a context property
\score { \relative { a'4^"Smaller font" a a a a4 a a\ff a } \layout { \context { \Staff fontSize = -4 } } }
- A predefined command such as
\dynamicUpor a music expression like\accidentalStyle dodecaphonic\score { \relative { a'4^"Dynamics above" a a a a4 a a\ff a } \layout { \context { \Voice \dynamicUp } \context { \Staff \accidentalStyle dodecaphonic } } }
- A user-defined variable containing a
\withblock; for details of the\withblock see Changing just one specific context.StaffDefaults = \with { fontSize = -4 } \score { \new Staff { \relative { a'4^"Smaller font" a a a a4 a a a } } \layout { \context { \Staff \StaffDefaults } } }
Property-setting commands can be placed in a \layout block
without being enclosed in a \context block. Such settings
are equivalent to including the same property-setting commands at
the start of every context of the type specified. If no context
is specified every bottom-level context is affected
(see Bottom-level contexts – voices). The syntax of a
property-setting command in a \layout block is the same as
the same command written in the music stream.
\score { \new Staff { \relative { a'4^"Smaller font" a a a a4 a a a } } \layout { \accidentalStyle dodecaphonic \set fontSize = -4 \override Voice.Stem.thickness = 4.0 } }
| [ << Changing defaults ] | [Top][Contents][Index] | [ Notation manual tables >> ] |
| [ < Changing context default settings ] | [ Up : Changing context default settings ] | [ Changing just one specific context > ] |
![[image of music]](../44/lily-60b37e46.png)
![[image of music]](../a5/lily-5687b4fb.png)
![[image of music]](../ab/lily-8f903095.png)
![[image of music]](../d5/lily-531c6317.png)
![[image of music]](../86/lily-147f80e2.png)