The constructs for describing the accidental typesetting rules are
quite hairy, so non-experts should stick to the variables
defined in ly/property-init.ly
.
The variables set properties in the "Current
" context (see
Context properties). This means that the variables should
normally be added right after the creation of the context in which the
accidental typesetting described by the variable is to take
effect. For example, if you want to use piano-accidentals in a piano
staff then issue \pianoAccidentals
first thing after the
creation of the piano staff:
\score { \notes \relative c'' << \new Staff { cis4 d e2 } \context GrandStaff << \pianoAccidentals \new Staff { cis4 d e2 } \new Staff { es2 c } >> \new Staff { es2 c } >> }
The variables are:
\defaultAccidentals
\voiceAccidentals
\defaultAccidentals
.
This leads to some weird and often unwanted results because accidentals from one voice do not get cancelled in other voices:
\context Staff << \voiceAccidentals << { es g } \\ { c, e } >> >>
Hence you should only use
\voiceAccidentals
if the voices
are to be read solely by individual musicians. If the staff is to be
used by one musician (e.g. a conductor) then you use
\modernVoiceAccidentals
or \modernVoiceCautionaries
instead.
\modernAccidentals
\defaultAccidentals
.
You get all the same accidentals, but temporary
accidentals also get cancelled in other octaves. Furthermore,
in the same octave, they also get cancelled in the following measure:
\modernAccidentals cis' c'' cis'2 | c'' c'
\modernCautionaries
\modernAccidentals
, but the
"extra" accidentals (the ones not typeset by
\defaultAccidentals
) are typeset as cautionary accidentals.
They are printed in reduced size or with parentheses:
\modernCautionaries cis' c'' cis'2 | c'' c'
\modernVoiceAccidentals
\modernVoiceCautionaries
\modernVoiceAccidentals
, but with the extra
accidentals (the ones not typeset by \voiceAccidentals
) typeset
as cautionaries. Even though all accidentals typeset by
\defaultAccidentals
are typeset by this variable then
some of them are typeset as cautionaries.
\pianoAccidentals
\modernAccidentals
but accidentals also get cancelled
across the staves in the same GrandStaff or
PianoStaff.
\pianoCautionaries
\pianoAccidentals
but with the extra accidentals
typeset as cautionaries.
\noResetKey
\defaultAccidentals
but with accidentals lasting
"forever" and not only until the next measure:
\noResetKey c1 cis cis c
\forgetAccidentals
\noResetKey
: Accidentals
are not remembered at all--and hence all accidentals are
typeset relative to the key signature, regardless of what was
before in the music:
\forgetAccidentals \key d\major c4 c cis cis d d dis dis
This page is for LilyPond-2.0.1 (stable-branch).