]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/pitches.itely
Merge branch 'original' into HEAD
[lilypond.git] / Documentation / user / pitches.itely
index 2fb9c41be40cecd4a78372095e83e89f6be9d87c..05b71b88db4a3859da8d9fa1707fa56ceb6caab0 100644 (file)
@@ -1,6 +1,6 @@
 @c -*- coding: utf-8; mode: texinfo; -*-
 @ignore
-    Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
+   Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
 
     When revising a translation, copy the HEAD committish of the
     version that you are working on.  See TRANSLATION for details.
 @node Pitches
 @section Pitches
 
-This section discusses how to specify the pitch of notes.
-
-@lilypondfile[ragged-right,line-width=16\cm,staffsize=16,quote]
+@lilypondfile[quote,ragged-right,line-width=16\cm,staffsize=16]
 {pitches-headword.ly}
 
+This section discusses how to specify the pitch of notes.  There
+are three steps to this process: input, modification, and output.
+
 @menu
 * Writing pitches::             
 * Changing multiple pitches::   
 * Displaying pitches::          
+* Note heads::                  
 @end menu
 
 
 @node Writing pitches
 @subsection Writing pitches
 
-Into text.
+This section discusses how to input pitches.  There are two
+different ways to place notes in octaves: absolute and relative
+mode.  In most cases, relative mode will be more convenient.
 
 @menu
-* Normal pitches::              
+* Absolute octave entry::       
+* Relative octave entry::       
 * Accidentals::                 
-* Cautionary accidentals::      
-* Micro tones::                 
 * Note names in other languages::  
 @end menu
 
 
-@node Normal pitches
-@unnumberedsubsubsec Normal pitches
+@node Absolute octave entry
+@subsubsection Absolute octave entry
 
-@cindex Pitch names
+@cindex pitch names
 @cindex pitches
+@cindex absolute
+@cindex absolute octave specification
 
-A pitch name is specified using lowercase letters @code{a} through
-@code{g}.  An ascending C-major scale is engraved with
+A pitch name is specified using lowercase letters@tie{}@code{a}
+through@tie{}@code{g}.  The note names @code{c} to @code{b} are
+engraved in the octave below middle C.
 
-@lilypond[quote,fragment,verbatim,ragged-right]
-\clef bass
-c d e f g a b c'
-@end lilypond
-
-The note name @code{c} is engraved one octave below middle C.
-
-@lilypond[quote,fragment,verbatim,ragged-right]
-\clef treble
-c1
+@c NOTE: don't use c' here.
+@lilypond[verbatim,quote,ragged-right,fragment]
 \clef bass
-c1
+c d e f
+g a b c
+d e f g
 @end lilypond
 
 @funindex '
 @funindex ,
 
