Node:Customized accidental rules, Previous:Using the predefined accidental variables, Up:Accidentals



Customized accidental rules

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

context:
In which context is the rule 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.
octavation:
Whether the accidental changes all octaves or only the current octave.
lazyness:
Over how many barlines the accidental lasts. If lazyness is -1 then the accidental is forget immediately, and if lazyness is #t then the accidental lasts forever.

Predefined commands

\defaultAccidentals, \voiceAccidentals, \modernAccidentals, \modernCautionaries, \modernVoiceAccidentals, \modernVoiceCautionaries, \pianoAccidentals, \pianoCautionaries, \noResetKey, \forgetAccidentals.

See also

Accidental_engraver, Accidental, and AccidentalPlacement.

Bugs

Currently the simultaneous notes are considered to be entered in sequential mode. This means that in a chord the accidentals are typeset as if the notes in the chord happened once at a time - in the order in which they appear in the input file.

This is only a problem when there are simultaneous notes whose accidentals depend on each other. The problem only occurs when using non-default accidentals. In the default scheme, accidentals only depend on other accidentals with the same pitch on the same staff, so no conflicts possible.

This example shows two examples of the same music giving different accidentals depending on the order in which the notes occur in the input file:

     \property Staff.autoAccidentals = #'( Staff (any-octave . 0) )
     cis'4 <c'' c'> r2 | cis'4 <c' c''> r2
     | <cis' c''> r | <c'' cis'> r |
     

[picture of music]

This problem can be solved by manually inserting ! and ? for the problematic notes.


This page is for LilyPond-2.0.0 (stable-branch).

Report errors to <bug-lilypond@gnu.org>.