[ << Changing defaults ] | [Top][Contents][Index] | [ Notation manual tables >> ] |
[ < Changing all contexts of the same type ] | [ Up : Changing context default settings ] | [ Order of precedence > ] |
Changing just one specific context
The context properties of just one specific context instance can be
changed in a \with
block. All other context instances of the
same type retain the default settings built into LilyPond and modified
by any \layout
block within scope. The \with
block
must be placed immediately after the \new
context-type
command:
\new Staff \with { [context settings for this context instance only] } { … }
Alternatively, if the music is being entered using the short form
of the input mode-specifying commands, e.g., \chords
rather
than \chordmode
, the \with
command must be placed
immediately after the mode-specifying command:
\chords \with { [context settings for this (implicit) context instance only] } { … }
as it is the implicit context created by these short forms which
should be modified. The same consideration applies to the other
input mode-specifying short forms (\drums
,
\figures
), see Input modes.
Since context modifications specified in \with
blocks are
inside music, they affect all outputs (typesetting
and MIDI) as opposed to changes within an output
definition.
The following types of settings may be specified:
- An
\override
command, but with the context name omitted.\score { \new Staff { \new Voice \with { \override Stem.thickness = 4.0 } { \relative { a'4^"Thick stems" a a a a4 a a a } } } }
- Directly setting a context property.
\score { << \new Staff { \relative { a'4^"Default font" a a a a4 a a a } } \new Staff \with { fontSize = -4 } { \relative { a'4^"Smaller font" a a a a4 a a a } } >> }
- A predefined command such as
\dynamicUp
.\score { << \new Staff { \new Voice { \relative { a'4^"Dynamics below" a a a a4 a a\ff a } } } \new Staff \with { \accidentalStyle dodecaphonic } { \new Voice \with { \dynamicUp } { \relative { a'4^"Dynamics above" a a a a4 a a\ff a } } } >> }
See also
Notation Reference: Input modes.
[ << Changing defaults ] | [Top][Contents][Index] | [ Notation manual tables >> ] |
[ < Changing all contexts of the same type ] | [ Up : Changing context default settings ] | [ Order of precedence > ] |