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::
16 @subsection Writing pitches
22 @anchor{Normal pitches}
23 @unnumberedsubsubsec Normal pitches
28 A pitch name is specified using lowercase letters @code{a} through @code{g}.
29 An ascending C-major scale is engraved with
31 @lilypond[quote,fragment,verbatim,ragged-right]
36 The note name @code{c} is engraved one octave below middle C.
38 @lilypond[quote,fragment,verbatim,ragged-right]
48 The optional octave specification takes the form of a series of
49 single quote (@samp{'}) characters or a series of comma
50 (@samp{,}) characters. Each @samp{'} raises the pitch by one
51 octave; each @samp{,} lowers the pitch by an octave.
53 @lilypond[quote,ragged-right,fragment,verbatim]
55 c' c'' e' g d'' d' d c
57 c, c,, e, g d,, d, d c
60 An alternate method may be used to declare which octave to
61 engrave a pitch; this method does not require as many
62 octave specifications (@code{'} and @code{,}). See
63 @ref{Relative octaves}.
67 @unnumberedsubsubsec Accidentals
69 @cindex note names, Dutch
70 @cindex note names, default
72 A sharp is formed by adding @code{-is} to the end of a pitch name and
73 a flat is formed by adding @code{-es}. Double sharps and double flats
74 are obtained by adding @code{-isis} or @code{-eses} to a note name.
76 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
82 These are the Dutch note names. In Dutch, @code{aes} is contracted to
83 @code{as}, but both forms are accepted. Similarly, both
84 @code{es} and @code{ees} are accepted
86 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
90 A natural will cancel the effect of an accidental or key signature.
91 However, naturals are not encoded into the note name syntax with a
92 suffix; a natural pitch is shown as a simple note name
94 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
98 The input @code{d e f} is interpreted as @q{print a D-natural,
99 E-natural, and an F-natural,} regardless of the key
100 signature. For more information about the distinction between
101 musical content and the presentation of that content, see
102 @rlearning{Accidentals and key signatures}.
104 @lilypond[fragment,quote,ragged-right,verbatim,relative]
113 In accordance with standard typesetting rules, a natural sign is printed
114 before a sharp or flat if a previous accidental needs to be
115 cancelled. To change this behavior, use
116 @code{\set Staff.extraNatural = ##f}
118 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
120 \set Staff.extraNatural = ##f
127 Program reference: @internalsref{LedgerLineSpanner},
128 @internalsref{NoteHead}.
131 @anchor{Cautionary accidentals}
132 @unnumberedsubsubsec Cautionary accidentals
134 @cindex accidental, reminder
135 @cindex accidental, cautionary
136 @cindex accidental, parenthesized
137 @cindex reminder accidental
139 @cindex cautionary accidental
140 @cindex parenthesized accidental
143 Normally accidentals are printed automatically, but you may also
144 print them manually. A reminder accidental
145 can be forced by adding an exclamation mark @code{!}
146 after the pitch. A cautionary accidental
147 (i.e., an accidental within parentheses) can be obtained by adding the
148 question mark @samp{?} after the pitch. These extra accidentals
149 can be used to produce natural signs, too.
151 @lilypond[quote,ragged-right,fragment,verbatim,relative=1]
152 cis cis cis! cis? c c? c! c
158 The automatic production of accidentals can be tuned in many
159 ways. For more information, see @ref{Automatic accidentals}.
163 @unnumberedsubsubsec Micro tones
165 @cindex quarter tones
166 @cindex semi-flats, semi-sharps
168 Half-flats and half-sharps are formed by adding @code{-eh} and
169 @code{-ih}; the following is a series of Cs with increasing pitches
171 @lilypond[verbatim,ragged-right,quote,relative=2,fragment]
172 \set Staff.extraNatural = ##f
176 Micro tones are also exported to the MIDI file.
181 There are no generally accepted standards for denoting
182 three-quarter flats, so LilyPond's symbol does not conform to any
186 @anchor{Note names in other languages}
187 @unnumberedsubsubsec Note names in other languages
189 There are predefined sets of note names for various other languages.
190 To use them, include the language specific init file. For
191 example, add @code{\include "english.ly"} to the top of the input
192 file. The available language files
193 and the note names they define are
195 @c Should this be made into a multitable?
196 @cindex note names, other languages
198 Note Names sharp flat double double
201 nederlands.ly c d e f g a bes b -is -es -isis -eses
202 english.ly c d e f g a bf b -s/-sharp -f/-flat -ss/-x/ -ff/
203 -sharpsharp -flatflat
204 deutsch.ly c d e f g a b h -is -es -isis -eses
205 norsk.ly c d e f g a b h -iss/-is -ess/-es -ississ/-isis -essess/-eses
206 svenska.ly c d e f g a b h -iss -ess -ississ -essess
207 italiano.ly do re mi fa sol la sib si -d -b -dd -bb
208 catalan.ly do re mi fa sol la sib si -d/-s -b -dd/-ss -bb
209 espanol.ly do re mi fa sol la sib si -s -b -ss -bb
213 Note that in Dutch, German, Norwegian, and Swedish, the flat
214 alterations of @samp{a} like for example @code{aes} and @code{aeses}
215 are usually contracted to @code{as} and @code{ases} (or more commonly
216 @code{asas}). Sometimes only these contracted names are defined in the
217 corresponding language files (this also applies to the suffixes for
221 Some music uses microtones whose alterations are fractions of a
222 @q{regular} sharp or flat. The note names for quartertones defined in
223 the various language files are listed in the following table. Here the
224 prefixes @q{semi-} and @q{sesqui-} mean @q{half} and @q{one and a
225 half}, respectively. For Norwegian, Swedish, Catalan and Spanish no
226 special names have been defined yet.
227 @c What about Turkish Maquam music and similar microtonal systems?
229 @c Note that the term "three-quarter-sharp/-flat" used in lilypond's source code
230 @c is actually misleading since the alteration is in fact one and a half
231 @c of a regular sharp/flat. Whence the naming "sesqui-sharp/-flat" used below.
234 Note Names semi- semi- sesqui- sesqui-
235 sharp flat sharp flat
237 nederlands.ly c d e f g a bes b -ih -eh -isih -eseh
238 english.ly c d e f g a bf b -qs -qf -tqs -tqf
239 deutsch.ly c d e f g a b h -ih -eh -isih -eseh
240 norsk.ly c d e f g a b h
241 svenska.ly c d e f g a b h
242 italiano.ly do re mi fa sol la sib si -sd -sb -dsd -bsb
243 catalan.ly do re mi fa sol la sib si
244 espanol.ly do re mi fa sol la sib si
248 @node Changing multiple pitches
249 @subsection Changing multiple pitches
254 @anchor{Relative octaves}
255 @unnumberedsubsubsec Relative octaves
258 @cindex Relative octave specification
261 Octaves are specified by adding @code{'} and @code{,} to pitch names.
262 When you copy existing music, it is easy to accidentally put a pitch
263 in the wrong octave and hard to find such an error. The relative
264 octave mode prevents these errors by making the mistakes much
265 larger: a single error puts the rest of the piece off by one octave
268 \relative @var{startpitch} @var{musicexpr}
275 \relative @var{musicexpr}
279 @code{c'} is used as the default if no starting pitch is defined.
281 The octave of notes that appear in @var{musicexpr} are calculated as
282 follows: if no octave changing marks are used, the basic interval
283 between this and the last note is always taken to be a fourth or
284 less. This distance is determined without regarding alterations; a
285 @code{fisis} following a @code{ceses} will be put above the
286 @code{ceses}. In other words, a doubly-augmented fourth is considered
287 a smaller interval than a diminished fifth, even though the
288 doubly-augmented fourth spans seven semitones while the diminished
289 fifth only spans six semitones.
291 The octave changing marks @code{'} and @code{,} can be added to raise
292 or lower the pitch by an extra octave. Upon entering relative mode,
293 an absolute starting pitch can be specified that will act as the
294 predecessor of the first note of @var{musicexpr}. If no starting pitch
295 is specified, then middle C is used as a start.
297 Here is the relative mode shown in action
298 @lilypond[quote,fragment,ragged-right,verbatim]
304 Octave changing marks are used for intervals greater than a fourth
306 @lilypond[quote,ragged-right,fragment,verbatim]
312 If the preceding item is a chord, the first note of the chord is used
313 to determine the first note of the next chord
315 @lilypond[quote,ragged-right,fragment,verbatim]
323 The pitch after @code{\relative} contains a note name.
325 The relative conversion will not affect @code{\transpose},
326 @code{\chordmode} or @code{\relative} sections in its argument. To use
327 relative within transposed music, an additional @code{\relative} must
328 be placed inside @code{\transpose}.
331 @anchor{Octave check}
332 @unnumberedsubsubsec Octave check
336 Octave checks make octave errors easier to correct: a note may be
337 followed by @code{=}@var{quotes} which indicates what its absolute
338 octave should be. In the following example,
341 \relative c'' @{ c='' b=' d,='' @}
345 the @code{d} will generate a warning, because a @code{d''} is expected
346 (because @code{b'} to @code{d''} is only a third), but a @code{d'} is
347 found. In the output, the octave is corrected to be a @code{d''} and
348 the next note is calculated relative to @code{d''} instead of @code{d'}.
350 There is also an octave check that produces no visible output. The syntax
356 This checks that @var{pitch} (without quotes) yields @var{pitch} (with
357 quotes) in @code{\relative} mode compared to the note given in the
358 @code{\relative} command. If not, a warning is printed, and the
359 octave is corrected. The @var{pitch} is not printed as a note.
361 In the example below, the first check passes without incident, since
362 the @code{e} (in @code{relative} mode) is within a fifth of
364 the second check produces a warning, since the @code{e} is not within
365 a fifth of @code{b'}. The warning message is printed, and the octave
366 is adjusted so that the following notes are in the correct octave
378 The octave of a note following an octave check is determined with
379 respect to the note preceding it. In the next fragment, the last note
380 is an @code{a'}, above middle C. That means that the @code{\octave}
381 check passes successfully, so the check could be deleted without changing
382 the output of the piece.
384 @lilypond[quote,ragged-right,verbatim,fragment]
394 @unnumberedsubsubsec Transpose
397 @cindex Transposition of pitches
400 A music expression can be transposed with @code{\transpose}. The
403 \transpose @var{from} @var{to} @var{musicexpr}
406 This means that @var{musicexpr} is transposed by the interval between
407 the pitches @var{from} and @var{to}: any note with pitch @code{from}
408 is changed to @code{to}.
410 For example, consider a piece written in the key of D-major. If
411 this piece is a little too low for its performer, it can be
412 transposed up to E-major with
414 \transpose d e @dots{}
417 Consider a part written for violin (a C instrument). If
418 this part is to be played on the A clarinet (for which an
419 A is notated as a C, and which sounds a minor third lower
420 than notated), the following
421 transposition will produce the appropriate part
424 \transpose a c @dots{}
427 @code{\transpose} distinguishes between enharmonic pitches: both
428 @code{\transpose c cis} or @code{\transpose c des} will transpose up
429 half a tone. The first version will print sharps and the second
430 version will print flats
432 @lilypond[quote,ragged-right,verbatim]
433 mus = { \key d \major cis d fis g }
442 @code{\transpose} may also be used to input written notes for a
443 transposing instrument. Pitches are normally entered into LilyPond
444 in C (or @q{concert pitch}), but they may be entered in another
445 key. For example, when entering music for a B-flat trumpet which
446 begins on concert D, one would write
449 \transpose c bes @{ e4 @dots{} @}
452 To print this music in B-flat again (i.e., producing a trumpet part,
453 instead of a concert pitch conductor's score) you would wrap the
454 existing music with another @code{transpose}
457 \transpose bes c @{ \transpose c bes @{ e4 @dots{} @} @}
463 Program reference: @internalsref{TransposedMusic}.
465 Example: @lsr{scheme,transpose-pitches-with-minimum-accidentals.ly}.
470 If you want to use both @code{\transpose} and @code{\relative},
471 you must put @code{\transpose} outside of @code{\relative}, since
472 @code{\relative} will have no effect on music that appears inside a
476 @node Displaying pitches
477 @subsection Displaying pitches
483 @unnumberedsubsubsec Clef
487 The clef indicates which lines of the staff correspond to which
488 pitches. The clef is set with the @code{\clef} command
490 @lilypond[quote,ragged-right,fragment,verbatim]
491 { c''2 \clef alto g'2 }
501 @cindex mezzosoprano clef
502 @cindex baritone clef
503 @cindex varbaritone clef
506 Supported clefs include
508 @multitable @columnfractions .33 .66
509 @headitem Clef @tab Position
510 @item @code{treble}, violin, G, G2 @tab
512 @item @code{alto, C} @tab
514 @item @code{tenor} @tab
516 @item @code{bass, F} @tab
518 @item @code{french} @tab
519 G clef on 1st line, so-called French violin clef
520 @item @code{soprano} @tab
522 @item @code{mezzosoprano} @tab
524 @item @code{baritone} @tab
526 @item @code{varbaritone} @tab
528 @item @code{subbass} @tab
530 @item @code{percussion} @tab
532 @item @code{tab} @tab
536 By adding @code{_8} or @code{^8} to the clef name, the clef is
537 transposed one octave down or up, respectively, and @code{_15} and
538 @code{^15} transposes by two octaves. The argument @var{clefname}
539 must be enclosed in quotes when it contains underscores or digits. For
542 @cindex choral tenor clef
543 @lilypond[quote,ragged-right,verbatim,fragment,relative=1]
550 The command @code{\clef "treble_8"} is equivalent to setting
552 @code{clefPosition} (which controls the Y position of the clef),
553 @code{middleCPosition} and @code{clefOctavation}. A clef is printed
554 when any of these properties are changed. The following example shows
555 possibilities when setting properties manually.
557 @lilypond[quote,ragged-right,verbatim]
559 \set Staff.clefGlyph = #"clefs.F"
560 \set Staff.clefPosition = #2
562 \set Staff.clefGlyph = #"clefs.G"
564 \set Staff.clefGlyph = #"clefs.C"
566 \set Staff.clefOctavation = #7
568 \set Staff.clefOctavation = #0
569 \set Staff.clefPosition = #0
573 \set Staff.middleCPosition = #4
581 Manual: @ref{Grace notes}.
583 Program reference: @internalsref{Clef}.
586 @anchor{Key signature}
587 @unnumberedsubsubsec Key signature
589 @cindex Key signature
592 The key signature indicates the tonality in which a piece is played. It
593 is denoted by a set of alterations (flats or sharps) at the start of the
596 Setting or changing the key signature is done with the @code{\key}
600 @code{\key} @var{pitch} @var{type}
609 @funindex \mixolydian
615 Here, @var{type} should be @code{\major} or @code{\minor} to get
616 @var{pitch}-major or @var{pitch}-minor, respectively. You may also
617 use the standard mode names (also called @q{church modes}): @code{\ionian},
618 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
619 @code{\phrygian}, and @code{\dorian}.
621 This command sets the context property
622 @code{Staff.keySignature}. Non-standard key signatures
623 can be specified by setting this property directly.
625 Accidentals and key signatures often confuse new users, because
626 unaltered notes get natural signs depending on the key signature. For
627 more information, see @ref{Accidentals}, or @rlearning{Accidentals
630 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
639 A natural sign is printed to cancel any previous accidentals. This
640 can be suppressed by setting the @code{Staff.printKeyCancellation}
643 @lilypond[quote,fragment,ragged-right,fragment,verbatim,relative=2]
648 \set Staff.printKeyCancellation = ##f
658 Program reference: @internalsref{KeyCancellation},
659 @internalsref{KeySignature}.
662 @anchor{Ottava brackets}
663 @unnumberedsubsubsec Ottava brackets
665 @q{Ottava} brackets introduce an extra transposition of an octave for
666 the staff. They are created by invoking the function
667 @code{set-octavation}
673 @lilypond[quote,ragged-right,verbatim,fragment]
683 The @code{set-octavation} function also takes -1 (for 8va bassa), 2@tie{}(for 15ma),
684 and -2 (for 15ma bassa) as arguments. Internally the function sets the properties
685 @code{ottavation} (e.g., to @code{"8va"} or @code{"8vb"}) and
686 @code{centralCPosition}. For overriding the text of the bracket, set
687 @code{ottavation} after invoking @code{set-octavation}, i.e.,
689 @lilypond[quote,ragged-right,verbatim]
692 \set Staff.ottavation = #"8"
700 Program reference: @internalsref{OttavaBracket}.
705 @code{set-octavation} will get confused when clef changes happen
706 during an octavation bracket.
709 @anchor{Instrument transpositions}
710 @unnumberedsubsubsec Instrument transpositions
712 @cindex transposition, MIDI
713 @cindex transposition, instrument
715 The key of a transposing instrument can also be specified. This
716 applies to many wind instruments, for example, clarinets (B-flat, A, and
717 E-flat), horn (F) and trumpet (B-flat, C, D, and E-flat).
719 The transposition is entered after the keyword @code{\transposition}
722 \transposition bes %% B-flat clarinet
726 This command sets the property @code{instrumentTransposition}. The value of
727 this property is used for MIDI output and quotations. It does not
728 affect how notes are printed in the current staff. To change the printed
729 output, see @ref{Transpose}.
731 The pitch to use for @code{\transposition} should correspond to the
732 real sound heard when a @code{c'} written on the staff is played by the
733 transposing instrument. For example, when entering a score in
734 concert pitch, typically all voices are entered in C, so
735 they should be entered as
748 The command @code{\transposition} should be used when the music is
749 entered from a (transposed) orchestral part. For example, in
750 classical horn parts, the tuning of the instrument is often changed
751 during a piece. When copying the notes from the part, use
752 @code{\transposition}, e.g.,