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
37 @code{g}. 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 (@samp{,})
58 characters. Each @samp{'} raises the pitch by one octave; each
59 @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 engrave
69 a pitch; this method does not require as many octave
70 specifications (@code{'} and @code{,}). See @ref{Relative
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
81 and a flat is formed by adding @code{-es}. Double sharps and
82 double flats are obtained by adding @code{-isis} or @code{-eses}
85 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
91 These are the Dutch note names. In Dutch, @code{aes} is
92 contracted to @code{as}, but both forms are accepted. Similarly,
93 both @code{es} and @code{ees} are accepted
95 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
99 A natural will cancel the effect of an accidental or key
100 signature. However, naturals are not encoded into the note name
101 syntax with a suffix; a natural pitch is shown as a simple note
104 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
108 The input @code{d e f} is interpreted as @q{print a D-natural,
109 E-natural, and an F-natural,} regardless of the key signature.
110 For more information about the distinction between musical content
111 and the presentation of that content, see @rlearning{Accidentals
114 @lilypond[fragment,quote,ragged-right,verbatim,relative]
123 In accordance with standard typesetting rules, a natural sign is
124 printed before a sharp or flat if a previous accidental needs to
125 be cancelled. To change this behavior, use @code{\set
126 Staff.extraNatural = ##f}
128 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
130 \set Staff.extraNatural = ##f
137 Program reference: @internalsref{LedgerLineSpanner},
138 @internalsref{NoteHead}.
141 @node Cautionary accidentals
142 @unnumberedsubsubsec Cautionary accidentals
144 @cindex accidental, reminder
145 @cindex accidental, cautionary
146 @cindex accidental, parenthesized
147 @cindex reminder accidental
149 @cindex cautionary accidental
150 @cindex parenthesized accidental
153 Normally accidentals are printed automatically, but you may also
154 print them manually. A reminder accidental can be forced by
155 adding an exclamation mark @code{!} after the pitch. A cautionary
156 accidental (i.e., an accidental within parentheses) can be
157 obtained by adding the question mark @samp{?} after the pitch.
158 These extra accidentals can be used to produce natural signs, too.
160 @lilypond[quote,ragged-right,fragment,verbatim,relative=1]
161 cis cis cis! cis? c c? c! c
167 The automatic production of accidentals can be tuned in many ways.
168 For more information, see @ref{Automatic accidentals}.
172 @unnumberedsubsubsec Micro tones
174 @cindex quarter tones
175 @cindex semi-flats, semi-sharps
177 Half-flats and half-sharps are formed by adding @code{-eh} and
178 @code{-ih}; the following is a series of Cs with increasing
181 @lilypond[verbatim,ragged-right,quote,relative=2,fragment]
182 \set Staff.extraNatural = ##f
186 Micro tones are also exported to the MIDI file.
191 There are no generally accepted standards for denoting
192 three-quarter flats, so LilyPond's symbol does not conform to any
196 @node Note names in other languages
197 @unnumberedsubsubsec Note names in other languages
199 There are predefined sets of note names for various other
200 languages. To use them, include the language specific init file.
201 For example, add @code{\include "english.ly"} to the top of the
202 input file. The available language files and the note names they
205 @cindex note names, other languages
206 @c put the rest of the old table into this new format.
208 @multitable @columnfractions .2 .6 .05 .05 .05 .05
211 @tab sharp @tab flat @tab double sharp @tab double flat
213 @tab c d e f g a bes b
214 @tab -is @tab -es @tab -isis @tab -eses
224 Note Names sharp flat double double
227 nederlands.ly c d e f g a bes b -is -es -isis -eses
228 english.ly c d e f g a bf b -s/-sharp -f/-flat -ss/-x/ -ff/
229 -sharpsharp -flatflat
230 deutsch.ly c d e f g a b h -is -es -isis -eses
231 norsk.ly c d e f g a b h -iss/-is -ess/-es -ississ/-isis -essess/-eses
232 svenska.ly c d e f g a b h -iss -ess -ississ -essess
233 italiano.ly do re mi fa sol la sib si -d -b -dd -bb
234 catalan.ly do re mi fa sol la sib si -d/-s -b -dd/-ss -bb
235 espanol.ly do re mi fa sol la sib si -s -b -ss -bb
240 Note that in Dutch, German, Norwegian, and Swedish, the flat
241 alterations of @samp{a} like for example @code{aes} and
242 @code{aeses} are usually contracted to @code{as} and @code{ases}
243 (or more commonly @code{asas}). Sometimes only these contracted
244 names are defined in the corresponding language files (this also
245 applies to the suffixes for quartertones below).
248 Some music uses microtones whose alterations are fractions of a
249 @q{regular} sharp or flat. The note names for quartertones defined
250 in the various language files are listed in the following table.
251 Here the prefixes @q{semi-} and @q{sesqui-} mean @q{half} and
252 @q{one and a half}, respectively. For Norwegian, Swedish, Catalan
253 and Spanish no special names have been defined yet.
255 @c What about Turkish Maquam music and similar microtonal systems?
257 @c Note that the term "three-quarter-sharp/-flat" used in lilypond's source code
258 @c is actually misleading since the alteration is in fact one and a half
259 @c of a regular sharp/flat. Whence the naming "sesqui-sharp/-flat" used below.
262 Note Names semi- semi- sesqui- sesqui-
263 sharp flat sharp flat
265 nederlands.ly c d e f g a bes b -ih -eh -isih -eseh
266 english.ly c d e f g a bf b -qs -qf -tqs -tqf
267 deutsch.ly c d e f g a b h -ih -eh -isih -eseh
268 norsk.ly c d e f g a b h
269 svenska.ly c d e f g a b h
270 italiano.ly do re mi fa sol la sib si -sd -sb -dsd -bsb
271 catalan.ly do re mi fa sol la sib si
272 espanol.ly do re mi fa sol la sib si
276 @node Changing multiple pitches
277 @subsection Changing multiple pitches
285 @node Relative octaves
286 @unnumberedsubsubsec Relative octaves
289 @cindex Relative octave specification
292 Octaves are specified by adding @code{'} and @code{,} to pitch
293 names. When you copy existing music, it is easy to accidentally
294 put a pitch in the wrong octave and hard to find such an error.
295 The relative octave mode prevents these errors by making the
296 mistakes much larger: a single error puts the rest of the piece
300 \relative @var{startpitch} @var{musicexpr}
307 \relative @var{musicexpr}
311 @code{c'} is used as the default if no starting pitch is defined.
313 The octave of notes that appear in @var{musicexpr} are calculated
314 as follows: if no octave changing marks are used, the basic
315 interval between this and the last note is always taken to be a
316 fourth or less. This distance is determined without regarding
317 alterations; a @code{fisis} following a @code{ceses} will be put
318 above the @code{ceses}. In other words, a doubly-augmented fourth
319 is considered a smaller interval than a diminished fifth, even
320 though the doubly-augmented fourth spans seven semitones while the
321 diminished fifth only spans six semitones.
323 The octave changing marks @code{'} and @code{,} can be added to
324 raise or lower the pitch by an extra octave. Upon entering
325 relative mode, an absolute starting pitch can be specified that
326 will act as the predecessor of the first note of @var{musicexpr}.
327 If no starting pitch is specified, then middle C is used as a
330 Here is the relative mode shown in action
331 @lilypond[quote,fragment,ragged-right,verbatim]
337 Octave changing marks are used for intervals greater than a fourth
339 @lilypond[quote,ragged-right,fragment,verbatim]
345 If the preceding item is a chord, the first note of the chord is
346 used to determine the first note of the next chord
348 @lilypond[quote,ragged-right,fragment,verbatim]
356 The pitch after @code{\relative} contains a note name.
358 The relative conversion will not affect @code{\transpose},
359 @code{\chordmode} or @code{\relative} sections in its argument.
360 To use relative within transposed music, an additional
361 @code{\relative} must be placed inside @code{\transpose}.
365 @unnumberedsubsubsec Octave check
369 Octave checks make octave errors easier to correct: a note may be
370 followed by @code{=}@var{quotes} which indicates what its absolute
371 octave should be. In the following example,
374 \relative c'' @{ c='' b=' d,='' @}
378 the @code{d} will generate a warning, because a @code{d''} is
379 expected (because @code{b'} to @code{d''} is only a third), but a
380 @code{d'} is found. In the output, the octave is corrected to be
381 a @code{d''} and the next note is calculated relative to
382 @code{d''} instead of @code{d'}.
384 There is also an octave check that produces no visible output.
391 This checks that @var{pitch} (without quotes) yields @var{pitch}
392 (with quotes) in @code{\relative} mode compared to the note given
393 in the @code{\relative} command. If not, a warning is printed,
394 and the octave is corrected. The @var{pitch} is not printed as a
397 In the example below, the first check passes without incident,
398 since the @code{e} (in @code{relative} mode) is within a fifth of
399 @code{a'}. However, the second check produces a warning, since
400 the @code{e} is not within a fifth of @code{b'}. The warning
401 message is printed, and the octave is adjusted so that the
402 following notes are in the correct octave once again.
413 The octave of a note following an octave check is determined with
414 respect to the note preceding it. In the next fragment, the last
415 note is an @code{a'}, above middle C. That means that the
416 @code{\octave} check passes successfully, so the check could be
417 deleted without changing the output of the piece.
419 @lilypond[quote,ragged-right,verbatim,fragment]
429 @unnumberedsubsubsec Transpose
432 @cindex Transposition of pitches
435 A music expression can be transposed with @code{\transpose}. The
439 \transpose @var{from} @var{to} @var{musicexpr}
442 This means that @var{musicexpr} is transposed by the interval
443 between the pitches @var{from} and @var{to}: any note with pitch
444 @code{from} is changed to @code{to}.
446 For example, consider a piece written in the key of D-major. If
447 this piece is a little too low for its performer, it can be
448 transposed up to E-major with
451 \transpose d e @dots{}
454 Consider a part written for violin (a C instrument). If this part
455 is to be played on the A clarinet (for which an A is notated as a
456 C, and which sounds a minor third lower than notated), the
457 following transposition will produce the appropriate part
460 \transpose a c @dots{}
463 @code{\transpose} distinguishes between enharmonic pitches: both
464 @code{\transpose c cis} or @code{\transpose c des} will transpose
465 up half a tone. The first version will print sharps and the
466 second version will print flats
468 @lilypond[quote,ragged-right,verbatim]
469 mus = { \key d \major cis d fis g }
478 @code{\transpose} may also be used to input written notes for a
479 transposing instrument. Pitches are normally entered into
480 LilyPond in C (or @q{concert pitch}), but they may be entered in
481 another key. For example, when entering music for a B-flat
482 trumpet which begins on concert D, one would write
485 \transpose c bes @{ e4 @dots{} @}
488 To print this music in B-flat again (i.e., producing a trumpet part,
489 instead of a concert pitch conductor's score) you would wrap the
490 existing music with another @code{transpose}
493 \transpose bes c @{ \transpose c bes @{ e4 @dots{} @} @}
499 Program reference: @internalsref{TransposedMusic}.
502 @lsr{scheme,transpose-pitches-with-minimum-accidentals.ly}.
507 If you want to use both @code{\transpose} and @code{\relative},
508 you must put @code{\transpose} outside of @code{\relative}, since
509 @code{\relative} will have no effect on music that appears inside
513 @node Displaying pitches
514 @subsection Displaying pitches
520 * Instrument transpositions::
524 @unnumberedsubsubsec Clef
528 The clef indicates which lines of the staff correspond to which
529 pitches. The clef is set with the @code{\clef} command
531 @lilypond[quote,ragged-right,fragment,verbatim]
532 { c''2 \clef alto g'2 }
542 @cindex mezzosoprano clef
543 @cindex baritone clef
544 @cindex varbaritone clef
547 Supported clefs include
549 @multitable @columnfractions .33 .66
550 @headitem Clef @tab Position
551 @item @code{treble}, violin, G, G2 @tab
553 @item @code{alto, C} @tab
555 @item @code{tenor} @tab
557 @item @code{bass, F} @tab
559 @item @code{french} @tab
560 G clef on 1st line, so-called French violin clef
561 @item @code{soprano} @tab
563 @item @code{mezzosoprano} @tab
565 @item @code{baritone} @tab
567 @item @code{varbaritone} @tab
569 @item @code{subbass} @tab
571 @item @code{percussion} @tab
573 @item @code{tab} @tab
577 By adding @code{_8} or @code{^8} to the clef name, the clef is
578 transposed one octave down or up, respectively, and @code{_15} and
579 @code{^15} transposes by two octaves. The argument @var{clefname}
580 must be enclosed in quotes when it contains underscores or digits.
583 @cindex choral tenor clef
584 @lilypond[quote,ragged-right,verbatim,fragment,relative=1]
591 The command @code{\clef "treble_8"} is equivalent to setting
592 @code{clefGlyph}, @code{clefPosition} (which controls the Y
593 position of the clef), @code{middleCPosition} and
594 @code{clefOctavation}. A clef is printed when any of these
595 properties are changed. The following example shows possibilities
596 when setting properties manually.
598 @lilypond[quote,ragged-right,verbatim]
600 \set Staff.clefGlyph = #"clefs.F"
601 \set Staff.clefPosition = #2
603 \set Staff.clefGlyph = #"clefs.G"
605 \set Staff.clefGlyph = #"clefs.C"
607 \set Staff.clefOctavation = #7
609 \set Staff.clefOctavation = #0
610 \set Staff.clefPosition = #0
614 \set Staff.middleCPosition = #4
622 Manual: @ref{Grace notes}.
624 Program reference: @internalsref{Clef}.
628 @unnumberedsubsubsec Key signature
630 @cindex Key signature
633 The key signature indicates the tonality in which a piece is
634 played. It is denoted by a set of alterations (flats or sharps)
635 at the start of the staff.
637 Setting or changing the key signature is done with the @code{\key}
641 @code{\key} @var{pitch} @var{type}
650 @funindex \mixolydian
656 Here, @var{type} should be @code{\major} or @code{\minor} to get
657 @var{pitch}-major or @var{pitch}-minor, respectively. You may
658 also use the standard mode names (also called @q{church modes}):
659 @code{\ionian}, @code{\locrian}, @code{\aeolian},
660 @code{\mixolydian}, @code{\lydian}, @code{\phrygian}, and
663 This command sets the context property @code{Staff.keySignature}.
664 Non-standard key signatures can be specified by setting this
667 Accidentals and key signatures often confuse new users, because
668 unaltered notes get natural signs depending on the key signature.
669 For more information, see @ref{Accidentals}, or
670 @rlearning{Accidentals and key signatures}.
672 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
681 A natural sign is printed to cancel any previous accidentals.
682 This can be suppressed by setting the
683 @code{Staff.printKeyCancellation} property.
685 @lilypond[quote,fragment,ragged-right,fragment,verbatim,relative=2]
690 \set Staff.printKeyCancellation = ##f
700 Program reference: @internalsref{KeyCancellation},
701 @internalsref{KeySignature}.
704 @node Ottava brackets
705 @unnumberedsubsubsec Ottava brackets
707 @q{Ottava} brackets introduce an extra transposition of an octave
708 for the staff. They are created by invoking the function
709 @code{set-octavation}
715 @lilypond[quote,ragged-right,verbatim,fragment]
725 The @code{set-octavation} function also takes -1 (for 8va bassa),
726 2@tie{}(for 15ma), and -2 (for 15ma bassa) as arguments.
727 Internally the function sets the properties @code{ottavation}
728 (e.g., to @code{"8va"} or @code{"8vb"}) and
729 @code{centralCPosition}. For overriding the text of the bracket,
730 set @code{ottavation} after invoking @code{set-octavation}, i.e.,
732 @lilypond[quote,ragged-right,verbatim]
735 \set Staff.ottavation = #"8"
743 Program reference: @internalsref{OttavaBracket}.
748 @code{set-octavation} will get confused when clef changes happen
749 during an octavation bracket.
752 @node Instrument transpositions
753 @unnumberedsubsubsec Instrument transpositions
755 @cindex transposition, MIDI
756 @cindex transposition, instrument
758 The key of a transposing instrument can also be specified. This
759 applies to many wind instruments, for example, clarinets (B-flat,
760 A, and E-flat), horn (F) and trumpet (B-flat, C, D, and E-flat).
762 The transposition is entered after the keyword @code{\transposition}
765 \transposition bes %% B-flat clarinet
769 This command sets the property @code{instrumentTransposition}.
770 The value of this property is used for MIDI output and quotations.
771 It does not affect how notes are printed in the current staff. To
772 change the printed output, see @ref{Transpose}.
774 The pitch to use for @code{\transposition} should correspond to
775 the real sound heard when a @code{c'} written on the staff is
776 played by the transposing instrument. For example, when entering
777 a score in concert pitch, typically all voices are entered in C,
778 so they should be entered as
791 The command @code{\transposition} should be used when the music is
792 entered from a (transposed) orchestral part. For example, in
793 classical horn parts, the tuning of the instrument is often
794 changed during a piece. When copying the notes from the part, use
795 @code{\transposition}, e.g.,