-The optional octave specification takes the form of a series of
-single quote (@samp{'}) characters or a series of comma (@samp{,})
-characters.  Each @samp{'} raises the pitch by one octave; each
-@samp{,} lowers the pitch by an octave.
+Other octaves may be specified with a single quote@tie{}(@code{'})
+or comma@tie{}(@code{,}) character.  Each@tie{}@code{'} raises the
+pitch by one octave; each@tie{}@code{,} lowers the pitch by an
+octave.
 
-@lilypond[quote,ragged-right,fragment,verbatim]
+@lilypond[verbatim,quote,ragged-right,fragment]
 \clef treble
-c' c'' e' g d'' d' d c
+c' c'' e' g
+d'' d' d c
 \clef bass
-c, c,, e, g d,, d, d c
+c, c,, e, g
+d,, d, d c
 @end lilypond
 
-An alternate method may be used to declare which octave to engrave
-a pitch; this method does not require as many octave
-specifications (@code{'} and @code{,}).  See @ref{Relative
-octaves}.
+@seealso
 
+Music Glossary: @rglos{Pitch names}.
 
-@node Accidentals
-@unnumberedsubsubsec Accidentals
+Snippets: @lsrdir{Pitches,Pitches}.
 
-@cindex note names, Dutch
-@cindex note names, default
 
-@c following paragraph changed to match Tutorial and Accidental
-@c and Key Signature pages.  
+@node Relative octave entry
+@subsubsection Relative octave entry
 
-A @rglos{sharp} pitch is made by adding @samp{is} to the name, and
-a @rglos{flat} pitch by adding @samp{es}.  As you might expect, a
-@rglos{double sharp} or @rglos{double flat} is made by adding
-@samp{isis} or @samp{eses}@footnote{This syntax derived from note
-naming conventions in Nordic and Germanic languages, like German
-and Dutch.  To use other names for accidentals, see @ruser{Note
-names in other languages}.}
+@cindex relative
+@cindex relative octave specification
+@funindex \relative
 
-@lilypond[quote,ragged-right,fragment,verbatim,relative=2]
-a2 ais a aes
-a2 aisis a aeses
-@end lilypond
+When octaves are specified in absolute mode it is easy to
+accidentally put a pitch in the wrong octave.  Relative octave
+mode reduces these errors since most of the time it is not
+necessary to indicate any octaves at all.  Furthermore, in
+absolute mode a single mistake may be difficult to spot, while in
+relative mode a single error puts the rest of the piece off by one
+octave.
 
-@noindent
-These are the Dutch note names.  In Dutch, @code{aes} is
-contracted to @code{as}, but both forms are accepted.  Similarly,
-both @code{es} and @code{ees} are accepted
+@example
+\relative @var{startpitch} @var{musicexpr}
+@end example
+
+In relative mode, each note is assumed to be as close to the
+previous note as possible.  This means that the octave of pitches
+in @var{musicexpr} is calculated as follows:
+
+@itemize
+@item
+If no octave changing mark is used on a pitch, its octave is calculated
+so that the interval with the previous note is less than a fifth.  This
+interval is determined without considering accidentals.
+
+@item
+An octave changing mark@tie{}@code{'} or@tie{}@code{,} can be added to
+respectively raise or lower a pitch by an extra octave, relative to
+the pitch calculated without an octave mark.
+
+@item
+Multiple octave changing marks can be used.  For example, @code{''}@tie{}and
+@code{,,}@tie{} will alter the pitch by two octaves.
+
+@item
+The pitch of the first note is relative to
+@code{@var{startpitch}}.  @var{startpitch} is specified in
+absolute octave mode, and it is recommended that it be a octave of
+@code{c}.
+
+@end itemize
 
-@lilypond[fragment,quote,ragged-right,verbatim,relative=2]
-a2 as e es
+Here is the relative mode shown in action:
+
+@lilypond[verbatim,quote,ragged-right]
+\relative c {
+  \clef bass
+  c d e f
+  g a b c
+  d e f g
+}
 @end lilypond
 
-A natural will cancel the effect of an accidental or key
-signature.  However, naturals are not encoded into the note name
-syntax with a suffix; a natural pitch is shown as a simple note
-name
+Octave changing marks are used for intervals greater than a
+fourth:
 
-@lilypond[quote,ragged-right,fragment,verbatim,relative=2]
-a4 aes a2
+@lilypond[verbatim,quote,ragged-right]
+\relative c'' {
+  c g c f,
+  c' a, e'' c
+}
 @end lilypond
 
-The input @code{d e f} is interpreted as @q{print a D-natural,
-E-natural, and an F-natural,} regardless of the key signature.
-For more information about the distinction between musical content
-and the presentation of that content, see @rlearning{Accidentals
-and key signatures}.
+A note sequence without a single octave mark can nevertheless span
+large intervals:
 
-@lilypond[fragment,quote,ragged-right,verbatim,relative]
-\key d \major
-d e f g
-d e fis g
+@lilypond[verbatim,quote,ragged-right]
+\relative c {
+  c f b e
+  a d g c
+}
 @end lilypond
 
+If the preceding item is a chord, the first note of the chord is
+used as the reference point for the octave placement of a
+following note or chord.  Inside chords, the next note is always
+relative to the preceding one.
 
-@commonprop
+@lilypond[verbatim,quote,ragged-right]
+\relative c' {
+  c
+  <c e g>
+  % the C is now an octave higher
+  <c' e g'>
+  % the C returns to the original pitch
+  <c, e, g''>
+}
+@end lilypond
 
-In accordance with standard typesetting rules, a natural sign is
-printed before a sharp or flat if a previous accidental needs to
-be cancelled.  To change this behavior, use @code{\set
-Staff.extraNatural = ##f}
+As explained above, the octave of pitches is calculated only with
+the note names, regardless of any alterations.  Therefore, an
+E-double-sharp following a B will be placed higher, while an
+F-double-flat will be placed lower.  In other words, a
+double-augmented fourth is considered a smaller interval than a
+double-diminished fifth, regardless of the number of semitones
+that each interval contains.
 
-@lilypond[fragment,quote,ragged-right,verbatim,relative=2]
-ceses4 ces cis c
-\set Staff.extraNatural = ##f
-ceses4 ces cis c
+@lilypond[verbatim,quote,ragged-right]
+\relative c'' {
+  c2 fis
+  c2 ges
+  b2 eisis
+  b2 feses
+}
 @end lilypond
 
 
 @seealso
 
-Program reference: @internalsref{LedgerLineSpanner},
-@internalsref{NoteHead}.
+Music Glossary: @rglos{fifth}, @rglos{interval}, @rglos{Pitch names}.
+
+Notation Reference: @ref{Octave checks}.
+
+Snippets: @lsrdir{Pitches,Pitches}.
+
+
+@funindex \transpose
+@funindex \chordmode
+@funindex \relative
+
+@knownissues
+
+The relative conversion will not affect @code{\transpose},
+@code{\chordmode} or @code{\relative} sections in its argument.
+To use relative mode within transposed music, an additional
+@code{\relative} must be placed inside @code{\transpose}.
+
+@c NOTE: DEPRECATED
+If no @var{startpitch} is specified for @code{\relative},
+then@tie{}@code{c'} is assumed.  However, this is a deprecated
+option and may disappear in future versions, so its use is
+discouraged.
+
+
+
+@node Accidentals
+@subsubsection Accidentals
+
+@cindex accidental
+@cindex key signature
+@cindex clef
+
+@warning{New users are sometimes confused about accidentals and
+key signatures.  In LilyPond, note names are the raw input; key
+signatures and clefs determine how this raw input is displayed.
+An unaltered note like@tie{}@code{c} means @q{C natural},
+regardless of the key signature or clef.  For more information,
+see @rlearning{Accidentals and key signatures}.}
+
+@cindex note names, Dutch
+@cindex note names, default
+@cindex sharp
+@cindex flat
+@cindex double sharp
+@cindex sharp, double
+@cindex double flat
+@cindex flat, double
+@cindex natural sign
+
+A @notation{sharp} pitch is made by adding @code{is} to the note name,
+and a @notation{flat} pitch by adding @code{es}.  As you might expect,
+a @notation{double sharp} or @notation{double flat} is made by adding
+@code{isis} or @code{eses}.  This syntax is derived from Dutch note
+naming conventions.  To use other names for accidentals, see
+@ref{Note names in other languages}.
+
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
+ais1 aes aisis aeses
+@end lilypond
+
+A natural will cancel the effect of an accidental or key
+signature.  However, naturals are not encoded into the note name
+syntax with a suffix; a natural pitch is shown as a simple note
+name:
+
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
+a4 aes a2
+@end lilypond
+
+@cindex quarter tones
+@cindex semi-flats, semi-sharps
+
+Quarter tones may be added; the following is a series of Cs with
+increasing pitches
+
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
+ceseh1 ces ceh c cih cis cisih
+@end lilypond
 
 
-@node Cautionary accidentals
-@unnumberedsubsubsec Cautionary accidentals
 
 @cindex accidental, reminder
 @cindex accidental, cautionary
@@ -167,404 +289,381 @@ Program reference: @internalsref{LedgerLineSpanner},
 
 Normally accidentals are printed automatically, but you may also
 print them manually.  A reminder accidental can be forced by
-adding an exclamation mark @code{!} after the pitch.  A cautionary
-accidental (i.e., an accidental within parentheses) can be
-obtained by adding the question mark @samp{?} after the pitch.
-These extra accidentals can be used to produce natural signs, too.
-
-@lilypond[quote,ragged-right,fragment,verbatim,relative=1]
-cis cis cis! cis? c c? c! c
+adding an exclamation mark@tie{}@code{!} after the pitch.  A
+cautionary accidental (i.e., an accidental within parentheses) can
+be obtained by adding the question mark@tie{}@code{?} after the
+pitch.  These extra accidentals can also be used to produce
+natural signs.
+
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
+cis cis cis! cis? c c c! c?
 @end lilypond
 
+Accidentals on tied notes are only printed at the beginning of a
+new system:
 
-@seealso
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
+cis1 ~ cis ~
+\break
+cis
+@end lilypond
 
-The automatic production of accidentals can be tuned in many ways.
-For more information, see @ref{Automatic accidentals}.
 
+@snippets
 
-@node Micro tones
-@unnumberedsubsubsec Micro tones
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{preventing-extra-naturals-from-being-automatically-added.ly}
 
-@cindex quarter tones
-@cindex semi-flats, semi-sharps
+@seealso
 
-Half-flats and half-sharps are formed by adding @code{-eh} and
-@code{-ih}; the following is a series of Cs with increasing
-pitches
+Music Glossary: @rglos{sharp}, @rglos{flat}, @rglos{double sharp},
+@rglos{double flat}, @rglos{Pitch names}, @rglos{quarter-tone}.
 
-@lilypond[verbatim,ragged-right,quote,relative=2,fragment]
-\set Staff.extraNatural = ##f
-ceseh ceh cih cisih
-@end lilypond
+Learning Manual: @rlearning{Accidentals and key signatures}.
+
+Notation Reference: @ref{Automatic accidentals},
+@ref{Musica ficta accidentals},
+@ref{Note names in other languages}.
 
-Micro tones are also exported to the MIDI file.
+Snippets: @lsrdir{Pitches,Pitches}.
 
 
-@refbugs
+@knownissues
 
 There are no generally accepted standards for denoting
-three-quarter flats, so LilyPond's symbol does not conform to any
-standard.
+quarter-tone accidentals, so LilyPond's symbol does not conform to
+any standard.
+
 
 
 @node Note names in other languages
-@unnumberedsubsubsec Note names in other languages
+@subsubsection Note names in other languages
 
 There are predefined sets of note names for various other
-languages.  To use them, include the language specific init file.
-For example, add @code{\include "english.ly"} to the top of the
-input file.  The available language files and the note names they
-define are
+languages.  To use them, include the language-specific init file.
+For example, to use English notes names, add @code{\include
+"english.ly"} to the top of the input file.  The available
+language files and the note names they define are:
 
 @cindex note names, other languages
-@c  put the rest of the old table into this new format.
-@example
-@multitable @columnfractions .2 .6 .05 .05 .05 .05
+@cindex pitch names, other languages
+
+@smallexample
+@multitable {nederlands.ly} {do re mi fa sol la sib si} {-iss/-is} {-ess/-es} {-ss/-x/-sharpsharp} {-essess/-eses}
 @headitem Language
   @tab Note names
   @tab sharp @tab flat @tab double sharp @tab double flat
-@item netherlands.ly
+@item nederlands.ly
   @tab c d e f g a bes b
   @tab -is @tab -es @tab -isis @tab -eses
-@c new stuff here:
+@item english.ly
+  @tab c d e f g a bf b
+  @tab -s/-sharp @tab -f/-flat @tab -ss/-x/-sharpsharp
+    @tab -ff/-flatflat
+@item deutsch.ly
+  @tab c d e f g a b h
+  @tab -is @tab -es @tab -isis @tab -eses
+@item norsk.ly
+  @tab c d e f g a b h
+  @tab -iss/-is @tab -ess/-es @tab -ississ/-isis
+    @tab -essess/-eses
+@item svenska.ly
+  @tab c d e f g a b h
+  @tab -iss @tab -ess @tab -ississ @tab -essess
+@item suomi.ly
+  @tab c d e f g a b h
+  @tab -is @tab -es @tab -isis @tab -eses
+@item italiano.ly
+  @tab do re mi fa sol la sib si
+  @tab -d @tab -b @tab -dd @tab -bb
+@item catalan.ly
+  @tab do re mi fa sol la sib si
+  @tab -d/-s @tab -b @tab -dd/-ss @tab -bb
+@item espanol.ly
+  @tab do re mi fa sol la sib si
+  @tab -s @tab -b @tab -ss @tab -bb
+@item portugues.ly
+  @tab do re mi fa sol la sib si
+  @tab -s @tab -b @tab -ss @tab -bb
+@item vlaams.ly
+  @tab do re mi fa sol la sib si
+  @tab -k @tab -b @tab -kk @tab -bb
+@end multitable
+@end smallexample
 
+In Dutch, @code{aes} is contracted to @code{as}, but both forms
+are accepted in LilyPond.  Similarly, both @code{es} and
+@code{ees} are accepted.  This also applies to
+@code{aeses}@tie{}/@tie{}@code{ases} and
+@code{eeses}@tie{}/@tie{}@code{eses}.  Sometimes only these
+contracted names are defined in the corresponding language files.
 
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
+a2 as e es a ases e eses
+@end lilypond
+
+
+Some music uses microtones whose alterations are fractions of a
+@q{normal} sharp or flat.  The note names for quarter-tones
+defined in the various language files are listed in the following
+table.  Here the prefixes @notation{semi-} and @notation{sesqui-}
+mean @q{half} and @q{one and a half}, respectively.  For the other
+languages, no special names have been defined yet.
+
+@smallexample
+@multitable {nederlands.ly} {do re mi fa sol la sib si} {-iss/-is} {-ess/-es} {-ississ/-isis} {-ississ/-isis}
+@headitem Language
+  @tab Note names
+  @tab semi-sharp @tab semi-flat @tab sesqui-sharp @tab sesqui-flat
+
+@item nederlands.ly
+  @tab c d e f g a bes b
+  @tab -ih @tab -eh @tab -isih @tab -eseh
+@item english.ly
+  @tab c d e f g a bf b
+  @tab -qs @tab -qf @tab -tqs @tab -tqf
+@item deutsch.ly
+  @tab c d e f g a b h
+  @tab -ih @tab -eh @tab -isih @tab -eseh
+@item italiano.ly
+  @tab do re mi fa sol la sib si
+  @tab -sd @tab -sb @tab -dsd @tab -bsb
+@item portugues.ly
+  @tab do re mi fa sol la sib si
+  @tab -sqt @tab -bqt @tab -stqt @tab -btqt
 @end multitable
-@end example
+@end smallexample
 
-@c old table
-@ignore
-@example
-                        Note Names               sharp       flat     double        double
-                                                                       sharp        flat
-
-nederlands.ly  c   d   e   f   g   a   bes b   -is         -es       -isis         -eses
-english.ly     c   d   e   f   g   a   bf  b   -s/-sharp   -f/-flat  -ss/-x/       -ff/
-                                                                     -sharpsharp   -flatflat
-deutsch.ly     c   d   e   f   g   a   b   h   -is         -es       -isis         -eses
-norsk.ly       c   d   e   f   g   a   b   h   -iss/-is    -ess/-es  -ississ/-isis -essess/-eses
-svenska.ly     c   d   e   f   g   a   b   h   -iss        -ess      -ississ       -essess
-italiano.ly    do  re  mi  fa  sol la  sib si  -d          -b        -dd           -bb
-catalan.ly     do  re  mi  fa  sol la  sib si  -d/-s       -b        -dd/-ss       -bb
-espanol.ly     do  re  mi  fa  sol la  sib si  -s          -b        -ss           -bb
-@end example
-@end ignore
 
-@noindent
-Note that in Dutch, German, Norwegian, and Swedish, the flat
-alterations of @samp{a} like for example @code{aes} and
-@code{aeses} are usually contracted to @code{as} and @code{ases}
-(or more commonly @code{asas}).  Sometimes only these contracted
-names are defined in the corresponding language files (this also
-applies to the suffixes for quartertones below).
+@seealso
 
-@noindent
-Some music uses microtones whose alterations are fractions of a
-@q{regular} sharp or flat.  The note names for quartertones defined
-in the various language files are listed in the following table.
-Here the prefixes @q{semi-} and @q{sesqui-} mean @q{half} and
-@q{one and a half}, respectively.  For Norwegian, Swedish, Catalan
-and Spanish no special names have been defined yet.
-
-@c What about Turkish Maquam music and similar microtonal systems?
-@c
-@c Note that the term "three-quarter-sharp/-flat" used in lilypond's source code 
-@c is actually misleading since the alteration is in fact one and a half
-@c of a regular sharp/flat.  Whence the naming "sesqui-sharp/-flat" used below.
+Music Glossary: @rglos{Pitch names}.
 
-@example
-                        Note Names             semi-   semi-  sesqui-  sesqui-
-                                               sharp   flat    sharp    flat
-
-nederlands.ly  c   d   e   f   g   a   bes b   -ih     -eh    -isih    -eseh
-english.ly     c   d   e   f   g   a   bf  b   -qs     -qf    -tqs     -tqf
-deutsch.ly     c   d   e   f   g   a   b   h   -ih     -eh    -isih    -eseh
-norsk.ly       c   d   e   f   g   a   b   h   
-svenska.ly     c   d   e   f   g   a   b   h   
-italiano.ly    do  re  mi  fa  sol la  sib si  -sd     -sb    -dsd     -bsb
-catalan.ly     do  re  mi  fa  sol la  sib si  
-espanol.ly     do  re  mi  fa  sol la  sib si  
-@end example
+Snippets: @lsrdir{Pitches,Pitches}.
 
 
 @node Changing multiple pitches
 @subsection Changing multiple pitches
 
+This section discusses how to modify pitches.
+
 @menu
-* Relative octaves::            
-* Octave check::                
+* Octave checks::               
 * Transpose::                   
 @end menu
 
-@node Relative octaves
-@unnumberedsubsubsec Relative octaves
-
-@cindex Relative
-@cindex Relative octave specification
-@funindex \relative
-
-Octaves are specified by adding @code{'} and @code{,} to pitch
-names.  When you copy existing music, it is easy to accidentally
-put a pitch in the wrong octave and hard to find such an error.
-The relative octave mode prevents these errors by making the
-mistakes much larger: a single error puts the rest of the piece
-off by one octave
-
-@example
-\relative @var{startpitch} @var{musicexpr}
-@end example
-
-@noindent
-or
-
-@example
-\relative @var{musicexpr}
-@end example
-
-@noindent
-@code{c'} is used as the default if no starting pitch is defined.
-
-The octave of notes that appear in @var{musicexpr} are calculated
-as follows:
-
-@itemize
-@item
-If no octave changing marks are used, the basic interval between
-this and the last note is always taken to be a fourth or less.
-
-@item
-This distance is determined without regarding alterations; a
-@code{fisis} following a @code{ceses} will be put above the
-@code{ceses}.  In other words, a doubly-augmented fourth is
-considered a smaller interval than a diminished fifth, even though
-the doubly-augmented fourth spans seven semitones while the
-diminished fifth only spans six semitones.
-
-@item
-The octave changing marks @code{'} and @code{,} can be added to
-raise or lower the pitch by an extra octave from the basic
-interval.
+@node Octave checks
+@subsubsection Octave checks
 
-@item
-Multiple octave changing marks can be used.  @code{''} will raise
-the pitch by two octaves.
+@cindex octave correction
+@cindex octave check
+@funindex =
+@funindex \octave
 
-@item 
-The pitch of the first note is relative to @code{\relative
-@var{startpitch} }.  
+In relative mode, it is easy to forget an octave changing mark.
+Octave checks make such errors easier to find by displaying a
+warning and correcting the octave if a note is found in an
+unexpected octave.
 
-@item
-If you do not specify @var{startpitch} then middle C is used.
+To check the octave of a specific note, specify the absolute
+octave after the @code{=}@tie{}symbol.  This example will generate
+a warning (and change the pitch) because the second note is the
+absolute octave @code{d''} instead of @code{d'} as indicated by
+the octave correction.
 
-@end itemize 
-
-Here is the relative mode shown in action
-
-@lilypond[quote,fragment,ragged-right,verbatim]
+@lilypond[verbatim,quote,ragged-right,fragment]
 \relative c'' {
-  b c d c b c bes a
+  c2 d='4 d
+  e2 f
 }
 @end lilypond
 
-Octave changing marks are used for intervals greater than a fourth
+The octave of notes may also be checked with the
+@code{\octave}@tie{}@var{controlpitch} command.  @var{controlpitch} is
+specified in absolute mode.  This checks that the interval between the
+previous note and the @var{controlpitch} is within a fourth (i.e. the
+normal calculation of relative mode).  If this check fails, a warning
+is printed, but the previous note is not changed.  Future notes are
+relative to the @var{controlpitch}.
 
-@lilypond[quote,ragged-right,fragment,verbatim]
+@lilypond[verbatim,quote,ragged-right,fragment]
 \relative c'' {
-  c g c f, c' a, e''
+  c2 d
+  \octave c'
+  e2 f
 }
 @end lilypond
 
-If the preceding item is a chord, the first note of the chord is
-used to determine the first note of the next chord
+Compare the two bars below.  The first and third @code{\octave}
+check fail, but the second one does not fail.
 
-@lilypond[quote,ragged-right,fragment,verbatim]
-\relative c' {
-  c <c e g>
-  <c' e g>
-  <c, e' g>
+@lilypond[verbatim,quote,ragged-right,fragment]
+\relative c'' {
+  c4 f g f
+
+  c4
+  \octave c'
+  f
+  \octave c'
+  g
+  \octave c'
+  f
 }
 @end lilypond
 
-The pitch after @code{\relative} contains a note name.
-
-The relative conversion will not affect @code{\transpose},
-@code{\chordmode} or @code{\relative} sections in its argument.
-To use relative within transposed music, an additional
-@code{\relative} must be placed inside @code{\transpose}.
-
-
-@node Octave check
-@unnumberedsubsubsec Octave check
-
-@cindex Octave check
-
-Octave checks make octave errors easier to correct: a note may be
-followed by @code{=}@var{quotes} which indicates what its absolute
-octave should be.  In the following example,
-
-@example
-\relative c'' @{ c='' b=' d,='' @}
-@end example
-
-@noindent
-the @code{d} will generate a warning, because a @code{d''} is
-expected (because @code{b'} to @code{d''} is only a third), but a
-@code{d'} is found.  In the output, the octave is corrected to be
-a @code{d''} and the next note is calculated relative to
-@code{d''} instead of @code{d'}.
-
-There is also an octave check that produces no visible output.
-The syntax
-
-@example
-\octave @var{pitch}
-@end example
-
-This checks that @var{pitch} (without quotes) yields @var{pitch}
-(with quotes) in @code{\relative} mode compared to the note given
-in the @code{\relative} command.  If not, a warning is printed,
-and the octave is corrected.  The @var{pitch} is not printed as a
-note.
 
-In the example below, the first check passes without incident,
-since the @code{e} (in @code{relative} mode) is within a fifth of
-@code{a'}.  However, the second check produces a warning, since
-the @code{e} is not within a fifth of @code{b'}.  The warning
-message is printed, and the octave is adjusted so that the
-following notes are in the correct octave once again.
-
-@example
-\relative c' @{
-  e
-  \octave a'
-  \octave b'
-@}
-@end example
-
-
-The octave of a note following an octave check is determined with
-respect to the note preceding it.  In the next fragment, the last
-note is an @code{a'}, above middle C.  That means that the
-@code{\octave} check passes successfully, so the check could be
-deleted without changing the output of the piece.
+@seealso
 
-@lilypond[quote,ragged-right,verbatim,fragment]
-\relative c' {
-  e
-  \octave b
-  a
-}
-@end lilypond
+Snippets: @lsrdir{Pitches,Pitches}.
 
 
 @node Transpose
-@unnumberedsubsubsec Transpose
+@subsubsection Transpose
 
-@cindex Transpose
-@cindex Transposition of pitches
+@cindex transpose
+@cindex transposition
+@cindex transposition of pitches
 @funindex \transpose
 
 A music expression can be transposed with @code{\transpose}.  The
 syntax is
 
 @example
-\transpose @var{from} @var{to} @var{musicexpr}
+\transpose @var{frompitch} @var{topitch} @var{musicexpr}
 @end example
 
+@noindent
 This means that @var{musicexpr} is transposed by the interval
-between the pitches @var{from} and @var{to}: any note with pitch
-@code{from} is changed to @code{to}.
-
-Consider a piece written in the key of D-major.  If this piece is
-a little too low for its performer, it can be transposed up to
-E-major with
-
-@example
-\transpose d e @dots{}
-@end example
+between the pitches @var{frompitch} and @var{topitch}: any note
+with pitch @var{frompitch} is changed to @var{topitch} and any
+other note is transposed by the same interval.  Both pitches are
+entered in absolute mode.
+
+Consider a piece written in the key of D-major.  It can be
+transposed up to E-major; note that the key signature is
+automatically transposed as well.
+
+@lilypond[verbatim,quote,ragged-right]
+\transpose d e {
+  \relative c' {
+    \key d \major
+    d4 fis a d
+  }
+}
+@end lilypond
 
-Consider a part written for violin (a C instrument).  If this part
-is to be played on the A clarinet (for which an A is notated as a
-C, and which sounds a minor third lower than notated), the
-following transposition will produce the appropriate part
+If a part written in C (normal concert pitch) is to be played on
+the A clarinet (for which an A is notated as a C and thus sounds a
+minor third lower than notated), the appropriate part will be
+produced with:
+
+@lilypond[verbatim,quote,ragged-right]
+\transpose a c' {
+  \relative c' {
+    \key c \major
+    c4 d e g
+  }
+}
+@end lilypond
 
-@example
-\transpose a c @dots{}
-@end example
+@noindent
+Note that we specify @code{\key c \major} explicitly.  If we do
+not specify a key signature, the notes will be transposed but no
+key signature will be printed.
 
 @code{\transpose} distinguishes between enharmonic pitches: both
 @code{\transpose c cis} or @code{\transpose c des} will transpose
-up half a tone.  The first version will print sharps and the
-second version will print flats
+up a semitone.  The first version will print sharps and the notes
+will remain on the same scale step, the second version will print
+flats on the scale step above.
 
-@lilypond[quote,ragged-right,verbatim]
-mus = { \key d \major cis d fis g }
+@lilypond[verbatim,quote,ragged-right]
+mus = \relative c' { c d e f }
 \new Staff {
-  \clef "F" \mus
-  \clef "G"
-  \transpose c g' \mus
-  \transpose c f' \mus
+  \transpose c cis { \mus }
+  \transpose c des { \mus }
 }
 @end lilypond
 
-@code{\transpose} may also be used to input written notes for a
-transposing instrument.  Pitches are normally entered into
-LilyPond in C (or @q{concert pitch}), but they may be entered in
-another key.  For example, when entering music for a B-flat
-trumpet which begins on concert D, one would write
+@cindex transposing instruments
+
+@code{\transpose} may also be used in a different way, to input
+written notes for a transposing instrument.  The previous examples
+show how to enter pitches in C (or @notation{concert pitch}) and
+typeset them for a transposing instrument, but the opposite is
+also possible if you for example have a set of instrumental parts
+and want to print a conductor's score.  For example, when entering
+music for a B-flat trumpet that begins on a notated E (concert D),
+one would write:
 
 @example
-\transpose c bes @{ e4 @dots{} @}
+musicInBflat = @{ e4 @dots{} @}
+\transpose c bes, \musicInBflat
 @end example
 
-To print this music in B-flat again (i.e., producing a trumpet
-part, instead of a concert pitch conductor's score) you would wrap
-the existing music with another @code{transpose}
+@noindent
+To print this music in F (e.g., rearranging to a French horn) you
+could wrap the existing music with another @code{\transpose}:
 
 @example
-\transpose bes c @{ \transpose c bes @{ e4 @dots{} @} @}
+musicInBflat = @{ e4 @dots{} @}
+\transpose f c' @{ \transpose c bes, \musicInBflat @}
 @end example
 
+@noindent
+For more information about transposing instruments,
+see @ref{Instrument transpositions}.
+
+
+@snippets
+
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{transposing-pitches-with-minimum-accidentals-smart-transpose.ly}
+
 
 @seealso
 
-Program reference: @internalsref{TransposedMusic}.
+Notation Reference: @ref{Instrument transpositions}.
 
-Example:
-@lsr{scheme,transpose-pitches-with-minimum-accidentals.ly}.
+Snippets: @lsrdir{Pitches,Pitches}.
 
+Internals Reference: @internalsref{TransposedMusic}.
 
-@refbugs
+@funindex \transpose
+@funindex \chordmode
+@funindex \relative
 
-If you want to use both @code{\transpose} and @code{\relative},
-you must put @code{\transpose} outside of @code{\relative}, since
-@code{\relative} will have no effect on music that appears inside
-a @code{\transpose}.
+@knownissues
+
+
+The relative conversion will not affect @code{\transpose},
+@code{\chordmode} or @code{\relative} sections in its argument.
+To use relative mode within transposed music, an additional
+@code{\relative} must be placed inside @code{\transpose}.
 
 
 @node Displaying pitches
 @subsection Displaying pitches
 
+This section discusses how to alter the output of pitches.
+
 @menu
 * Clef::                        
 * Key signature::               
 * Ottava brackets::             
 * Instrument transpositions::   
+* Automatic accidentals::       
+* Ambitus::                     
 @end menu
 
+
 @node Clef
-@unnumberedsubsubsec Clef
+@subsubsection Clef
 
 @funindex \clef
-
-The clef indicates which lines of the staff correspond to which
-pitches.  The clef is set with the @code{\clef} command
-
-@lilypond[quote,ragged-right,fragment,verbatim]
-{ c''2 \clef alto g'2 }
-@end lilypond
-
+@cindex G clef
+@cindex C clef
+@cindex F clef
 @cindex treble clef
 @cindex violin clef
 @cindex alto clef
@@ -576,105 +675,120 @@ pitches.  The clef is set with the @code{\clef} command
 @cindex baritone clef
 @cindex varbaritone clef
 @cindex subbass clef
+@cindex clef
+@cindex ancient clef
+@cindex clef, ancient
+@cindex clef, G
+@cindex clef, C
+@cindex clef, F
+@cindex clef, treble
+@cindex clef, violin 
+@cindex clef, alto 
+@cindex clef, tenor
+@cindex clef, bass 
+@cindex clef, french 
+@cindex clef, soprano 
+@cindex clef, mezzosoprano 
+@cindex clef, baritone 
+@cindex clef, varbaritone 
+@cindex subbass clef, subbass 
+
+The clef is set with the @code{\clef} @var{clefname} command.
+Middle C is shown in every example.
+
+@lilypond[verbatim,quote,ragged-right,fragment,relative=1]
+\clef treble
+c2 c
+\clef alto
+c2 c
+\clef tenor
+c2 c
+\clef bass
+c2 c
+@end lilypond
 
-Supported clefs include
-
-@multitable @columnfractions .33 .66
-@headitem Clef @tab Position
-@item @code{treble}, violin, G, G2 @tab
-G clef on 2nd line
-@item @code{alto, C} @tab
-C clef on 3rd line
-@item @code{tenor} @tab
-C clef on 4th line.
-@item @code{bass, F} @tab
-F clef on 4th line
-@item @code{french} @tab
-G clef on 1st line, so-called French violin clef
-@item @code{soprano} @tab
-C clef on 1st line
-@item @code{mezzosoprano} @tab
-C clef on 2nd line
-@item @code{baritone} @tab
-C clef on 5th line
-@item @code{varbaritone} @tab
-F clef on 3rd line
-@item @code{subbass} @tab
-F clef on 5th line
-@item @code{percussion} @tab
-percussion clef
-@item @code{tab} @tab
-tablature clef
-@end multitable
+Other clefs include:
+
+@lilypond[verbatim,quote,ragged-right,fragment,relative=1]
+\clef french
+c2 c
+\clef soprano
+c2 c
+\clef mezzosoprano
+c2 c
+\clef baritone
+c2 c
+
+\break
+
+\clef varbaritone
+c2 c
+\clef subbass
+c2 c
+\clef percussion
+c2 c
+\clef tab
+c2 c
+@end lilypond
+
+Further supported clefs are described under @ref{Ancient clefs}.
+
+@cindex transposing clefs
+@cindex clef, transposing
+@cindex octave transposition
 
 By adding @code{_8} or @code{^8} to the clef name, the clef is
 transposed one octave down or up, respectively, and @code{_15} and
 @code{^15} transposes by two octaves.  The argument @var{clefname}
 must be enclosed in quotes when it contains underscores or digits.
-For example,
 
 @cindex choral tenor clef
-@lilypond[quote,ragged-right,verbatim,fragment,relative=1]
-\clef "G_8" c4
-@end lilypond
 
+@lilypond[verbatim,quote,ragged-right,fragment,relative=1]
+\clef "treble_8"
+c2 c
+\clef "bass^15"
+c2 c
+@end lilypond
 
-@commonprop
 
-The command @code{\clef "treble_8"} is equivalent to setting
-@code{clefGlyph}, @code{clefPosition} (which controls the Y
-position of the clef), @code{middleCPosition} and
-@code{clefOctavation}.  A clef is printed when any of these
-properties are changed.  The following example shows possibilities
-when setting properties manually.
+@snippets
 
-@lilypond[quote,ragged-right,verbatim]
-{
-  \set Staff.clefGlyph = #"clefs.F"
-  \set Staff.clefPosition = #2
-  c'4
-  \set Staff.clefGlyph = #"clefs.G"
-  c'4
-  \set Staff.clefGlyph = #"clefs.C"
-  c'4
-  \set Staff.clefOctavation = #7
-  c'4
-  \set Staff.clefOctavation = #0
-  \set Staff.clefPosition = #0
-  c'4
-  \clef "bass"
-  c'4
-  \set Staff.middleCPosition = #4
-  c'4
-}
-@end lilypond
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{clefs-commonly-tweaked-properties.ly}
 
 
 @seealso
 
-Manual: @ref{Grace notes}.
+Notation Reference: @ref{Ancient clefs}.
 
-Program reference: @internalsref{Clef}.
+Snippets: @lsrdir{Pitches,Pitches}.
+
+Internals Reference: @internalsref{Clef}.
 
 
 @node Key signature
-@unnumberedsubsubsec Key signature
+@subsubsection Key signature
 
-@cindex Key signature
+@cindex key signature
 @funindex \key
 
+@warning{New users are sometimes confused about accidentals and
+key signatures.  In LilyPond, note names are the raw input; key
+signatures and clefs determine how this raw input is displayed.
+An unaltered note like@tie{}@code{c} means @q{C natural},
+regardless of the key signature or clef.  For more information,
+see @rlearning{Accidentals and key signatures}.}
+
 The key signature indicates the tonality in which a piece is
 played.  It is denoted by a set of alterations (flats or sharps)
-at the start of the staff.
-
-Setting or changing the key signature is done with the @code{\key}
-command
+at the start of the staff.  Setting or changing the key signature
+is done with the @code{\key} command:
 
 @example
-@code{\key} @var{pitch} @var{type}
+\key @var{pitch} @var{mode}
 @end example
 
-@funindex \minor
 @funindex \major
 @funindex \minor
 @funindex \ionian
@@ -685,155 +799,1149 @@ command
 @funindex \phrygian
 @funindex \dorian
 @cindex church modes
+@cindex modes
 
-Here, @var{type} should be @code{\major} or @code{\minor} to get
-@var{pitch}-major or @var{pitch}-minor, respectively.  You may
-also use the standard mode names (also called @q{church modes}):
-@code{\ionian}, @code{\locrian}, @code{\aeolian},
-@code{\mixolydian}, @code{\lydian}, @code{\phrygian}, and
-@code{\dorian}.
+Here, @var{mode} should be @code{\major} or @code{\minor} to get a
+key signature of @var{pitch}-major or @var{pitch}-minor,
+respectively.  You may also use the standard mode names, also
+called @q{church modes}: @code{\ionian}, @code{\dorian},
+@code{\phrygian}, @code{\lydian}, @code{\mixolydian},
+@code{\aeolian}, and @code{\locrian}.
 
-This command sets the context property @code{Staff.keySignature}.
-Non-standard key signatures can be specified by setting this
-property directly.
-
-Accidentals and key signatures often confuse new users, because
-unaltered notes get natural signs depending on the key signature.
-For more information, see @ref{Accidentals}, or
-@rlearning{Accidentals and key signatures}.
-
-@lilypond[quote,ragged-right,verbatim,relative=2,fragment]
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
 \key g \major
-f1
+fis1
+f
 fis
 @end lilypond
 
 
-@commonprop
+@snippets
 
-A natural sign is printed to cancel any previous accidentals.
-This can be suppressed by setting the
-@code{Staff.printKeyCancellation} property.
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly}
 
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-\key d \major
-a b cis d
-\key g \minor
-a bes c d
-\set Staff.printKeyCancellation = ##f
-\key d \major
-a b cis d
-\key g \minor
-a bes c d
-@end lilypond
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{non-traditional-key-signatures.ly}
 
 
 @seealso
 
-Program reference: @internalsref{KeyCancellation},
-@internalsref{KeySignature}.
+Music Glossary: @rglos{church mode}, @rglos{scordatura}.
 
+Learning Manual: @rlearning{Accidentals and key signatures}.
 
-@node Ottava brackets
-@unnumberedsubsubsec Ottava brackets
+Snippets: @lsrdir{Pitches,Pitches}.
+
+Internals Reference: @internalsref{KeyCancellation},
+@internalsref{KeySignature}, @internalsref{Key_engraver}.
 
-@q{Ottava} brackets introduce an extra transposition of an octave
-for the staff.  They are created by invoking the function
-@code{set-octavation}
+
+@node Ottava brackets
+@subsubsection Ottava brackets
 
 @cindex ottava
 @cindex 15ma
+@cindex 8va
+@cindex 8ve
 @cindex octavation
 
-@lilypond[quote,ragged-right,verbatim,fragment]
-\relative c''' {
-  a2 b
-  #(set-octavation 1)
-  a b
-  #(set-octavation 0)
-  a b
-}
+@notation{Ottava brackets} introduce an extra transposition of an
+octave for the staff:
+
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
+a'2 b
+#(set-octavation 1)
+a b
+#(set-octavation 0)
+a b
 @end lilypond
 
 The @code{set-octavation} function also takes -1 (for 8va bassa),
 2@tie{}(for 15ma), and -2 (for 15ma bassa) as arguments.
-Internally the function sets the properties @code{ottavation}
-(e.g., to @code{"8va"} or @code{"8vb"}) and
-@code{centralCPosition}.  For overriding the text of the bracket,
-set @code{ottavation} after invoking @code{set-octavation}, i.e.,
 
-@lilypond[quote,ragged-right,verbatim]
-{
-  #(set-octavation 1)
-  \set Staff.ottavation = #"8"
-  c'''
-}
-@end lilypond
+
+@snippets
+
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{ottava-text.ly}
 
 
 @seealso
 
-Program reference: @internalsref{OttavaBracket}.
+Music Glossary: @rglos{octavation}.
 
+Snippets: @lsrdir{Pitches,Pitches}.
 
-@refbugs
+Internals Reference: @internalsref{OttavaBracket}.
 
-@code{set-octavation} will get confused when clef changes happen
-during an octavation bracket.
 
 
 @node Instrument transpositions
-@unnumberedsubsubsec Instrument transpositions
+@subsubsection Instrument transpositions
 
 @cindex transposition, MIDI
 @cindex transposition, instrument
+@cindex transposing instrument
+@cindex MIDI
+@funindex \transposition
+
+When typesetting scores that involve transposing instruments, some
+parts can be typeset in a different pitch than the
+@notation{concert pitch}.  In these cases, the key of the
+@notation{transposing instrument} should be specified; otherwise
+the MIDI output and cues in other parts will produce incorrect
+pitches.  For more information about quotations, see @ref{Quoting
+other voices}.
+
+@example
+\transposition @var{pitch}
+@end example
+
+The pitch to use for @code{\transposition} should correspond to
+the real sound heard when a@tie{}@code{c'} written on the staff is
+played by the transposing instrument.  This pitch is entered in
+absolute mode, so an instrument that produces a real sound which
+is one tone higher than the printed music should use
+@code{\transposition d'}.  @code{\transposition} should
+@emph{only} be used if the pitches are @emph{not} being entered in
+concert pitch.
+
+Here are a few notes for violin and B-flat clarinet where the
+parts have been entered using the notes and key as they appear in
+each part of the conductor's score.  The two instruments are
+playing in unison.
+
+@lilypond[verbatim,quote,ragged-right]
+\new GrandStaff <<
+  \new Staff = "Vln" {
+    \relative c'' {
+      \set Staff.instrumentName = "Vln"
+      \set Staff.midiInstrument="violin"
+      % strictly speaking not necessary, but a good reminder
+      \transposition c'
+
+      \key c \major
+      g4( c8) r c r c4
+    }
+  }
+  \new Staff = "clarinet" {
+    \relative c'' {
+      \set Staff.instrumentName = \markup {Cl (B\flat)}
+      \set Staff.midiInstrument="clarinet"
+      \transposition bes
+
+      % not concert pitch
+      \key d \major
+      a4( d8) r d r d4
+    }
+  }
+>>
+@end lilypond
+
+The @code{\transposition} may be changed during a piece.  For
+example, a clarinetist may switch from an A clarinet to a B-flat
+clarinet.
+
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
+\set Staff.instrumentName = "Cl (A)"
+\key a \major
+\transposition a
+c d e f
+\textLengthOn
+r1^\markup{Switch to B\flat clarinet}
+
+\key bes \major
+\transposition bes
+c2 g
+@end lilypond
+
+
+@seealso
+
+Music Glossary: @rglos{concert pitch}, @rglos{transposing instrument}.
+
+Notation Reference: @ref{Quoting other voices}, @ref{Transpose}.
+
+Snippets: @lsrdir{Pitches,Pitches}.
 
-The key of a transposing instrument can also be specified.  This
-applies to many wind instruments, for example, clarinets (B-flat,
-A, and E-flat), horn (F) and trumpet (B-flat, C, D, and E-flat).
 
-The transposition is entered after the keyword
-@code{\transposition}
+@node Automatic accidentals
+@subsubsection Automatic accidentals
+
+@cindex automatic accidentals
+@cindex accidentals, automatic
+@cindex accidentals
+@cindex accidental style
+@cindex default accidental style
+@cindex accidental style, default
+@funindex set-accidental-style
+
+There are many different conventions on how to typeset
+accidentals.  LilyPond provides a function to specify which
+accidental style to use.  This function is called as follows
 
 @example
-\transposition bes   %% B-flat clarinet
+\new Staff <<
+  #(set-accidental-style 'voice)
+  @{ @dots{} @}
+>>
 @end example
 
-@noindent
-This command sets the property @code{instrumentTransposition}.
-The value of this property is used for MIDI output and quotations.
-It does not affect how notes are printed in the current staff.  To
-change the printed output, see @ref{Transpose}.
-
-The pitch to use for @code{\transposition} should correspond to
-the real sound heard when a @code{c'} written on the staff is
-played by the transposing instrument.  For example, when entering
-a score in concert pitch, typically all voices are entered in C,
-so they should be entered as
+The accidental style applies to the current @code{Staff} by
+default (with the exception of the styles @code{piano} and
+@code{piano-cautionary}, which are explained below).  Optionally,
+the function can take a second argument that determines in which
+scope the style should be changed.  For example, to use the same
+style in all staves of the current @code{StaffGroup}, use
 
 @example
-clarinet = @{
-  \transposition c'
-  ...
-@}
-saxophone = @{
-  \transposition c'
-  ...
-@}
+#(set-accidental-style 'voice 'StaffGroup)
 @end example
 
-The command @code{\transposition} should be used when the music is
-entered from a (transposed) orchestral part.  For example, in
-classical horn parts, the tuning of the instrument is often
-changed during a piece.  When copying the notes from the part, use
-@code{\transposition}, e.g.,
+The following accidental styles are supported.  To demonstrate
+each style, we use the following example:
+
+@lilypond[verbatim,quote,ragged-right]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
 
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      %%% change the next line as desired:
+      #(set-accidental-style 'default)
+      \musicA
+    }
+    \context Staff = "down" {
+      %%% change the next line as desired:
+      #(set-accidental-style 'default)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+Note that the last lines of this example can be replaced by the
+following, as long as the same accidental style should be used in
+both staves.
 @example
-\transposition d'
-c'4^"in D"
-...
-\transposition g'
-c'4^"in G"
-...
+\new PianoStaff @{
+  <<
+    \context Staff = "up" @{
+      %%% change the next line as desired:
+      #(set-accidental-style 'default 'Score)
+      \musicA
+    @}
+    \context Staff = "down" @{
+      \musicB
+    @}
+  >>
+@}
 @end example
 
+
+@c NOTE: don't use verbatim in this table.
+@table @code
+@item default
+This is the default typesetting behavior.  It corresponds to
+eighteenth-century common practice: accidentals are remembered to
+the end of the measure in which they occur and only on their own
+octave.  Thus, in the example below, no natural signs are printed
+before the@tie{}@code{b} in the second measure or the
+last@tie{}@code{c}:
+
+@lilypond[quote,ragged-right]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'default)
+      \musicA
+    }
+    \context Staff = "down" {
+      #(set-accidental-style 'default)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+@item voice
+The normal behavior is to remember the accidentals on Staff-level.
+In this style, however, accidentals are typeset individually for
+each voice.  Apart from that, the rule is similar to
+@code{default}.
+
+As a result, accidentals from one voice do not get canceled in
+other voices, which is often an unwanted result: in the following
+example, it is hard to determine whether the second@tie{}@code{a}
+should be played natural or sharp.  The @code{voice} option should
+therefore be used only 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 or in a piano score) then @code{modern} or
+@code{modern-cautionary} should be used instead.
+
+
+@lilypond[quote,ragged-right]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'voice)
+      \musicA
+    }
+    \context Staff = "down" {
+      #(set-accidental-style 'voice)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+@item modern
+@cindex accidentals, modern style
+@cindex modern style accidentals
+@funindex modern style accidentals
+
+This rule corresponds to the common practice in the twentieth
+century.  It prints the same accidentals as @code{default}, with
+two exceptions that serve to avoid ambiguity: after temporary
+accidentals, cancellation marks are printed also in the following
+measure (for notes in the same octave) and, in the same measure,
+for notes in other octaves.  Hence the naturals before
+the@tie{}@code{b} and the@tie{}@code{c} in the second measure of
+the upper staff:
+
+@lilypond[quote,ragged-right]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'modern)
+      \musicA
+    }
+    \context Staff = "down" {
+      #(set-accidental-style 'modern)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+@item modern-cautionary
+@cindex accidentals, modern cautionary style
+@cindex modern style accidentals
+@cindex modern style cautionary accidentals
+@cindex modern accidental style
+@cindex modern cautionary accidental style
+@funindex modern-cautionary
+
+This rule is similar to @code{modern}, but the @q{extra}
+accidentals (the ones not typeset by @code{default}) are typeset
+as cautionary accidentals.  They are by default printed with
+parentheses, but they can also be printed in reduced size by
+defining the @code{cautionary-style} property of
+@code{AccidentalSuggestion}.
+
+
+@lilypond[quote,ragged-right]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'modern-cautionary)
+      \musicA
+    }
+    \context Staff = "down" {
+      #(set-accidental-style 'modern-cautionary)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+@item modern-voice
+@cindex accidentals, multivoice
+@cindex accidentals, modern
+@cindex modern accidentals
+@cindex multivoice accidentals
+@cindex accidental style, modern
+@cindex modern accidental style
+@funindex modern-voice
+
+This rule is used for multivoice accidentals to be read both by
+musicians playing one voice and musicians playing all voices.
+Accidentals are typeset for each voice, but they @emph{are}
+canceled across voices in the same @code{Staff}.  Hence,
+the@tie{}@code{a} in the last measure is canceled because the
+previous cancellation was in a different voice, and
+the@tie{}@code{d} in the lower staff is canceled because of the
+accidental in a different voice in the previous measure:
+
+
+@lilypond[quote,ragged-right]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'modern-voice)
+      \musicA
+    }
+    \context Staff = "down" {
+      #(set-accidental-style 'modern-voice)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+@cindex accidental style, modern voice cautionary
+@cindex accidental style, cautionary, modern voice
+@cindex accidental style, voice, modern cautionary
+@funindex modern-voice-cautionary
+@item modern-voice-cautionary
+
+This rule is the same as @code{modern-voice}, but with the extra
+accidentals (the ones not typeset by @code{voice}) typeset
+as cautionaries.  Even though all accidentals typeset by
+@code{default} @emph{are} typeset with this rule,
+some of them are typeset as cautionaries.
+
+@lilypond[quote,ragged-right]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'modern-voice-cautionary)
+      \musicA
+    }
+    \context Staff = "down" {
+      #(set-accidental-style 'modern-voice-cautionary)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+@item piano
+@cindex piano accidentals
+@cindex piano accidentals
+@cindex accidentals, piano
+@cindex piano accidental style
+@cindex accidental style, piano
+
+This rule reflects twentieth-century practice for piano notation.
+Its behavior is very similar to @code{modern} style, but here
+accidentals also get canceled across the staves in the same
+GrandStaff or PianoStaff, hence all the cancellations of the final
+notes.
+
+This accidental style applies to the current @code{GrandStaff} or
+@code{PianoStaff} by default.
+
+@lilypond[quote,ragged-right]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'piano)
+      \musicA
+    }
+    \context Staff = "down" {
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+@item piano-cautionary
+@funindex #(set-accidental-style 'piano-cautionary)
+@cindex accidentals, piano cautionary
+@cindex cautionary accidentals, piano
+@cindex piano cautionary accidentals
+@cindex accidental style, piano cautionary
+@cindex cautionary accidental style, piano
+@cindex piano cautionary accidental style
+
+Same as @code{#(set-accidental-style 'piano)} but with the extra
+accidentals typeset as cautionaries.
+
+@lilypond[quote,ragged-right]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'piano-cautionary)
+      \musicA
+    }
+    \context Staff = "down" {
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+@item no-reset
+@funindex no-reset accidental style
+@cindex accidental style, no reset
+@cindex no reset accidental style
+
+This is the same as @code{default} but with accidentals lasting
+@q{forever} and not only within the same measure:
+
+@lilypond[quote,ragged-right]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'no-reset)
+      \musicA
+    }
+    \context Staff = "down" {
+      #(set-accidental-style 'no-reset)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+
+@item forget
+@funindex forget accidental style
+@cindex forget accidental style
+@cindex accidental style, forget
+
+This is the opposite of @code{no-reset}: 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:
+
+@lilypond[quote,ragged-right]
+musicA = {
+  <<
+    \relative c' {
+      cis'8 fis, d'4 <a cis>8 f bis4 |
+      cis2. <c, g'>4 |
+    }
+    \\
+    \relative c' {
+      ais'2 cis, |
+      fis8 b a4 cis2 |
+    }
+  >>
+}
+
+musicB = {
+  \clef bass
+  \new Voice {
+    \voiceTwo \relative c' {
+      <fis, a cis>4
+      \change Staff = up
+      cis'
+      \change Staff = down
+      <fis, a>
+      \change Staff = up
+      dis' |
+      \change Staff = down
+      <fis, a cis>4 gis <f a d>2 |
+    }
+  }
+}
+
+\new PianoStaff {
+  <<
+    \context Staff = "up" {
+      #(set-accidental-style 'forget)
+      \musicA
+    }
+    \context Staff = "down" {
+      #(set-accidental-style 'forget)
+      \musicB
+    }
+  >>
+}
+@end lilypond
+@end table
+
+@snippets
+
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{dodecaphonic-style-accidentals-for-each-note-including-naturals.ly}
+
+
+@seealso
+
+Snippets: @lsrdir{Pitches,Pitches}.
+
+Internals Reference: @internalsref{Accidental_engraver},
+@internalsref{Accidental}, @internalsref{AccidentalSuggestion},
+@internalsref{AccidentalPlacement}, @internalsref{GrandStaff} and
+@internalsref{PianoStaff}, @internalsref{Staff}.
+
+
+@cindex accidentals and simultaneous notes
+@cindex simultaneous notes and accidentals
+@cindex accidentals in chords
+@cindex chords, accidentals in
+
+@knownissues
+
+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 happen one at a time, in the order in
+which they appear in the input file.  This is a problem when
+accidentals in a chord depend on each other, which does not happen
+for the default accidental style.  The problem can be solved by
+manually inserting@tie{}@code{!} and@tie{}@code{?} for the
+problematic notes.
+
+
+@node Ambitus
+@subsubsection Ambitus
+
+@cindex ambitus
+@cindex range of pitches
+@cindex pitch range
+
+The term @notation{ambitus} (pl. ambitus) denotes a range of
+pitches for a given voice in a part of music.  It may also denote
+the pitch range that a musical instrument is capable of playing.
+Ambitus are printed on vocal parts so that performers can easily
+determine if it matches their capabilities.
+
+Ambitus are denoted at the beginning of a piece near the initial
+clef.  The range is graphically specified by two note heads that
+represent the lowest and highest pitches.  Accidentals are only
+printed if they are not part of the key signature.
+
+@lilypond[verbatim,quote,ragged-right]
+\layout {
+  \context {
+    \Voice
+    \consists Ambitus_engraver
+  }
+}
+
+\relative c'' {
+  aes c e2 cis,2
+}
+@end lilypond
+
+
+@snippets
+
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{adding-ambiti-per-voice.ly}
+
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{ambiti-multiple-voices.ly}
+
+
+@seealso
+
+Music Glossary: @rglos{ambitus}.
+
+Snippets: @lsrdir{Pitches,Pitches}.
+
+Internals Reference: @internalsref{Ambitus},
+@internalsref{AmbitusLine}, @internalsref{AmbitusNoteHead},
+@internalsref{AmbitusAccidental}, @internalsref{Ambitus_engraver},
+@internalsref{Staff}, @internalsref{Voice}.
+
+
+@knownissues
+
+There is no collision handling in the case of multiple per-voice
+ambitus.
+
+
+@node Note heads
+@subsection Note heads
+
+This section suggests ways of altering note heads.
+
+@menu
+* Special note heads::          
+* Easy notation note heads::    
+* Shape note heads::            
+* Improvisation::               
+@end menu
+
+@node Special note heads
+@subsubsection Special note heads
+
+@cindex note heads, special
+@cindex note heads, cross
+@cindex note heads, diamond
+@cindex note heads, parlato
+@cindex note heads, harmonic
+@cindex note heads, guitar
+@cindex special note heads
+@cindex cross note heads
+@cindex diamond note heads
+@cindex parlato note heads
+@cindex harmonic note heads
+@cindex guitar note heads
+
+Different note heads are used by various instruments for various
+meanings -- crosses are used for @q{parlato} with vocalists,
+stopped notes on guitar; diamonds are used for harmonics on string
+instruments, etc.  There is a shorthand (@code{\harmonic}) for
+diamond shapes; the other note head styles are produced by
+tweaking the property:
+
+@lilypond[verbatim,quote,ragged-right,fragment,relative=1]
+c4 d
+\override NoteHead #'style = #'cross
+e f
+\revert NoteHead #'style
+e d <c f\harmonic> <d a'\harmonic>
+@end lilypond
+
+@noindent
+To see all note head styles, see @ref{Note head styles}.
+
+
+@seealso
+
+Snippets: @lsrdir{Pitches,Pitches}.
+
+Notation Reference: @ref{Note head styles}.
+
+Internals Reference: @internalsref{NoteHead},
+@internalsref{LedgerLineSpanner}.
+
+
+@node Easy notation note heads
+@subsubsection Easy notation note heads
+
+@cindex note heads, practice
+@cindex note heads, easy notation
+@cindex easy notation
+@cindex Hal Leonard
+@cindex beginners' music
+@cindex music, beginners'
+@cindex easy play note heads
+@cindex note heads, easy play
+
+The @q{easy play} note head includes a note name inside the head.
+It is used in music for beginners.
+
+@lilypond[verbatim,quote,ragged-right]
+#(set-global-staff-size 26)
+\relative c' {
+  \easyHeadsOn
+  c2 e4 f
+  g1
+  \easyHeadsOff
+  c,1
+}
+@end lilypond
+
+The command @code{\easyHeadsOn} overrides settings for the
+@code{NoteHead} object.  These settings can be reverted with the command
+@code{\easyHeadsOff}. To make the letters readable, it has to be printed
+in a large font size.  To print with a larger font, see @ref{Setting the
+staff size}.
+
+@predefined
+
+@funindex \easyHeadsOn
+@funindex \easyHeadsOff
+@code{\easyHeadsOn}, @code{\easyHeadsOff}
+
+@seealso
+
+Notation Reference: @ref{Setting the staff size}.
+
+Snippets: @lsrdir{Pitches,Pitches},
+
+Internals Reference: @internalsref{NoteHead}.
+
+
+@node Shape note heads
+@subsubsection Shape note heads
+
+@cindex note heads, shape
+@cindex note heads, Aiken
+@cindex note heads, sacred harp
+@cindex shape notes
+@cindex Aiken shape note heads
+@cindex sacred harp note heads
+@funindex \key
+@funindex shapeNoteStyles
+@funindex \aikenHeads
+@funindex \sacredHarpHeads
+
+In shape note head notation, the shape of the note head
+corresponds to the harmonic function of a note in the scale.  This
+notation was popular in nineteenth-century American song books.
+
+Shape note heads can be produced by setting @code{\aikenHeads} or
+@code{\sacredHarpHeads}, depending on the style desired.
+
+@lilypond[verbatim,fragment,quote,ragged-right,relative=1]
+\aikenHeads
+c8 d4 e8 a2 g1
+\sacredHarpHeads
+c,8 d4 e8 a2 g1
+@end lilypond
+
+Shapes are typeset according to the step in the scale, where
+the base of the scale is determined by the @code{\key} command.
+
+@snippets
+
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
+{applying-noteheads-styles-depending-on-the-step-of-the-scale.ly}
+
+@noindent
+To see all note head styles, see @ref{Note head styles}.
+
+@seealso
+
+Snippets: @lsrdir{Pitches,Pitches}.
+
+Notation Reference: @ref{Note head styles}.
+
+
+@node Improvisation
+@subsubsection Improvisation
+
+@cindex improvisation
+@cindex slashed note heads
+@cindex note heads, improvisation
+@cindex note heads, slashed
+
+Improvisation is sometimes denoted with slashed note heads, where
+the performer may choose any pitch but should play the specified
+rhythm.  Such note heads can be created:
+
+@lilypond[verbatim,quote,ragged-right]
+\new Voice \with {
+  \consists Pitch_squash_engraver
+} \transpose c c' {
+  e8 e g a a16( bes) a8 g
+  \improvisationOn
+  e8
+  ~e2~e8 f4 fis8
+  ~fis2
+  \improvisationOff
+  a16(bes) a8 g e
+}
+@end lilypond
+
+
+@predefined
+
+@funindex \improvisationOn
+@funindex \improvisationOff
+
+@code{\improvisationOn}, @code{\improvisationOff}
+
+@seealso
+
+Snippets: @lsrdir{Pitches,Pitches}.
+
+Internals Reference: @internalsref{Pitch_squash_engraver},
+@internalsref{Voice}.
+
+