1 @c -*- coding: utf-8; mode: texinfo; -*-
3 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 When revising a translation, copy the HEAD committish of the
6 version that you are working on. See TRANSLATION for details.
13 @lilypondfile[quote,ragged-right,line-width=16\cm,staffsize=16]
16 This section discusses how to specify the pitch of notes. There
17 are three steps to this process: input, modifying, and output.
21 * Changing multiple pitches::
22 * Displaying pitches::
28 @subsection Writing pitches
30 This section discusses how to input pitches.
33 * Absolute octave entry::
34 * Relative octave entry::
36 * Note names in other languages::
40 @node Absolute octave entry
41 @unnumberedsubsubsec Absolute octave entry
46 A pitch name is specified using lowercase letters@tie{}@code{a}
47 through@tie{}@code{g}. An ascending C-major scale is engraved
50 @lilypond[verbatim,quote,ragged-right,fragment]
56 @cindex absolute octave specification
58 There are two different ways to enter these note names with regard
59 to octave placement: absolute and relative. The relative mode
60 will in most cases be the most convenient, but the absolute mode
61 is more fundamental and will be presented first. In absolute
62 mode, every note is placed explicitly in a specific octave. The
63 note names @code{c} to @code{b} are engraved in the octave below
64 middle C, as in the previous example.
66 @lilypond[verbatim,quote,ragged-right,fragment]
76 If a note should be in another octave than this, an octave
77 specification must be given. It takes the form of a series of
78 single quote@tie{}(@code{'}) or comma@tie{}(@code{,}) characters.
79 Each@tie{}@code{'} raises the pitch by one octave;
80 each@tie{}@code{,} lowers the pitch by an octave.
82 @lilypond[verbatim,quote,ragged-right,fragment]
84 c' c'' e' g d'' d' d c
86 c, c,, e, g d,, d, d c
91 Snippets: @lsrdir{Pitches}.
93 Internals Reference: @internalsref{LedgerLineSpanner},
94 @internalsref{NoteHead}.
97 @node Relative octave entry
98 @unnumberedsubsubsec Relative octave entry
101 @cindex relative octave specification
104 The absolute mode requires a lot of octave specifications, which
105 not only becomes tedious but also easily leads to errors.
106 Therefore, it is usually more convenient to let notes be entered
107 relative to the previous note. This is done with the relative
111 \relative @var{startpitch} @var{musicexpr}
114 In relative mode, each note is assumed to be as close to the
115 previous note as possible. This means that the octave of pitches
116 in @var{musicexpr} is calculated as follows:
120 If no octave changing mark is used on a pitch, its octave is calculated
121 so that the interval with the previous note is less than a fifth. This
122 interval is determined without considering accidentals.
125 An octave changing mark@tie{}@code{'} or@tie{}@code{,} can be added to
126 respectively raise or lower a pitch by an extra octave, relatively to
127 the pitch calculated without octave mark.
130 Multiple octave changing marks can be used. For example, @code{''}@tie{}and
131 @code{,,}@tie{} will alter the pitch by two octaves.
134 The pitch of the first note is relative to @code{@var{startpitch}}.
138 Here is the relative mode shown in action:
140 @lilypond[verbatim,quote,ragged-right,fragment]
146 Octave changing marks are used for intervals greater than a
149 @lilypond[verbatim,quote,ragged-right,fragment]
155 A note sequence without a single octave mark can nevertheless span
158 @lilypond[verbatim,quote,ragged-right,fragment]
164 If the preceding item is a chord, the first note of the chord is
165 used as the reference point for the octave placement of a
166 following note or chord. Inside of chords the next note is always
167 relative to the preceding one.
169 @lilypond[verbatim,quote,ragged-right,fragment]
177 The @var{startpitch} (after @code{\relative}) is a note name in
178 absolute mode. In principle it can be any note name, but common
179 practice is to use@tie{}@code{c} in various octave positions or the
180 first note of @var{musicexpr}.
182 When octaves are specified in absolute mode it is easy to
183 accidentally put a pitch in the wrong octave. Relative octave
184 mode reduces these errors since most of the time it is not
185 necessary to indicate any octaves at all. Furthermore, in
186 absolute mode, a single mistake may be difficult to spot; in
187 relative mode, a single error puts the rest of the piece off by
190 As explained above, the octave of pitches is calculated only with the
191 note names, regardless of any alterations. Therefore, an F-sharp
192 following a C will be placed higher than the C, while a G-flat following
193 a C will be placed lower than the C.
195 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
200 In addition, an augmented fourth is considered a smaller interval
201 than a diminished fifth, even though these intervals both span six
202 semitones. Even @qq{worse}, a doubly-augmented fourth is
203 considered a smaller interval than a diminished fifth, even though
204 the doubly-augmented fourth spans seven semitones while the
205 diminished fifth only spans six semitones; that is why a B-sharp
206 following an F will be put above the F.
211 Music Glossary: @rglos{fifth}, @rglos{interval}.
213 Snippets: @lsrdir{Pitches}.
218 The relative conversion will not affect @code{\transpose},
219 @code{\chordmode} or @code{\relative} sections in its argument.
220 To use relative mode within transposed music, an additional
221 @code{\relative} must be placed inside @code{\transpose}.
224 If no @var{startpitch} is specified for @code{\relative},
225 then@tie{}@code{c'} is assumed. However, this is a deprecated
226 option and may disappear in future versions, so its use is
232 @unnumberedsubsubsec Accidentals
234 @warning{New users are sometimes confused about accidentals and
235 key signatures. In LilyPond, note names are the raw input; key
236 signatures and clefs determine how this raw input is displayed.
237 An unaltered note like@tie{}@code{c} means @q{C natural},
238 regardless of the key signature or clef. For more information,
239 see @rlearning{Accidentals and key signatures}.}
241 @cindex note names, Dutch
242 @cindex note names, default
244 A @notation{sharp} pitch is made by adding @code{is} to the name,
245 and a @notation{flat} pitch by adding @code{es}. As you might
246 expect, a @notation{double sharp} or @notation{double flat} is
247 made by adding @code{isis} or @code{eses}. This syntax is derived
248 from Dutch note naming conventions. To use other names for
249 accidentals, see @ref{Note names in other languages}.
251 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
257 In Dutch, @code{aes} is contracted to @code{as}, but both forms
258 are accepted in LilyPond. Similarly, both @code{es} and
259 @code{ees} are accepted:
261 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
265 A natural will cancel the effect of an accidental or key
266 signature. However, naturals are not encoded into the note name
267 syntax with a suffix; a natural pitch is shown as a simple note
270 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
275 @cindex accidental, reminder
276 @cindex accidental, cautionary
277 @cindex accidental, parenthesized
278 @cindex reminder accidental
280 @cindex cautionary accidental
281 @cindex parenthesized accidental
284 Normally accidentals are printed automatically, but you may also
285 print them manually. A reminder accidental can be forced by
286 adding an exclamation mark@tie{}@code{!} after the pitch. A
287 cautionary accidental (i.e., an accidental within parentheses) can
288 be obtained by adding the question mark@tie{}@code{?} after the
289 pitch. These extra accidentals can be used to produce natural
292 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
293 cis cis cis! cis? c c? c! c
296 Accidentals are not printed on tied notes, except when the tie
297 crosses a line break, where a reminder accidental is automatically added:
299 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
300 cis1~ cis~ \break cis
303 @cindex quarter tones
304 @cindex semi-flats, semi-sharps
306 Half-flats and half-sharps are formed by adding @code{eh} and
307 @code{ih}; the following is a series of Cs with increasing
310 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
311 \set Staff.extraNatural = ##f
312 ceseh ces ceh c cih cis cisih
318 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
319 {preventing-extra-naturals-from-being-automatically-added.ly}
323 Music Glossary: @rglos{sharp}, @rglos{flat}, @rglos{double sharp},
324 @rglos{double flat}. @c FIXME note names
326 Learning Manual: @rlearning{Accidentals and key signatures}.
328 Notation Reference: @ref{Automatic accidentals},
329 @ref{Musica ficta accidentals},
330 @ref{Note names in other languages}.
332 Snippets: @lsrdir{Pitches},
334 dodecaphonic-style-accidentals-for-each-note-including-naturals.ly},
335 @lsr{Pitches, makam.ly}.
341 There are no generally accepted standards for denoting
342 three-quarter flats, so LilyPond's symbol does not conform to any
347 @node Note names in other languages
348 @unnumberedsubsubsec Note names in other languages
350 There are predefined sets of note names for various other
351 languages. To use them, include the language specific init file.
352 For example, add @code{\include "english.ly"} to the top of the
353 input file. The available language files and the note names they
356 @cindex note names, other languages
359 @multitable @columnfractions .2 .6 .05 .05 .05 .05
362 @tab sharp @tab flat @tab double sharp @tab double flat
364 @tab c d e f g a bes b
365 @tab -is @tab -es @tab -isis @tab -eses
367 @tab c d e f g a bf b
368 @tab -s/-sharp @tab -f/-flat @tab -ss/-x/-sharpsharp
372 @tab -is @tab -es @tab -isis @tab -eses
375 @tab -iss/-is @tab -ess/-es @tab -ississ/-isis
379 @tab -iss @tab -ess @tab -ississ @tab -essess
382 @tab -is @tab -es @tab -isis @tab -eses
384 @tab do re mi fa sol la sib si
385 @tab -d @tab -b @tab -dd @tab -bb
387 @tab do re mi fa sol la sib si
388 @tab -d/-s @tab -b @tab -dd/-ss @tab -bb
390 @tab do re mi fa sol la sib si
391 @tab -s @tab -b @tab -ss @tab -bb
393 @tab do re mi fa sol la sib si
394 @tab -s @tab -b @tab -ss @tab -bb
396 @tab do re mi fa sol la sib si
397 @tab -k @tab -b @tab -kk @tab -bb
401 Note that in some languages such as Norwegian and Swedish, the usual
402 spelling for accidentals is a double @q{s} such as in @code{ciss}
403 or @code{cess}. For both historical reasons and a greater simplicity,
404 LilyPond uses a single @q{s} for all these languages.
406 Similarly, in Germanic and Nordic languages, alterations
407 of@tie{}@code{a}, like for example @code{aes} and
408 @code{aeses}, are usually contracted to @code{as} and @code{ases}
409 (or more commonly @code{asas}). Sometimes only these contracted
410 names are defined in the corresponding language files (this also
411 applies to the suffixes for quartertones below).
413 Some music uses microtones whose alterations are fractions of a
414 @q{normal} sharp or flat. The note names for quartertones defined
415 in the various language files are listed in the following table.
416 Here the prefixes @q{semi-} and @q{sesqui-} mean @q{half} and
417 @q{one and a half}, respectively. For the other languages, no
418 special names have been defined yet.
421 @multitable @columnfractions .2 .6 .05 .05 .05 .05
424 @tab semi- @tab semi- @tab sesqui- @tab sesqui-
427 @tab c d e f g a bes b
428 @tab -ih @tab -eh @tab -isih @tab -eseh
430 @tab c d e f g a bf b
431 @tab -qs @tab -qf @tab -tqs @tab -tqf
434 @tab -ih @tab -eh @tab -isih @tab -eseh
436 @c @tab c d e f g a b h
438 @c @tab c d e f g a b h
440 @tab do re mi fa sol la sib si
441 @tab -sd @tab -sb @tab -dsd @tab -bsb
443 @c @tab do re mi fa sol la sib si
445 @c @tab do re mi fa sol la sib si
447 @tab do re mi fa sol la sib si
448 @tab -sqt @tab -bqt @tab -stqt @tab -btqt
454 Snippets: @lsrdir{Pitches}.
457 @node Changing multiple pitches
458 @subsection Changing multiple pitches
460 This section discusses how to modify pitches.
468 @unnumberedsubsubsec Octave check
472 In relative mode, it is easy to forget an octave changing mark.
473 Octave checks make such errors easier to correct. A note may be
474 followed by @code{=}@var{quotes} to indicate what its absolute
475 octave should be. In the following example,
478 \relative c'' @{ c g d='' @}
482 the@tie{}@code{d} will generate a warning, because
483 a@tie{}@code{d''} is expected, as indicated by the octave check
484 @code{=''}, but a@tie{}@code{d'} is found, since both
485 @code{c}-@code{g} and @code{g}-@code{d} without octavation marks
486 are descending fourths. In the output, the octave is corrected to
487 be a@tie{}@code{d''} and the next note is calculated relative
488 to@tie{}@code{d''} instead of@tie{}@code{d'}.
490 There is also an octave check that produces no visible output.
494 @var{pitch} \octave @var{controlpitch}
498 where @var{pitch} is a regular note within a music expression in
499 relative mode and @var{controlpitch} is a pitch in absolute mode.
500 This checks that @var{pitch} lies within the octave surrounding
501 @var{controlpitch}, i.e. not more than a fourth above or below it.
502 If this is not the case, a warning is printed and the octave is
503 corrected. The @var{controlpitch} is not printed as a note.
505 In the example below, the first check passes without incident,
506 since the@tie{}@code{e} (in @code{relative} mode) is within the
507 octave range of@tie{}@code{a'}. However, the second check
508 produces a warning, since the@tie{}@code{e} is not within the
509 octave range of@tie{}@code{b'}. The warning message is printed,
510 and the octave is adjusted so that the following notes are in the
511 correct octave once again.
521 The octave of a note following an @code{\octave} check is
522 determined with respect to the note preceding it, as modified by
523 the outcome of the octave check. In the next fragment, the first
524 note, an@tie{}@code{e'}, lies within the octave of@tie{}@code{b},
525 and the @code{\octave} check passes successfully. The second note
526 is then calculated relative to (absolute)@tie{}@code{e'}, which
527 yields an@tie{}@code{a'}, above middle@tie{}C. In this case, the
528 check had no influence on the output of the piece.
530 The second @code{\octave} check fails: @code{a'}@tie{}is not
531 within the range of@tie{}@code{b}. A warning is issued, and the
532 last note is calculated relative to@tie{}@code{a}, not
533 to@tie{}@code{a'}, and we get a@tie{}@code{d'}. Without the last
534 @code{\octave} check, the last note would have been
537 @lilypond[verbatim,quote,ragged-right,fragment]
549 Snippets: @lsrdir{Pitches}.
553 @unnumberedsubsubsec Transpose
556 @cindex transposition of pitches
559 A music expression can be transposed with @code{\transpose}. The
563 \transpose @var{from} @var{to} @var{musicexpr}
567 This means that @var{musicexpr} is transposed by the interval
568 between the pitches @var{from} and @var{to}: any note with pitch
569 @var{from} is changed to @var{to} and any other note is transposed
570 by the same interval.
572 Consider a piece written in the key of D-major. If this piece is
573 a little too low for its performer, it can be transposed up to
577 \transpose d e @dots{}
580 Consider a part written for violin (a C instrument). If this part is to
581 be played on the A clarinet (for which an A is notated as a C, and thus
582 sounds a minor third lower than notated), the appropriate part will be
586 \transpose a c' @dots{}
589 @code{\transpose} will also transpose key signatures:
591 @lilypond[verbatim,quote,ragged-right]
592 mus = { \key d \major cis d fis g }
601 @code{\transpose} distinguishes between enharmonic pitches: both
602 @code{\transpose c cis} or @code{\transpose c des} will transpose
603 up half a tone. The first version will print sharps and the notes
604 will remain on the same scale step, the second version will print
605 flats on the scale step above.
607 @lilypond[verbatim,quote,ragged-right]
608 mus = \relative c' { c d e f }
610 \transpose c cis { \mus }
611 \transpose c des { \mus }
615 @cindex transposing instruments
617 @code{\transpose} may also be used in a different way, to input
618 written notes for a transposing instrument. The previous examples
619 show how to enter pitches in C (or @notation{concert pitch}) and
620 typeset them for a transposing instrument, but the opposite is
621 also possible if you for example have a set of instrumental parts
622 and want to print a conductor's score. For example, when entering
623 music for a B-flat trumpet which begins on a notated E (concert
627 musicInBflat = @{ e4 @dots{} @}
628 \transpose c bes, \musicInBflat
632 To print this music in F (e.g., rearranging to a French horn) you
633 could wrap the existing music with another @code{\transpose}:
636 musicInBflat = @{ e4 @dots{} @}
637 \transpose f c' @{ \transpose c bes, \musicInBflat @}
641 For more information about transposing instruments,
642 see @ref{Instrument transpositions}.
646 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
647 {transposing-pitches-with-minimum-accidentals-smart-transpose.ly}
652 Notation Reference: @ref{Instrument transpositions}.
654 Snippets: @lsrdir{Pitches}.
656 Internals Reference: @internalsref{TransposedMusic}.
660 If you want to use both @code{\transpose} and @code{\relative},
661 you must put @code{\transpose} outside of @code{\relative}, since
662 @code{\relative} will have no effect on music that appears inside
663 a @code{\transpose}. See the previous example.
666 @node Displaying pitches
667 @subsection Displaying pitches
669 This section discusses how to alter the output of pitches.
675 * Instrument transpositions::
676 * Automatic accidentals::
681 @unnumberedsubsubsec Clef
695 @cindex mezzosoprano clef
696 @cindex baritone clef
697 @cindex varbaritone clef
700 The clef is set with the @code{\clef} @var{clefname} command:
702 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
713 The clef can also be changed inside the staff:
715 @lilypond[verbatim,quote,ragged-right,fragment]
733 These same clef symbols are used in different positions on the staff to
734 change the range of notes shown by that staff. The treble (respectively
735 alto, bass) clef is always positioned to show the line on which
736 a@tie{}@code{g'} (resp. @code{c'}, @code{f}) note is printed.
738 Supported clefs include
740 @multitable @columnfractions .4 .6
741 @headitem Clef @tab Position
742 @item @code{treble, violin, G, G2} @tab
743 G clef (g') on 2nd line
744 @item @code{alto, C} @tab
745 C clef (c') on 3rd line
746 @item @code{tenor} @tab
747 C clef (c') on 4th line
748 @item @code{bass, F} @tab
749 F clef (f) on 4th line
750 @item @code{french} @tab
751 G clef (g') on 1st line, so-called French violin clef
752 @item @code{soprano} @tab
753 C clef (c') on 1st line
754 @item @code{mezzosoprano} @tab
755 C clef (c') on 2nd line
756 @item @code{baritone} @tab
757 C clef (c') on 5th line
758 @item @code{varbaritone} @tab
759 F clef (f) on 3rd line
760 @item @code{subbass} @tab
761 F clef (f) on 5th line
762 @item @code{percussion} @tab
764 @item @code{tab} @tab
768 Further supported clefs are described under @ref{Ancient clefs}.
770 By adding @code{_8} or @code{^8} to the clef name, the clef is
771 transposed one octave down or up, respectively, and @code{_15} and
772 @code{^15} transposes by two octaves. The argument @var{clefname}
773 must be enclosed in quotes when it contains underscores or digits.
776 @cindex choral tenor clef
778 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
785 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
786 {clefs-commonly-tweaked-properties.ly}
791 Notation Reference: @ref{Ancient clefs}.
793 Snippets: @lsrdir{Pitches}.
795 Internals Reference: @internalsref{Clef}.
799 @unnumberedsubsubsec Key signature
801 @cindex key signature
804 @warning{New users are sometimes confused about accidentals and
805 key signatures. In LilyPond, note names are the raw input; key
806 signatures and clefs determine how this raw input is displayed.
807 An unaltered note like@tie{}@code{c} means @q{C natural},
808 regardless of the key signature or clef. For more information,
809 see @rlearning{Accidentals and key signatures}.}
811 The key signature indicates the tonality in which a piece is
812 played. It is denoted by a set of alterations (flats or sharps)
813 at the start of the staff.
815 Setting or changing the key signature is done with the @code{\key}
819 \key @var{pitch} @var{mode}
828 @funindex \mixolydian
834 Here, @var{mode} should be @code{\major} or @code{\minor} to get
835 @var{pitch}-major or @var{pitch}-minor, respectively. You may
836 also use the standard mode names, also called @q{church modes}:
837 @code{\ionian}, @code{\locrian}, @code{\aeolian},
838 @code{\mixolydian}, @code{\lydian}, @code{\phrygian}, and
841 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
850 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
851 {preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly}
853 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
854 {non-traditional-key-signatures.ly}
859 Music Glossary: @rglos{church mode}, @rglos{scordatura}.
861 Learning Manual: @rlearning{Accidentals and key signatures}.
863 Snippets: @lsrdir{Pitches}.
865 Internals Reference: @internalsref{KeyCancellation},
866 @internalsref{KeySignature}, @internalsref{Key_engraver}.
869 @node Ottava brackets
870 @unnumberedsubsubsec Ottava brackets
878 @notation{Ottava brackets} introduce an extra transposition of an
879 octave for the staff:
881 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
889 The @code{set-octavation} function also takes -1 (for 8va bassa),
890 2@tie{}(for 15ma), and -2 (for 15ma bassa) as arguments.
891 Internally the function sets the properties @code{ottavation}
892 (e.g., to @code{"8va"} or @code{"8vb"}) and
893 @code{middleCPosition}. To override the text of the bracket, set
894 @code{ottavation} after invoking @code{set-octavation}, i.e.,
896 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
898 \set Staff.ottavation = #"8"
905 Music Glossary: @rglos{ottava}.
907 Snippets: @lsrdir{Pitches}.
909 Internals Reference: @internalsref{OttavaBracket}.
914 @c FIXME: This should have been fixed by Joe.
915 @c If it hasn't, we should mention the appropriate
916 @c workaround (there is a snippet in the LSR) -vv
917 @code{set-octavation} will get confused when clef changes happen
918 during an octavation bracket.
921 @node Instrument transpositions
922 @unnumberedsubsubsec Instrument transpositions
924 @cindex transposition, MIDI
925 @cindex transposition, instrument
927 When typesetting scores that involve transposing instruments, some
928 parts can be typeset in a different pitch than the
929 @notation{concert pitch}.
931 The key of a @notation{transposing instrument} can be specified.
932 This applies to many wind instruments, for example, clarinets
933 (B-flat, A, and E-flat), horn (F) and trumpet (B-flat, C, D, and
936 For such instruments, LilyPond will print a correct part, but is
937 not aware whether the instrument is playing in concert pitch or
938 not. This can lead to problems if you want a MIDI output, or if
939 you quote other parts in a transposing staff. In such cases, an
940 explicit transposition must be specified:
943 \transposition @var{pitch}
947 where @var{pitch} specifies the key in which the instrument plays.
948 For example, a part for B-flat clarinet would include:
954 This command sets the property @code{instrumentTransposition}.
955 The value of this property is used for MIDI output and quotations.
956 MIDI output is transposed to play at concert pitch, and cue notes
957 and quotations are automatically transposed to the key of the
958 instrument in which they are quoted. For more information about
959 quotations, see @ref{Quoting other voices}.
961 The pitch to use for @code{\transposition} should correspond to
962 the real sound heard when a@tie{}@code{c'} written on the staff is
963 played by the transposing instrument. @code{\transposition}
964 should be used when the music is entered from an orchestral part
965 written for the instrument. For example, in classical horn parts,
966 the tuning of the instrument is often changed during a piece.
967 Here are a few notes for a violin and a B-flat clarinet where the
968 parts have been entered using the notes and key as they appear in
969 each part or the conductor's score:
971 @lilypond[verbatim,quote,ragged-right]
973 \new Staff = "Violin I" {
974 \set Staff.instrumentName = "Vln"
975 \set Staff.midiInstrument="violin"
978 g'4( c''8) r c'' r c''4
980 \new Staff = "Clarinet" {
981 \set Staff.instrumentName = "Cl"
982 \set Staff.midiInstrument="clarinet"
985 a'4( d''8) r d'' r d''4
990 Without the @code{\transposition} command the MIDI output of this
991 music would play the notes a tone apart; with it the notes are
992 played correctly in unison.
994 However, when entering the notes of a score in concert pitch, when
995 all voices are entered in C, they may be prefaced by (the default)
996 @code{\transposition c'}:
1010 to serve as a reminder that these parts are written in C.
1015 Music Glossary: @c TODO @rglos{concert pitch}
1017 Notation Reference: @ref{Quoting other voices}, @ref{Transpose}.
1019 Snippets: @lsrdir{Pitches}.
1022 @node Automatic accidentals
1023 @unnumberedsubsubsec Automatic accidentals
1024 @cindex automatic accidentals
1026 @funindex set-accidental-style
1028 There are many different conventions on how to typeset
1029 accidentals. LilyPond provides a function to specify which such
1030 accidental style to use. This function is called as follows
1034 #(set-accidental-style 'voice)
1039 The accidental style applies to the current @code{Staff} by
1040 default (with the exception of the styles @code{piano} and
1041 @code{piano-cautionary}, which are explained below). Optionally,
1042 the function can take a second argument which determines in which
1043 scope the style should be changed. For example, to use the same
1044 style in all staves of the current @code{StaffGroup}, use
1047 #(set-accidental-style 'voice 'StaffGroup)
1050 The following accidental styles are supported. To demonstrate
1051 each style, we use the following example:
1053 @lilypond[verbatim,quote,ragged-right]
1057 cis'8 fis, d'4 <a cis>8 f bis4 |
1071 \voiceTwo \relative c' {
1075 \change Staff = down
1079 \change Staff = down
1080 <fis, a cis>4 gis <f a d>2 |
1087 \context Staff = "up" {
1088 %%% change the next line as desired:
1089 #(set-accidental-style 'default)
1092 \context Staff = "down" {
1093 %%% change the next line as desired:
1094 #(set-accidental-style 'default)
1101 Note that the last lines of this example can be replaced by the
1102 following, as long as the same accidental style should be used in
1107 \context Staff = "up" @{
1108 %%% change the next line as desired:
1109 #(set-accidental-style 'default 'Score)
1112 \context Staff = "down" @{
1120 @c don't use verbatim in this table.
1123 This is the default typesetting behavior. It corresponds to
1124 eighteenth-century common practice: accidentals are remembered to
1125 the end of the measure in which they occur and only on their own
1126 octave. Thus, in the example below, no natural signs are printed
1127 before the@tie{}@code{b} in the second measure or the
1130 @lilypond[quote,ragged-right]
1134 cis'8 fis, d'4 <a cis>8 f bis4 |
1148 \voiceTwo \relative c' {
1152 \change Staff = down
1156 \change Staff = down
1157 <fis, a cis>4 gis <f a d>2 |
1164 \context Staff = "up" {
1165 #(set-accidental-style 'default)
1168 \context Staff = "down" {
1169 #(set-accidental-style 'default)
1177 The normal behavior is to remember the accidentals on Staff-level.
1178 In this style, however, accidentals are typeset individually for
1179 each voice. Apart from that, the rule is similar to
1182 As a result, accidentals from one voice do not get canceled in
1183 other voices, which is often an unwanted result: in the following
1184 example, it is hard to determine whether the second@tie{}@code{a}
1185 should be played natural or sharp. The @code{voice} option should
1186 therefore be used only if the voices are to be read solely by
1187 individual musicians. If the staff is to be used by one musician
1188 (e.g., a conductor or in a piano score) then @code{modern} or
1189 @code{modern-cautionary} should be used instead.
1192 @lilypond[quote,ragged-right]
1196 cis'8 fis, d'4 <a cis>8 f bis4 |
1210 \voiceTwo \relative c' {
1214 \change Staff = down
1218 \change Staff = down
1219 <fis, a cis>4 gis <f a d>2 |
1226 \context Staff = "up" {
1227 #(set-accidental-style 'voice)
1230 \context Staff = "down" {
1231 #(set-accidental-style 'voice)
1239 @funindex modern style accidentals
1241 This rule corresponds to the common practice in the twentieth
1242 century. It prints the same accidentals as @code{default}, with
1243 two exceptions which serve to avoid ambiguity: after temporary
1244 accidentals, cancellation marks are printed also in the following
1245 measure (for notes in the same octave) and, in the same measure,
1246 for notes in other octaves. Hence the naturals before
1247 the@tie{}@code{b} and the@tie{}@code{c} in the second measure of
1250 @lilypond[quote,ragged-right]
1254 cis'8 fis, d'4 <a cis>8 f bis4 |
1268 \voiceTwo \relative c' {
1272 \change Staff = down
1276 \change Staff = down
1277 <fis, a cis>4 gis <f a d>2 |
1284 \context Staff = "up" {
1285 #(set-accidental-style 'modern)
1288 \context Staff = "down" {
1289 #(set-accidental-style 'modern)
1296 @item modern-cautionary
1297 @funindex modern-cautionary
1299 This rule is similar to @code{modern}, but the @q{extra}
1300 accidentals (the ones not typeset by @code{default}) are typeset
1301 as cautionary accidentals. They are by default printed with
1302 parentheses, but they can also be printed in reduced size by
1303 defining the @code{cautionary-style} property of
1304 @code{AccidentalSuggestion}.
1307 @lilypond[quote,ragged-right]
1311 cis'8 fis, d'4 <a cis>8 f bis4 |
1325 \voiceTwo \relative c' {
1329 \change Staff = down
1333 \change Staff = down
1334 <fis, a cis>4 gis <f a d>2 |
1341 \context Staff = "up" {
1342 #(set-accidental-style 'modern-cautionary)
1345 \context Staff = "down" {
1346 #(set-accidental-style 'modern-cautionary)
1354 @funindex modern-voice
1356 This rule is used for multivoice accidentals to be read both by
1357 musicians playing one voice and musicians playing all voices.
1358 Accidentals are typeset for each voice, but they @emph{are}
1359 canceled across voices in the same @code{Staff}. Hence,
1360 the@tie{}@code{a} in the last measure is canceled because the
1361 previous cancellation was in a different voice, and
1362 the@tie{}@code{d} in the lower staff is canceled because of the
1363 accidental in a different voice in the previous measure:
1366 @lilypond[quote,ragged-right]
1370 cis'8 fis, d'4 <a cis>8 f bis4 |
1384 \voiceTwo \relative c' {
1388 \change Staff = down
1392 \change Staff = down
1393 <fis, a cis>4 gis <f a d>2 |
1400 \context Staff = "up" {
1401 #(set-accidental-style 'modern-voice)
1404 \context Staff = "down" {
1405 #(set-accidental-style 'modern-voice)
1412 @funindex modern-voice-cautionary
1413 @item modern-voice-cautionary
1415 This rule is the same as @code{modern-voice}, but with the extra
1416 accidentals (the ones not typeset by @code{voice}) typeset
1417 as cautionaries. Even though all accidentals typeset by
1418 @code{default} @emph{are} typeset with this rule,
1419 some of them are typeset as cautionaries.
1421 @lilypond[quote,ragged-right]
1425 cis'8 fis, d'4 <a cis>8 f bis4 |
1439 \voiceTwo \relative c' {
1443 \change Staff = down
1447 \change Staff = down
1448 <fis, a cis>4 gis <f a d>2 |
1455 \context Staff = "up" {
1456 #(set-accidental-style 'modern-voice-cautionary)
1459 \context Staff = "down" {
1460 #(set-accidental-style 'modern-voice-cautionary)
1468 @funindex piano accidentals
1470 This rule reflects twentieth-century practice for piano notation.
1471 Its behavior is very similar to @code{modern} style, but here
1472 accidentals also get canceled across the staves in the same
1473 GrandStaff or PianoStaff, hence all the cancellations of the final
1476 This accidental style applies to the current @code{GrandStaff} or
1477 @code{PianoStaff} by default.
1479 @lilypond[quote,ragged-right]
1483 cis'8 fis, d'4 <a cis>8 f bis4 |
1497 \voiceTwo \relative c' {
1501 \change Staff = down
1505 \change Staff = down
1506 <fis, a cis>4 gis <f a d>2 |
1513 \context Staff = "up" {
1514 #(set-accidental-style 'piano)
1517 \context Staff = "down" {
1524 @item piano-cautionary
1525 @funindex #(set-accidental-style 'piano-cautionary)
1527 Same as @code{#(set-accidental-style 'piano)} but with the extra
1528 accidentals typeset as cautionaries.
1530 @lilypond[quote,ragged-right]
1534 cis'8 fis, d'4 <a cis>8 f bis4 |
1548 \voiceTwo \relative c' {
1552 \change Staff = down
1556 \change Staff = down
1557 <fis, a cis>4 gis <f a d>2 |
1564 \context Staff = "up" {
1565 #(set-accidental-style 'piano-cautionary)
1568 \context Staff = "down" {
1576 @funindex no-reset accidental style
1578 This is the same as @code{default} but with accidentals lasting
1579 @q{forever} and not only within the same measure:
1581 @lilypond[quote,ragged-right]
1585 cis'8 fis, d'4 <a cis>8 f bis4 |
1599 \voiceTwo \relative c' {
1603 \change Staff = down
1607 \change Staff = down
1608 <fis, a cis>4 gis <f a d>2 |
1615 \context Staff = "up" {
1616 #(set-accidental-style 'no-reset)
1619 \context Staff = "down" {
1620 #(set-accidental-style 'no-reset)
1628 @funindex forget accidental style
1630 This is the opposite of @code{no-reset}: Accidentals are not
1631 remembered at all -- and hence all accidentals are typeset
1632 relative to the key signature, regardless of what was before in
1635 @lilypond[quote,ragged-right]
1639 cis'8 fis, d'4 <a cis>8 f bis4 |
1653 \voiceTwo \relative c' {
1657 \change Staff = down
1661 \change Staff = down
1662 <fis, a cis>4 gis <f a d>2 |
1669 \context Staff = "up" {
1670 #(set-accidental-style 'forget)
1673 \context Staff = "down" {
1674 #(set-accidental-style 'forget)
1684 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1685 {dodecaphonic-style-accidentals-for-each-note-including-naturals.ly}
1690 Snippets: @lsrdir{Pitches}.
1692 Internals Reference: @internalsref{Accidental_engraver},
1693 @internalsref{Accidental}, @internalsref{AccidentalSuggestion},
1694 @internalsref{AccidentalPlacement}, @internalsref{GrandStaff} and
1695 @internalsref{PianoStaff}, @internalsref{Staff}.
1700 Simultaneous notes are considered to be entered in sequential
1701 mode. This means that in a chord the accidentals are typeset as
1702 if the notes in the chord happen one at a time, in the order in
1703 which they appear in the input file. This is a problem when
1704 accidentals in a chord depend on each other, which does not happen
1705 for the default accidental style. The problem can be solved by
1706 manually inserting@tie{}@code{!} and@tie{}@code{?} for the
1711 @unnumberedsubsubsec Ambitus
1714 The term @notation{ambitus} or @notation{ambit} denotes a range of
1715 pitches for a given voice in a part of music. It may also denote
1716 the pitch range that a musical instrument is capable of playing.
1717 Ambits are printed on vocal parts, so performers can easily
1718 determine if it matches their capabilities.
1720 Ambits are denoted at the beginning of a piece near the initial
1721 clef. The range is graphically specified by two note heads that
1722 represent the minimum and maximum pitch. Accidentals are only
1723 printed if they are not part of the key signature.
1725 @lilypond[verbatim,quote,ragged-right]
1729 \consists Ambitus_engraver
1741 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1742 {adding-ambiti-per-voice.ly}
1744 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1745 {ambiti-multiple-voices.ly}
1750 Snippets: @lsrdir{Pitches}.
1752 Internals Reference: @internalsref{Ambitus},
1753 @internalsref{AmbitusLine}, @internalsref{AmbitusNoteHead},
1754 @internalsref{AmbitusAccidental}, @internalsref{Ambitus_engraver},
1755 @internalsref{Staff}, @internalsref{Voice}.
1760 There is no collision handling in the case of multiple per-voice
1765 @subsection Note heads
1768 * Special note heads::
1769 * Easy notation note heads::
1770 * Shape note heads::
1774 @node Special note heads
1775 @unnumberedsubsubsec Special note heads
1777 @cindex note heads, special
1779 Different note heads are used by various instruments for various
1780 meanings -- crosses are used for @q{parlato} with vocalists,
1781 stopped notes on guitar; diamonds are used for harmonics on string
1782 instruments, etc. There is a shorthand (@code{\harmonic}) for
1783 diamond shapes; the other note head styles are produced by tweaking
1786 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
1788 \override NoteHead #'style = #'cross
1790 \revert NoteHead #'style
1791 e d <c f\harmonic> <d a'\harmonic>
1795 To see all note head styles, please see @ref{Note head styles}.
1800 Snippets: @lsrdir{Pitches}.
1802 Notation Reference: @ref{Note head styles}.
1804 Internals Reference: @internalsref{NoteHead}.
1807 @node Easy notation note heads
1808 @unnumberedsubsubsec Easy notation note heads
1810 @cindex note heads, practice
1811 @cindex note heads, easy notation
1812 @cindex easy notation
1815 The @q{easy play} note head includes a note name inside the head.
1816 It is used in music for beginners
1818 @lilypond[verbatim,quote,ragged-right,fragment,staffsize=26]
1824 The command @code{\setEasyHeads} overrides settings for the
1825 @code{NoteHead} object. To make the letters readable, it
1826 has to be printed in a large font size. To print with a larger
1827 font, see @ref{Setting the staff size}.
1831 @funindex \setEasyHeads
1832 @code{\setEasyHeads}
1836 Notation Reference: @ref{Setting the staff size}.
1838 Snippets: @lsrdir{Pitches},
1840 Internals Reference: @internalsref{NoteHead}.
1843 @node Shape note heads
1844 @unnumberedsubsubsec Shape note heads
1846 @cindex note heads, shape
1848 In shape note head notation, the shape of the note head
1849 corresponds to the harmonic function of a note in the scale. This
1850 notation was popular in nineteenth-century American song books.
1852 Shape note heads can be produced by setting @code{\aikenHeads} or
1853 @code{\sacredHarpHeads}, depending on the style desired.
1855 @lilypond[verbatim,fragment,relative=1]
1862 Shapes are typeset according to the step in the scale, where
1863 the base of the scale is determined by the @code{\key} command.
1866 @funindex shapeNoteStyles
1867 @funindex \aikenHeads
1868 @funindex \sacredHarpHeads
1870 Shape note heads are implemented through the
1871 @code{shapeNoteStyles} property. Its value is a vector of
1872 symbols. The k-th element indicates the style to use for the k-th
1873 step of the scale. Arbitrary combinations are possible, e.g.:
1875 @lilypond[verbatim,fragment,relative=1]
1876 \set shapeNoteStyles =
1877 ##(cross triangle fa #f mensural xcircle diamond)
1883 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1884 {applying-noteheads-styles-depending-on-the-step-of-the-scale.ly}
1889 Snippets: @lsrdir{Pitches}.
1893 @unnumberedsubsubsec Improvisation
1895 @cindex improvisation
1896 @cindex slashed note heads
1897 @cindex note heads, improvisation
1898 @cindex note heads, slashed
1900 Improvisation is sometimes denoted with slashed note heads. Such
1901 note heads can be created by adding a @code{Pitch_squash_engraver}
1902 to the @code{Voice} context. Then, the following command
1905 \set squashedPosition = #0
1906 \override NoteHead #'style = #'slash
1910 switches on the slashes.
1912 There are shortcuts @code{\improvisationOn} (and an accompanying
1913 @code{\improvisationOff}) for this command sequence. They are
1914 used in the following example:
1916 @lilypond[verbatim,quote,ragged-right]
1918 \consists Pitch_squash_engraver
1920 e8 e g a a16(bes)(a8) g
1932 Snippets: @lsrdir{Pitches}.
1934 Internals Reference: @internalsref{Pitch_squash_engraver},
1935 @internalsref{Voice}.