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 @c don't use @samp here because that might get confused with
48 A pitch name is specified using lowercase letters@tie{}@code{a}
49 through@tie{}@code{g}. An ascending C-major scale is engraved
52 @lilypond[verbatim,quote,ragged-right,fragment]
57 There are two different ways to enter these note names with regard
58 to octave placement: absolute and relative. The relative mode
59 will in most cases be the most convenient, but the absolute mode
60 is more fundamental and will be presented first.
63 @cindex absolute octave specification
65 In absolute mode, every note is placed explicitly in a specific
66 octave. The note names @code{c} to @code{b} are engraved in the
67 octave below middle C, as in the previous example.
69 @lilypond[verbatim,quote,ragged-right,fragment]
79 If a note should be in another octave than this, an octave
80 specification must be given. It takes the form of a series of
81 single quote@tie{}(@code{'}) or comma@tie{}(@code{,}) characters.
82 Each@tie{}@code{'} raises the pitch by one octave;
83 each@tie{}@code{,} lowers the pitch by an octave.
85 @lilypond[verbatim,quote,ragged-right,fragment]
87 c' c'' e' g d'' d' d c
89 c, c,, e, g d,, d, d c
94 Snippets: @lsrdir{pitches}.
96 Internals reference: @internalsref{LedgerLineSpanner},
97 @internalsref{NoteHead}.
100 @node Relative octave entry
101 @unnumberedsubsubsec Relative octave entry
104 @cindex relative octave specification
107 The absolute mode requires a lot of octave specifications, which
108 not only becomes tedious but also easily leads to errors.
109 Therefore, it is usually more convenient to let notes be entered
110 relative to the previous note. This is done with the relative
114 \relative @var{startpitch} @var{musicexpr}
117 In relative mode, each note is assumed to be as close to the
118 previous note as possible. This means that the octave of notes
119 that appear in @var{musicexpr} are calculated as follows:
123 The pitch of the first note is relative to @code{\relative
127 If no octave changing marks are used, the basic interval between a
128 note and the one that precedes it is always taken to be a fourth
132 This distance is determined without regarding alterations or the
133 actual sounding pitches; a @code{fisis} following a @code{ceses}
134 will be put above the @code{ceses}. In other words, a
135 doubly-augmented fourth is considered a smaller interval than a
136 diminished fifth, even though the doubly-augmented fourth spans
137 seven semitones while the diminished fifth only spans six
141 The octave changing marks@tie{}@code{'} and@tie{}@code{,} can be
142 added to raise or lower the pitch by an extra octave from the
146 Multiple octave changing marks can be used. @code{''}@tie{}will
147 raise the pitch by two octaves.
151 Here is the relative mode shown in action:
153 @lilypond[verbatim,quote,ragged-right,fragment]
159 Octave changing marks are used for intervals greater than a
162 @lilypond[verbatim,quote,ragged-right,fragment]
168 A note sequence without a single octave mark can nevertheless span
171 @lilypond[verbatim,quote,ragged-right,fragment]
177 If the preceding item is a chord, the first note of the chord is
178 used as the reference point for the octave placement of a
179 following note or chord:
181 @lilypond[verbatim,quote,ragged-right,fragment]
189 The @var{startpitch} (after @code{\relative}) is a note name in
190 absolute mode. In principle it can be any note name, but common
191 practice is to use@tie{}@code{c} in various octave positions.
193 When octaves are specified as above by adding@tie{}@code{'}
194 and@tie{}@code{,} to pitch names, it is easy to accidentally put a
195 pitch in the wrong octave. The relative octave mode prevents
196 these errors since most of the time it is not necessary to
197 indicate any octaves at all. Furthermore, in absolute mode, a
198 single mistake may be difficult to spot; in relative mode, a
199 single error puts the rest of the piece off by one octave.
201 LilyPond examines pitches based on the note names -- in other
202 words, an augmented fourth is @emph{not} treated the same as a
203 diminished fifth. If we begin at a C, then an F-sharp will be
204 placed higher than the C, while a G-flat will be placed lower than
207 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
214 Snippets: @lsrdir{pitches}.
219 The relative conversion will not affect @code{\transpose},
220 @code{\chordmode} or @code{\relative} sections in its argument.
221 To use relative within transposed music, an additional
222 @code{\relative} must be placed inside @code{\transpose}.
225 If no @var{startpitch} is specified for @code{\relative},
226 then@tie{}@code{c'} is assumed. However, this is a deprecated
227 option and may disappear in future versions, so its use is
233 @unnumberedsubsubsec Accidentals
235 @warning{New users are sometimes confused about accidentals and
236 key signatures. In LilyPond, note names are the raw input; key
237 signatures and clefs determine how this raw input is displayed.
238 An unaltered note like@tie{}@code{c} means @q{C natural},
239 regardless of the key signature or clef. For more information,
240 see @rlearning{Accidentals and key signatures}.}
242 @cindex note names, Dutch
243 @cindex note names, default
245 A @notation{sharp} pitch is made by adding @code{is} to the name,
246 and a @notation{flat} pitch by adding @code{es}. As you might
247 expect, a @notation{double sharp} or @notation{double flat} is
248 made by adding @code{isis} or @code{eses}. This syntax derived
249 from note naming conventions in Nordic and Germanic languages,
250 like German and Dutch. To use other names for accidentals, see
251 @ref{Note names in other languages}.
253 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
259 These are the Dutch note names. In Dutch, @code{aes} is
260 contracted to @code{as}, but both forms are accepted. Similarly,
261 both @code{es} and @code{ees} are accepted:
263 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
267 A natural will cancel the effect of an accidental or key
268 signature. However, naturals are not encoded into the note name
269 syntax with a suffix; a natural pitch is shown as a simple note
272 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
277 @cindex accidental, reminder
278 @cindex accidental, cautionary
279 @cindex accidental, parenthesized
280 @cindex reminder accidental
282 @cindex cautionary accidental
283 @cindex parenthesized accidental
286 Normally accidentals are printed automatically, but you may also
287 print them manually. A reminder accidental can be forced by
288 adding an exclamation mark@tie{}@code{!} after the pitch. A
289 cautionary accidental (i.e., an accidental within parentheses) can
290 be obtained by adding the question mark@tie{}@code{?} after the
291 pitch. These extra accidentals can be used to produce natural
294 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
295 cis cis cis! cis? c c? c! c
299 @cindex quarter tones
300 @cindex semi-flats, semi-sharps
302 Half-flats and half-sharps are formed by adding @code{eh} and
303 @code{ih}; the following is a series of Cs with increasing
306 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
307 \set Staff.extraNatural = ##f
311 Micro tones are also exported to the MIDI file.
316 Snippets: @lsrdir{pitches},
317 @lsr{pitches,preventing-extra-naturals-from-being-automatically-added.ly}.
321 Music Glossary: @rglos{sharp}, @rglos{flat}, @rglos{double sharp},
324 Learning Manual: @rlearning{Accidentals and key signatures}.
326 Notation Reference: @ref{Automatic accidentals},
327 @ref{Musica ficta accidentals},
328 @ref{Note names in other languages}.
334 There are no generally accepted standards for denoting
335 three-quarter flats, so LilyPond's symbol does not conform to any
340 @node Note names in other languages
341 @unnumberedsubsubsec Note names in other languages
343 There are predefined sets of note names for various other
344 languages. To use them, include the language specific init file.
345 For example, add @code{\include "english.ly"} to the top of the
346 input file. The available language files and the note names they
349 @cindex note names, other languages
352 @multitable @columnfractions .2 .6 .05 .05 .05 .05
355 @tab sharp @tab flat @tab double sharp @tab double flat
357 @tab c d e f g a bes b
358 @tab -is @tab -es @tab -isis @tab -eses
360 @tab c d e f g a bf b
361 @tab -s/-sharp @tab -f/-flat @tab -ss/-x/-sharpsharp
365 @tab -is @tab -es @tab -isis @tab -eses
368 @tab -iss/-is @tab -ess/-es @tab -ississ/-isis
372 @tab -iss @tab -ess @tab -ississ @tab -essess
375 @tab -is @tab -es @tab -isis @tab -eses
377 @tab do re mi fa sol la sib si
378 @tab -d @tab -b @tab -dd @tab -bb
380 @tab do re mi fa sol la sib si
381 @tab -d/-s @tab -b @tab -dd/-ss @tab -bb
383 @tab do re mi fa sol la sib si
384 @tab -s @tab -b @tab -ss @tab -bb
386 @tab do re mi fa sol la sib si
387 @tab -s @tab -b @tab -ss @tab -bb
389 @tab do re mi fa sol la sib si
390 @tab -k @tab -b @tab -kk @tab -bb
395 Note that in Dutch, German, Norwegian, and Swedish, the flat
396 alterations of@tie{}@code{a} like for example @code{aes} and
397 @code{aeses} are usually contracted to @code{as} and @code{ases}
398 (or more commonly @code{asas}). Sometimes only these contracted
399 names are defined in the corresponding language files (this also
400 applies to the suffixes for quartertones below).
403 Some music uses microtones whose alterations are fractions of a
404 @q{normal} sharp or flat. The note names for quartertones defined
405 in the various language files are listed in the following table.
406 Here the prefixes @q{semi-} and @q{sesqui-} mean @q{half} and
407 @q{one and a half}, respectively. For the other languages no
408 special names have been defined yet.
411 @c What about Turkish Maquam music and similar microtonal systems?
413 @c Note that the term "three-quarter-sharp/-flat" used in
414 @c lilypond's source code is actually misleading since the
415 @c alteration is in fact one and a half of a regular sharp/flat.
416 @c Whence the naming "sesqui-sharp/-flat" used below.
419 @multitable @columnfractions .2 .6 .05 .05 .05 .05
422 @tab semi- @tab semi- @tab sesqui- @tab sesqui-
425 @tab c d e f g a bes b
426 @tab -ih @tab -eh @tab -isih @tab -eseh
428 @tab c d e f g a bf b
429 @tab -qs @tab -qf @tab -tqs @tab -tqf
432 @tab -ih @tab -eh @tab -isih @tab -eseh
434 @c @tab c d e f g a b h
436 @c @tab c d e f g a b h
438 @tab do re mi fa sol la sib si
439 @tab -sd @tab -sb @tab -dsd @tab -bsb
441 @c @tab do re mi fa sol la sib si
443 @c @tab do re mi fa sol la sib si
445 @tab do re mi fa sol la sib si
446 @tab -sqt @tab -bqt @tab -stqt @tab -btqt
452 Snippets: @lsrdir{pitches}.
455 @node Changing multiple pitches
456 @subsection Changing multiple pitches
458 This section discusses how to modify pitches.
466 @unnumberedsubsubsec Octave check
470 In relative mode, it is easy to forget an octave changing mark.
471 Octave checks make such errors easier to correct. A note may be
472 followed by @code{=}@var{quotes} to indicate what its absolute
473 octave should be. In the following example,
476 \relative c'' @{ c g d='' @}
480 the@tie{}@code{d} will generate a warning, because
481 a@tie{}@code{d''} is expected, as indicated by the octave check
482 @code{=''}, but a @code{d'} is found, since both @code{c}-@code{g}
483 and @code{g}-@code{d} without octavation marks are descending
484 fourths. In the output, the octave is corrected to be
485 a@tie{}@code{d''} and the next note is calculated relative
486 to@tie{}@code{d''} instead of@tie{}@code{d'}.
488 There is also an octave check that produces no visible output.
492 @var{pitch} \octave @var{controlpitch}
496 where @var{pitch} is a regular note within a music expression in
497 relative mode and @var{controlpitch} is a pitch in absolute mode.
498 This checks that @var{pitch} lies within the octave surrounding
499 @var{controlpitch}, i.e. not more than a fourth above or below it.
500 If this is not the case, a warning is printed and the octave is
501 corrected. The @var{controlpitch} is not printed as a note.
503 In the example below, the first check passes without incident,
504 since the@tie{}@code{e} (in @code{relative} mode) is within the
505 octave range of@tie{}@code{a'}. However, the second check
506 produces a warning, since the@tie{}@code{e} is not within the
507 octave range of@tie{}@code{b'}. The warning message is printed,
508 and the octave is adjusted so that the following notes are in the
509 correct octave once again.
520 The octave of a note following an @code{\octave} check is
521 determined with respect to the note preceding it, as modified by
522 the outcome of the octave check. In the next fragment, the first
523 note, an@tie{}@code{e'}, lies within the octave of@tie{}@code{b},
524 and the @code{\octave} check passes successfully. The second note
525 is then calculated relative to (absolute)@tie{}@code{e'}, which
526 yields an@tie{}@code{a'}, above middle@tie{}C. In this case, the
527 check had no influence on the output of the piece.
529 The second @code{\octave} check fails: @code{a'}@tie{}is not
530 within the range of@tie{}@code{b}. A warning is issued, and the
531 last note is calculated relative to@tie{}@code{a}, not
532 to@tie{}@code{a'}, and we get a@tie{}@code{d'}. Without the last
533 @code{\octave} check, the last note would have been
536 @lilypond[verbatim,quote,ragged-right,fragment]
548 Snippets: @lsrdir{pitches}.
552 @unnumberedsubsubsec Transpose
555 @cindex transposition of pitches
558 A music expression can be transposed with @code{\transpose}. The
562 \transpose @var{from} @var{to} @var{musicexpr}
565 This means that @var{musicexpr} is transposed by the interval
566 between the pitches @var{from} and @var{to}: any note with pitch
567 @var{from} is changed to @var{to} and any other note is transposed
568 by the same interval.
570 Consider a piece written in the key of D-major. If this piece is
571 a little too low for its performer, it can be transposed up to
575 \transpose d e @dots{}
578 Consider a part written for violin (a C instrument). If this part
579 is to be played on the A clarinet (for which an A is notated as a
580 C, and thus sounds a minor third lower than notated), the
581 following transposition will produce the appropriate part:
584 \transpose a c @dots{}
587 @code{\transpose} will also transpose key signatures:
589 @lilypond[verbatim,quote,ragged-right]
590 mus = { \key d \major cis d fis g }
599 @code{\transpose} distinguishes between enharmonic pitches: both
600 @code{\transpose c cis} or @code{\transpose c des} will transpose
601 up half a tone. The first version will print sharps and the notes
602 will remain on the same scale step, the second version will print
603 flats on the scale step above.
605 @lilypond[verbatim,quote,ragged-right]
608 \transpose c cis { \relative c' \mus }
609 \transpose c des { \relative c' \mus }
613 @code{\transpose} may also be used to input written notes for a
614 transposing instrument. The previous examples show how to enter
615 pitches in C (or @notation{concert pitch}) and typeset them for a
616 transposing instrument, but the opposite is also possible if you
617 for example have a set of instrumental parts and want to print a
618 conductor's score. For example, when entering music for a B-flat
619 trumpet which begins on a notated E (concert D), one would write:
622 musicInBflat = @{ e4 @dots{} @}
623 \transpose c bes \musicInBflat
626 To print this music in F (e.g., rearranging to a french horn) you
627 would wrap the existing music with another @code{\transpose}
630 musicInBflat = @{ e4 @dots{} @}
631 \transpose f c @{ \transpose c bes \musicInBflat @}
636 Snippets: @lsrdir{pitches}, @lsr{scheme,
637 transpose-pitches-with-minimum-accidentals.ly}.
639 Internals reference: @internalsref{TransposedMusic}.
643 If you want to use both @code{\transpose} and @code{\relative},
644 you must put @code{\transpose} outside of @code{\relative}, since
645 @code{\relative} will have no effect on music that appears inside
646 a @code{\transpose}. See the previous example.
649 @node Displaying pitches
650 @subsection Displaying pitches
652 This section discusses how to alter the output of pitches.
658 * Instrument transpositions::
659 * Automatic accidentals::
664 @unnumberedsubsubsec Clef
678 @cindex mezzosoprano clef
679 @cindex baritone clef
680 @cindex varbaritone clef
683 The clef is set with the @code{\clef} @var{clefname}
686 @lilypond[verbatim,quote,ragged-right,fragment]
689 % treble clef by default
703 The clef can also be changed inside the staff:
705 @lilypond[verbatim,quote,ragged-right,fragment]
723 These same clef symbols are used in different positions on the
724 staff to change the range of notes shown by that staff. The
725 treble (alto, bass) clef is always positioned to show the line on
726 which a@tie{}@code{g'} (@code{c'}, @code{f}) note is printed.
728 Supported clefs include
730 @multitable @columnfractions .4 .6
731 @headitem Clef @tab Position
732 @item @code{treble, violin, G, G2} @tab
733 G clef (g') on 2nd line
734 @item @code{alto, C} @tab
735 C clef (c') on 3rd line
736 @item @code{tenor} @tab
737 C clef (c') on 4th line
738 @item @code{bass, F} @tab
739 F clef (f) on 4th line
740 @item @code{french} @tab
741 G clef (g') on 1st line, so-called French violin clef
742 @item @code{soprano} @tab
743 C clef (c') on 1st line
744 @item @code{mezzosoprano} @tab
745 C clef (c') on 2nd line
746 @item @code{baritone} @tab
747 C clef (c') on 5th line
748 @item @code{varbaritone} @tab
749 F clef (f) on 3rd line
750 @item @code{subbass} @tab
751 F clef (f) on 5th line
752 @item @code{percussion} @tab
754 @item @code{tab} @tab
758 Further supported clefs are described under @ref{Ancient clefs}.
760 By adding @code{_8} or @code{^8} to the clef name, the clef is
761 transposed one octave down or up, respectively, and @code{_15} and
762 @code{^15} transposes by two octaves. The argument @var{clefname}
763 must be enclosed in quotes when it contains underscores or digits.
766 @cindex choral tenor clef
768 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
774 When a clef change takes place at a line break the new clef symbol
775 is printed at both the end of the previous line and the beginning
776 of the new line by default. If the warning clef at the end of the
777 previous line in not required it can be suppressed by setting the
778 @code{explicitClefVisibility} Staff property to the value
779 @var{end-of-line-invisible}: @code{\set
780 Staff.explicitClefVisibility = #end-of-line-invisible} The default
781 behaviour can be recovered with @code{\unset
782 Staff.explicitClefVisibility}
784 The command @code{\clef "treble_8"} is equivalent to setting
785 @code{clefGlyph}, @code{clefPosition} (which controls the Y
786 position of the clef), @code{middleCPosition} and
787 @code{clefOctavation}. A clef is printed when either the
788 @code{clefGlyph}, @code{clefPosition} or @code{clefOctavation}
789 properties are changed. Note that changing the glyph, the
790 position of the clef, or the octavation, does not in itself change
791 the position of subsequent notes on the staff: the position of
792 middle C must also be specified to do this. The positional
793 parameters are relative to the staff centre line, positive numbers
794 displacing upwards, counting 1 for each line and space. The
795 clefOctavation value would normally be set to 7, -7, 15 or -15,
796 but other values are not invalid.
798 The following examples show the possibilities when setting these
799 properties manually. First some manual changes which preserve the
800 standard relative positioning of clefs and notes:
802 @lilypond[verbatim,quote,ragged-right]
804 % The default treble clef
806 % The standard bass clef
807 \set Staff.clefGlyph = #"clefs.F"
808 \set Staff.clefPosition = #2
809 \set Staff.middleCPosition = #6
812 \set Staff.clefGlyph = #"clefs.C"
813 \set Staff.clefPosition = #4
814 \set Staff.middleCPosition = #4
816 % The standard choral tenor clef
817 \set Staff.clefGlyph = #"clefs.G"
818 \set Staff.clefPosition = #-2
819 \set Staff.clefOctavation = #-7
820 \set Staff.middleCPosition = #1
822 % A non-standard clef
823 \set Staff.clefPosition = #0
824 \set Staff.clefOctavation = #0
825 \set Staff.middleCPosition = #-4
830 and some which do not:
832 @lilypond[verbatim,quote,ragged-right]
834 \set Staff.clefGlyph = #"clefs.F"
835 \set Staff.clefPosition = #2
837 \set Staff.clefGlyph = #"clefs.G"
839 \set Staff.clefGlyph = #"clefs.C"
841 \set Staff.clefOctavation = #7
843 \set Staff.clefOctavation = #0
844 \set Staff.clefPosition = #0
846 \set Staff.middleCPosition = #4
853 Notation Reference: @ref{Ancient clefs}.
855 Snippets: @lsrdir{pitches}.
857 Internals reference: @internalsref{Clef}.
861 @unnumberedsubsubsec Key signature
863 @cindex key signature
866 @warning{New users are sometimes confused about accidentals and
867 key signatures. In LilyPond, note names are the raw input; key
868 signatures and clefs determine how this raw input is displayed.
869 An unaltered note like@tie{}@code{c} means @q{C natural},
870 regardless of the key signature or clef. For more information,
871 see @rlearning{Accidentals and key signatures}.}
873 The key signature indicates the tonality in which a piece is
874 played. It is denoted by a set of alterations (flats or sharps)
875 at the start of the staff.
877 Setting or changing the key signature is done with the @code{\key}
881 \key @var{pitch} @var{type}
890 @funindex \mixolydian
896 Here, @var{type} should be @code{\major} or @code{\minor} to get
897 @var{pitch}-major or @var{pitch}-minor, respectively. You may
898 also use the standard mode names (also called @q{church modes}):
899 @code{\ionian}, @code{\locrian}, @code{\aeolian},
900 @code{\mixolydian}, @code{\lydian}, @code{\phrygian}, and
903 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
912 Snippets: @lsrdir{pitches}, @lsr{pitches,
913 preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly},
914 @lsr{pitches, non-traditional-key-signatures.ly}
918 Music Glossary: @rglos{church mode}, @rglos{scordatura}.
920 Learning Manual: @rlearning{Accidentals and key signatures}.
922 Internals reference: @internalsref{KeyCancellation},
923 @internalsref{KeySignature}, @internalsref{Key_engraver}.
926 @node Ottava brackets
927 @unnumberedsubsubsec Ottava brackets
935 @notation{Ottava brackets} introduce an extra transposition of an
936 octave for the staff:
938 @lilypond[verbatim,quote,ragged-right,fragment]
948 The @code{set-octavation} function also takes -1 (for 8va bassa),
949 2@tie{}(for 15ma), and -2 (for 15ma bassa) as arguments.
950 Internally the function sets the properties @code{ottavation}
951 (e.g., to @code{"8va"} or @code{"8vb"}) and
952 @code{middleCPosition}. To override the text of the bracket, set
953 @code{ottavation} after invoking @code{set-octavation}, i.e.,
955 @lilypond[verbatim,quote,ragged-right]
958 \set Staff.ottavation = #"8"
966 Music Glossary: @c FIXME add link once it's in the glossary @c @rgloss{ottava}.
968 Snippets: @lsrdir{pitches}.
970 Internals reference: @internalsref{OttavaBracket}.
975 @code{set-octavation} will get confused when clef changes happen
976 during an octavation bracket.
979 @node Instrument transpositions
980 @unnumberedsubsubsec Instrument transpositions
982 @cindex transposition, MIDI
983 @cindex transposition, instrument
985 The key of a @notation{transposing instrument} can be specified.
986 This applies to many wind instruments, for example, clarinets
987 (B-flat, A, and E-flat), horn (F) and trumpet (B-flat, C, D, and
990 The transposition is entered with the command
993 \transposition @var{pitch}
997 where @var{pitch} specifies the key in which the instrument plays.
998 For example, a part for B-flat clarinet would include
1004 This command sets the property @code{instrumentTransposition}.
1005 The value of this property is used for MIDI output and quotations.
1006 MIDI output is transposed to play at concert pitch, and cue notes
1007 and quotations are automatically transposed to the key of the
1008 instrument in which they are quoted. For more information about
1009 quotations, see @ref{Quoting other voices}.
1011 The pitch to use for @code{\transposition} should correspond to
1012 the real sound heard when a@tie{}@code{c'} written on the staff is
1013 played by the transposing instrument. @code{\transposition}
1014 should be used when the music is entered from an orchestral part
1015 written for the instrument. For example, in classical horn parts,
1016 the tuning of the instrument is often changed during a piece.
1017 Here are a few notes for a violin and a B-flat clarinet where the
1018 parts have been entered using the notes and key as they appear in
1019 each part or the conductor's score:
1021 @lilypond[verbatim,quote,ragged-right]
1023 \new Staff = "Violin I" {
1024 \set Staff.instrumentName = "Vln"
1025 \set Staff.midiInstrument="violin"
1028 g'4( c''8) r c'' r c''4
1030 \new Staff = "Clarinet" {
1031 \set Staff.instrumentName = "Cl"
1032 \set Staff.midiInstrument="clarinet"
1035 a'4( d''8) r d'' r d''4
1040 Without the @code{\transposition} command the MIDI output of this
1041 music would play the notes a tone apart; with it the notes are
1042 played correctly in unison.
1044 However, when entering the notes of a score in concert pitch, when
1045 all voices are entered in C, they may be prefaced by (the default)
1046 @code{\transposition c'}:
1060 to serve as a reminder that these parts are written in C.
1065 Music Glossary: @c FIXME add link once it's in the glossary @c @rgloss{instrument transposition}.
1067 Notation Reference: @ref{Quoting other voices}, @ref{Transpose}.
1069 Snippets: @lsrdir{pitches}.
1072 @node Automatic accidentals
1073 @unnumberedsubsubsec Automatic accidentals
1074 @cindex automatic accidentals
1076 Common rules for typesetting accidentals have been placed in a
1077 function. This function is called as follows
1079 @funindex set-accidental-style
1083 #(set-accidental-style 'voice)
1088 @c TODO: check the context stuff below
1089 @c -does it *really* work?
1090 @c -the default contexts as specified in
1091 @c scm/music-function.scm seem to be different -vv
1093 If no context name is supplied, the accidental style applies to
1094 the @code{Staff} by default. Optionally, the function can take
1095 the context for which the style should be changed as a second
1099 #(set-accidental-style 'STYLE #('CONTEXT))
1102 The following accidental styles are supported. To demonstrate
1103 each style, we use the following example:
1105 @lilypond[verbatim,quote,ragged-right]
1109 cis'8 fis, d'4 <a cis>8 f bis4 |
1123 \voiceTwo \relative c' {
1127 \change Staff = down
1131 \change Staff = down
1132 <fis, a cis>4 gis <f a d>2 |
1139 \context Staff = "up" {
1140 %%% change the next line as desired:
1141 %#(set-accidental-style 'default)
1144 \context Staff = "down" {
1145 %%% change the next line as desired:
1146 %#(set-accidental-style 'default)
1153 @c don't use verbatim in this table.
1156 This is the default typesetting behavior. It corresponds to
1157 eighteenth-century common practice: Accidentals are remembered to
1158 the end of the measure in which they occur and only on their own
1159 octave. Thus, in the example below, no natural signs are printed
1160 before the@tie{}@code{b} in the second measure or the
1163 @lilypond[quote,ragged-right]
1167 cis'8 fis, d'4 <a cis>8 f bis4 |
1181 \voiceTwo \relative c' {
1185 \change Staff = down
1189 \change Staff = down
1190 <fis, a cis>4 gis <f a d>2 |
1197 \context Staff = "up" {
1198 %#(set-accidental-style 'default)
1201 \context Staff = "down" {
1202 %#(set-accidental-style 'default)
1210 The normal behavior is to remember the accidentals on
1211 Staff-level. This variable, however, typesets accidentals
1212 individually for each voice. Apart from that, the rule is similar
1215 As a result, accidentals from one voice do not get canceled in
1216 other voices, which is often an unwanted result: in the following
1217 example, it is hard to determine whether the second@tie{}@code{a}
1218 should be played natural or sharp. The @code{voice} option should
1219 therefore be used only if the voices are to be read solely by
1220 individual musicians. If the staff is to be used by one musician
1221 (e.g., a conductor or in a piano score) then @code{modern} or
1222 @code{modern-cautionary} should be used instead.
1225 @lilypond[quote,ragged-right]
1229 cis'8 fis, d'4 <a cis>8 f bis4 |
1243 \voiceTwo \relative c' {
1247 \change Staff = down
1251 \change Staff = down
1252 <fis, a cis>4 gis <f a d>2 |
1259 \context Staff = "up" {
1260 #(set-accidental-style 'voice)
1263 \context Staff = "down" {
1264 #(set-accidental-style 'voice)
1272 @funindex modern style accidentals
1274 This rule corresponds to the common practice in the twentieth
1275 century. It prints the same accidentals as @code{default}, with
1276 two exceptions which serve to avoid ambiguity: after temporary
1277 accidentals, cancellation marks are printed also in the following
1278 measure (for notes in the same octave) and, in the same measure,
1279 for notes in other octaves. Hence the naturals before
1280 the@tie{}@code{b} and the@tie{}@code{c} in the second measure of
1283 @lilypond[quote,ragged-right]
1287 cis'8 fis, d'4 <a cis>8 f bis4 |
1301 \voiceTwo \relative c' {
1305 \change Staff = down
1309 \change Staff = down
1310 <fis, a cis>4 gis <f a d>2 |
1317 \context Staff = "up" {
1318 #(set-accidental-style 'modern)
1321 \context Staff = "down" {
1322 #(set-accidental-style 'modern)
1329 @item modern-cautionary
1330 @funindex modern-cautionary
1332 This rule is similar to @code{modern}, but the @q{extra}
1333 accidentals (the ones not typeset by @code{default}) are typeset
1334 as cautionary accidentals. They are by default printed with
1335 parentheses, but they can also be printed in reduced size by
1336 defining the @code{cautionary-style} property of
1337 @code{AccidentalSuggestion}.
1340 @lilypond[quote,ragged-right]
1344 cis'8 fis, d'4 <a cis>8 f bis4 |
1358 \voiceTwo \relative c' {
1362 \change Staff = down
1366 \change Staff = down
1367 <fis, a cis>4 gis <f a d>2 |
1374 \context Staff = "up" {
1375 #(set-accidental-style 'modern-cautionary)
1378 \context Staff = "down" {
1379 #(set-accidental-style 'modern-cautionary)
1387 @funindex modern-voice
1389 This rule is used for multivoice accidentals to be read both by
1390 musicians playing one voice and musicians playing all voices.
1391 Accidentals are typeset for each voice, but they @emph{are}
1392 canceled across voices in the same @internalsref{Staff}. Hence,
1393 the@tie{}@code{a} in the last measure is canceled because the
1394 previous cancellation was in a different voice, and
1395 the@tie{}@code{d} in the lower staff is canceled because of the
1396 accidental in a different voice in the previous measure:
1399 @lilypond[quote,ragged-right]
1403 cis'8 fis, d'4 <a cis>8 f bis4 |
1417 \voiceTwo \relative c' {
1421 \change Staff = down
1425 \change Staff = down
1426 <fis, a cis>4 gis <f a d>2 |
1433 \context Staff = "up" {
1434 #(set-accidental-style 'modern-voice)
1437 \context Staff = "down" {
1438 #(set-accidental-style 'modern-voice)
1445 @funindex modern-voice-cautionary
1446 @item modern-voice-cautionary
1448 This rule is the same as @code{modern-voice}, but with the extra
1449 accidentals (the ones not typeset by @code{voice}) typeset
1450 as cautionaries. Even though all accidentals typeset by
1451 @code{default} @emph{are} typeset by this variable,
1452 some of them are typeset as cautionaries.
1454 @lilypond[quote,ragged-right]
1458 cis'8 fis, d'4 <a cis>8 f bis4 |
1472 \voiceTwo \relative c' {
1476 \change Staff = down
1480 \change Staff = down
1481 <fis, a cis>4 gis <f a d>2 |
1488 \context Staff = "up" {
1489 #(set-accidental-style 'modern-voice-cautionary)
1492 \context Staff = "down" {
1493 #(set-accidental-style 'modern-voice-cautionary)
1501 @funindex piano accidentals
1503 This rule reflects twentieth-century practice for piano notation.
1504 Its behavior is very similar to @code{modern} style, but here
1505 accidentals also get canceled across the staves in the same
1506 GrandStaff or PianoStaff, hence all the cancellations of the final
1509 This accidental style takes place in a GrandStaff context.
1510 However, you have to explicitly set it for @emph{each} individual
1511 Staff of the GrandStaff:
1515 \new GrandStaff @{ <<
1516 \new Staff = "up" @{ <<
1517 #(set-accidental-style 'piano)
1520 \new Staff = "down" @{ <<
1521 #(set-accidental-style 'piano)
1527 @lilypond[quote,ragged-right]
1531 cis'8 fis, d'4 <a cis>8 f bis4 |
1545 \voiceTwo \relative c' {
1549 \change Staff = down
1553 \change Staff = down
1554 <fis, a cis>4 gis <f a d>2 |
1561 \context Staff = "up" {
1562 #(set-accidental-style 'piano)
1565 \context Staff = "down" {
1566 #(set-accidental-style 'piano)
1573 @item piano-cautionary
1574 @funindex #(set-accidental-style 'piano-cautionary)
1576 Same as @code{#(set-accidental-style 'piano)} but with the extra
1577 accidentals typeset as cautionaries.
1579 @lilypond[quote,ragged-right]
1583 cis'8 fis, d'4 <a cis>8 f bis4 |
1597 \voiceTwo \relative c' {
1601 \change Staff = down
1605 \change Staff = down
1606 <fis, a cis>4 gis <f a d>2 |
1613 \context Staff = "up" {
1614 #(set-accidental-style 'piano-cautionary)
1617 \context Staff = "down" {
1618 #(set-accidental-style 'piano-cautionary)
1626 @funindex no-reset accidental style
1628 This is the same as @code{default} but with accidentals lasting
1629 @q{forever} and not only within the same measure:
1631 @lilypond[quote,ragged-right]
1635 cis'8 fis, d'4 <a cis>8 f bis4 |
1649 \voiceTwo \relative c' {
1653 \change Staff = down
1657 \change Staff = down
1658 <fis, a cis>4 gis <f a d>2 |
1665 \context Staff = "up" {
1666 #(set-accidental-style 'no-reset)
1669 \context Staff = "down" {
1670 #(set-accidental-style 'no-reset)
1678 @funindex forget accidental style
1680 This is the opposite of @code{no-reset}: Accidentals are not
1681 remembered at all -- and hence all accidentals are typeset
1682 relative to the key signature, regardless of what was before in
1685 @lilypond[quote,ragged-right]
1689 cis'8 fis, d'4 <a cis>8 f bis4 |
1703 \voiceTwo \relative c' {
1707 \change Staff = down
1711 \change Staff = down
1712 <fis, a cis>4 gis <f a d>2 |
1719 \context Staff = "up" {
1720 #(set-accidental-style 'forget)
1723 \context Staff = "down" {
1724 #(set-accidental-style 'forget)
1735 Snippets: @lsrdir{pitches}.
1737 Internals reference: @internalsref{Accidental_engraver},
1738 @internalsref{Accidental}, @internalsref{AccidentalSuggestion},
1739 @internalsref{AccidentalPlacement}, @internalsref{GrandStaff} and
1740 @internalsref{PianoStaff}, @internalsref{Staff}.
1745 Simultaneous notes are considered to be entered in sequential
1746 mode. This means that in a chord the accidentals are typeset as
1747 if the notes in the chord happen one at a time, in the order in
1748 which they appear in the input file. This is a problem when
1749 accidentals in a chord depend on each other, which does not happen
1750 for the default accidental style. The problem can be solved by
1751 manually inserting@tie{}@code{!} and@tie{}@code{?} for the
1756 @unnumberedsubsubsec Ambitus
1759 The term @notation{ambitus} or @notation{ambit} denotes a range of
1760 pitches for a given voice in a part of music. It may also denote
1761 the pitch range that a musical instrument is capable of playing.
1762 Ambits are printed on vocal parts, so performers can easily
1763 determine if it matches their capabilities.
1765 Ambits are denoted at the beginning of a piece near the initial
1766 clef. The range is graphically specified by two note heads that
1767 represent the minimum and maximum pitch. To print such ambits,
1768 add the @code{Ambitus_engraver} to the @code{Voice} context, for
1771 @lilypond[verbatim,quote,ragged-right]
1775 \consists Ambitus_engraver
1779 \relative \new Staff {
1784 If you have multiple voices in a single staff and you want a
1785 single ambitus per staff rather than per voice, add the
1786 @code{Ambitus_engraver} to the @code{Staff} context rather than to
1787 the @code{Voice} context:
1789 @lilypond[verbatim,quote,ragged-right]
1791 \consists "Ambitus_engraver"
1795 \remove "Ambitus_engraver"
1797 \override Ambitus #'X-offset = #-1.0
1802 \remove "Ambitus_engraver"
1811 This example uses one advanced feature,
1814 \override Ambitus #'X-offset = #-1.0
1818 This code moves the ambitus to the left. The same effect could
1819 have been achieved with @code{extra-offset}, but then the
1820 formatting system would not reserve space for the moved object.
1824 Snippets: @lsrdir{pitches}.
1825 @c FIXME: lsr stuff.
1826 @c @lsr{vocal,ambitus@/.ly}.
1828 Internals reference: @internalsref{Ambitus},
1829 @internalsref{AmbitusLine}, @internalsref{AmbitusNoteHead},
1830 @internalsref{AmbitusAccidental}, @internalsref{Ambitus_engraver},
1831 @internalsref{Staff} and @internalsref{Voice}.
1836 There is no collision handling in the case of multiple per-voice
1841 @subsection Note heads
1844 * Easy notation note heads::
1845 * Shape note heads::
1847 * Special noteheads::
1850 @node Easy notation note heads
1851 @unnumberedsubsubsec Easy notation note heads
1853 @cindex note heads, practice
1854 @cindex note heads, easy notation
1855 @cindex easy notation
1858 The @q{easy play} note head includes a note name inside the head.
1859 It is used in music for beginners
1861 @lilypond[verbatim,quote,ragged-right,fragment,staffsize=26]
1867 The command @code{\setEasyHeads} overrides settings for the
1868 @code{NoteHead} object. To make the letters readable, it
1869 has to be printed in a large font size. To print with a larger
1870 font, see @ref{Setting the staff size}.
1874 @funindex \setEasyHeads
1875 @code{\setEasyHeads}
1879 Notation Reference: @ref{Setting the staff size}.
1881 Snippets: @lsrdir{pitches},
1883 Internals reference: @internalsref{NoteHead}.
1886 @node Shape note heads
1887 @unnumberedsubsubsec Shape note heads
1889 @cindex note heads, shape
1891 In shape note head notation, the shape of the note head
1892 corresponds to the harmonic function of a note in the scale. This
1893 notation was popular in nineteenth-century American song books.
1895 Shape note heads can be produced by setting @code{\aikenHeads} or
1896 @code{\sacredHarpHeads}, depending on the style desired.
1898 @lilypond[verbatim,fragment,relative=1]
1905 Shapes are typeset according to the step in the scale, where
1906 the base of the scale is determined by the @code{\key} command.
1909 @funindex shapeNoteStyles
1910 @funindex \aikenHeads
1911 @funindex \sacredHarpHeads
1913 Shape note heads are implemented through the
1914 @code{shapeNoteStyles} property. Its value is a vector of
1915 symbols. The k-th element indicates the style to use for the k-th
1916 step of the scale. Arbitrary combinations are possible, e.g.:
1918 @lilypond[verbatim,fragment,relative=1]
1919 \set shapeNoteStyles =
1920 ##(cross triangle fa #f mensural xcircle diamond)
1926 Snippets: @lsrdir{pitches}.
1930 @unnumberedsubsubsec Improvisation
1932 Improvisation is sometimes denoted with slashed note heads. Such
1933 note heads can be created by adding a @code{Pitch_squash_engraver}
1934 to the @code{Voice} context. Then, the following command
1937 \set squashedPosition = #0
1938 \override NoteHead #'style = #'slash
1942 switches on the slashes.
1944 There are shortcuts @code{\improvisationOn} (and an accompanying
1945 @code{\improvisationOff}) for this command sequence. They are
1946 used in the following example:
1948 @lilypond[verbatim,quote,ragged-right]
1950 \consists Pitch_squash_engraver
1952 e8 e g a a16(bes)(a8) g
1964 Snippets: @lsrdir{pitches}.
1966 Internals reference: @internalsref{Pitch_squash_engraver} and
1967 @internalsref{Voice}.
1969 @node Special noteheads
1970 @unnumberedsubsubsec Special noteheads
1972 @cindex note heads, special
1974 Different noteheads are used by various instruments for various
1975 meanings -- crosses are used for @q{parlato} with vocalists,
1976 stopped notes on guitar; diamonds are used for harmonics on string
1977 instruments, etc. There is a shorthand (@code{\harmonic}) for
1978 diamond shapes; the other notehead styles are produced by tweaking
1981 @lilypond[verbatim,quote,ragged-right,fragment,relative=1]
1983 \override NoteHead #'style = #'cross
1985 \revert NoteHead #'style
1986 e d <c f\harmonic> <d a'\harmonic>
1990 To see all notehead styles, please see @ref{Note head styles}.
1995 Snippets: @lsrdir{pitches}.
1997 Notation Reference: @ref{Note head styles}.
1999 Internals reference: @internalsref{NoteHead}.