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 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
297 Accidentals are not printed on tied notes, except when the tie
298 crosses a line break, where a reminder accidental is automatically added:
300 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
301 cis1~ cis~ \break cis
304 @cindex quarter tones
305 @cindex semi-flats, semi-sharps
307 Half-flats and half-sharps are formed by adding @code{eh} and
308 @code{ih}; the following is a series of Cs with increasing
311 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
312 \set Staff.extraNatural = ##f
313 ceseh ces ceh c cih cis cisih
319 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
320 {preventing-extra-naturals-from-being-automatically-added.ly}
324 Music Glossary: @rglos{sharp}, @rglos{flat}, @rglos{double sharp},
327 Learning Manual: @rlearning{Accidentals and key signatures}.
329 Notation Reference: @ref{Automatic accidentals},
330 @ref{Musica ficta accidentals},
331 @ref{Note names in other languages}.
333 Snippets: @lsrdir{Pitches},
335 dodecaphonic-style-accidentals-for-each-note-including-naturals.ly},
336 @lsr{Pitches, makam.ly}.
342 There are no generally accepted standards for denoting
343 three-quarter flats, so LilyPond's symbol does not conform to any
348 @node Note names in other languages
349 @unnumberedsubsubsec Note names in other languages
351 There are predefined sets of note names for various other
352 languages. To use them, include the language specific init file.
353 For example, add @code{\include "english.ly"} to the top of the
354 input file. The available language files and the note names they
357 @cindex note names, other languages
360 @multitable @columnfractions .2 .6 .05 .05 .05 .05
363 @tab sharp @tab flat @tab double sharp @tab double flat
365 @tab c d e f g a bes b
366 @tab -is @tab -es @tab -isis @tab -eses
368 @tab c d e f g a bf b
369 @tab -s/-sharp @tab -f/-flat @tab -ss/-x/-sharpsharp
373 @tab -is @tab -es @tab -isis @tab -eses
376 @tab -iss/-is @tab -ess/-es @tab -ississ/-isis
380 @tab -iss @tab -ess @tab -ississ @tab -essess
383 @tab -is @tab -es @tab -isis @tab -eses
385 @tab do re mi fa sol la sib si
386 @tab -d @tab -b @tab -dd @tab -bb
388 @tab do re mi fa sol la sib si
389 @tab -d/-s @tab -b @tab -dd/-ss @tab -bb
391 @tab do re mi fa sol la sib si
392 @tab -s @tab -b @tab -ss @tab -bb
394 @tab do re mi fa sol la sib si
395 @tab -s @tab -b @tab -ss @tab -bb
397 @tab do re mi fa sol la sib si
398 @tab -k @tab -b @tab -kk @tab -bb
402 @c TODO: move most of this junk into glossary
404 Note that in some languages such as Norwegian and Swedish, the usual
405 spelling for accidentals is a double @q{s} such as in @code{ciss}
406 or @code{cess}. For both historical reasons and a greater simplicity,
407 LilyPond uses a single @q{s} for all these languages.
410 Similarly, in Germanic and Nordic languages, alterations
411 of@tie{}@code{a}, like for example @code{aes} and
412 @code{aeses}, are usually contracted to @code{as} and @code{ases}
413 (or more commonly @code{asas}). Sometimes only these contracted
414 names are defined in the corresponding language files (this also
415 applies to the suffixes for quartertones below).
418 Some music uses microtones whose alterations are fractions of a
419 @q{normal} sharp or flat. The note names for quartertones defined
420 in the various language files are listed in the following table.
421 Here the prefixes @q{semi-} and @q{sesqui-} mean @q{half} and
422 @q{one and a half}, respectively. For the other languages, no
423 special names have been defined yet.
427 @multitable @columnfractions .2 .6 .05 .05 .05 .05
430 @tab semi- @tab semi- @tab sesqui- @tab sesqui-
433 @tab c d e f g a bes b
434 @tab -ih @tab -eh @tab -isih @tab -eseh
436 @tab c d e f g a bf b
437 @tab -qs @tab -qf @tab -tqs @tab -tqf
440 @tab -ih @tab -eh @tab -isih @tab -eseh
442 @c @tab c d e f g a b h
444 @c @tab c d e f g a b h
446 @tab do re mi fa sol la sib si
447 @tab -sd @tab -sb @tab -dsd @tab -bsb
449 @c @tab do re mi fa sol la sib si
451 @c @tab do re mi fa sol la sib si
453 @tab do re mi fa sol la sib si
454 @tab -sqt @tab -bqt @tab -stqt @tab -btqt
460 Snippets: @lsrdir{Pitches}.
463 @node Changing multiple pitches
464 @subsection Changing multiple pitches
466 This section discusses how to modify pitches.
474 @unnumberedsubsubsec Octave check
478 In relative mode, it is easy to forget an octave changing mark.
479 Octave checks make such errors easier to correct. A note may be
480 followed by @code{=}@var{quotes} to indicate what its absolute
481 octave should be. In the following example,
484 \relative c'' @{ c g d='' @}
488 the@tie{}@code{d} will generate a warning, because
489 a@tie{}@code{d''} is expected, as indicated by the octave check
490 @code{=''}, but a@tie{}@code{d'} is found, since both
491 @code{c}-@code{g} and @code{g}-@code{d} without octavation marks
492 are descending fourths. In the output, the octave is corrected to
493 be a@tie{}@code{d''} and the next note is calculated relative
494 to@tie{}@code{d''} instead of@tie{}@code{d'}.
496 There is also an octave check that produces no visible output.
500 @var{pitch} \octave @var{controlpitch}
504 where @var{pitch} is a regular note within a music expression in
505 relative mode and @var{controlpitch} is a pitch in absolute mode.
506 This checks that @var{pitch} lies within the octave surrounding
507 @var{controlpitch}, i.e. not more than a fourth above or below it.
508 If this is not the case, a warning is printed and the octave is
509 corrected. The @var{controlpitch} is not printed as a note.
511 In the example below, the first check passes without incident,
512 since the@tie{}@code{e} (in @code{relative} mode) is within the
513 octave range of@tie{}@code{a'}. However, the second check
514 produces a warning, since the@tie{}@code{e} is not within the
515 octave range of@tie{}@code{b'}. The warning message is printed,
516 and the octave is adjusted so that the following notes are in the
517 correct octave once again.
527 The octave of a note following an @code{\octave} check is
528 determined with respect to the note preceding it, as modified by
529 the outcome of the octave check. In the next fragment, the first
530 note, an@tie{}@code{e'}, lies within the octave of@tie{}@code{b},
531 and the @code{\octave} check passes successfully. The second note
532 is then calculated relative to (absolute)@tie{}@code{e'}, which
533 yields an@tie{}@code{a'}, above middle@tie{}C. In this case, the
534 check had no influence on the output of the piece.
536 The second @code{\octave} check fails: @code{a'}@tie{}is not
537 within the range of@tie{}@code{b}. A warning is issued, and the
538 last note is calculated relative to@tie{}@code{a}, not
539 to@tie{}@code{a'}, and we get a@tie{}@code{d'}. Without the last
540 @code{\octave} check, the last note would have been
543 @lilypond[verbatim,quote,ragged-right,fragment]
555 Snippets: @lsrdir{Pitches}.
559 @unnumberedsubsubsec Transpose
562 @cindex transposition of pitches
565 A music expression can be transposed with @code{\transpose}. The
569 \transpose @var{from} @var{to} @var{musicexpr}
573 This means that @var{musicexpr} is transposed by the interval
574 between the pitches @var{from} and @var{to}: any note with pitch
575 @var{from} is changed to @var{to} and any other note is transposed
576 by the same interval.
578 Consider a piece written in the key of D-major. If this piece is
579 a little too low for its performer, it can be transposed up to
583 \transpose d e @dots{}
586 Consider a part written for violin (a C instrument). If this part is to
587 be played on the A clarinet (for which an A is notated as a C, and thus
588 sounds a minor third lower than notated), the appropriate part will be
592 \transpose a c' @dots{}
595 @code{\transpose} will also transpose key signatures:
597 @lilypond[verbatim,quote,ragged-right]
598 mus = { \key d \major cis d fis g }
607 @code{\transpose} distinguishes between enharmonic pitches: both
608 @code{\transpose c cis} or @code{\transpose c des} will transpose
609 up half a tone. The first version will print sharps and the notes
610 will remain on the same scale step, the second version will print
611 flats on the scale step above.
613 @lilypond[verbatim,quote,ragged-right]
614 mus = \relative c' { c d e f }
616 \transpose c cis { \mus }
617 \transpose c des { \mus }
621 @cindex transposing instruments
623 @code{\transpose} may also be used in a different way, to input
624 written notes for a transposing instrument. The previous examples
625 show how to enter pitches in C (or @notation{concert pitch}) and
626 typeset them for a transposing instrument, but the opposite is
627 also possible if you for example have a set of instrumental parts
628 and want to print a conductor's score. For example, when entering
629 music for a B-flat trumpet which begins on a notated E (concert
633 musicInBflat = @{ e4 @dots{} @}
634 \transpose c bes, \musicInBflat
638 To print this music in F (e.g., rearranging to a French horn) you
639 could wrap the existing music with another @code{\transpose}:
642 musicInBflat = @{ e4 @dots{} @}
643 \transpose f c' @{ \transpose c bes, \musicInBflat @}
647 For more information about transposing instruments,
648 see @ref{Instrument transpositions}.
652 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
653 {transposing-pitches-with-minimum-accidentals-smart-transpose.ly}
658 Notation Reference: @ref{Instrument transpositions}.
660 Snippets: @lsrdir{Pitches}.
662 Internals Reference: @internalsref{TransposedMusic}.
666 If you want to use both @code{\transpose} and @code{\relative},
667 you must put @code{\transpose} outside of @code{\relative}, since
668 @code{\relative} will have no effect on music that appears inside
669 a @code{\transpose}. See the previous example.
672 @node Displaying pitches
673 @subsection Displaying pitches
675 This section discusses how to alter the output of pitches.
681 * Instrument transpositions::
682 * Automatic accidentals::
687 @unnumberedsubsubsec Clef
701 @cindex mezzosoprano clef
702 @cindex baritone clef
703 @cindex varbaritone clef
706 The clef is set with the @code{\clef} @var{clefname} command:
708 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
719 The clef can also be changed inside the staff:
721 @lilypond[verbatim,quote,ragged-right,fragment]
739 These same clef symbols are used in different positions on the staff to
740 change the range of notes shown by that staff. The treble (respectively
741 alto, bass) clef is always positioned to show the line on which
742 a@tie{}@code{g'} (resp. @code{c'}, @code{f}) note is printed.
744 Supported clefs include
746 @multitable @columnfractions .4 .6
747 @headitem Clef @tab Position
748 @item @code{treble, violin, G, G2} @tab
749 G clef (g') on 2nd line
750 @item @code{alto, C} @tab
751 C clef (c') on 3rd line
752 @item @code{tenor} @tab
753 C clef (c') on 4th line
754 @item @code{bass, F} @tab
755 F clef (f) on 4th line
756 @item @code{french} @tab
757 G clef (g') on 1st line, so-called French violin clef
758 @item @code{soprano} @tab
759 C clef (c') on 1st line
760 @item @code{mezzosoprano} @tab
761 C clef (c') on 2nd line
762 @item @code{baritone} @tab
763 C clef (c') on 5th line
764 @item @code{varbaritone} @tab
765 F clef (f) on 3rd line
766 @item @code{subbass} @tab
767 F clef (f) on 5th line
768 @item @code{percussion} @tab
770 @item @code{tab} @tab
774 Further supported clefs are described under @ref{Ancient clefs}.
776 By adding @code{_8} or @code{^8} to the clef name, the clef is
777 transposed one octave down or up, respectively, and @code{_15} and
778 @code{^15} transposes by two octaves. The argument @var{clefname}
779 must be enclosed in quotes when it contains underscores or digits.
782 @cindex choral tenor clef
784 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
791 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
792 {clefs-commonly-tweaked-properties.ly}
797 Notation Reference: @ref{Ancient clefs}.
799 Snippets: @lsrdir{Pitches}.
801 Internals Reference: @internalsref{Clef}.
805 @unnumberedsubsubsec Key signature
807 @cindex key signature
810 @warning{New users are sometimes confused about accidentals and
811 key signatures. In LilyPond, note names are the raw input; key
812 signatures and clefs determine how this raw input is displayed.
813 An unaltered note like@tie{}@code{c} means @q{C natural},
814 regardless of the key signature or clef. For more information,
815 see @rlearning{Accidentals and key signatures}.}
817 The key signature indicates the tonality in which a piece is
818 played. It is denoted by a set of alterations (flats or sharps)
819 at the start of the staff.
821 Setting or changing the key signature is done with the @code{\key}
825 \key @var{pitch} @var{mode}
834 @funindex \mixolydian
840 Here, @var{mode} should be @code{\major} or @code{\minor} to get
841 @var{pitch}-major or @var{pitch}-minor, respectively. You may
842 also use the standard mode names, also called @q{church modes}:
843 @code{\ionian}, @code{\locrian}, @code{\aeolian},
844 @code{\mixolydian}, @code{\lydian}, @code{\phrygian}, and
847 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
856 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
857 {preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly}
859 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
860 {non-traditional-key-signatures.ly}
865 Music Glossary: @rglos{church mode}, @rglos{scordatura}.
867 Learning Manual: @rlearning{Accidentals and key signatures}.
869 Snippets: @lsrdir{Pitches}.
871 Internals Reference: @internalsref{KeyCancellation},
872 @internalsref{KeySignature}, @internalsref{Key_engraver}.
875 @node Ottava brackets
876 @unnumberedsubsubsec Ottava brackets
884 @notation{Ottava brackets} introduce an extra transposition of an
885 octave for the staff:
887 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
895 The @code{set-octavation} function also takes -1 (for 8va bassa),
896 2@tie{}(for 15ma), and -2 (for 15ma bassa) as arguments.
897 Internally the function sets the properties @code{ottavation}
898 (e.g., to @code{"8va"} or @code{"8vb"}) and
899 @code{middleCPosition}. To override the text of the bracket, set
900 @code{ottavation} after invoking @code{set-octavation}, i.e.,
902 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
904 \set Staff.ottavation = #"8"
911 Music Glossary: @rglos{ottava}.
913 Snippets: @lsrdir{Pitches}.
915 Internals Reference: @internalsref{OttavaBracket}.
920 @c FIXME: This should have been fixed by Joe.
921 @c If it hasn't, we should mention the appropriate
922 @c workaround (there is a snippet in the LSR) -vv
923 @code{set-octavation} will get confused when clef changes happen
924 during an octavation bracket.
927 @node Instrument transpositions
928 @unnumberedsubsubsec Instrument transpositions
930 @cindex transposition, MIDI
931 @cindex transposition, instrument
933 When typesetting scores that involve transposing instruments, some
934 parts can be typeset in a different pitch than the
935 @notation{concert pitch}.
937 The key of a @notation{transposing instrument} can be specified.
938 This applies to many wind instruments, for example, clarinets
939 (B-flat, A, and E-flat), horn (F) and trumpet (B-flat, C, D, and
942 For such instruments, LilyPond will print a correct part, but is
943 not aware whether the instrument is playing in concert pitch or
944 not. This can lead to problems if you want a MIDI output, or if
945 you quote other parts in a transposing staff. In such cases, an
946 explicit transposition must be specified:
949 \transposition @var{pitch}
953 where @var{pitch} specifies the key in which the instrument plays.
954 For example, a part for B-flat clarinet would include:
960 This command sets the property @code{instrumentTransposition}.
961 The value of this property is used for MIDI output and quotations.
962 MIDI output is transposed to play at concert pitch, and cue notes
963 and quotations are automatically transposed to the key of the
964 instrument in which they are quoted. For more information about
965 quotations, see @ref{Quoting other voices}.
967 The pitch to use for @code{\transposition} should correspond to
968 the real sound heard when a@tie{}@code{c'} written on the staff is
969 played by the transposing instrument. @code{\transposition}
970 should be used when the music is entered from an orchestral part
971 written for the instrument. For example, in classical horn parts,
972 the tuning of the instrument is often changed during a piece.
973 Here are a few notes for a violin and a B-flat clarinet where the
974 parts have been entered using the notes and key as they appear in
975 each part or the conductor's score:
977 @lilypond[verbatim,quote,ragged-right]
979 \new Staff = "Violin I" {
980 \set Staff.instrumentName = "Vln"
981 \set Staff.midiInstrument="violin"
984 g'4( c''8) r c'' r c''4
986 \new Staff = "Clarinet" {
987 \set Staff.instrumentName = "Cl"
988 \set Staff.midiInstrument="clarinet"
991 a'4( d''8) r d'' r d''4
996 Without the @code{\transposition} command the MIDI output of this
997 music would play the notes a tone apart; with it the notes are
998 played correctly in unison.
1000 However, when entering the notes of a score in concert pitch, when
1001 all voices are entered in C, they may be prefaced by (the default)
1002 @code{\transposition c'}:
1016 to serve as a reminder that these parts are written in C.
1021 Music Glossary: @c TODO @rglos{concert pitch}
1023 Notation Reference: @ref{Quoting other voices}, @ref{Transpose}.
1025 Snippets: @lsrdir{Pitches}.
1028 @node Automatic accidentals
1029 @unnumberedsubsubsec Automatic accidentals
1030 @cindex automatic accidentals
1032 @funindex set-accidental-style
1034 There are many different conventions on how to typeset
1035 accidentals. LilyPond provides a function to specify which such
1036 accidental style to use. This function is called as follows
1040 #(set-accidental-style 'voice)
1045 The accidental style applies to the current @code{Staff} by
1046 default (with the exception of the styles @code{piano} and
1047 @code{piano-cautionary}, which are explained below). Optionally,
1048 the function can take a second argument which determines in which
1049 scope the style should be changed. For example, to use the same
1050 style in all staves of the current @code{StaffGroup}, use
1053 #(set-accidental-style 'voice 'StaffGroup)
1056 The following accidental styles are supported. To demonstrate
1057 each style, we use the following example:
1059 @lilypond[verbatim,quote,ragged-right]
1063 cis'8 fis, d'4 <a cis>8 f bis4 |
1077 \voiceTwo \relative c' {
1081 \change Staff = down
1085 \change Staff = down
1086 <fis, a cis>4 gis <f a d>2 |
1093 \context Staff = "up" {
1094 %%% change the next line as desired:
1095 #(set-accidental-style 'default)
1098 \context Staff = "down" {
1099 %%% change the next line as desired:
1100 #(set-accidental-style 'default)
1107 Note that the last lines of this example can be replaced by the
1108 following, as long as the same accidental style should be used in
1113 \context Staff = "up" @{
1114 %%% change the next line as desired:
1115 #(set-accidental-style 'default 'Score)
1118 \context Staff = "down" @{
1126 @c don't use verbatim in this table.
1129 This is the default typesetting behavior. It corresponds to
1130 eighteenth-century common practice: accidentals are remembered to
1131 the end of the measure in which they occur and only on their own
1132 octave. Thus, in the example below, no natural signs are printed
1133 before the@tie{}@code{b} in the second measure or the
1136 @lilypond[quote,ragged-right]
1140 cis'8 fis, d'4 <a cis>8 f bis4 |
1154 \voiceTwo \relative c' {
1158 \change Staff = down
1162 \change Staff = down
1163 <fis, a cis>4 gis <f a d>2 |
1170 \context Staff = "up" {
1171 #(set-accidental-style 'default)
1174 \context Staff = "down" {
1175 #(set-accidental-style 'default)
1183 The normal behavior is to remember the accidentals on Staff-level.
1184 In this style, however, accidentals are typeset individually for
1185 each voice. Apart from that, the rule is similar to
1188 As a result, accidentals from one voice do not get canceled in
1189 other voices, which is often an unwanted result: in the following
1190 example, it is hard to determine whether the second@tie{}@code{a}
1191 should be played natural or sharp. The @code{voice} option should
1192 therefore be used only if the voices are to be read solely by
1193 individual musicians. If the staff is to be used by one musician
1194 (e.g., a conductor or in a piano score) then @code{modern} or
1195 @code{modern-cautionary} should be used instead.
1198 @lilypond[quote,ragged-right]
1202 cis'8 fis, d'4 <a cis>8 f bis4 |
1216 \voiceTwo \relative c' {
1220 \change Staff = down
1224 \change Staff = down
1225 <fis, a cis>4 gis <f a d>2 |
1232 \context Staff = "up" {
1233 #(set-accidental-style 'voice)
1236 \context Staff = "down" {
1237 #(set-accidental-style 'voice)
1245 @funindex modern style accidentals
1247 This rule corresponds to the common practice in the twentieth
1248 century. It prints the same accidentals as @code{default}, with
1249 two exceptions which serve to avoid ambiguity: after temporary
1250 accidentals, cancellation marks are printed also in the following
1251 measure (for notes in the same octave) and, in the same measure,
1252 for notes in other octaves. Hence the naturals before
1253 the@tie{}@code{b} and the@tie{}@code{c} in the second measure of
1256 @lilypond[quote,ragged-right]
1260 cis'8 fis, d'4 <a cis>8 f bis4 |
1274 \voiceTwo \relative c' {
1278 \change Staff = down
1282 \change Staff = down
1283 <fis, a cis>4 gis <f a d>2 |
1290 \context Staff = "up" {
1291 #(set-accidental-style 'modern)
1294 \context Staff = "down" {
1295 #(set-accidental-style 'modern)
1302 @item modern-cautionary
1303 @funindex modern-cautionary
1305 This rule is similar to @code{modern}, but the @q{extra}
1306 accidentals (the ones not typeset by @code{default}) are typeset
1307 as cautionary accidentals. They are by default printed with
1308 parentheses, but they can also be printed in reduced size by
1309 defining the @code{cautionary-style} property of
1310 @code{AccidentalSuggestion}.
1313 @lilypond[quote,ragged-right]
1317 cis'8 fis, d'4 <a cis>8 f bis4 |
1331 \voiceTwo \relative c' {
1335 \change Staff = down
1339 \change Staff = down
1340 <fis, a cis>4 gis <f a d>2 |
1347 \context Staff = "up" {
1348 #(set-accidental-style 'modern-cautionary)
1351 \context Staff = "down" {
1352 #(set-accidental-style 'modern-cautionary)
1360 @funindex modern-voice
1362 This rule is used for multivoice accidentals to be read both by
1363 musicians playing one voice and musicians playing all voices.
1364 Accidentals are typeset for each voice, but they @emph{are}
1365 canceled across voices in the same @code{Staff}. Hence,
1366 the@tie{}@code{a} in the last measure is canceled because the
1367 previous cancellation was in a different voice, and
1368 the@tie{}@code{d} in the lower staff is canceled because of the
1369 accidental in a different voice in the previous measure:
1372 @lilypond[quote,ragged-right]
1376 cis'8 fis, d'4 <a cis>8 f bis4 |
1390 \voiceTwo \relative c' {
1394 \change Staff = down
1398 \change Staff = down
1399 <fis, a cis>4 gis <f a d>2 |
1406 \context Staff = "up" {
1407 #(set-accidental-style 'modern-voice)
1410 \context Staff = "down" {
1411 #(set-accidental-style 'modern-voice)
1418 @funindex modern-voice-cautionary
1419 @item modern-voice-cautionary
1421 This rule is the same as @code{modern-voice}, but with the extra
1422 accidentals (the ones not typeset by @code{voice}) typeset
1423 as cautionaries. Even though all accidentals typeset by
1424 @code{default} @emph{are} typeset with this rule,
1425 some of them are typeset as cautionaries.
1427 @lilypond[quote,ragged-right]
1431 cis'8 fis, d'4 <a cis>8 f bis4 |
1445 \voiceTwo \relative c' {
1449 \change Staff = down
1453 \change Staff = down
1454 <fis, a cis>4 gis <f a d>2 |
1461 \context Staff = "up" {
1462 #(set-accidental-style 'modern-voice-cautionary)
1465 \context Staff = "down" {
1466 #(set-accidental-style 'modern-voice-cautionary)
1474 @funindex piano accidentals
1476 This rule reflects twentieth-century practice for piano notation.
1477 Its behavior is very similar to @code{modern} style, but here
1478 accidentals also get canceled across the staves in the same
1479 GrandStaff or PianoStaff, hence all the cancellations of the final
1482 This accidental style applies to the current @code{GrandStaff} or
1483 @code{PianoStaff} by default.
1485 @lilypond[quote,ragged-right]
1489 cis'8 fis, d'4 <a cis>8 f bis4 |
1503 \voiceTwo \relative c' {
1507 \change Staff = down
1511 \change Staff = down
1512 <fis, a cis>4 gis <f a d>2 |
1519 \context Staff = "up" {
1520 #(set-accidental-style 'piano)
1523 \context Staff = "down" {
1530 @item piano-cautionary
1531 @funindex #(set-accidental-style 'piano-cautionary)
1533 Same as @code{#(set-accidental-style 'piano)} but with the extra
1534 accidentals typeset as cautionaries.
1536 @lilypond[quote,ragged-right]
1540 cis'8 fis, d'4 <a cis>8 f bis4 |
1554 \voiceTwo \relative c' {
1558 \change Staff = down
1562 \change Staff = down
1563 <fis, a cis>4 gis <f a d>2 |
1570 \context Staff = "up" {
1571 #(set-accidental-style 'piano-cautionary)
1574 \context Staff = "down" {
1582 @funindex no-reset accidental style
1584 This is the same as @code{default} but with accidentals lasting
1585 @q{forever} and not only within the same measure:
1587 @lilypond[quote,ragged-right]
1591 cis'8 fis, d'4 <a cis>8 f bis4 |
1605 \voiceTwo \relative c' {
1609 \change Staff = down
1613 \change Staff = down
1614 <fis, a cis>4 gis <f a d>2 |
1621 \context Staff = "up" {
1622 #(set-accidental-style 'no-reset)
1625 \context Staff = "down" {
1626 #(set-accidental-style 'no-reset)
1634 @funindex forget accidental style
1636 This is the opposite of @code{no-reset}: Accidentals are not
1637 remembered at all -- and hence all accidentals are typeset
1638 relative to the key signature, regardless of what was before in
1641 @lilypond[quote,ragged-right]
1645 cis'8 fis, d'4 <a cis>8 f bis4 |
1659 \voiceTwo \relative c' {
1663 \change Staff = down
1667 \change Staff = down
1668 <fis, a cis>4 gis <f a d>2 |
1675 \context Staff = "up" {
1676 #(set-accidental-style 'forget)
1679 \context Staff = "down" {
1680 #(set-accidental-style 'forget)
1690 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1691 {dodecaphonic-style-accidentals-for-each-note-including-naturals.ly}
1696 Snippets: @lsrdir{Pitches}.
1698 Internals Reference: @internalsref{Accidental_engraver},
1699 @internalsref{Accidental}, @internalsref{AccidentalSuggestion},
1700 @internalsref{AccidentalPlacement}, @internalsref{GrandStaff} and
1701 @internalsref{PianoStaff}, @internalsref{Staff}.
1706 Simultaneous notes are considered to be entered in sequential
1707 mode. This means that in a chord the accidentals are typeset as
1708 if the notes in the chord happen one at a time, in the order in
1709 which they appear in the input file. This is a problem when
1710 accidentals in a chord depend on each other, which does not happen
1711 for the default accidental style. The problem can be solved by
1712 manually inserting@tie{}@code{!} and@tie{}@code{?} for the
1717 @unnumberedsubsubsec Ambitus
1720 The term @notation{ambitus} or @notation{ambit} denotes a range of
1721 pitches for a given voice in a part of music. It may also denote
1722 the pitch range that a musical instrument is capable of playing.
1723 Ambits are printed on vocal parts, so performers can easily
1724 determine if it matches their capabilities.
1726 Ambits are denoted at the beginning of a piece near the initial
1727 clef. The range is graphically specified by two note heads that
1728 represent the minimum and maximum pitch. Accidentals are only
1729 printed if they are not part of the key signature.
1731 @lilypond[verbatim,quote,ragged-right]
1735 \consists Ambitus_engraver
1747 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1748 {adding-ambiti-per-voice.ly}
1750 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1751 {ambiti-multiple-voices.ly}
1756 Snippets: @lsrdir{Pitches}.
1758 Internals Reference: @internalsref{Ambitus},
1759 @internalsref{AmbitusLine}, @internalsref{AmbitusNoteHead},
1760 @internalsref{AmbitusAccidental}, @internalsref{Ambitus_engraver},
1761 @internalsref{Staff}, @internalsref{Voice}.
1766 There is no collision handling in the case of multiple per-voice
1771 @subsection Note heads
1774 * Special note heads::
1775 * Easy notation note heads::
1776 * Shape note heads::
1780 @node Special note heads
1781 @unnumberedsubsubsec Special note heads
1783 @cindex note heads, special
1785 Different note heads are used by various instruments for various
1786 meanings -- crosses are used for @q{parlato} with vocalists,
1787 stopped notes on guitar; diamonds are used for harmonics on string
1788 instruments, etc. There is a shorthand (@code{\harmonic}) for
1789 diamond shapes; the other note head styles are produced by tweaking
1792 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
1794 \override NoteHead #'style = #'cross
1796 \revert NoteHead #'style
1797 e d <c f\harmonic> <d a'\harmonic>
1801 To see all note head styles, please see @ref{Note head styles}.
1806 Snippets: @lsrdir{Pitches}.
1808 Notation Reference: @ref{Note head styles}.
1810 Internals Reference: @internalsref{NoteHead}.
1813 @node Easy notation note heads
1814 @unnumberedsubsubsec Easy notation note heads
1816 @cindex note heads, practice
1817 @cindex note heads, easy notation
1818 @cindex easy notation
1821 The @q{easy play} note head includes a note name inside the head.
1822 It is used in music for beginners
1824 @lilypond[verbatim,quote,ragged-right,fragment,staffsize=26]
1830 The command @code{\setEasyHeads} overrides settings for the
1831 @code{NoteHead} object. To make the letters readable, it
1832 has to be printed in a large font size. To print with a larger
1833 font, see @ref{Setting the staff size}.
1837 @funindex \setEasyHeads
1838 @code{\setEasyHeads}
1842 Notation Reference: @ref{Setting the staff size}.
1844 Snippets: @lsrdir{Pitches},
1846 Internals Reference: @internalsref{NoteHead}.
1849 @node Shape note heads
1850 @unnumberedsubsubsec Shape note heads
1852 @cindex note heads, shape
1854 In shape note head notation, the shape of the note head
1855 corresponds to the harmonic function of a note in the scale. This
1856 notation was popular in nineteenth-century American song books.
1858 Shape note heads can be produced by setting @code{\aikenHeads} or
1859 @code{\sacredHarpHeads}, depending on the style desired.
1861 @lilypond[verbatim,fragment,relative=1]
1868 Shapes are typeset according to the step in the scale, where
1869 the base of the scale is determined by the @code{\key} command.
1872 @funindex shapeNoteStyles
1873 @funindex \aikenHeads
1874 @funindex \sacredHarpHeads
1876 Shape note heads are implemented through the
1877 @code{shapeNoteStyles} property. Its value is a vector of
1878 symbols. The k-th element indicates the style to use for the k-th
1879 step of the scale. Arbitrary combinations are possible, e.g.:
1881 @lilypond[verbatim,fragment,relative=1]
1882 \set shapeNoteStyles =
1883 ##(cross triangle fa #f mensural xcircle diamond)
1889 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
1890 {applying-noteheads-styles-depending-on-the-step-of-the-scale.ly}
1895 Snippets: @lsrdir{Pitches}.
1899 @unnumberedsubsubsec Improvisation
1901 @cindex improvisation
1902 @cindex slashed note heads
1903 @cindex note heads, improvisation
1904 @cindex note heads, slashed
1906 Improvisation is sometimes denoted with slashed note heads. Such
1907 note heads can be created by adding a @code{Pitch_squash_engraver}
1908 to the @code{Voice} context. Then, the following command
1911 \set squashedPosition = #0
1912 \override NoteHead #'style = #'slash
1916 switches on the slashes.
1918 There are shortcuts @code{\improvisationOn} (and an accompanying
1919 @code{\improvisationOff}) for this command sequence. They are
1920 used in the following example:
1922 @lilypond[verbatim,quote,ragged-right]
1924 \consists Pitch_squash_engraver
1926 e8 e g a a16(bes)(a8) g
1938 Snippets: @lsrdir{Pitches}.
1940 Internals Reference: @internalsref{Pitch_squash_engraver},
1941 @internalsref{Voice}.