[icon]

GNU LilyPond

-- --

What is LilyPond
Home
Examples
Templates
Download
GNU/Linux binaries
Windows binaries
Source code
Documentation
Tutorial
Manual
Glossary
Index

Support
Mailing lists
Search
WikiWiki

External sites
lilypond.org/stable
lilypond.org/development
savannah.gnu.org
ftp.lilypond.org
Mutopia
Other music online

Defining your own accidental typesettings

This section must be considered gurus-only, and hence it must be sufficient with a short description of the system and a reference to the internal documentation.

The idea of the algorithm is to try several different rules and then use the rule that gives the highest number of accidentals. Each rule cosists of

Context:
In which context is the rule applied. I.e. 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 don't - like normally.
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 immidiately, and if lazyness is #t then the accidental lasts forever.

As described in the internal documentation of Accidental_engraver , the properties autoAccidentals and autoCautionaries contain lists of rule descriptions. Notice that the contexts must be listed from in to out - that is Thread before Voice , Voice before Staff , etc. see the macros in ly/property-init.ly for examples of how the properties are set.

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 one at a time - in the order in which they appear in the input file.

Of course this is only a problem when you have simultainous notes which accidentals should depend on each other. Notice that the problem only occurs when using non-default accidentals - as the default accidentals only depend on other accidentals on the same staff and same pitch and hence cannot depend on other simultainous notes.

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]

The only solution is to manually insert the problematic accidentals using ! and ?.

Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to (address unknown)

Copyright (c) 1997--2002 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.7.14 (development-branch) by

Buchan Milne <(address unknown)>, Thu Mar 6 21:11:35 2003 CET.