Make accidentals. Catch note heads, ties and notices key-change events. This engraver usually lives at Staff level, but reads the settings for Accidental at Voice level, so you can \override them at Voice.

Properties (read)

accidentalGrouping (symbol)

If set to 'voice, accidentals
on the same note in different octaves may be horizontally staggered
if in different voices.

autoAccidentals (list)

List of different ways to typeset an
accidental.

For determining when to print an accidental, several different rules
are tried. The rule that gives the highest number of accidentals is
used.

Each entry in the list is either a symbol or a procedure.

symbol

The symbol is the name of the context in which the following rules are to be
applied. For example, if context is Score then all
staves share accidentals, and if context is Staff then
all voices in the same staff share accidentals, but staves do not.

procedure

The procedure represents an accidental rule to be applied to the previously
specified context.

The procedure takes the following arguments:

context

The current context to which the rule should be applied.

pitch

The pitch of the note to be evaluated.

barnum

The current bar number.

measurepos

The current measure position.

The procedure returns a pair of booleans. The first states whether an extra
natural should be added. The second states whether an accidental should be
printed. (#t . #f) does not make sense.

autoCautionaries (list)

List similar to autoAccidentals,
but it controls cautionary accidentals rather than normal ones. Both
lists are tried, and the one giving the most accidentals wins. In
case of draw, a normal accidental is typeset.

extraNatural (boolean)

Whether to typeset an extra natural sign
before accidentals that reduce the effect of a previous alteration.

harmonicAccidentals (boolean)

If set, harmonic notes in chords
get accidentals.

internalBarNumber (integer)

Contains the current barnumber.
This property is used for internal timekeeping, among others by the
Accidental_engraver.

keySignature (list)

The current key signature. This is an alist
containing (step . alter) or
((octave . step) . alter), where step
is a number in the range 0 to 6 and alter a fraction,
denoting alteration. For alterations, use symbols, e.g.
keySignature = #`((6 . ,FLAT)).

localKeySignature (list)

The key signature at this point in the
measure. The format is the same as for keySignature, but can
also contain ((octave . name) . (alterbarnumber . measureposition)) pairs.

Properties (write)

localKeySignature (list)

The key signature at this point in the
measure. The format is the same as for keySignature, but can
also contain ((octave . name) . (alterbarnumber . measureposition)) pairs.

Create barlines. This engraver is controlled through the whichBar property. If it has no bar line to create, it will forbid a linebreak at this point. This engraver is required to trigger the creation of clefs at the start of systems.

Properties (read)

whichBar (string)

This property is read to determine what type
of bar line to create.

Example:

\set Staff.whichBar = ".|:"

This will create a start-repeat bar in this staff only. Valid values
are described in ‘scm/bar-line.scm’.

‘break-visibility’
function for explicit key changes. ‘\override’ of the
break-visibility property will set the visibility for
normal (i.e., at the start of the line) key signatures.

extraNatural (boolean)

Whether to typeset an extra natural sign
before accidentals that reduce the effect of a previous alteration.

keyAlterationOrder (list)

An alist that defines in what order
alterations should be printed. The format is
(step . alter),
where step is a number from 0 to 6 and
alter from -2 (sharp) to 2 (flat).

keySignature (list)

The current key signature. This is an alist
containing (step . alter) or
((octave . step) . alter), where step
is a number in the range 0 to 6 and alter a fraction,
denoting alteration. For alterations, use symbols, e.g.
keySignature = #`((6 . ,FLAT)).

lastKeySignature (list)

Last key signature before a key
signature change.

middleCClefPosition (number)

The position of the middle C,
as determined only by the clef. This can be calculated by looking at
clefPosition and clefGlyph.

printKeyCancellation (boolean)

Print restoration alterations
before a key signature change.

Properties (write)

keySignature (list)

The current key signature. This is an alist
containing (step . alter) or
((octave . step) . alter), where step
is a number in the range 0 to 6 and alter a fraction,
denoting alteration. For alterations, use symbols, e.g.
keySignature = #`((6 . ,FLAT)).