1 @c -*- coding: utf-8; mode: texinfo; -*-
7 This section discusses how to specify the pitch of notes.
11 * Changing multiple pitches::
12 * Displaying pitches::
17 @subsection Writing pitches
24 * Cautionary accidentals::
26 * Note names in other languages::
31 @unnumberedsubsubsec Normal pitches
36 A pitch name is specified using lowercase letters @code{a} through @code{g}.
37 An ascending C-major scale is engraved with
39 @lilypond[quote,fragment,verbatim,ragged-right]
44 The note name @code{c} is engraved one octave below middle C.
46 @lilypond[quote,fragment,verbatim,ragged-right]
56 The optional octave specification takes the form of a series of
57 single quote (@samp{'}) characters or a series of comma
58 (@samp{,}) characters. Each @samp{'} raises the pitch by one
59 octave; each @samp{,} lowers the pitch by an octave.
61 @lilypond[quote,ragged-right,fragment,verbatim]
63 c' c'' e' g d'' d' d c
65 c, c,, e, g d,, d, d c
68 An alternate method may be used to declare which octave to
69 engrave a pitch; this method does not require as many
70 octave specifications (@code{'} and @code{,}). See
71 @ref{Relative octaves}.
75 @unnumberedsubsubsec Accidentals
77 @cindex note names, Dutch
78 @cindex note names, default
80 A sharp is formed by adding @code{-is} to the end of a pitch name and
81 a flat is formed by adding @code{-es}. Double sharps and double flats
82 are obtained by adding @code{-isis} or @code{-eses} to a note name.
84 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
90 These are the Dutch note names. In Dutch, @code{aes} is contracted to
91 @code{as}, but both forms are accepted. Similarly, both
92 @code{es} and @code{ees} are accepted
94 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
98 A natural will cancel the effect of an accidental or key signature.
99 However, naturals are not encoded into the note name syntax with a
100 suffix; a natural pitch is shown as a simple note name
102 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
106 The input @code{d e f} is interpreted as @q{print a D-natural,
107 E-natural, and an F-natural,} regardless of the key
108 signature. For more information about the distinction between
109 musical content and the presentation of that content, see
110 @rlearning{Accidentals and key signatures}.
112 @lilypond[fragment,quote,ragged-right,verbatim,relative]
121 In accordance with standard typesetting rules, a natural sign is printed
122 before a sharp or flat if a previous accidental needs to be
123 cancelled. To change this behavior, use
124 @code{\set Staff.extraNatural = ##f}
126 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
128 \set Staff.extraNatural = ##f
135 Program reference: @internalsref{LedgerLineSpanner},
136 @internalsref{NoteHead}.
139 @node Cautionary accidentals
140 @unnumberedsubsubsec Cautionary accidentals
142 @cindex accidental, reminder
143 @cindex accidental, cautionary
144 @cindex accidental, parenthesized
145 @cindex reminder accidental
147 @cindex cautionary accidental
148 @cindex parenthesized accidental
151 Normally accidentals are printed automatically, but you may also
152 print them manually. A reminder accidental
153 can be forced by adding an exclamation mark @code{!}
154 after the pitch. A cautionary accidental
155 (i.e., an accidental within parentheses) can be obtained by adding the
156 question mark @samp{?} after the pitch. These extra accidentals
157 can be used to produce natural signs, too.
159 @lilypond[quote,ragged-right,fragment,verbatim,relative=1]
160 cis cis cis! cis? c c? c! c
166 The automatic production of accidentals can be tuned in many
167 ways. For more information, see @ref{Automatic accidentals}.
171 @unnumberedsubsubsec Micro tones
173 @cindex quarter tones
174 @cindex semi-flats, semi-sharps
176 Half-flats and half-sharps are formed by adding @code{-eh} and
177 @code{-ih}; the following is a series of Cs with increasing pitches
179 @lilypond[verbatim,ragged-right,quote,relative=2,fragment]
180 \set Staff.extraNatural = ##f
184 Micro tones are also exported to the MIDI file.
189 There are no generally accepted standards for denoting
190 three-quarter flats, so LilyPond's symbol does not conform to any
194 @node Note names in other languages
195 @unnumberedsubsubsec Note names in other languages
197 There are predefined sets of note names for various other languages.
198 To use them, include the language specific init file. For
199 example, add @code{\include "english.ly"} to the top of the input
200 file. The available language files
201 and the note names they define are
203 @c Should this be made into a multitable?
204 @cindex note names, other languages
206 Note Names sharp flat double double
209 nederlands.ly c d e f g a bes b -is -es -isis -eses
210 english.ly c d e f g a bf b -s/-sharp -f/-flat -ss/-x/ -ff/
211 -sharpsharp -flatflat
212 deutsch.ly c d e f g a b h -is -es -isis -eses
213 norsk.ly c d e f g a b h -iss/-is -ess/-es -ississ/-isis -essess/-eses
214 svenska.ly c d e f g a b h -iss -ess -ississ -essess
215 italiano.ly do re mi fa sol la sib si -d -b -dd -bb
216 catalan.ly do re mi fa sol la sib si -d/-s -b -dd/-ss -bb
217 espanol.ly do re mi fa sol la sib si -s -b -ss -bb
221 Note that in Dutch, German, Norwegian, and Swedish, the flat
222 alterations of @samp{a} like for example @code{aes} and @code{aeses}
223 are usually contracted to @code{as} and @code{ases} (or more commonly
224 @code{asas}). Sometimes only these contracted names are defined in the
225 corresponding language files (this also applies to the suffixes for
229 Some music uses microtones whose alterations are fractions of a
230 @q{regular} sharp or flat. The note names for quartertones defined in
231 the various language files are listed in the following table. Here the
232 prefixes @q{semi-} and @q{sesqui-} mean @q{half} and @q{one and a
233 half}, respectively. For Norwegian, Swedish, Catalan and Spanish no
234 special names have been defined yet.
235 @c What about Turkish Maquam music and similar microtonal systems?
237 @c Note that the term "three-quarter-sharp/-flat" used in lilypond's source code
238 @c is actually misleading since the alteration is in fact one and a half
239 @c of a regular sharp/flat. Whence the naming "sesqui-sharp/-flat" used below.
242 Note Names semi- semi- sesqui- sesqui-
243 sharp flat sharp flat
245 nederlands.ly c d e f g a bes b -ih -eh -isih -eseh
246 english.ly c d e f g a bf b -qs -qf -tqs -tqf
247 deutsch.ly c d e f g a b h -ih -eh -isih -eseh
248 norsk.ly c d e f g a b h
249 svenska.ly c d e f g a b h
250 italiano.ly do re mi fa sol la sib si -sd -sb -dsd -bsb
251 catalan.ly do re mi fa sol la sib si
252 espanol.ly do re mi fa sol la sib si
256 @node Changing multiple pitches
257 @subsection Changing multiple pitches
265 @node Relative octaves
266 @unnumberedsubsubsec Relative octaves
269 @cindex Relative octave specification
272 Octaves are specified by adding @code{'} and @code{,} to pitch names.
273 When you copy existing music, it is easy to accidentally put a pitch
274 in the wrong octave and hard to find such an error. The relative
275 octave mode prevents these errors by making the mistakes much
276 larger: a single error puts the rest of the piece off by one octave
279 \relative @var{startpitch} @var{musicexpr}
286 \relative @var{musicexpr}
290 @code{c'} is used as the default if no starting pitch is defined.
292 The octave of notes that appear in @var{musicexpr} are calculated as
293 follows: if no octave changing marks are used, the basic interval
294 between this and the last note is always taken to be a fourth or
295 less. This distance is determined without regarding alterations; a
296 @code{fisis} following a @code{ceses} will be put above the
297 @code{ceses}. In other words, a doubly-augmented fourth is considered
298 a smaller interval than a diminished fifth, even though the
299 doubly-augmented fourth spans seven semitones while the diminished
300 fifth only spans six semitones.
302 The octave changing marks @code{'} and @code{,} can be added to raise
303 or lower the pitch by an extra octave. Upon entering relative mode,
304 an absolute starting pitch can be specified that will act as the
305 predecessor of the first note of @var{musicexpr}. If no starting pitch
306 is specified, then middle C is used as a start.
308 Here is the relative mode shown in action
309 @lilypond[quote,fragment,ragged-right,verbatim]
315 Octave changing marks are used for intervals greater than a fourth
317 @lilypond[quote,ragged-right,fragment,verbatim]
323 If the preceding item is a chord, the first note of the chord is used
324 to determine the first note of the next chord
326 @lilypond[quote,ragged-right,fragment,verbatim]
334 The pitch after @code{\relative} contains a note name.
336 The relative conversion will not affect @code{\transpose},
337 @code{\chordmode} or @code{\relative} sections in its argument. To use
338 relative within transposed music, an additional @code{\relative} must
339 be placed inside @code{\transpose}.
343 @unnumberedsubsubsec Octave check
347 Octave checks make octave errors easier to correct: a note may be
348 followed by @code{=}@var{quotes} which indicates what its absolute
349 octave should be. In the following example,
352 \relative c'' @{ c='' b=' d,='' @}
356 the @code{d} will generate a warning, because a @code{d''} is expected
357 (because @code{b'} to @code{d''} is only a third), but a @code{d'} is
358 found. In the output, the octave is corrected to be a @code{d''} and
359 the next note is calculated relative to @code{d''} instead of @code{d'}.
361 There is also an octave check that produces no visible output. The syntax
367 This checks that @var{pitch} (without quotes) yields @var{pitch} (with
368 quotes) in @code{\relative} mode compared to the note given in the
369 @code{\relative} command. If not, a warning is printed, and the
370 octave is corrected. The @var{pitch} is not printed as a note.
372 In the example below, the first check passes without incident, since
373 the @code{e} (in @code{relative} mode) is within a fifth of
375 the second check produces a warning, since the @code{e} is not within
376 a fifth of @code{b'}. The warning message is printed, and the octave
377 is adjusted so that the following notes are in the correct octave
389 The octave of a note following an octave check is determined with
390 respect to the note preceding it. In the next fragment, the last note
391 is an @code{a'}, above middle C. That means that the @code{\octave}
392 check passes successfully, so the check could be deleted without changing
393 the output of the piece.
395 @lilypond[quote,ragged-right,verbatim,fragment]
405 @unnumberedsubsubsec Transpose
408 @cindex Transposition of pitches
411 A music expression can be transposed with @code{\transpose}. The
414 \transpose @var{from} @var{to} @var{musicexpr}
417 This means that @var{musicexpr} is transposed by the interval between
418 the pitches @var{from} and @var{to}: any note with pitch @code{from}
419 is changed to @code{to}.
421 For example, consider a piece written in the key of D-major. If
422 this piece is a little too low for its performer, it can be
423 transposed up to E-major with
425 \transpose d e @dots{}
428 Consider a part written for violin (a C instrument). If
429 this part is to be played on the A clarinet (for which an
430 A is notated as a C, and which sounds a minor third lower
431 than notated), the following
432 transposition will produce the appropriate part
435 \transpose a c @dots{}
438 @code{\transpose} distinguishes between enharmonic pitches: both
439 @code{\transpose c cis} or @code{\transpose c des} will transpose up
440 half a tone. The first version will print sharps and the second
441 version will print flats
443 @lilypond[quote,ragged-right,verbatim]
444 mus = { \key d \major cis d fis g }
453 @code{\transpose} may also be used to input written notes for a
454 transposing instrument. Pitches are normally entered into LilyPond
455 in C (or @q{concert pitch}), but they may be entered in another
456 key. For example, when entering music for a B-flat trumpet which
457 begins on concert D, one would write
460 \transpose c bes @{ e4 @dots{} @}
463 To print this music in B-flat again (i.e., producing a trumpet part,
464 instead of a concert pitch conductor's score) you would wrap the
465 existing music with another @code{transpose}
468 \transpose bes c @{ \transpose c bes @{ e4 @dots{} @} @}
474 Program reference: @internalsref{TransposedMusic}.
476 Example: @lsr{scheme,transpose-pitches-with-minimum-accidentals.ly}.
481 If you want to use both @code{\transpose} and @code{\relative},
482 you must put @code{\transpose} outside of @code{\relative}, since
483 @code{\relative} will have no effect on music that appears inside a
487 @node Displaying pitches
488 @subsection Displaying pitches
494 * Instrument transpositions::
498 @unnumberedsubsubsec Clef
502 The clef indicates which lines of the staff correspond to which
503 pitches. The clef is set with the @code{\clef} command
505 @lilypond[quote,ragged-right,fragment,verbatim]
506 { c''2 \clef alto g'2 }
516 @cindex mezzosoprano clef
517 @cindex baritone clef
518 @cindex varbaritone clef
521 Supported clefs include
523 @multitable @columnfractions .33 .66
524 @headitem Clef @tab Position
525 @item @code{treble}, violin, G, G2 @tab
527 @item @code{alto, C} @tab
529 @item @code{tenor} @tab
531 @item @code{bass, F} @tab
533 @item @code{french} @tab
534 G clef on 1st line, so-called French violin clef
535 @item @code{soprano} @tab
537 @item @code{mezzosoprano} @tab
539 @item @code{baritone} @tab
541 @item @code{varbaritone} @tab
543 @item @code{subbass} @tab
545 @item @code{percussion} @tab
547 @item @code{tab} @tab
551 By adding @code{_8} or @code{^8} to the clef name, the clef is
552 transposed one octave down or up, respectively, and @code{_15} and
553 @code{^15} transposes by two octaves. The argument @var{clefname}
554 must be enclosed in quotes when it contains underscores or digits. For
557 @cindex choral tenor clef
558 @lilypond[quote,ragged-right,verbatim,fragment,relative=1]
565 The command @code{\clef "treble_8"} is equivalent to setting
567 @code{clefPosition} (which controls the Y position of the clef),
568 @code{middleCPosition} and @code{clefOctavation}. A clef is printed
569 when any of these properties are changed. The following example shows
570 possibilities when setting properties manually.
572 @lilypond[quote,ragged-right,verbatim]
574 \set Staff.clefGlyph = #"clefs.F"
575 \set Staff.clefPosition = #2
577 \set Staff.clefGlyph = #"clefs.G"
579 \set Staff.clefGlyph = #"clefs.C"
581 \set Staff.clefOctavation = #7
583 \set Staff.clefOctavation = #0
584 \set Staff.clefPosition = #0
588 \set Staff.middleCPosition = #4
596 Manual: @ref{Grace notes}.
598 Program reference: @internalsref{Clef}.
602 @unnumberedsubsubsec Key signature
604 @cindex Key signature
607 The key signature indicates the tonality in which a piece is played. It
608 is denoted by a set of alterations (flats or sharps) at the start of the
611 Setting or changing the key signature is done with the @code{\key}
615 @code{\key} @var{pitch} @var{type}
624 @funindex \mixolydian
630 Here, @var{type} should be @code{\major} or @code{\minor} to get
631 @var{pitch}-major or @var{pitch}-minor, respectively. You may also
632 use the standard mode names (also called @q{church modes}): @code{\ionian},
633 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
634 @code{\phrygian}, and @code{\dorian}.
636 This command sets the context property
637 @code{Staff.keySignature}. Non-standard key signatures
638 can be specified by setting this property directly.
640 Accidentals and key signatures often confuse new users, because
641 unaltered notes get natural signs depending on the key signature. For
642 more information, see @ref{Accidentals}, or @rlearning{Accidentals
645 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
654 A natural sign is printed to cancel any previous accidentals. This
655 can be suppressed by setting the @code{Staff.printKeyCancellation}
658 @lilypond[quote,fragment,ragged-right,fragment,verbatim,relative=2]
663 \set Staff.printKeyCancellation = ##f
673 Program reference: @internalsref{KeyCancellation},
674 @internalsref{KeySignature}.
677 @node Ottava brackets
678 @unnumberedsubsubsec Ottava brackets
680 @q{Ottava} brackets introduce an extra transposition of an octave for
681 the staff. They are created by invoking the function
682 @code{set-octavation}
688 @lilypond[quote,ragged-right,verbatim,fragment]
698 The @code{set-octavation} function also takes -1 (for 8va bassa), 2@tie{}(for 15ma),
699 and -2 (for 15ma bassa) as arguments. Internally the function sets the properties
700 @code{ottavation} (e.g., to @code{"8va"} or @code{"8vb"}) and
701 @code{centralCPosition}. For overriding the text of the bracket, set
702 @code{ottavation} after invoking @code{set-octavation}, i.e.,
704 @lilypond[quote,ragged-right,verbatim]
707 \set Staff.ottavation = #"8"
715 Program reference: @internalsref{OttavaBracket}.
720 @code{set-octavation} will get confused when clef changes happen
721 during an octavation bracket.
724 @node Instrument transpositions
725 @unnumberedsubsubsec Instrument transpositions
727 @cindex transposition, MIDI
728 @cindex transposition, instrument
730 The key of a transposing instrument can also be specified. This
731 applies to many wind instruments, for example, clarinets (B-flat, A, and
732 E-flat), horn (F) and trumpet (B-flat, C, D, and E-flat).
734 The transposition is entered after the keyword @code{\transposition}
737 \transposition bes %% B-flat clarinet
741 This command sets the property @code{instrumentTransposition}. The value of
742 this property is used for MIDI output and quotations. It does not
743 affect how notes are printed in the current staff. To change the printed
744 output, see @ref{Transpose}.
746 The pitch to use for @code{\transposition} should correspond to the
747 real sound heard when a @code{c'} written on the staff is played by the
748 transposing instrument. For example, when entering a score in
749 concert pitch, typically all voices are entered in C, so
750 they should be entered as
763 The command @code{\transposition} should be used when the music is
764 entered from a (transposed) orchestral part. For example, in
765 classical horn parts, the tuning of the instrument is often changed
766 during a piece. When copying the notes from the part, use
767 @code{\transposition}, e.g.,