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 as above by adding@tie{}@code{'}
183 and@tie{}@code{,} to pitch names, it is easy to accidentally put a
184 pitch in the wrong octave. The relative octave mode prevents
185 these errors since most of the time it is not necessary to
186 indicate any octaves at all. Furthermore, in absolute mode, a
187 single mistake may be difficult to spot; in relative mode, a
188 single error puts the rest of the piece off by one octave.
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 note naming conventions in Nordic and Germanic languages,
249 like German and Dutch. To use other names for accidentals, see
250 @ref{Note names in other languages}.
252 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
258 The above notes are the Dutch note names. In Dutch, @code{aes} is
259 contracted to @code{as}, but both forms are accepted in LilyPond.
260 Similarly, both @code{es} and @code{ees} are accepted:
262 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
266 A natural will cancel the effect of an accidental or key
267 signature. However, naturals are not encoded into the note name
268 syntax with a suffix; a natural pitch is shown as a simple note
271 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
276 @cindex accidental, reminder
277 @cindex accidental, cautionary
278 @cindex accidental, parenthesized
279 @cindex reminder accidental
281 @cindex cautionary accidental
282 @cindex parenthesized accidental
285 Normally accidentals are printed automatically, but you may also
286 print them manually. A reminder accidental can be forced by
287 adding an exclamation mark@tie{}@code{!} after the pitch. A
288 cautionary accidental (i.e., an accidental within parentheses) can
289 be obtained by adding the question mark@tie{}@code{?} after the
290 pitch. These extra accidentals can be used to produce natural
293 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
294 cis cis cis! cis? c c? c! c
298 @cindex quarter tones
299 @cindex semi-flats, semi-sharps
301 Half-flats and half-sharps are formed by adding @code{eh} and
302 @code{ih}; the following is a series of Cs with increasing
305 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
306 \set Staff.extraNatural = ##f
307 ceseh ces ceh c cih cis cisih
313 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
314 {preventing-extra-naturals-from-being-automatically-added.ly}
318 Music Glossary: @rglos{sharp}, @rglos{flat}, @rglos{double sharp},
321 Learning Manual: @rlearning{Accidentals and key signatures}.
323 Notation Reference: @ref{Automatic accidentals},
324 @ref{Musica ficta accidentals},
325 @ref{Note names in other languages}.
327 Snippets: @lsrdir{Pitches},
329 dodecaphonic-style-accidentals-for-each-note-including-naturals.ly},
330 @lsr{Pitches, makam.ly}.
336 There are no generally accepted standards for denoting
337 three-quarter flats, so LilyPond's symbol does not conform to any
342 @node Note names in other languages
343 @unnumberedsubsubsec Note names in other languages
345 There are predefined sets of note names for various other
346 languages. To use them, include the language specific init file.
347 For example, add @code{\include "english.ly"} to the top of the
348 input file. The available language files and the note names they
351 @cindex note names, other languages
354 @multitable @columnfractions .2 .6 .05 .05 .05 .05
357 @tab sharp @tab flat @tab double sharp @tab double flat
359 @tab c d e f g a bes b
360 @tab -is @tab -es @tab -isis @tab -eses
362 @tab c d e f g a bf b
363 @tab -s/-sharp @tab -f/-flat @tab -ss/-x/-sharpsharp
367 @tab -is @tab -es @tab -isis @tab -eses
370 @tab -iss/-is @tab -ess/-es @tab -ississ/-isis
374 @tab -iss @tab -ess @tab -ississ @tab -essess
377 @tab -is @tab -es @tab -isis @tab -eses
379 @tab do re mi fa sol la sib si
380 @tab -d @tab -b @tab -dd @tab -bb
382 @tab do re mi fa sol la sib si
383 @tab -d/-s @tab -b @tab -dd/-ss @tab -bb
385 @tab do re mi fa sol la sib si
386 @tab -s @tab -b @tab -ss @tab -bb
388 @tab do re mi fa sol la sib si
389 @tab -s @tab -b @tab -ss @tab -bb
391 @tab do re mi fa sol la sib si
392 @tab -k @tab -b @tab -kk @tab -bb
397 Note that in some languages such as Norwegian and Swedish, the usual
398 spelling for accidentals is a double q{s} such as in @code{ciss}
399 or @{cess}. For both historical reasons and a greater simplicity,
400 LilyPond uses a single @q{s} for all these languages.
403 Similarly, in Germanic and Nordic languages, alterations
404 of@tie{}@code{a}, like for example @code{aes} and
405 @code{aeses}, are usually contracted to @code{as} and @code{ases}
406 (or more commonly @code{asas}). Sometimes only these contracted
407 names are defined in the corresponding language files (this also
408 applies to the suffixes for quartertones below).
411 Some music uses microtones whose alterations are fractions of a
412 @q{normal} sharp or flat. The note names for quartertones defined
413 in the various language files are listed in the following table.
414 Here the prefixes @q{semi-} and @q{sesqui-} mean @q{half} and
415 @q{one and a half}, respectively. For the other languages, no
416 special names have been defined yet.
420 @multitable @columnfractions .2 .6 .05 .05 .05 .05
423 @tab semi- @tab semi- @tab sesqui- @tab sesqui-
426 @tab c d e f g a bes b
427 @tab -ih @tab -eh @tab -isih @tab -eseh
429 @tab c d e f g a bf b
430 @tab -qs @tab -qf @tab -tqs @tab -tqf
433 @tab -ih @tab -eh @tab -isih @tab -eseh
435 @c @tab c d e f g a b h
437 @c @tab c d e f g a b h
439 @tab do re mi fa sol la sib si
440 @tab -sd @tab -sb @tab -dsd @tab -bsb
442 @c @tab do re mi fa sol la sib si
444 @c @tab do re mi fa sol la sib si
446 @tab do re mi fa sol la sib si
447 @tab -sqt @tab -bqt @tab -stqt @tab -btqt
453 Snippets: @lsrdir{Pitches}.
456 @node Changing multiple pitches
457 @subsection Changing multiple pitches
459 This section discusses how to modify pitches.
467 @unnumberedsubsubsec Octave check
471 In relative mode, it is easy to forget an octave changing mark.
472 Octave checks make such errors easier to correct. A note may be
473 followed by @code{=}@var{quotes} to indicate what its absolute
474 octave should be. In the following example,
477 \relative c'' @{ c g d='' @}
481 the@tie{}@code{d} will generate a warning, because
482 a@tie{}@code{d''} is expected, as indicated by the octave check
483 @code{=''}, but a@tie{}@code{d'} is found, since both
484 @code{c}-@code{g} and @code{g}-@code{d} without octavation marks
485 are descending fourths. In the output, the octave is corrected to
486 be a@tie{}@code{d''} and the next note is calculated relative
487 to@tie{}@code{d''} instead of@tie{}@code{d'}.
489 There is also an octave check that produces no visible output.
493 @var{pitch} \octave @var{controlpitch}
497 where @var{pitch} is a regular note within a music expression in
498 relative mode and @var{controlpitch} is a pitch in absolute mode.
499 This checks that @var{pitch} lies within the octave surrounding
500 @var{controlpitch}, i.e. not more than a fourth above or below it.
501 If this is not the case, a warning is printed and the octave is
502 corrected. The @var{controlpitch} is not printed as a note.
504 In the example below, the first check passes without incident,
505 since the@tie{}@code{e} (in @code{relative} mode) is within the
506 octave range of@tie{}@code{a'}. However, the second check
507 produces a warning, since the@tie{}@code{e} is not within the
508 octave range of@tie{}@code{b'}. The warning message is printed,
509 and the octave is adjusted so that the following notes are in the
510 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, however, 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,
618 to input written notes for a transposing instrument.
619 The previous examples show how to enter
620 pitches in C (or @notation{concert pitch}) and typeset them for a
621 transposing instrument, but the opposite is also possible if you
622 for example have a set of instrumental parts and want to print a
623 conductor's score. For example, when entering music for a B-flat
624 trumpet which begins on a notated E (concert D), one would write:
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 Snippets: @lsrdir{Pitches}.
654 Internals Reference: @internalsref{TransposedMusic}.
658 If you want to use both @code{\transpose} and @code{\relative},
659 you must put @code{\transpose} outside of @code{\relative}, since
660 @code{\relative} will have no effect on music that appears inside
661 a @code{\transpose}. See the previous example.
664 @node Displaying pitches
665 @subsection Displaying pitches
667 This section discusses how to alter the output of pitches.
673 * Instrument transpositions::
674 * Automatic accidentals::
679 @unnumberedsubsubsec Clef
693 @cindex mezzosoprano clef
694 @cindex baritone clef
695 @cindex varbaritone clef
698 The clef is set with the @code{\clef} @var{clefname} command:
700 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
711 The clef can also be changed inside the staff:
713 @lilypond[verbatim,quote,ragged-right,fragment]
731 These same clef symbols are used in different positions on the staff to
732 change the range of notes shown by that staff. The treble (respectively
733 alto, bass) clef is always positioned to show the line on which
734 a@tie{}@code{g'} (resp. @code{c'}, @code{f}) note is printed.
736 Supported clefs include
738 @multitable @columnfractions .4 .6
739 @headitem Clef @tab Position
740 @item @code{treble, violin, G, G2} @tab
741 G clef (g') on 2nd line
742 @item @code{alto, C} @tab
743 C clef (c') on 3rd line
744 @item @code{tenor} @tab
745 C clef (c') on 4th line
746 @item @code{bass, F} @tab
747 F clef (f) on 4th line
748 @item @code{french} @tab
749 G clef (g') on 1st line, so-called French violin clef
750 @item @code{soprano} @tab
751 C clef (c') on 1st line
752 @item @code{mezzosoprano} @tab
753 C clef (c') on 2nd line
754 @item @code{baritone} @tab
755 C clef (c') on 5th line
756 @item @code{varbaritone} @tab
757 F clef (f) on 3rd line
758 @item @code{subbass} @tab
759 F clef (f) on 5th line
760 @item @code{percussion} @tab
762 @item @code{tab} @tab
766 Further supported clefs are described under @ref{Ancient clefs}.
768 By adding @code{_8} or @code{^8} to the clef name, the clef is
769 transposed one octave down or up, respectively, and @code{_15} and
770 @code{^15} transposes by two octaves. The argument @var{clefname}
771 must be enclosed in quotes when it contains underscores or digits.
774 @cindex choral tenor clef
776 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
783 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
784 {clefs-commonly-tweaked-properties.ly}
789 Notation Reference: @ref{Ancient clefs}.
791 Snippets: @lsrdir{Pitches}.
793 Internals Reference: @internalsref{Clef}.
797 @unnumberedsubsubsec Key signature
799 @cindex key signature
802 @warning{New users are sometimes confused about accidentals and
803 key signatures. In LilyPond, note names are the raw input; key
804 signatures and clefs determine how this raw input is displayed.
805 An unaltered note like@tie{}@code{c} means @q{C natural},
806 regardless of the key signature or clef. For more information,
807 see @rlearning{Accidentals and key signatures}.}
809 The key signature indicates the tonality in which a piece is
810 played. It is denoted by a set of alterations (flats or sharps)
811 at the start of the staff.
813 Setting or changing the key signature is done with the @code{\key}
817 \key @var{pitch} @var{mode}
826 @funindex \mixolydian
832 Here, @var{mode} should be @code{\major} or @code{\minor} to get
833 @var{pitch}-major or @var{pitch}-minor, respectively. You may
834 also use the standard mode names, also called @q{church modes}:
835 @code{\ionian}, @code{\locrian}, @code{\aeolian},
836 @code{\mixolydian}, @code{\lydian}, @code{\phrygian}, and
839 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
848 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
849 {preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly}
851 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
852 {non-traditional-key-signatures.ly}
857 Music Glossary: @rglos{church mode}, @rglos{scordatura}.
859 Learning Manual: @rlearning{Accidentals and key signatures}.
861 Snippets: @lsrdir{Pitches}.
863 Internals Reference: @internalsref{KeyCancellation},
864 @internalsref{KeySignature}, @internalsref{Key_engraver}.
867 @node Ottava brackets
868 @unnumberedsubsubsec Ottava brackets
876 @notation{Ottava brackets} introduce an extra transposition of an
877 octave for the staff:
879 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
887 The @code{set-octavation} function also takes -1 (for 8va bassa),
888 2@tie{}(for 15ma), and -2 (for 15ma bassa) as arguments.
889 Internally the function sets the properties @code{ottavation}
890 (e.g., to @code{"8va"} or @code{"8vb"}) and
891 @code{middleCPosition}. To override the text of the bracket, set
892 @code{ottavation} after invoking @code{set-octavation}, i.e.,
894 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
896 \set Staff.ottavation = #"8"
903 Music Glossary: @rglos{ottava}.
905 Snippets: @lsrdir{Pitches}.
907 Internals Reference: @internalsref{OttavaBracket}.
912 @c FIXME: This should have been fixed by Joe.
913 @c If it hasn't, we should mention the appropriate
914 @c workaround (there is a snippet in the LSR) -vv
915 @code{set-octavation} will get confused when clef changes happen
916 during an octavation bracket.
919 @node Instrument transpositions
920 @unnumberedsubsubsec Instrument transpositions
922 @cindex transposition, MIDI
923 @cindex transposition, instrument
925 When typesetting scores that involve transposing instruments,
926 some parts can be typeset in a different pitch than the @qq{concert pitch}.
928 The key of a @notation{transposing instrument} can be specified.
929 This applies to many wind instruments, for example, clarinets
930 (B-flat, A, and E-flat), horn (F) and trumpet (B-flat, C, D, and
933 For such instruments, LilyPond will print a correct part, but is not
934 aware whether the instrument is playing in concert pitch or not.
935 This can lead to problems if you want a MIDI output, or if you quote
936 other parts in a transposing staff. In such cases, an explicit transposition
937 has to be specified, with the command
940 \transposition @var{pitch}
944 where @var{pitch} specifies the key in which the instrument plays.
945 For example, a part for B-flat clarinet would include
951 This command sets the property @code{instrumentTransposition}.
952 The value of this property is used for MIDI output and quotations.
953 MIDI output is transposed to play at concert pitch, and cue notes
954 and quotations are automatically transposed to the key of the
955 instrument in which they are quoted. For more information about
956 quotations, see @ref{Quoting other voices}.
958 The pitch to use for @code{\transposition} should correspond to
959 the real sound heard when a@tie{}@code{c'} written on the staff is
960 played by the transposing instrument. @code{\transposition}
961 should be used when the music is entered from an orchestral part
962 written for the instrument. For example, in classical horn parts,
963 the tuning of the instrument is often changed during a piece.
964 Here are a few notes for a violin and a B-flat clarinet where the
965 parts have been entered using the notes and key as they appear in
966 each part or the conductor's score:
968 @lilypond[verbatim,quote,ragged-right]
970 \new Staff = "Violin I" {
971 \set Staff.instrumentName = "Vln"
972 \set Staff.midiInstrument="violin"
975 g'4( c''8) r c'' r c''4
977 \new Staff = "Clarinet" {
978 \set Staff.instrumentName = "Cl"
979 \set Staff.midiInstrument="clarinet"
982 a'4( d''8) r d'' r d''4
987 Without the @code{\transposition} command the MIDI output of this
988 music would play the notes a tone apart; with it the notes are
989 played correctly in unison.
991 However, when entering the notes of a score in concert pitch, when
992 all voices are entered in C, they may be prefaced by (the default)
993 @code{\transposition c'}:
1007 to serve as a reminder that these parts are written in C.
1012 Notation Reference: @ref{Quoting other voices}, @ref{Transpose}.
1014 Snippets: @lsrdir{Pitches}.
1017 @node Automatic accidentals
1018 @unnumberedsubsubsec Automatic accidentals
1019 @cindex automatic accidentals
1021 @funindex set-accidental-style
1023 There are many different conventions on how to typeset
1024 accidentals. LilyPond provides a function to specify which such
1025 accidental style to use. This function is called as follows
1029 #(set-accidental-style 'voice)
1034 The accidental style applies to the current @code{Staff} by
1035 default (with the exception of the styles @code{piano} and
1036 @code{piano-cautionary}, see below. Optionally, the function can
1037 take a second argument which determines in which scope the style
1038 should be changed. For example, to use the same style in all
1039 staves of the current @code{StaffGroup}, use
1042 #(set-accidental-style 'voice 'StaffGroup)
1045 The following accidental styles are supported. To demonstrate
1046 each style, we use the following example:
1048 @lilypond[verbatim,quote,ragged-right]
1052 cis'8 fis, d'4 <a cis>8 f bis4 |
1066 \voiceTwo \relative c' {
1070 \change Staff = down
1074 \change Staff = down
1075 <fis, a cis>4 gis <f a d>2 |
1082 \context Staff = "up" {
1083 %%% change the next line as desired:
1084 #(set-accidental-style 'default)
1087 \context Staff = "down" {
1088 %%% change the next line as desired:
1089 #(set-accidental-style 'default)
1096 Note that the last lines of this example can be replaced by the
1097 following, as long as the same accidental style should be used in
1102 \context Staff = "up" @{
1103 %%% change the next line as desired:
1104 #(set-accidental-style 'default 'Score)
1107 \context Staff = "down" @{
1115 @c don't use verbatim in this table.
1118 This is the default typesetting behavior. It corresponds to
1119 eighteenth-century common practice: accidentals are remembered to
1120 the end of the measure in which they occur and only on their own
1121 octave. Thus, in the example below, no natural signs are printed
1122 before the@tie{}@code{b} in the second measure or the
1125 @lilypond[quote,ragged-right]
1129 cis'8 fis, d'4 <a cis>8 f bis4 |
1143 \voiceTwo \relative c' {
1147 \change Staff = down
1151 \change Staff = down
1152 <fis, a cis>4 gis <f a d>2 |
1159 \context Staff = "up" {
1160 #(set-accidental-style 'default)
1163 \context Staff = "down" {
1164 #(set-accidental-style 'default)
1172 The normal behavior is to remember the accidentals on Staff-level.
1173 In this style, however, accidentals are typeset individually for
1174 each voice. Apart from that, the rule is similar to
1177 As a result, accidentals from one voice do not get canceled in
1178 other voices, which is often an unwanted result: in the following
1179 example, it is hard to determine whether the second@tie{}@code{a}
1180 should be played natural or sharp. The @code{voice} option should
1181 therefore be used only if the voices are to be read solely by
1182 individual musicians. If the staff is to be used by one musician
1183 (e.g., a conductor or in a piano score) then @code{modern} or
1184 @code{modern-cautionary} should be used instead.
1187 @lilypond[quote,ragged-right]
1191 cis'8 fis, d'4 <a cis>8 f bis4 |
1205 \voiceTwo \relative c' {
1209 \change Staff = down
1213 \change Staff = down
1214 <fis, a cis>4 gis <f a d>2 |
1221 \context Staff = "up" {
1222 #(set-accidental-style 'voice)
1225 \context Staff = "down" {
1226 #(set-accidental-style 'voice)
1234 @funindex modern style accidentals
1236 This rule corresponds to the common practice in the twentieth
1237 century. It prints the same accidentals as @code{default}, with
1238 two exceptions which serve to avoid ambiguity: after temporary
1239 accidentals, cancellation marks are printed also in the following
1240 measure (for notes in the same octave) and, in the same measure,
1241 for notes in other octaves. Hence the naturals before
1242 the@tie{}@code{b} and the@tie{}@code{c} in the second measure of
1245 @lilypond[quote,ragged-right]
1249 cis'8 fis, d'4 <a cis>8 f bis4 |
1263 \voiceTwo \relative c' {
1267 \change Staff = down
1271 \change Staff = down
1272 <fis, a cis>4 gis <f a d>2 |
1279 \context Staff = "up" {
1280 #(set-accidental-style 'modern)
1283 \context Staff = "down" {
1284 #(set-accidental-style 'modern)
1291 @item modern-cautionary
1292 @funindex modern-cautionary
1294 This rule is similar to @code{modern}, but the @q{extra}
1295 accidentals (the ones not typeset by @code{default}) are typeset
1296 as cautionary accidentals. They are by default printed with
1297 parentheses, but they can also be printed in reduced size by
1298 defining the @code{cautionary-style} property of
1299 @code{AccidentalSuggestion}.
1302 @lilypond[quote,ragged-right]
1306 cis'8 fis, d'4 <a cis>8 f bis4 |
1320 \voiceTwo \relative c' {
1324 \change Staff = down
1328 \change Staff = down
1329 <fis, a cis>4 gis <f a d>2 |
1336 \context Staff = "up" {
1337 #(set-accidental-style 'modern-cautionary)
1340 \context Staff = "down" {
1341 #(set-accidental-style 'modern-cautionary)
1349 @funindex modern-voice
1351 This rule is used for multivoice accidentals to be read both by
1352 musicians playing one voice and musicians playing all voices.
1353 Accidentals are typeset for each voice, but they @emph{are}
1354 canceled across voices in the same @code{Staff}. Hence,
1355 the@tie{}@code{a} in the last measure is canceled because the
1356 previous cancellation was in a different voice, and
1357 the@tie{}@code{d} in the lower staff is canceled because of the
1358 accidental in a different voice in the previous measure:
1361 @lilypond[quote,ragged-right]
1365 cis'8 fis, d'4 <a cis>8 f bis4 |
1379 \voiceTwo \relative c' {
1383 \change Staff = down
1387 \change Staff = down
1388 <fis, a cis>4 gis <f a d>2 |
1395 \context Staff = "up" {
1396 #(set-accidental-style 'modern-voice)
1399 \context Staff = "down" {
1400 #(set-accidental-style 'modern-voice)
1407 @funindex modern-voice-cautionary
1408 @item modern-voice-cautionary
1410 This rule is the same as @code{modern-voice}, but with the extra
1411 accidentals (the ones not typeset by @code{voice}) typeset
1412 as cautionaries. Even though all accidentals typeset by
1413 @code{default} @emph{are} typeset with this rule,
1414 some of them are typeset as cautionaries.
1416 @lilypond[quote,ragged-right]
1420 cis'8 fis, d'4 <a cis>8 f bis4 |
1434 \voiceTwo \relative c' {
1438 \change Staff = down
1442 \change Staff = down
1443 <fis, a cis>4 gis <f a d>2 |
1450 \context Staff = "up" {
1451 #(set-accidental-style 'modern-voice-cautionary)
1454 \context Staff = "down" {
1455 #(set-accidental-style 'modern-voice-cautionary)
1463 @funindex piano accidentals
1465 This rule reflects twentieth-century practice for piano notation.
1466 Its behavior is very similar to @code{modern} style, but here
1467 accidentals also get canceled across the staves in the same
1468 GrandStaff or PianoStaff, hence all the cancellations of the final
1471 This accidental style applies to the current @code{GrandStaff} or
1472 @code{PianoStaff} by default.
1474 @lilypond[quote,ragged-right]
1478 cis'8 fis, d'4 <a cis>8 f bis4 |
1492 \voiceTwo \relative c' {
1496 \change Staff = down
1500 \change Staff = down
1501 <fis, a cis>4 gis <f a d>2 |
1508 \context Staff = "up" {
1509 #(set-accidental-style 'piano)
1512 \context Staff = "down" {
1519 @item piano-cautionary
1520 @funindex #(set-accidental-style 'piano-cautionary)
1522 Same as @code{#(set-accidental-style 'piano)} but with the extra
1523 accidentals typeset as cautionaries.
1525 @lilypond[quote,ragged-right]
1529 cis'8 fis, d'4 <a cis>8 f bis4 |
1543 \voiceTwo \relative c' {
1547 \change Staff = down
1551 \change Staff = down
1552 <fis, a cis>4 gis <f a d>2 |
1559 \context Staff = "up" {
1560 #(set-accidental-style 'piano-cautionary)
1563 \context Staff = "down" {
1571 @funindex no-reset accidental style
1573 This is the same as @code{default} but with accidentals lasting
1574 @q{forever} and not only within the same measure:
1576 @lilypond[quote,ragged-right]
1580 cis'8 fis, d'4 <a cis>8 f bis4 |
1594 \voiceTwo \relative c' {
1598 \change Staff = down
1602 \change Staff = down
1603 <fis, a cis>4 gis <f a d>2 |
1610 \context Staff = "up" {
1611 #(set-accidental-style 'no-reset)
1614 \context Staff = "down" {
1615 #(set-accidental-style 'no-reset)
1623 @funindex forget accidental style
1625 This is the opposite of @code{no-reset}: Accidentals are not
1626 remembered at all -- and hence all accidentals are typeset
1627 relative to the key signature, regardless of what was before in
1630 @lilypond[quote,ragged-right]
1634 cis'8 fis, d'4 <a cis>8 f bis4 |
1648 \voiceTwo \relative c' {
1652 \change Staff = down
1656 \change Staff = down
1657 <fis, a cis>4 gis <f a d>2 |
1664 \context Staff = "up" {
1665 #(set-accidental-style 'forget)
1668 \context Staff = "down" {
1669 #(set-accidental-style 'forget)
1679 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1680 {dodecaphonic-style-accidentals-for-each-note-including-naturals.ly}
1685 Snippets: @lsrdir{Pitches}.
1687 Internals Reference: @internalsref{Accidental_engraver},
1688 @internalsref{Accidental}, @internalsref{AccidentalSuggestion},
1689 @internalsref{AccidentalPlacement}, @internalsref{GrandStaff} and
1690 @internalsref{PianoStaff}, @internalsref{Staff}.
1695 Simultaneous notes are considered to be entered in sequential
1696 mode. This means that in a chord the accidentals are typeset as
1697 if the notes in the chord happen one at a time, in the order in
1698 which they appear in the input file. This is a problem when
1699 accidentals in a chord depend on each other, which does not happen
1700 for the default accidental style. The problem can be solved by
1701 manually inserting@tie{}@code{!} and@tie{}@code{?} for the
1706 @unnumberedsubsubsec Ambitus
1709 The term @notation{ambitus} or @notation{ambit} denotes a range of
1710 pitches for a given voice in a part of music. It may also denote
1711 the pitch range that a musical instrument is capable of playing.
1712 Ambits are printed on vocal parts, so performers can easily
1713 determine if it matches their capabilities.
1715 Ambits are denoted at the beginning of a piece near the initial
1716 clef. The range is graphically specified by two note heads that
1717 represent the minimum and maximum pitch. Accidentals are only
1718 printed if they are not part of the key signature.
1720 @lilypond[verbatim,quote,ragged-right]
1724 \consists Ambitus_engraver
1736 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1737 {adding-ambiti-per-voice.ly}
1739 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1740 {ambiti-multiple-voices.ly}
1745 Snippets: @lsrdir{Pitches}.
1747 Internals Reference: @internalsref{Ambitus},
1748 @internalsref{AmbitusLine}, @internalsref{AmbitusNoteHead},
1749 @internalsref{AmbitusAccidental}, @internalsref{Ambitus_engraver},
1750 @internalsref{Staff}, @internalsref{Voice}.
1755 There is no collision handling in the case of multiple per-voice
1760 @subsection Note heads
1763 * Special note heads::
1764 * Easy notation note heads::
1765 * Shape note heads::
1769 @node Special note heads
1770 @unnumberedsubsubsec Special note heads
1772 @cindex note heads, special
1774 Different note heads are used by various instruments for various
1775 meanings -- crosses are used for @q{parlato} with vocalists,
1776 stopped notes on guitar; diamonds are used for harmonics on string
1777 instruments, etc. There is a shorthand (@code{\harmonic}) for
1778 diamond shapes; the other note head styles are produced by tweaking
1781 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
1783 \override NoteHead #'style = #'cross
1785 \revert NoteHead #'style
1786 e d <c f\harmonic> <d a'\harmonic>
1790 To see all note head styles, please see @ref{Note head styles}.
1795 Snippets: @lsrdir{Pitches}.
1797 Notation Reference: @ref{Note head styles}.
1799 Internals Reference: @internalsref{NoteHead}.
1802 @node Easy notation note heads
1803 @unnumberedsubsubsec Easy notation note heads
1805 @cindex note heads, practice
1806 @cindex note heads, easy notation
1807 @cindex easy notation
1810 The @q{easy play} note head includes a note name inside the head.
1811 It is used in music for beginners
1813 @lilypond[verbatim,quote,ragged-right,fragment,staffsize=26]
1819 The command @code{\setEasyHeads} overrides settings for the
1820 @code{NoteHead} object. To make the letters readable, it
1821 has to be printed in a large font size. To print with a larger
1822 font, see @ref{Setting the staff size}.
1826 @funindex \setEasyHeads
1827 @code{\setEasyHeads}
1831 Notation Reference: @ref{Setting the staff size}.
1833 Snippets: @lsrdir{Pitches},
1835 Internals Reference: @internalsref{NoteHead}.
1838 @node Shape note heads
1839 @unnumberedsubsubsec Shape note heads
1841 @cindex note heads, shape
1843 In shape note head notation, the shape of the note head
1844 corresponds to the harmonic function of a note in the scale. This
1845 notation was popular in nineteenth-century American song books.
1847 Shape note heads can be produced by setting @code{\aikenHeads} or
1848 @code{\sacredHarpHeads}, depending on the style desired.
1850 @lilypond[verbatim,fragment,relative=1]
1857 Shapes are typeset according to the step in the scale, where
1858 the base of the scale is determined by the @code{\key} command.
1861 @funindex shapeNoteStyles
1862 @funindex \aikenHeads
1863 @funindex \sacredHarpHeads
1865 Shape note heads are implemented through the
1866 @code{shapeNoteStyles} property. Its value is a vector of
1867 symbols. The k-th element indicates the style to use for the k-th
1868 step of the scale. Arbitrary combinations are possible, e.g.:
1870 @lilypond[verbatim,fragment,relative=1]
1871 \set shapeNoteStyles =
1872 ##(cross triangle fa #f mensural xcircle diamond)
1878 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1879 {applying-noteheads-styles-depending-on-the-step-of-the-scale.ly}
1884 Snippets: @lsrdir{Pitches}.
1888 @unnumberedsubsubsec Improvisation
1890 @cindex improvisation
1891 @cindex slashed note heads
1892 @cindex note heads, improvisation
1893 @cindex note heads, slashed
1895 Improvisation is sometimes denoted with slashed note heads. Such
1896 note heads can be created by adding a @code{Pitch_squash_engraver}
1897 to the @code{Voice} context. Then, the following command
1900 \set squashedPosition = #0
1901 \override NoteHead #'style = #'slash
1905 switches on the slashes.
1907 There are shortcuts @code{\improvisationOn} (and an accompanying
1908 @code{\improvisationOff}) for this command sequence. They are
1909 used in the following example:
1911 @lilypond[verbatim,quote,ragged-right]
1913 \consists Pitch_squash_engraver
1915 e8 e g a a16(bes)(a8) g
1927 Snippets: @lsrdir{Pitches}.
1929 Internals Reference: @internalsref{Pitch_squash_engraver},
1930 @internalsref{Voice}.