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 @cindex note names, other languages
204 @c put the rest of the old table into this new format.
206 @multitable @columnfractions .2 .6 .05 .05 .05 .05
209 @tab sharp @tab flat @tab double sharp @tab double flat
211 @tab c d e f g a bes b
212 @tab -is @tab -es @tab -isis @tab -eses
221 Note Names sharp flat double double
224 nederlands.ly c d e f g a bes b -is -es -isis -eses
225 english.ly c d e f g a bf b -s/-sharp -f/-flat -ss/-x/ -ff/
226 -sharpsharp -flatflat
227 deutsch.ly c d e f g a b h -is -es -isis -eses
228 norsk.ly c d e f g a b h -iss/-is -ess/-es -ississ/-isis -essess/-eses
229 svenska.ly c d e f g a b h -iss -ess -ississ -essess
230 italiano.ly do re mi fa sol la sib si -d -b -dd -bb
231 catalan.ly do re mi fa sol la sib si -d/-s -b -dd/-ss -bb
232 espanol.ly do re mi fa sol la sib si -s -b -ss -bb
236 Note that in Dutch, German, Norwegian, and Swedish, the flat
237 alterations of @samp{a} like for example @code{aes} and @code{aeses}
238 are usually contracted to @code{as} and @code{ases} (or more commonly
239 @code{asas}). Sometimes only these contracted names are defined in the
240 corresponding language files (this also applies to the suffixes for
244 Some music uses microtones whose alterations are fractions of a
245 @q{regular} sharp or flat. The note names for quartertones defined in
246 the various language files are listed in the following table. Here the
247 prefixes @q{semi-} and @q{sesqui-} mean @q{half} and @q{one and a
248 half}, respectively. For Norwegian, Swedish, Catalan and Spanish no
249 special names have been defined yet.
250 @c What about Turkish Maquam music and similar microtonal systems?
252 @c Note that the term "three-quarter-sharp/-flat" used in lilypond's source code
253 @c is actually misleading since the alteration is in fact one and a half
254 @c of a regular sharp/flat. Whence the naming "sesqui-sharp/-flat" used below.
257 Note Names semi- semi- sesqui- sesqui-
258 sharp flat sharp flat
260 nederlands.ly c d e f g a bes b -ih -eh -isih -eseh
261 english.ly c d e f g a bf b -qs -qf -tqs -tqf
262 deutsch.ly c d e f g a b h -ih -eh -isih -eseh
263 norsk.ly c d e f g a b h
264 svenska.ly c d e f g a b h
265 italiano.ly do re mi fa sol la sib si -sd -sb -dsd -bsb
266 catalan.ly do re mi fa sol la sib si
267 espanol.ly do re mi fa sol la sib si
271 @node Changing multiple pitches
272 @subsection Changing multiple pitches
280 @node Relative octaves
281 @unnumberedsubsubsec Relative octaves
284 @cindex Relative octave specification
287 Octaves are specified by adding @code{'} and @code{,} to pitch names.
288 When you copy existing music, it is easy to accidentally put a pitch
289 in the wrong octave and hard to find such an error. The relative
290 octave mode prevents these errors by making the mistakes much
291 larger: a single error puts the rest of the piece off by one octave
294 \relative @var{startpitch} @var{musicexpr}
301 \relative @var{musicexpr}
305 @code{c'} is used as the default if no starting pitch is defined.
307 The octave of notes that appear in @var{musicexpr} are calculated as
308 follows: if no octave changing marks are used, the basic interval
309 between this and the last note is always taken to be a fourth or
310 less. This distance is determined without regarding alterations; a
311 @code{fisis} following a @code{ceses} will be put above the
312 @code{ceses}. In other words, a doubly-augmented fourth is considered
313 a smaller interval than a diminished fifth, even though the
314 doubly-augmented fourth spans seven semitones while the diminished
315 fifth only spans six semitones.
317 The octave changing marks @code{'} and @code{,} can be added to raise
318 or lower the pitch by an extra octave. Upon entering relative mode,
319 an absolute starting pitch can be specified that will act as the
320 predecessor of the first note of @var{musicexpr}. If no starting pitch
321 is specified, then middle C is used as a start.
323 Here is the relative mode shown in action
324 @lilypond[quote,fragment,ragged-right,verbatim]
330 Octave changing marks are used for intervals greater than a fourth
332 @lilypond[quote,ragged-right,fragment,verbatim]
338 If the preceding item is a chord, the first note of the chord is used
339 to determine the first note of the next chord
341 @lilypond[quote,ragged-right,fragment,verbatim]
349 The pitch after @code{\relative} contains a note name.
351 The relative conversion will not affect @code{\transpose},
352 @code{\chordmode} or @code{\relative} sections in its argument. To use
353 relative within transposed music, an additional @code{\relative} must
354 be placed inside @code{\transpose}.
358 @unnumberedsubsubsec Octave check
362 Octave checks make octave errors easier to correct: a note may be
363 followed by @code{=}@var{quotes} which indicates what its absolute
364 octave should be. In the following example,
367 \relative c'' @{ c='' b=' d,='' @}
371 the @code{d} will generate a warning, because a @code{d''} is expected
372 (because @code{b'} to @code{d''} is only a third), but a @code{d'} is
373 found. In the output, the octave is corrected to be a @code{d''} and
374 the next note is calculated relative to @code{d''} instead of @code{d'}.
376 There is also an octave check that produces no visible output. The syntax
382 This checks that @var{pitch} (without quotes) yields @var{pitch} (with
383 quotes) in @code{\relative} mode compared to the note given in the
384 @code{\relative} command. If not, a warning is printed, and the
385 octave is corrected. The @var{pitch} is not printed as a note.
387 In the example below, the first check passes without incident, since
388 the @code{e} (in @code{relative} mode) is within a fifth of
390 the second check produces a warning, since the @code{e} is not within
391 a fifth of @code{b'}. The warning message is printed, and the octave
392 is adjusted so that the following notes are in the correct octave
404 The octave of a note following an octave check is determined with
405 respect to the note preceding it. In the next fragment, the last note
406 is an @code{a'}, above middle C. That means that the @code{\octave}
407 check passes successfully, so the check could be deleted without changing
408 the output of the piece.
410 @lilypond[quote,ragged-right,verbatim,fragment]
420 @unnumberedsubsubsec Transpose
423 @cindex Transposition of pitches
426 A music expression can be transposed with @code{\transpose}. The
429 \transpose @var{from} @var{to} @var{musicexpr}
432 This means that @var{musicexpr} is transposed by the interval between
433 the pitches @var{from} and @var{to}: any note with pitch @code{from}
434 is changed to @code{to}.
436 For example, consider a piece written in the key of D-major. If
437 this piece is a little too low for its performer, it can be
438 transposed up to E-major with
440 \transpose d e @dots{}
443 Consider a part written for violin (a C instrument). If
444 this part is to be played on the A clarinet (for which an
445 A is notated as a C, and which sounds a minor third lower
446 than notated), the following
447 transposition will produce the appropriate part
450 \transpose a c @dots{}
453 @code{\transpose} distinguishes between enharmonic pitches: both
454 @code{\transpose c cis} or @code{\transpose c des} will transpose up
455 half a tone. The first version will print sharps and the second
456 version will print flats
458 @lilypond[quote,ragged-right,verbatim]
459 mus = { \key d \major cis d fis g }
468 @code{\transpose} may also be used to input written notes for a
469 transposing instrument. Pitches are normally entered into LilyPond
470 in C (or @q{concert pitch}), but they may be entered in another
471 key. For example, when entering music for a B-flat trumpet which
472 begins on concert D, one would write
475 \transpose c bes @{ e4 @dots{} @}
478 To print this music in B-flat again (i.e., producing a trumpet part,
479 instead of a concert pitch conductor's score) you would wrap the
480 existing music with another @code{transpose}
483 \transpose bes c @{ \transpose c bes @{ e4 @dots{} @} @}
489 Program reference: @internalsref{TransposedMusic}.
491 Example: @lsr{scheme,transpose-pitches-with-minimum-accidentals.ly}.
496 If you want to use both @code{\transpose} and @code{\relative},
497 you must put @code{\transpose} outside of @code{\relative}, since
498 @code{\relative} will have no effect on music that appears inside a
502 @node Displaying pitches
503 @subsection Displaying pitches
509 * Instrument transpositions::
513 @unnumberedsubsubsec Clef
517 The clef indicates which lines of the staff correspond to which
518 pitches. The clef is set with the @code{\clef} command
520 @lilypond[quote,ragged-right,fragment,verbatim]
521 { c''2 \clef alto g'2 }
531 @cindex mezzosoprano clef
532 @cindex baritone clef
533 @cindex varbaritone clef
536 Supported clefs include
538 @multitable @columnfractions .33 .66
539 @headitem Clef @tab Position
540 @item @code{treble}, violin, G, G2 @tab
542 @item @code{alto, C} @tab
544 @item @code{tenor} @tab
546 @item @code{bass, F} @tab
548 @item @code{french} @tab
549 G clef on 1st line, so-called French violin clef
550 @item @code{soprano} @tab
552 @item @code{mezzosoprano} @tab
554 @item @code{baritone} @tab
556 @item @code{varbaritone} @tab
558 @item @code{subbass} @tab
560 @item @code{percussion} @tab
562 @item @code{tab} @tab
566 By adding @code{_8} or @code{^8} to the clef name, the clef is
567 transposed one octave down or up, respectively, and @code{_15} and
568 @code{^15} transposes by two octaves. The argument @var{clefname}
569 must be enclosed in quotes when it contains underscores or digits. For
572 @cindex choral tenor clef
573 @lilypond[quote,ragged-right,verbatim,fragment,relative=1]
580 The command @code{\clef "treble_8"} is equivalent to setting
582 @code{clefPosition} (which controls the Y position of the clef),
583 @code{middleCPosition} and @code{clefOctavation}. A clef is printed
584 when any of these properties are changed. The following example shows
585 possibilities when setting properties manually.
587 @lilypond[quote,ragged-right,verbatim]
589 \set Staff.clefGlyph = #"clefs.F"
590 \set Staff.clefPosition = #2
592 \set Staff.clefGlyph = #"clefs.G"
594 \set Staff.clefGlyph = #"clefs.C"
596 \set Staff.clefOctavation = #7
598 \set Staff.clefOctavation = #0
599 \set Staff.clefPosition = #0
603 \set Staff.middleCPosition = #4
611 Manual: @ref{Grace notes}.
613 Program reference: @internalsref{Clef}.
617 @unnumberedsubsubsec Key signature
619 @cindex Key signature
622 The key signature indicates the tonality in which a piece is played. It
623 is denoted by a set of alterations (flats or sharps) at the start of the
626 Setting or changing the key signature is done with the @code{\key}
630 @code{\key} @var{pitch} @var{type}
639 @funindex \mixolydian
645 Here, @var{type} should be @code{\major} or @code{\minor} to get
646 @var{pitch}-major or @var{pitch}-minor, respectively. You may also
647 use the standard mode names (also called @q{church modes}): @code{\ionian},
648 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
649 @code{\phrygian}, and @code{\dorian}.
651 This command sets the context property
652 @code{Staff.keySignature}. Non-standard key signatures
653 can be specified by setting this property directly.
655 Accidentals and key signatures often confuse new users, because
656 unaltered notes get natural signs depending on the key signature. For
657 more information, see @ref{Accidentals}, or @rlearning{Accidentals
660 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
669 A natural sign is printed to cancel any previous accidentals. This
670 can be suppressed by setting the @code{Staff.printKeyCancellation}
673 @lilypond[quote,fragment,ragged-right,fragment,verbatim,relative=2]
678 \set Staff.printKeyCancellation = ##f
688 Program reference: @internalsref{KeyCancellation},
689 @internalsref{KeySignature}.
692 @node Ottava brackets
693 @unnumberedsubsubsec Ottava brackets
695 @q{Ottava} brackets introduce an extra transposition of an octave for
696 the staff. They are created by invoking the function
697 @code{set-octavation}
703 @lilypond[quote,ragged-right,verbatim,fragment]
713 The @code{set-octavation} function also takes -1 (for 8va bassa), 2@tie{}(for 15ma),
714 and -2 (for 15ma bassa) as arguments. Internally the function sets the properties
715 @code{ottavation} (e.g., to @code{"8va"} or @code{"8vb"}) and
716 @code{centralCPosition}. For overriding the text of the bracket, set
717 @code{ottavation} after invoking @code{set-octavation}, i.e.,
719 @lilypond[quote,ragged-right,verbatim]
722 \set Staff.ottavation = #"8"
730 Program reference: @internalsref{OttavaBracket}.
735 @code{set-octavation} will get confused when clef changes happen
736 during an octavation bracket.
739 @node Instrument transpositions
740 @unnumberedsubsubsec Instrument transpositions
742 @cindex transposition, MIDI
743 @cindex transposition, instrument
745 The key of a transposing instrument can also be specified. This
746 applies to many wind instruments, for example, clarinets (B-flat, A, and
747 E-flat), horn (F) and trumpet (B-flat, C, D, and E-flat).
749 The transposition is entered after the keyword @code{\transposition}
752 \transposition bes %% B-flat clarinet
756 This command sets the property @code{instrumentTransposition}. The value of
757 this property is used for MIDI output and quotations. It does not
758 affect how notes are printed in the current staff. To change the printed
759 output, see @ref{Transpose}.
761 The pitch to use for @code{\transposition} should correspond to the
762 real sound heard when a @code{c'} written on the staff is played by the
763 transposing instrument. For example, when entering a score in
764 concert pitch, typically all voices are entered in C, so
765 they should be entered as
778 The command @code{\transposition} should be used when the music is
779 entered from a (transposed) orchestral part. For example, in
780 classical horn parts, the tuning of the instrument is often changed
781 during a piece. When copying the notes from the part, use
782 @code{\transposition}, e.g.,