2 @c This file is part of lilypond.tely
4 @c A menu is needed before every deeper *section nesting of @node's; run
5 @c M-x texinfo-all-menus-update
6 @c to automatically fill in these menus before saving changes
9 @chapter Notation manual
11 This chapter describes all the different types of notation supported
12 by LilyPond. It is intended as a reference for users that are already
13 somewhat familiar with LilyPond.
17 * Easier music entry::
27 * Other instrument specific notation::
31 * Formatting cue notes::
33 * Contemporary notation::
38 @c FIXME: Note entry vs Music entry at top level menu is confusing.
44 This section is about basic notation elements notes, rests and
45 related constructs, such as stems, tuplets and ties.
50 * Chromatic alterations::
65 A note is printed by specifying its pitch and then its duration
66 @footnote{Notes constitute the most basic elements of LilyPond input,
67 but they do not form valid input on their own without a @code{\score}
68 block. However, for the sake of brevity and simplicity we will
69 generally omit @code{\score} blocks and @code{\paper} declarations in
72 @lilypond[quote,fragment,verbatim]
81 @cindex Note specification
83 @cindex entering notes
85 The most common syntax for pitch entry is used in standard notes and
86 @code{\chords} mode. In these modes, pitches may be designated by
87 names. The notes are specified by the letters @code{a} through
88 @code{g}, while the octave is formed with notes ranging from @code{c}
89 to @code{b}. The pitch @code{c} is an octave below middle C and the
90 letters span the octave above that C
92 @lilypond[quote,fragment,verbatim]
94 a,4 b, c d e f g a b c' d' e' \clef treble f' g' a' b' c''
97 @cindex note names, Dutch
99 A sharp is formed by adding @code{-is} to the end of a pitch name and
100 a flat is formed by adding @code{-es}. Double sharps and double flats
101 are obtained by adding @code{-isis} or @code{-eses}. These
102 names are the Dutch note names. In Dutch, @code{aes} is contracted to
103 @code{as}, but both forms are accepted. Similarly, both
104 @code{es} and @code{ees} are accepted.
106 Half-flats and half-sharps are formed by adding @code{-eh} and
107 @code{-ih}; the following is a series of Cs with increasing pitches
109 @cindex quarter tones
110 @cindex semi-flats, semi-sharps
112 @lilypond[fragment,quote,verbatim,relative=2]
124 There are predefined sets of note names for various other languages.
125 To use them, include the language specific init file. For
126 example: @code{\include "english.ly"}. The available language files
127 and the note names they define are
132 Note Names sharp flat
133 nederlands.ly c d e f g a bes b -is -es
134 english.ly c d e f g a bf b -s/-sharp -f/-flat
136 deutsch.ly c d e f g a b h -is -es
137 norsk.ly c d e f g a b h -iss/-is -ess/-es
138 svenska.ly c d e f g a b h -iss -ess
139 italiano.ly do re mi fa sol la sib si -d -b
140 catalan.ly do re mi fa sol la sib si -d/-s -b
141 espanol.ly do re mi fa sol la sib si -s -b
150 The optional octave specification takes the form of a series of
151 single quote (`@code{'}') characters or a series of comma
152 (`@code{,}') characters. Each @code{'} raises the pitch by one
153 octave; each @code{,} lowers the pitch by an octave
155 @lilypond[quote,fragment,verbatim]
156 c' c'' es' g' as' gisis' ais'
162 Notes can be hidden and unhidden with the following commands
164 @cindex @code{\hideNotes}
166 @cindex @code{\unHideNotes}
172 Program reference: @internalsref{NoteEvent}, and @internalsref{NoteHead}.
174 @node Chromatic alterations
175 @subsection Chromatic alterations
177 Normally accidentals are printed automatically, but you may also
178 print them manually. A reminder accidental
179 @cindex reminder accidental
181 can be forced by adding an exclamation mark @code{!}
182 after the pitch. A cautionary accidental
183 @cindex cautionary accidental
184 @cindex parenthesized accidental
185 (i.e. an accidental within parentheses) can be obtained by adding the
186 question mark `@code{?}' after the pitch
188 @lilypond[quote,fragment,verbatim]
189 cis' cis' cis'! cis'?
195 The automatic production of accidentals can be tuned in many
196 ways. For more information, refer to @ref{Accidentals}.
201 There are no generally accepted standards for denoting three quarter
202 flats, so LilyPond's symbol does not conform to any standard.
207 A chord is formed by a enclosing a set of pitches in @code{<} and
208 @code{>}. A chord may be followed by a duration, and a set of
209 articulations, just like simple notes.
211 @lilypond[fragment,quote,relative=1]
222 Rests are entered like notes, with the note name @code{r}
224 @lilypond[fragment,quote,raggedright,verbatim]
228 Whole bar rests, centered in middle of the bar,
229 must be done with multi-measure rests. They are discussed in
230 @ref{Multi measure rests}.
233 A rest's vertical position may be explicitly specified by entering a
234 note with the @code{\rest} keyword appended. This makes manual
235 formatting in polyphonic music easier. Rest collision testing will
236 leave these rests alone
240 @lilypond[fragment,quote,raggedright,verbatim]
246 Program reference: @internalsref{RestEvent}, and @internalsref{Rest}.
253 @cindex Invisible rest
256 An invisible rest (also called a `skip') can be entered like a note
257 with note name `@code{s}' or with @code{\skip @var{duration}}
259 @lilypond[fragment,quote,raggedright,verbatim,relative=2]
263 The @code{s} syntax is only available in note mode and chord mode. In
264 other situations, you should use the @code{\skip} command
266 @lilypond[quote,raggedright,verbatim]
268 { \time 4/8 \skip 2 \time 4/4 }
269 \relative c'' { a2 a1 }
273 The skip command is merely an empty musical placeholder. It does not
274 produce any output, not even transparent output.
276 The @code{s} skip command does create @internalsref{Staff} and
277 @internalsref{Voice} when necessary, similar to note and rest
278 commands. For example, the following results in an empty staff.
280 @lilypond[quote,raggedright,verbatim]
284 The same fragment using @code{\skip} results in an empty page.
288 Program reference: @internalsref{SkipEvent}, @internalsref{SkipMusic}.
293 @subsection Durations
297 @cindex @code{\longa}
298 @cindex @code{\breve}
299 @cindex @code{\maxima}
302 In Note, Chord, and Lyrics mode, durations are designated by numbers
303 and dots: durations are entered as their reciprocal values. For example,
304 a quarter note is entered using a @code{4} (since it is a 1/4 note), while
305 a half note is entered using a @code{2} (since it is a 1/2 note). For notes
306 longer than a whole you must use variables
310 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64
312 r1 r2 r4 r8 r16 r32 r64 r64
318 a\breve*1/2 \autoBeamOff
319 a1 a2 a4 a8 a16 a32 a64 a64
320 r\longa*1/4 r\breve *1/2
321 r1 r2 r4 r8 r16 r32 r64 r64
327 \remove "Clef_engraver"
328 \override StaffSymbol #'transparent = ##t
329 \override TimeSignature #'transparent = ##t
330 \override BarLine #'transparent = ##t
331 \consists "Pitch_squash_engraver"
338 If the duration is omitted then it is set to the previously entered
339 duration. The default for the first note is a quarter note. The duration
340 can be followed by dots (`@code{.}') in order to obtain dotted note
344 @lilypond[quote,fragment,verbatim]
345 a' b' c''8 b' a'4 a'4. b'4.. c'8.
350 You can alter the length of duration by a fraction @var{N/M}
351 appending `@code{*}@var{N/M}' (or `@code{*}@var{N}' if @var{M=1}). This
352 will not affect the appearance of the notes or rests produced.
354 In the following example, the first three notes take up exactly two
355 beats, but no triplet bracket is printed.
356 @lilypond[quote,fragment,relative=2,verbatim]
358 a4*2/3 gis4*2/3 a4*2/3
364 Dots are normally moved up to avoid staff lines, except in polyphonic
365 situations. The following commands may be used to force a particular
368 @cindex @code{\dotsUp}
370 @cindex @code{\dotsDown}
372 @cindex @code{\dotsBoth}
377 This manual: @ref{Tuplets}
379 Program reference: @internalsref{Dots}, and @internalsref{DotColumn}.
384 Whenever a note is found, a @internalsref{Stem} object is created
385 automatically. For whole notes and rests, they are also created but
390 @cindex @code{\stemUp}
392 @cindex @code{\stemDown}
394 @cindex @code{\stemBoth}
405 A tie connects two adjacent note heads of the same pitch. The tie in
406 effect extends the length of a note. Ties should not be confused with
407 slurs, which indicate articulation, or phrasing slurs, which indicate
408 musical phrasing. A tie is entered using the tilde symbol `@code{~}'
410 @lilypond[quote,fragment,verbatim]
411 e' ~ e' <c' e' g'> ~ <c' e' g'>
414 When a tie is applied to a chord, all note heads whose pitches match
415 are connected. When no note heads match, no ties will be created.
417 In its meaning a tie is just a way of extending a note duration, similar
418 to the augmentation dot; in the following example there are two ways of
419 notating exactly the same concept
421 @lilypond[quote,fragment,raggedright]
422 \time 3/4 c'2. c'2 ~ c'4
424 If you need to tie a lot of notes over bars, it may be easier to use automatic
425 note splitting (see @ref{Automatic note splitting}).
430 @cindex @code{\tieUp}
432 @cindex @code{\tieDown}
434 @cindex @code{\tieBoth}
436 @cindex @code{\tieDotted}
438 @cindex @code{\tieSolid}
443 In this manual: @ref{Automatic note splitting}.
445 Program reference: @internalsref{TieEvent}, @internalsref{Tie}.
447 For tying only a subset of the note heads of a pair of chords, see
448 @inputfileref{input/regression,tie-chord-partial.ly}.
453 Switching staves when a tie is active will not produce a slanted tie.
455 Formatting of ties is a difficult subject. The results are often not
465 @cindex @code{\times}
467 Tuplets are made out of a music expression by multiplying all durations
470 @cindex @code{\times}
472 \times @var{fraction} @var{musicexpr}
476 The duration of @var{musicexpr} will be multiplied by the fraction.
477 The fraction's denominator will be printed over the notes, optionally
478 with a bracket. The most common tuplet is the triplet in which 3
479 notes have the length of 2, so the notes are 2/3 of their written
482 @lilypond[quote,fragment,verbatim]
483 g'4 \times 2/3 {c'4 c' c'} d'4 d'4
486 The property @code{tupletSpannerDuration} specifies how long each
487 bracket should last. With this, you can make lots of tuplets while
488 typing @code{\times} only once, saving lots of typing. In the next
489 example, there are two triplets shown, while @code{\times} was only
492 @lilypond[quote,fragment,relative=1,raggedright,verbatim]
493 \set tupletSpannerDuration = #(ly:make-moment 1 4)
494 \times 2/3 { c'8 c c c c c }
497 The format of the number is determined by the property
498 @code{tupletNumberFormatFunction}. The default prints only the
499 denominator, but if it is set to the Scheme function
500 @code{fraction-tuplet-formatter}, @var{num}:@var{den} will be printed
504 @cindex @code{tupletNumberFormatFunction}
505 @cindex tuplet formatting
510 @cindex @code{\tupletUp}
512 @cindex @code{\tupletDown}
514 @cindex @code{\tupletBoth}
519 User manual: @ref{Changing context properties on the fly} for the
523 Program reference: @internalsref{TupletBracket}, and @internalsref{TimeScaledMusic}.
525 Examples: @inputfileref{input/regression,tuplet-nest.ly}.
529 Nested tuplets are not formatted automatically. In this case, outer
530 tuplet brackets should be moved manually, which is demonstrated in
531 @inputfileref{input/regression,tuplet-nest.ly}.
535 @node Easier music entry
536 @section Easier music entry
539 This section deals with tricks and features of the input language that
540 were added solely to help entering music, finding and correcting
541 mistakes. There are also external tools that make debugging easier.
542 See @ref{Point and click} for more information.
544 It is also possible to enter and edit music using other programs. For
545 example, GUI interfaces, or MIDI sequencers. Refer to the LilyPond
546 website for more information.
553 * Skipping corrected music::
554 * Automatic note splitting::
560 @node Relative octaves
561 @subsection Relative octaves
563 @cindex relative octave specification
565 Octaves are specified by adding @code{'} and @code{,} to pitch names.
566 When you copy existing music, it is easy to accidentally put a pitch
567 in the wrong octave and hard to find such an error. The relative
568 octave mode prevents these errors: a single error puts the rest of the
569 piece off by one octave
571 @cindex @code{\relative}
573 \relative @var{startpitch} @var{musicexpr}
576 The octave of notes that appear in @var{musicexpr} are calculated as
577 follows: If no octave changing marks are used, the basic interval
578 between this and the last note is always taken to be a fourth or
579 less. This distance is determined without regarding alterations; a
580 @code{fisis} following a @code{ceses} will be put above the
583 The octave changing marks @code{'} and @code{,} can be added to raise
584 or lower the pitch by an extra octave. Upon entering relative mode,
585 an absolute starting pitch must be specified that will act as the
586 predecessor of the first note of @var{musicexpr}.
588 Here is the relative mode shown in action
589 @lilypond[quote,fragment,raggedright,verbatim]
595 Octave changing marks are used for intervals greater than a fourth
596 @lilypond[quote,fragment,verbatim]
602 If the preceding item is a chord, the first note of the chord is used
603 to determine the first note of the next chord
605 @lilypond[quote,fragment,verbatim]
613 The pitch after the @code{\relative} contains a note name.
616 The relative conversion will not affect @code{\transpose},
617 @code{\chords} or @code{\relative} sections in its argument. If you
618 want to use relative within transposed music, you must place an
619 additional @code{\relative} inside the @code{\transpose}.
622 @subsection Octave check
625 Octave checks make octave errors easier to correct: a note may be
626 followed by @code{=}@var{quotes} which indicates what its absolute
627 octave should be. In the following example,
629 \relative c'' @{ c='' b=' d,='' @}
633 @c take care with @code, adds confusing quotes.
634 the d will generate a warning, because a d'' is expected, but a d' is
635 found. In the output, the octave is corrected for this and the
640 There is also a syntax that is separate from the notes. The syntax
646 This checks that @var{pitch} (without quotes) yields @var{pitch} (with
647 quotes) in \relative mode. If not, a warning is printed, and the
648 octave is corrected, for example, the first check is passed
649 successfully. The second check fails with an error message. The
650 octave is adjusted so the following notes are in the correct octave
661 The octave of a note following an octave check is determined with
662 respect to the note preceding it. In the next fragment, the last note
663 is a @code{a'}, above middle C. Hence, the @code{\octave} check may
664 be deleted without changing the meaning of the piece.
666 @lilypond[quote,verbatim,fragment]
675 @subsection Bar check
679 @cindex @code{barCheckSynchronize}
682 Bar checks help detect errors in the durations. A bar check is
683 entered using the bar symbol, `@code{|}'. Whenever it is encountered
684 during interpretation, it should fall on a measure boundary. If it
685 does not, a warning is printed. In the next example, the second bar
686 check will signal an error
688 \time 3/4 c2 e4 | g2 |
691 Bar checks can also be used in lyrics, for example
696 Twin -- kle | Twin -- kle
701 @cindex @code{skipTypesetting}
703 Failed bar checks are caused by entering incorrect
704 durations. Incorrect durations often completely garble up the score,
705 especially if it is polyphonic, so you should start correcting the
706 score by scanning for failed bar checks and incorrect durations. To
707 speed up this process, you can use @code{skipTypesetting}, described
710 It is also possible to redefine the meaning of @code{|}. This is done
711 by assigning a music expression to @code{pipeSymbol},
714 pipeSymbol = \bar "||"
716 { c'2 c'2 | c'2 c'2 | }
720 @node Skipping corrected music
721 @subsection Skipping corrected music
723 The property @code{Score.skipTypesetting} can be used to switch on and
724 off typesetting completely during the interpretation phase. When
725 typesetting is switched off, the music is processed much more quickly.
726 This can be used to skip over the parts of a score that have already
727 been checked for errors
729 @lilypond[quote,fragment,raggedright,verbatim]
732 \set Score.skipTypesetting = ##t
734 \set Score.skipTypesetting = ##f
738 @node Automatic note splitting
739 @subsection Automatic note splitting
741 Long notes can be converted automatically to tied notes. This is done
742 by replacing the @internalsref{Note_heads_engraver} by the
743 @internalsref{Completion_heads_engraver}.
744 In the following examples, notes crossing the bar line are split and tied.
747 @lilypond[quote,fragment,verbatim,relative=1,raggedright]
749 \remove "Note_heads_engraver"
750 \consists "Completion_heads_engraver"
752 c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2
756 This engraver splits all running notes at the bar line, and inserts
757 ties. One of its uses is to debug complex scores: if the measures are
758 not entirely filled, then the ties exactly show how much each measure
763 Not all durations (especially those containing tuplets) can be
764 represented exactly; the engraver will not insert tuplets.
768 Examples: @inputfileref{input/regression,completion-heads.ly}.
770 Program reference: @internalsref{Completion_heads_engraver}.
774 @section Staff notation
776 This section describes music notation that occurs on staff level,
777 such as keys, clefs and time signatures.
779 @cindex Staff notation
790 * Time administration::
791 * Controlling formatting of prefatory matter::
795 @subsection Staff symbol
797 @cindex adjusting staff symbol
799 Notes, dynamic signs, etc. are grouped
800 with a set of horizontal lines, into a staff (plural `staves'). In our
801 system, these lines are drawn using a separate layout object called
805 @cindex staff lines, setting number of
806 @cindex staff lines, setting thickness of
807 @cindex thickness of staff lines, setting
808 @cindex number of staff lines, setting
812 Program reference: @internalsref{StaffSymbol}.
814 Examples: @inputfileref{input/test,staff-lines.ly},
815 @inputfileref{input/test,staff-size.ly}.
819 If a staff is ended halfway a piece, the staff symbol may not end
820 exactly on the bar line.
824 @subsection Key signature
825 @cindex Key signature
829 The key signature indicates the scale in which a piece is played. It
830 is denoted by a set of alterations (flats or sharps) at the start of
834 Setting or changing the key signature is done with the @code{\key}
837 @code{\key} @var{pitch} @var{type}
840 @cindex @code{\minor}
841 @cindex @code{\major}
842 @cindex @code{\minor}
843 @cindex @code{\ionian}
844 @cindex @code{\locrian}
845 @cindex @code{\aeolian}
846 @cindex @code{\mixolydian}
847 @cindex @code{\lydian}
848 @cindex @code{\phrygian}
849 @cindex @code{\dorian}
851 Here, @var{type} should be @code{\major} or @code{\minor} to get
852 @var{pitch}-major or @var{pitch}-minor, respectively.
853 The standard mode names @code{\ionian},
854 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
855 @code{\phrygian}, and @code{\dorian} are also defined.
857 This command sets the context property
858 @internalsref{Staff}.@code{keySignature}. Non-standard key signatures
859 can be specified by setting this property directly.
861 Accidentals and key signatures often confuse new users, because
862 unaltered notes get natural signs depending on the key signature. For
863 more information, see @ref{More about pitches}.
867 The ordering of a key cancellation is wrong when it is combined with
868 repeat bar lines. The cancellation is also printed after a line break.
872 Program reference: @internalsref{KeyChangeEvent}, and @internalsref{KeySignature}.
874 @cindex @code{keySignature}
881 The clef indicates which lines of the staff correspond to which
885 The clef can be set or changed with the @code{\clef} command
886 @lilypond[quote,fragment,verbatim]
887 \key f\major c''2 \clef alto g'2
890 Supported clef-names include
891 @c Moved standard clefs to the top /MB
895 @item treble, violin, G, G2
908 G clef on 1st line, so-called French violin clef
913 @cindex mezzosoprano clef
916 @cindex baritone clef
919 @cindex varbaritone clef
930 By adding @code{_8} or @code{^8} to the clef name, the clef is
931 transposed one octave down or up, respectively, and @code{_15} and
932 @code{^15} transposes by two octaves. The argument @var{clefname}
933 must be enclosed in quotes when it contains underscores or digits. For
937 @cindex choral tenor clef
938 @lilypond[quote,verbatim,fragment,relative=1]
942 This command is equivalent to setting @code{clefGlyph},
943 @code{clefPosition} (which controls the Y position of the clef),
944 @code{centralCPosition} and @code{clefOctavation}. A clef is printed
945 when any of these properties are changed. The following example shows
946 possibilities when setting properties manually.
950 \set Staff.clefGlyph = #"clefs-F"
951 \set Staff.clefPosition = #2
953 \set Staff.clefGlyph = #"clefs-G"
955 \set Staff.clefGlyph = #"clefs-C"
957 \set Staff.clefOctavation = #7
959 \set Staff.clefOctavation = #0
960 \set Staff.clefPosition = #0
970 Program reference: @internalsref{Clef}.
974 @node Ottava brackets
975 @subsection Ottava brackets
977 ``Ottava'' brackets introduce an extra transposition of an octave for
978 the staff. They are created by invoking the function
979 @code{set-octavation}
985 @lilypond[quote,verbatim,fragment]
995 The @code{set-octavation} function also takes -1 (for 8va bassa) and 2
996 (for 15ma) as arguments. Internally the function sets the properties
997 @code{ottavation} (e.g. to @code{"8va"}) and
998 @code{centralCPosition}. For overriding the text of the bracket, set
999 @code{ottavation} after invoking @code{set-octavation}, i.e.,
1003 \set Staff.ottavation = #"8"
1008 Program reference: @internalsref{OttavaBracket}.
1010 Examples: @inputfileref{input/regression,ottava.ly},
1011 @inputfileref{input/regression,ottava-broken.ly}.
1015 @code{set-octavation} will get confused when clef changes happen
1016 during an octavation bracket.
1021 @node Time signature
1022 @subsection Time signature
1023 @cindex Time signature
1025 @cindex @code{\time}
1027 Time signature indicates the metrum of a piece: a regular pattern of
1028 strong and weak beats. It is denoted by a fraction at the start of the
1032 The time signature is set or changed by the @code{\time}
1034 @lilypond[quote,fragment,verbatim]
1035 \time 2/4 c'2 \time 3/4 c'2.
1038 The symbol that is printed can be customized with the @code{style}
1039 property. Setting it to @code{#'()} uses fraction style for 4/4 and
1042 @lilypond[fragment,verbatim]
1045 \override TimeSignature #'style = #'()
1052 There are many more options for its layout. See @ref{Ancient time
1053 signatures} for more examples.
1056 This command sets the property @code{timeSignatureFraction},
1057 @code{beatLength} and @code{measureLength} in the @code{Timing}
1058 context, which is normally aliased to @internalsref{Score}. The
1059 property @code{measureLength} determines where bar lines should be
1060 inserted, and how automatic beams should be generated. Changing the
1061 value of @code{timeSignatureFraction} also causes the symbol to be
1064 More options are available through the Scheme function
1065 @code{set-time-signature}. In combination with the
1066 @internalsref{Measure_grouping_engraver}, it will create
1067 @internalsref{MeasureGrouping} signs. Such signs ease reading
1068 rhythmically complex modern music. In the following example, the 9/8
1069 measure is subdivided in 2, 2, 2 and 3. This is passed to
1070 @code{set-time-signature} as the third argument @code{(2 2 2 3)}
1072 @lilypond[quote,raggedright,verbatim]
1075 #(set-time-signature 9 8 '(2 2 2 3))
1076 g8[ g] d[ d] g[ g] a8[( bes g]) |
1077 #(set-time-signature 5 8 '(3 2))
1083 \consists "Measure_grouping_engraver"
1091 Program reference: @internalsref{TimeSignature}, and @internalsref{Timing_engraver}.
1096 Automatic beaming does not use the measure grouping specified with
1097 @code{set-time-signature}.
1099 @node Partial measures
1100 @subsection Partial measures
1103 @cindex partial measure
1104 @cindex measure, partial
1105 @cindex shorten measures
1106 @cindex @code{\partial}
1108 Partial measures, for example in upsteps, are entered using the
1109 @code{\partial} command
1110 @lilypond[quote,fragment,verbatim,relative=2]
1111 \partial 16*5 c16 cis d dis e | a2. c,4 | b2
1114 The syntax for this command is
1116 \partial @var{duration}
1118 This is internally translated into
1120 \set Timing.measurePosition = -@var{length of duration}
1123 The property @code{measurePosition} contains a rational number
1124 indicating how much of the measure has passed at this point.
1126 @node Unmetered music
1127 @subsection Unmetered music
1131 Bar lines and bar numbers are calculated automatically. For unmetered
1132 music (e.g. cadenzas), this is not desirable. By setting
1133 @code{Score.timing} to false, this automatic timing can be switched
1134 off. Empty bar lines,
1141 indicate where line breaks can occur.
1145 @cindex @code{\cadenzaOn}
1147 @cindex @code{\cadenzaOff}
1154 @subsection Bar lines
1158 @cindex measure lines
1162 Bar lines delimit measures, but are also used to indicate repeats.
1163 Normally, they are inserted automatically. Line breaks may only
1164 happen on bar lines.
1166 Special types of bar lines can be forced with the @code{\bar} command
1168 @lilypond[quote,relative=2,fragment,verbatim]
1172 The following bar types are available
1173 @lilypond[quote,fragment,relative=1,raggedright,verbatim]
1186 For allowing line breaks, there is a special command,
1190 This will insert an invisible bar line, and allow line breaks at this
1193 In scores with many staves, a @code{\bar} command in one staff is
1194 automatically applied to all staves. The resulting bar lines are
1195 connected between different staves of a @internalsref{StaffGroup}
1197 @lilypond[quote,fragment,verbatim]
1199 \context StaffGroup <<
1205 \new Staff { \clef bass c4 g e g }
1207 \new Staff { \clef bass c2 c2 }
1211 A bar line is created whenever the @code{whichBar} property is set.
1212 At the start of a measure it is set to the contents of
1213 @code{defaultBarType}. The contents of @code{repeatCommands} are used
1214 to override default measure bars.
1216 The command @code{\bar }@var{bartype} is a short cut for doing
1217 @code{\set Timing.whichBar = }@var{bartype}. Whenever @code{whichBar}
1218 is set to a string, a bar line of that type is created.
1220 @cindex @code{whichBar}
1221 @cindex @code{repeatCommands}
1222 @cindex @code{defaultBarType}
1224 You are encouraged to use @code{\repeat} for repetitions. See
1231 In this manual: @ref{Repeats}.
1234 Program reference: the bar line objects that are created at
1235 @internalsref{Staff} level are called @internalsref{BarLine}, the bar
1236 lines that span staves are @internalsref{SpanBar} objects.
1238 @cindex bar lines at start of system
1239 @cindex start of system
1241 The bar lines at the start of each system are
1242 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace}, and
1243 @internalsref{SystemStartBracket}. Only one of these types is created
1244 in every context, and that type is determined by the property
1245 @code{systemStartDelimiter}.
1247 Examples: @inputfileref{input/test,bar-lines.ly},
1250 @node Time administration
1251 @subsection Time administration
1253 Time is administered by the @internalsref{Time_signature_engraver},
1254 which usually lives in the @internalsref{Score} context.
1255 The bookkeeping deals with the following variables
1258 @item currentBarNumber
1261 the length of the measures in the current time signature. For a 4/4
1262 time this is 1, and for 6/8 it is 3/4.
1263 @item measurePosition
1264 the point within the measure where we currently are. This quantity
1265 is reset to 0 whenever it exceeds @code{measureLength}. When that happens,
1266 @code{currentBarNumber} is incremented.
1268 if set to true, the above variables are updated for every time
1269 step. When set to false, the engraver stays in the current measure
1273 Timing can be changed by setting any of these variables explicitly.
1274 In the next example, the 4/4 time signature is printed, but
1275 @code{measureLength} is set to 5/4. After a while, the measure is
1276 shortened by 1/8, by setting @code{measurePosition} to -3/8 at 2/4 in
1277 the measure, so the next bar line will fall at 2/4 + 3/8.
1281 \set Score.measureLength = #(ly:make-moment 5 4)
1285 \set Score.measurePosition = #(ly:make-moment -3 8)
1292 @node Controlling formatting of prefatory matter
1293 @subsection Controlling formatting of prefatory matter
1299 \override Staff.Clef #'break-visibility = #end-of-line-visible
1300 \override Staff.KeySignature #'break-visibility = #end-of-line-visible
1301 \set Staff.explicitClefVisibility = #end-of-line-visible
1302 \set Staff.explicitKeySignatureVisibility = #end-of-line-visible
1304 % We want the time sig to take space, otherwise there is not
1305 % enough white at the start of the line.
1308 \override Staff.TimeSignature #'transparent = ##t
1309 \set Score.defaultBarType = #"empty"
1330 The easiest way to enter fragments with more than one voice on a staff
1331 is to split chords using the separator @code{\\}. You can use it for
1332 small, short-lived voices or for single chords
1336 @lilypond[quote,verbatim,fragment]
1337 \context Staff \relative c'' {
1338 c4 << { f d e } \\ { b c2 } >>
1339 c4 << g' \\ b, \\ f' \\ d >>
1343 The separator causes @internalsref{Voice} contexts@footnote{Polyphonic
1344 voices are sometimes called "layers" other notation packages}
1346 to be instantiated. They bear the names @code{"1"}, @code{"2"}, etc. In
1347 each of these contexts, vertical direction of slurs, stems, etc. is set
1350 @cindex @code{\voiceOne}
1351 @cindex @code{\voiceFour}
1353 This can also be done by instantiating @internalsref{Voice} contexts
1354 by hand, and using @code{\voiceOne}, up to @code{\voiceFour} to assign
1355 a stem directions and horizontal shift for each part
1358 @lilypond[quote,raggedright,verbatim]
1361 \new Voice { \voiceOne cis2 b }
1362 \new Voice { \voiceThree b4 ais ~ ais4 gis4 }
1363 \new Voice { \voiceTwo fis4~ fis4 f ~ f } >>
1367 The command @code{\oneVoice} will revert back to the normal setting.
1368 @cindex @code{\oneVoice}
1371 Normally, note heads with a different number of dots are not merged, but
1372 when the object property @code{merge-differently-dotted} is set in
1373 the @internalsref{NoteCollision} object, they are merged
1374 @lilypond[quote,verbatim,fragment,raggedright,relative=2]
1377 \override Staff.NoteCollision
1378 #'merge-differently-dotted = ##t
1380 } \\ { g8.[ f16] g8.[ f16] } >>
1383 Similarly, you can merge half note heads with eighth notes, by setting
1384 @code{merge-differently-headed}
1385 @lilypond[quote,fragment,relative=2,verbatim]
1388 \override Staff.NoteCollision
1389 #'merge-differently-headed = ##t
1390 c8 c4. } \\ { c2 c2 } >>
1393 LilyPond also vertically shifts rests that are opposite of a stem,
1396 @lilypond[quote,raggedright,fragment,verbatim]
1397 \context Voice << c''4 \\ r4 >>
1405 @cindex @code{\oneVoice}
1407 @cindex @code{\voiceOne}
1409 @cindex @code{\voiceTwo}
1411 @cindex @code{\voiceThree}
1413 @cindex @code{\voiceFour}
1417 The following commands specify in what chords of the current voice
1418 should be shifted: the outer voice has @code{\shiftOff}, and the inner
1419 voices have @code{\shiftOn}, @code{\shiftOnn}, etc.
1422 @cindex @code{\shiftOn}
1424 @cindex @code{\shiftOnn}
1426 @cindex @code{\shiftOnnn}
1428 @cindex @code{\shiftOff}
1431 When LilyPond cannot cope, the @code{force-hshift}
1432 property of the @internalsref{NoteColumn} object and pitched rests can
1433 be used to override typesetting decisions.
1435 @lilypond[verbatim,raggedright]
1442 \once \override NoteColumn #'force-hshift = #1.7
1451 Program reference: the objects responsible for resolving collisions are
1452 @internalsref{NoteCollision} and @internalsref{RestCollision}.
1454 Examples: See also example files
1455 @inputfileref{input/regression,collision-dots.ly},
1456 @inputfileref{input/regression,collision-head-chords.ly},
1457 @inputfileref{input/regression,collision-heads.ly},
1458 @inputfileref{input/regression,collision-mesh.ly}, and
1459 @inputfileref{input/regression,collisions.ly}.
1465 When using @code{merge-differently-headed} with an upstem eighth or a
1466 shorter note, and a downstem half note, the eighth note gets the wrong
1469 There is no support for clusters where the same note occurs with
1470 different accidentals in the same chord. In this case, it is
1471 recommended to use enharmonic transcription, or to use special cluster
1472 notation (see @ref{Clusters}).
1477 Beams are used to group short notes into chunks that are aligned with
1478 the metrum. They are inserted automatically
1480 @lilypond[quote,fragment,verbatim,relative=2]
1481 \time 2/4 c8 c c c \time 6/8 c c c c8. c16 c8
1484 When these automatic decisions are not good enough, beaming can be
1485 entered explicitly. It is also possible to define beaming patterns
1486 that differ from the defaults.
1488 Individual notes may be marked with @code{\noBeam}, to prevent them
1491 @lilypond[quote,fragment,verbatim,relative=2]
1492 \time 2/4 c8 c\noBeam c c
1498 Program reference: @internalsref{Beam}.
1501 @cindex Automatic beams
1504 * Setting automatic beam behavior::
1509 @subsection Manual beams
1510 @cindex beams, manual
1514 In some cases it may be necessary to override the automatic beaming
1515 algorithm. For example, the autobeamer will not put beams over rests
1516 or bar lines. Such beams are specified by manually: the begin and end
1517 point are marked with @code{[} and @code{]}
1519 @lilypond[quote,fragment,relative=1,verbatim]
1521 r4 r8[ g' a r8] r8 g[ | a] r8
1525 @cindex @code{stemLeftBeamCount}
1527 Normally, beaming patterns within a beam are determined automatically.
1528 If necessary, the properties @code{stemLeftBeamCount} and
1529 @code{stemRightBeamCount} can be used to override the defaults. If
1530 either property is set, its value will be used only once, and then it
1533 @lilypond[quote,fragment,relative=1,verbatim]
1536 f8[ r16 \set stemLeftBeamCount = #1 f g a]
1539 @cindex @code{stemRightBeamCount}
1542 The property @code{subdivideBeams} can be set in order to subdivide
1543 all 16th or shorter beams at beat positions, as defined by the
1544 @code{beatLength} property.
1547 @lilypond[fragment,quote,relative=2,verbatim,noindent]
1549 \set subdivideBeams = ##t
1551 \set Score.beatLength = #(ly:make-moment 1 8)
1554 @cindex @code{subdivideBeams}
1556 Kneed beams are inserted automatically, when a large gap is detected
1557 between the note heads. This behavior can be tuned through the object
1558 property @code{auto-knee-gap}.
1560 Normally, line breaks are forbidden when beams cross bar lines. This
1561 behavior can be changed by setting @code{allowBeamBreak}.
1563 @cindex @code{allowBeamBreak}
1564 @cindex beams and line breaks
1566 @cindex beams, kneed
1568 @cindex auto-knee-gap
1573 User manual: @ref{Changing context properties on the fly} for the
1579 @cindex Frenched staves
1581 Automatically kneed cross-staff beams cannot be used together with
1584 Beams do not avoid collisions with symbols around the notes, such as
1585 texts and accidentals.
1589 @node Setting automatic beam behavior
1590 @subsection Setting automatic beam behavior
1592 @cindex @code{autoBeamSettings}
1593 @cindex @code{(end * * * *)}
1594 @cindex @code{(begin * * * *)}
1595 @cindex automatic beams, tuning
1596 @cindex tuning automatic beaming
1598 @c [TODO: use \applycontext]
1600 In normal time signatures, automatic beams can start on any note but can
1601 only end in a few positions within the measure: beams can end on a beat,
1602 or at durations specified by the properties in
1603 @code{autoBeamSettings}. The defaults for @code{autoBeamSettings}
1604 are defined in @file{scm/auto-beam.scm}.
1606 The value of @code{autoBeamSettings} is changed with two functions,
1608 #(override-auto-beam-setting
1609 '(@var{be} @var{p} @var{q} @var{n} @var{m}) @var{a} @var{b}
1611 #(revert-auto-beam-setting '(@var{be} @var{p} @var{q} @var{n} @var{m}))
1613 Here, @var{be} is the symbol @code{begin} or @code{end}, and
1614 @var{context} is an optional context (default: @code{'Voice}). It
1615 determines whether the rule applies to begin or end-points. The
1616 quantity @var{p}/@var{q} refers to the length of the beamed notes (and
1617 `@code{* *}' designates notes of any length), @var{n}/@var{M} refers
1618 to a time signature (wildcards `@code{* *}' may be entered to
1619 designate all time signatures), @var{a}/@var{b} is a duration. By
1620 default, this command changes settings for the current voice. It is
1621 also possible to adjust settings at higher contexts, by adding a
1622 @var{context} argument.
1624 For example, if automatic beams should end on every quarter note, use
1627 #(override-auto-beam-setting '(end * * * *) 1 4 'Staff)
1629 Since the duration of a quarter note is 1/4 of a whole note, it is
1630 entered as @code{(ly:make-moment 1 4)}.
1632 The same syntax can be used to specify beam starting points. In this
1633 example, automatic beams can only end on a dotted quarter note
1635 #(override-auto-beam-setting '(end * * * *) 3 8)
1637 In 4/4 time signature, this means that automatic beams could end only on
1638 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
1639 3/8, has passed within the measure).
1641 Rules can also be restricted to specific time signatures. A rule that
1642 should only be applied in @var{N}/@var{M} time signature is formed by
1643 replacing the second asterisks by @var{N} and @var{M}. For example, a
1644 rule for 6/8 time exclusively looks like
1646 #(override-auto-beam-setting '(begin * * 6 8) @dots{})
1649 If a rule should be to applied only to certain types of beams, use the
1650 first pair of asterisks. Beams are classified according to the
1651 shortest note they contain. For a beam ending rule that only applies
1652 to beams with 32nd notes (and no shorter notes), use @code{(end 1 32 *
1655 @cindex automatic beam generation
1657 @cindex @code{autoBeaming}
1660 If beams are used to indicate melismata in songs, then automatic
1661 beaming should be switched off. This is done by setting
1662 @code{autoBeaming} to @code{#f}.
1666 @cindex @code{\autoBeamOff}
1667 @code{\autoBeamOff},
1668 @cindex @code{\autoBeamOn}
1674 If a score ends while an automatic beam has not been ended and is
1675 still accepting notes, this last beam will not be typeset at all. The
1676 same holds polyphonic voices, entered with @code{<< @dots{} \\ @dots{}
1677 >>}. If a polyphonic voice ends while an automatic beam is still
1678 accepting notes, it is not typeset.
1680 The rules for ending a beam depend on the shortest note in a beam.
1681 So, while it is possible to have different ending rules for eight
1682 beams and sixteenth beams, a beam that contains both eight and
1683 sixteenth notes will use the rules for the sixteenth beam.
1685 In the example below, the autobeamer makes eight beams and sixteenth
1686 end at 3 eights; the third beam can only be corrected by specifying
1689 @lilypond[quote,raggedright,fragment,relative=1]
1690 #(override-auto-beam-setting '(end * * * *) 3 8)
1691 % rather show case where it goes wrong
1692 %\time 12/8 c'8 c c c16 c c c c c c[ c c c] c8[ c] c4
1693 \time 12/8 c'8 c c c16 c c c c c c c c c c8 c c4
1695 It is not possible to specify beaming parameters that act differently in
1696 different parts of a measure. This means that it is not possible to use
1697 automatic beaming in irregular meters such as @code{5/8}.
1699 @node Beam formatting
1700 @subsection Beam formatting
1703 When a beam falls in the middle of the staff, the beams point normally
1704 down. However, this behaviour can be altered with the
1705 @code{neutral-direction} property.
1711 \override Beam #'neutral-direction = #-1
1713 \override Beam #'neutral-direction = #1
1719 @section Accidentals
1722 This section describes how to change the way that accidentals are
1723 inserted automatically before the running notes.
1725 Common rules for typesetting accidentals have been canned in a
1726 function. This function is called as follows
1728 @cindex @code{set-accidental-style}
1730 #(set-accidental-style 'modern 'Voice)
1733 The function takes two arguments: a symbol that denotes the style (in
1734 the example, @code{modern}), and another symbol that denotes the
1735 context name (in this example, @code{Voice}). If no context name is
1736 supplied, @code{Staff} is the default.
1738 The following styles are supported
1741 This is the default typesetting behavior. It should correspond
1742 to 18th century common practice: Accidentals are
1743 remembered to the end of the measure in which they occur and
1744 only on their own octave.
1748 The normal behavior is to remember the accidentals on
1749 Staff-level. This variable, however, typesets accidentals
1750 individually for each voice. Apart from that, the rule is similar to
1753 This leads to some weird and often unwanted results
1754 because accidentals from one voice do not get canceled in other
1756 @lilypond[quote,raggedright,relative=1,fragment,verbatim]
1758 #(set-accidental-style 'voice)
1764 Hence you should only use @code{voice} if the voices
1765 are to be read solely by individual musicians. If the staff is to be
1766 used by one musician (e.g. a conductor) then you use
1767 @code{modern} or @code{modern-cautionary}
1771 @cindex @code{modern} style accidentals
1772 This rule corresponds to the common practice in the 20th
1774 This rule prints the same accidentals as @code{default}, but temporary
1775 accidentals also are canceled in other octaves. Furthermore,
1776 in the same octave, they also get canceled in the following
1779 @lilypond[quote,raggedright,fragment,verbatim]
1780 #(set-accidental-style 'modern)
1781 cis' c'' cis'2 | c'' c'
1784 @item @code{modern-cautionary}
1785 @cindex @code{modern-cautionary}
1786 This rule is similar to @code{modern}, but the
1787 ``extra'' accidentals (the ones not typeset by
1788 @code{default}) are typeset as cautionary accidentals.
1789 They are printed in reduced size or with parentheses
1790 @lilypond[quote,raggedright,fragment,verbatim]
1791 #(set-accidental-style 'modern-cautionary)
1792 cis' c'' cis'2 | c'' c'
1795 @cindex @code{modern-voice}
1797 This rule is used for multivoice accidentals to be read both by musicians
1798 playing one voice and musicians playing all voices. Accidentals are
1799 typeset for each voice, but they @emph{are} canceled across voices in
1800 the same @internalsref{Staff}.
1802 @cindex @code{modern-voice-cautionary}
1803 @item modern-voice-cautionary
1804 This rule is the same as @code{modern-voice}, but with the extra
1805 accidentals (the ones not typeset by @code{voice}) typeset
1806 as cautionaries. Even though all accidentals typeset by
1807 @code{default} @emph{are} typeset by this variable then
1808 some of them are typeset as cautionaries.
1811 @cindex @code{piano} accidentals
1812 This rule reflects 20th century practice for piano notation. Very similar to
1813 @code{modern} but accidentals also get canceled
1814 across the staves in the same @internalsref{GrandStaff} or
1815 @internalsref{PianoStaff}.
1817 @item piano-cautionary
1818 @cindex @code{#(set-accidental-style 'piano-cautionary)}
1819 As @code{#(set-accidental-style 'piano)' , str)} but with the extra accidentals
1820 typeset as cautionaries.
1823 @cindex @code{no-reset} accidental style
1825 This is the same as @code{default} but with accidentals lasting
1826 ``forever'' and not only until the next measure
1827 @lilypond[quote,raggedright,fragment,verbatim,relative=1]
1828 #(set-accidental-style 'no-reset)
1833 This is sort of the opposite of @code{no-reset}: Accidentals
1834 are not remembered at all---and hence all accidentals are
1835 typeset relative to the key signature, regardless of what was
1838 @lilypond[quote,raggedright,fragment,verbatim,relative=1]
1839 #(set-accidental-style 'forget)
1840 \key d\major c4 c cis cis d d dis dis
1847 Program reference: @internalsref{Accidental_engraver},
1848 @internalsref{Accidental}, and @internalsref{AccidentalPlacement}.
1853 Simultaneous notes are considered to be entered in sequential
1854 mode. This means that in a chord the accidentals are typeset as if the
1855 notes in the chord happened once at a time - in the order in which
1856 they appear in the input file.
1858 This is only a problem when accidentals in a chord depend on each
1859 other. This problem can be solved by manually inserting @code{!} and
1860 @code{?} for the problematic notes.
1862 In the default scheme, accidentals only depend on other
1863 accidentals with the same pitch on the same staff, so no conflicts are
1866 @node Expressive marks
1867 @section Expressive marks
1870 @c todo: should change ordering
1871 @c where to put text spanners, metronome marks,
1880 * Analysis brackets::
1883 * Fingering instructions::
1894 A slur indicates that notes are to be played bound or @emph{legato}.
1897 They are entered using parentheses
1898 @lilypond[quote,relative=2,fragment,verbatim]
1899 f( g)( a) a8 b( a4 g2 f4)
1903 The direction of a slur can be set with the
1907 \override Slur #'direction = #UP
1908 \slurUp % shortcut for the previous line
1912 However, there is a convenient shorthand for forcing slur
1913 directions. By adding @code{_} or @code{^} before the opening
1914 parentheses, the direction is also set. For example,
1916 @lilypond[relative=2,fragment]
1923 @cindex @code{\slurUp}
1925 @cindex @code{\slurDown}
1927 @cindex @code{\slurBoth}
1929 @cindex @code{\slurDotted}
1931 @cindex @code{\slurSolid}
1936 Program reference: @seeinternals{Slur}, and @internalsref{SlurEvent}.
1940 @cindex Adjusting slurs
1942 @node Phrasing slurs
1943 @subsection Phrasing slurs
1945 @cindex phrasing slurs
1946 @cindex phrasing marks
1948 A phrasing slur (or phrasing mark) connects chords and is used to
1949 indicate a musical sentence. It is started using @code{\(} and @code{\)}
1952 @lilypond[quote,fragment,verbatim,relative=1]
1953 \time 6/4 c'\( d( e) f( e) d\)
1956 Typographically, the phrasing slur behaves almost exactly like a
1957 normal slur. However, they are treated as different objects. A
1958 @code{\slurUp} will have no effect on a phrasing slur; instead, you
1959 should use @code{\phrasingSlurUp}, @code{\phrasingSlurDown}, and
1960 @code{\phrasingSlurBoth}.
1962 The commands @code{\slurUp}, @code{\slurDown}, and @code{\slurBoth}
1963 will only affect normal slurs and not phrasing slurs.
1967 @cindex @code{\phrasingSlurUp}
1968 @code{\phrasingSlurUp},
1969 @cindex @code{\phrasingSlurDown}
1970 @code{\phrasingSlurDown},
1971 @cindex @code{\phrasingSlurBoth}
1972 @code{\phrasingSlurBoth}.
1976 Program reference: see also @internalsref{PhrasingSlur}, and
1977 @internalsref{PhrasingSlurEvent}.
1981 Putting phrasing slurs over rests leads to spurious warnings.
1984 @subsection Breath marks
1986 Breath marks are entered using @code{\breathe}
1989 @lilypond[quote,fragment,relative=1,verbatim]
1993 The glyph of the breath mark can be tuned by overriding the
1994 @code{text} property of the @code{BreathingSign} layout object with
1995 any markup text. For example,
1996 @lilypond[quote,fragment,verbatim,relative=1]
1998 \override BreathingSign #'text
1999 = #(make-musicglyph-markup "scripts-rvarcomma")
2006 Program reference: @internalsref{BreathingSign},
2007 @internalsref{BreathingSignEvent}.
2009 Examples: @inputfileref{input/regression,breathing-sign.ly}.
2012 @node Metronome marks
2013 @subsection Metronome marks
2016 @cindex beats per minute
2017 @cindex metronome marking
2019 Metronome settings can be entered as follows
2021 \tempo @var{duration} = @var{per-minute}
2024 In the MIDI output, they are interpreted as a tempo change, and in the
2025 paper output, a metronome marking is printed
2026 @cindex @code{\tempo}
2027 @lilypond[quote,fragment,verbatim]
2033 Program reference: @internalsref{MetronomeChangeEvent}.
2038 @subsection Text spanners
2039 @cindex Text spanners
2041 Some performance indications, e.g. @i{rallentando} or @i{accelerando},
2042 are written as texts, and extended over many measures with dotted
2043 lines. You can create such texts using text spanners: attach
2044 @code{\startTextSpan} and @code{\stopTextSpan} to the
2045 start and ending note of the spanner.
2047 The string to be printed, as well as the style, is set through object
2050 @lilypond[quote,fragment,relative=1,verbatim]
2053 \override TextSpanner #'direction = #-1
2054 \override TextSpanner #'edge-text = #'("rall " . "")
2055 c2\startTextSpan b c\stopTextSpan a
2062 Internals @internalsref{TextSpanEvent},
2063 @internalsref{TextSpanner}.
2065 Examples: @inputfileref{input/regression,text-spanner.ly}.
2068 @node Analysis brackets
2069 @subsection Analysis brackets
2071 @cindex phrasing brackets
2072 @cindex musicological analysis
2073 @cindex note grouping bracket
2075 Brackets are used in musical analysis to indicate structure in musical
2076 pieces. LilyPond supports a simple form of nested horizontal brackets.
2077 To use this, add the @internalsref{Horizontal_bracket_engraver} to
2078 @internalsref{Staff} context. A bracket is started with
2079 @code{\startGroup} and closed with @code{\stopGroup}
2081 @lilypond[quote,raggedright,verbatim]
2084 c4\startGroup\startGroup
2087 c4\stopGroup\stopGroup
2091 \Staff \consists "Horizontal_bracket_engraver"
2097 Program reference: @internalsref{HorizontalBracket},
2098 @internalsref{NoteGroupingEvent}.
2100 Examples: @inputfileref{input/regression,note-group-bracket.ly}.
2104 @subsection Articulations
2105 @cindex Articulations
2107 @cindex articulations
2111 A variety of symbols can appear above and below notes to indicate
2112 different characteristics of the performance. They are added to a note
2113 by adding a dash and the character signifying the
2114 articulation. They are demonstrated here
2116 @lilypondfile[quote,raggedright]{script-abbreviations.ly}
2118 The meanings of these shorthands can be changed. See
2119 @file{ly/script-init.ly} for examples.
2122 The script is automatically placed, but if you need to force
2123 directions, you can use @code{_} to force them down, or @code{^} to
2125 @lilypond[quote,fragment,verbatim]
2129 Other symbols can be added using the syntax
2130 @var{note}@code{\}@var{name}, e.g. @code{c4\fermata}. Again, they
2131 can be forced up or down using @code{^} and @code{_},
2134 @lilypond[quote,verbatim,fragment,relative=2]
2135 c\fermata c^\fermata c_\fermata
2142 @cindex staccatissimo
2151 @cindex organ pedal marks
2160 @cindex prallmordent
2164 @cindex thumb marking
2169 @lilypondfile[quote,raggedright]{script-chart.ly}
2172 The vertical ordering of scripts is controlled with the
2173 @code{script-priority} property. The lower this number, the closer it
2174 will be put to the note. In this example, the
2175 @internalsref{TextScript} (the sharp symbol) first has the lowest
2176 priority, so it is put lowest in the first example. In the second, the
2177 prall trill (the @internalsref{Script}) has the lowest, so it on the
2178 inside. When two objects have the same priority, the order in which
2179 they are entered decides which one comes first.
2182 @lilypond[verbatim,raggedright]
2184 \once \override TextScript #'script-priority = #-100
2185 a4^\prall^\markup { \sharp }
2187 \once \override Script #'script-priority = #-100
2188 a4^\prall^\markup { \sharp }
2196 @cindex @code{\scriptUp}
2198 @cindex @code{\scriptDown}
2200 @cindex @code{\scriptBoth}
2205 Program reference: @internalsref{ScriptEvent}, and @internalsref{Script}.
2209 These note ornaments appear in the printed output but have no
2210 effect on the MIDI rendering of the music.
2214 @node Running trills
2215 @subsection Running trills
2217 Long running trills are made with @code{\startTrillSpan} and
2218 @code{\stopTrillSpan},
2221 @lilypond[verbatim,raggedright]
2222 \relative \new Voice {
2223 << { c1 \startTrillSpan }
2224 { s2. \grace { d16[\stopTrillSpan e] } } >>
2230 @code{\startTrillSpan},
2231 @cindex @code{\startTrillSpan}
2232 @code{\stopTrillSpan}.
2233 @cindex @code{\stopTrillSpan}
2237 Program reference: @internalsref{TrillSpanner},
2238 @internalsref{TrillSpanEvent}.
2240 @node Fingering instructions
2241 @subsection Fingering instructions
2245 Fingering instructions can be entered using
2247 @var{note}-@var{digit}
2249 For finger changes, use markup texts
2251 @lilypond[quote,verbatim,raggedright,fragment]
2252 c'4-1 c'4-2 c'4-3 c'4-4
2253 c'^\markup { \finger "2-3" }
2256 @cindex finger change
2261 You can use the thumb-script to indicate that a note should be
2262 played with the thumb (e.g. in cello music)
2264 @lilypond[quote,verbatim,raggedright,fragment]
2265 <a' a''-3>8_\thumb <b' b''-3>_\thumb
2268 Fingerings for chords can also be added to individual notes
2269 of the chord by adding them after the pitches
2270 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
2271 < c-1 e-2 g-3 b-5 >4
2275 iIn this case, setting @code{fingeringOrientations} will put fingerings next
2278 @lilypond[quote,verbatim,raggedright,fragment,relative=1]
2279 \set fingeringOrientations = #'(left down)
2280 <c-1 es-2 g-4 bes-5 > 4
2281 \set fingeringOrientations = #'(up right down)
2282 <c-1 es-2 g-4 bes-5 > 4
2283 \set fingeringOrientations = #'(right)
2287 The last note demonstrates how fingering instructions can be put close
2288 to note heads in monophonic music, using this feature.
2292 Program reference: @internalsref{FingerEvent}, and @internalsref{Fingering}.
2294 Examples: @inputfileref{input/regression,finger-chords.ly}.
2297 @subsection Text scripts
2298 @cindex Text scripts
2300 @cindex text items, non-empty
2301 @cindex non-empty texts
2303 It is possible to place arbitrary strings of text or markup text (see
2304 @ref{Text markup}) above or below notes by using a string
2305 @code{c^"text"}. By default, these indications do not influence the
2306 note spacing, but by using the command @code{\fatText}, the widths
2307 will be taken into account
2309 @lilypond[quote,fragment,raggedright,verbatim]
2311 c4^"longtext" \fatText c4_"longlongtext" c4
2315 It is possible to use @TeX{} commands in the strings, but this should
2316 be avoided because the exact dimensions of the string can then no
2321 @cindex @code{\fatText}
2323 @cindex @code{\emptyText}
2328 In this manual: @ref{Text markup}.
2330 Program reference: @internalsref{TextScriptEvent}, @internalsref{TextScript}.
2336 @subsection Grace notes
2339 @c should have blurb about accaciatura / appogiatura
2341 @cindex @code{\grace}
2345 Grace notes are ornaments that are written out. The most common ones
2346 are acciaccatura, which should be played as very short. It is denoted
2347 by a slurred small note with a slashed stem. The appoggiatura is a
2348 grace note that takes a fixed fraction of the main note, is and
2349 denoted as a slurred note in small print without a slash.
2350 They are entered with the commands @code{\acciaccatura} and
2351 @code{\appoggiatura}, as demonstrated in the following example
2354 @cindex appoggiatura
2355 @cindex acciaccatura
2357 @lilypond[quote,relative=2,verbatim,fragment]
2358 b4 \acciaccatura d8 c4 \appoggiatura e8 d4
2359 \acciaccatura { g16[ f] } e4
2362 Both are special forms of the @code{\grace} command. By prefixing this
2363 keyword to a music expression, a new one is formed, which will be
2364 printed in a smaller font and takes up no logical time in a measure.
2366 @lilypond[quote,relative=2,verbatim,fragment]
2368 \grace { c16[ d16] } c2 c4
2372 Unlike @code{\acciaccatura} and @code{\appoggiatura}, the
2373 @code{\grace} command does not start a slur.
2375 Internally, timing for grace notes is done using a second, `grace'
2376 time. Every point in time consists of two rational numbers: one
2377 denotes the logical time, one denotes the grace timing. The above
2378 example is shown here with timing tuples
2380 @lilypond[quote,raggedright]
2383 c4 \grace c16 c4 \grace {
2386 \new Lyrics \lyrics {
2389 ( \fraction 1 4 , \fraction -1 16 ) } 16 }
2390 \markup { (\fraction 1 4 , 0 ) } 4
2392 \markup { (\fraction 2 4 , \fraction "-1" 8 ) } 16
2393 \markup { (\fraction 2 4 , \fraction "-1" 16 ) } 16
2395 \markup { ( \fraction 2 4 , 0 ) }
2401 The placement of grace notes is synchronized between different staves.
2402 In the following example, there are two sixteenth graces notes for
2403 every eighth grace note
2405 @lilypond[quote,relative=2,verbatim,fragment]
2406 << \new Staff { e4 \grace { c16[ d e f] } e4 }
2407 \new Staff { c4 \grace { g8[ b] } c4 } >>
2412 If you want to end a note with a grace, the standard trick is to put
2413 the grace notes after a ``space note''
2415 @lilypond[quote,fragment,verbatim,relative=2]
2418 { s2 \grace { c16[ d] } } >>
2424 By adjusting the duration of the skip note (here it is a half-note),
2425 the space between the main-note and the grace is adjusted.
2428 A @code{\grace} section will introduce special typesetting settings,
2429 for example, to produce smaller type, and set directions. Hence, when
2430 introducing layout tweaks, they should be inside the grace section,
2432 @lilypond[quote,fragment,verbatim,relative=2]
2435 \override Stem #'direction = #-1
2437 \revert Stem #'direction
2444 The overrides should also be reverted inside the grace section.
2446 If the layout of grace sections must be changed throughout the music,
2447 then this can be accomplished through the function
2448 @code{add-grace-property}. The following example undefines the Stem
2449 direction for this grace, so stems do not always point up.
2453 #(add-grace-property 'Voice 'Stem 'direction '())
2459 Another option is to change the variables @code{startGraceMusic},
2460 @code{stopGraceMusic}, @code{startAcciaccaturaMusic},
2461 @code{stopAcciaccaturaMusic}, @code{startAppoggiaturaMusic},
2462 @code{stopAppoggiaturaMusic}. More information is in the file
2463 @file{ly/grace-init.ly}.
2468 Program reference: @internalsref{GraceMusic}.
2472 A score that starts with an @code{\grace} section needs an explicit
2473 @code{\context Voice} declaration, otherwise the main note and grace
2474 note end up on different staves.
2476 Grace note synchronization can also lead to surprises. Staff notation,
2477 such as key signatures, bar lines, etc. are also synchronized. Take
2478 care when you mix staves with grace notes and staves without, for example,
2480 @lilypond[quote,relative=2,verbatim,fragment]
2481 << \new Staff { e4 \bar "|:" \grace c16 d4 }
2482 \new Staff { c4 \bar "|:" d4 } >>
2486 This can be remedied by inserting grace skips, for the above example
2489 \new Staff @{ c4 \bar "|:" \grace s16 d4 @} >>
2492 Grace sections should only be used within sequential music
2493 expressions. Nesting or juxtaposing grace sections is not supported,
2494 and might produce crashes or other errors.
2498 @subsection Glissando
2501 @cindex @code{\glissando}
2503 A glissando is a smooth change in pitch. It is denoted by a line or a
2504 wavy line between two notes.
2507 A glissando line can be requested by attaching a @code{\glissando} to
2510 @lilypond[quote,fragment,relative=1,verbatim]
2516 Program reference: @internalsref{Glissando}, and @internalsref{GlissandoEvent}.
2518 Example files: @file{input/regression,glissando.ly}
2524 Printing text over the line (such as @emph{gliss.}) is not supported.
2528 @subsection Dynamics
2541 @cindex @code{\ffff}
2551 Absolute dynamic marks are specified using a command after a note
2552 @code{c4\ff}. The available dynamic marks are @code{\ppp},
2553 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
2554 @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
2555 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}
2557 @lilypond[quote,verbatim,raggedright,fragment,relative=1]
2558 c'\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff
2568 A crescendo mark is started with @code{\<} and terminated with
2569 @code{\!}. A decrescendo is started with @code{\>} and also terminated
2570 with @code{\!}. Because these marks are bound to notes, if you must
2571 use spacer notes if multiple marks during one note are needed
2573 @lilypond[quote,fragment,verbatim]
2574 c''\< c''\! d''\> e''\!
2575 << f''1 { s4 s4\< s4\! \> s4\! } >>
2577 This may give rise to very short hairpins. Use @code{minimum-length}
2578 in @internalsref{Voice}.@internalsref{Hairpin} to lengthen them, for
2582 \override Staff.Hairpin #'minimum-length = #5
2585 You can also use a text saying @emph{cresc.} instead of hairpins. Here
2586 is an example how to do it
2588 @lilypond[quote,fragment,relative=2,verbatim]
2598 You can also supply your own texts
2599 @lilypond[quote,fragment,relative=1,verbatim]
2601 \set crescendoText = \markup { \italic "cresc. poco" }
2602 \set crescendoSpanner = #'dashed-line
2612 @cindex @code{\dynamicUp}
2614 @cindex @code{\dynamicDown}
2615 @code{\dynamicDown},
2616 @cindex @code{\dynamicBoth}
2617 @code{\dynamicBoth}.
2619 @cindex direction, of dynamics
2623 Program reference: @internalsref{CrescendoEvent},
2624 @internalsref{DecrescendoEvent}, and
2625 @internalsref{AbsoluteDynamicEvent}.
2627 Dynamics @internalsref{DynamicText} and @internalsref{Hairpin}
2628 objects. Vertical positioning of these symbols is handled by the
2629 @internalsref{DynamicLineSpanner} object.
2637 @cindex @code{\repeat}
2640 Repetition is a central concept in music, and multiple notations exist
2641 for repetitions. In LilyPond, most of these notations can be captured
2642 in a uniform syntax. One of the advantages is that they can be
2643 rendered in MIDI accurately.
2645 The following types of repetition are supported
2649 Repeated music is fully written (played) out. Useful for MIDI
2650 output, and entering repetitive music.
2653 This is the normal notation: Repeats are not written out, but
2654 alternative endings (volte) are printed, left to right.
2658 Alternative endings are written stacked. This has limited use but may be
2659 used to typeset two lines of lyrics in songs with repeats, see
2660 @inputfileref{input,star-spangled-banner.ly}.
2668 Make beat or measure repeats. These look like percent signs.
2674 * Repeats and MIDI::
2675 * Manual repeat commands::
2677 * Tremolo subdivisions::
2682 @subsection Repeat syntax
2685 LilyPond has one syntactic construct for specifying different types of
2686 repeats. The syntax is
2689 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
2692 If you have alternative endings, you may add
2693 @cindex @code{\alternative}
2695 \alternative @code{@{} @var{alternative1}
2697 @var{alternative3} @dots{} @code{@}}
2699 where each @var{alternative} is a music expression. If you do not
2700 give enough alternatives for all of the repeats, the first alternative
2701 is assumed to be played more than once.
2703 Normal notation repeats are used like this
2704 @lilypond[quote,fragment,verbatim,relative=2]
2706 \repeat volta 2 { c4 d e f }
2707 \repeat volta 2 { f e d c }
2710 With alternative endings
2711 @lilypond[quote,fragment,verbatim,relative=2]
2713 \repeat volta 2 {c4 d e f}
2714 \alternative { {d2 d} {f f,} }
2718 @lilypond[quote,fragment,verbatim,relative=2]
2721 \repeat volta 4 { e | c2 d2 | e2 f2 | }
2722 \alternative { { g4 g g } { a | a a a a | b2. } }
2728 Brackets for the repeat are normally only printed over the topmost
2729 staff. This can be adjusted by setting the @code{voltaOnThisStaff}
2730 property @inputfileref{input/regression,volta-multi-staff.ly},
2731 @inputfileref{input/regression,volta-chord-names.ly}
2733 It is possible to shorten volta brackets
2734 by setting @code{voltaSpannerDuration}. In the next example, the
2735 bracket only lasts one measure, which is a duration of 3/4.
2739 @lilypond[verbatim,raggedright]
2743 \set Staff.voltaSpannerDuration = #(ly:make-moment 3 4)
2744 \repeat "volta" 5 { d d d }
2745 \alternative { { e e e f f f }
2752 A nested repeat like
2761 is ambiguous, since it is is not clear to which @code{\repeat} the
2762 @code{\alternative} belongs. This ambiguity is resolved by always
2763 having the @code{\alternative} belong to the inner @code{\repeat}.
2764 For clarity, it is advisable to use braces in such situations.
2769 Timing information is not remembered at the start of an alternative,
2770 so after a repeat timing information must be reset by hand, for
2771 example by setting @code{Score.measurePosition} or entering
2772 @code{\partial}. Similarly, slurs or ties are also not repeated.
2777 @node Repeats and MIDI
2778 @subsection Repeats and MIDI
2780 @cindex expanding repeats
2782 An advantage of the unified syntax for repeats, is that all repeats
2783 may be played out for the MIDI output. This is achieved by
2784 applying the @code{\unfoldrepeats} music function.
2786 @lilypond[verbatim,raggedright]
2789 \repeat tremolo 8 {c'32 e' }
2790 \repeat percent 2 { c''8 d'' }
2791 \repeat volta 2 {c'4 d' e' f'}
2800 When creating a score file using @code{\unfoldrepeats} for midi, then
2801 it is necessary to make two @code{\score} blocks. One for MIDI, with
2802 unfolded repeats, and one for notation, eg.
2810 \unfoldrepeats @var{..music..}
2815 @node Manual repeat commands
2816 @subsection Manual repeat commands
2818 @cindex @code{repeatCommands}
2820 The property @code{repeatCommands} can be used to control the layout of
2821 repeats. Its value is a Scheme list of repeat commands, where each repeat
2825 @item the symbol @code{start-repeat},
2826 which prints a @code{|:} bar line,
2827 @item the symbol @code{end-repeat},
2828 which prints a @code{:|} bar line,
2829 @item the list @code{(volta @var{text})},
2830 which prints a volta bracket saying @var{text}: The text can be specified as
2831 a text string or as a markup text, see @ref{Text markup}. Do not
2832 forget to change the font, as the default number font does not contain
2833 alphabetic characters. Or,
2834 @item the list @code{(volta #f)}, which
2835 stops a running volta bracket
2838 @lilypond[quote,verbatim,fragment,relative=2]
2840 \set Score.repeatCommands = #'((volta "93") end-repeat)
2842 \set Score.repeatCommands = #'((volta #f))
2850 Program reference: @internalsref{VoltaBracket}, @internalsref{RepeatedMusic},
2851 @internalsref{VoltaRepeatedMusic},
2852 @internalsref{UnfoldedRepeatedMusic}, and
2853 @internalsref{FoldedRepeatedMusic}.
2855 @node Tremolo repeats
2856 @subsection Tremolo repeats
2857 @cindex tremolo beams
2859 To place tremolo marks between notes, use @code{\repeat} with tremolo
2861 @lilypond[quote,verbatim,raggedright]
2862 \context Voice \relative c' {
2863 \repeat "tremolo" 8 { c16 d16 }
2864 \repeat "tremolo" 4 { c16 d16 }
2865 \repeat "tremolo" 2 { c16 d16 }
2869 Tremolo marks can also be put on a single note. In this case, the
2870 note should not be surrounded by braces.
2871 @lilypond[quote,verbatim,raggedright]
2872 \repeat "tremolo" 4 c'16
2875 A similar mechanism is the tremolo subdivision, described in
2876 @ref{Tremolo subdivisions}.
2880 In this manual: @ref{Tremolo subdivisions}, @ref{Repeats}.
2882 Program reference: tremolo beams are @internalsref{Beam} objects. Single stem
2883 tremolos are @internalsref{StemTremolo} objects. The music expression is
2884 @internalsref{TremoloEvent}.
2886 Example files: @inputfileref{input/regression,chord-tremolo.ly},
2887 @inputfileref{input/regression,stem-tremolo.ly}.
2889 @node Tremolo subdivisions
2890 @subsection Tremolo subdivisions
2891 @cindex tremolo marks
2892 @cindex @code{tremoloFlags}
2894 Tremolo marks can be printed on a single note by adding
2895 `@code{:}[@var{length}]' after the note. The length must be at least
2896 8. A @var{length} value of 8 gives one line across the note stem. If
2897 the length is omitted, the last value (stored in @code{tremoloFlags})
2900 @lilypond[quote,verbatim,fragment]
2901 c'2:8 c':32 | c': c': |
2904 @c [TODO : stok is te kort bij 32en]
2908 Tremolos entered in this way do not carry over into the MIDI output.
2912 In this manual: @ref{Tremolo repeats}.
2914 Elsewhere: @internalsref{StemTremolo}, @internalsref{TremoloEvent}.
2916 @node Measure repeats
2917 @subsection Measure repeats
2919 @cindex percent repeats
2920 @cindex measure repeats
2922 In the @code{percent} style, a note pattern can be repeated. It is
2923 printed once, and then the pattern is replaced with a special sign.
2924 Patterns of a one and two measures are replaced by percent-like signs,
2925 patterns that divide the measure length are replaced by slashes
2927 @lilypond[quote,verbatim,raggedright]
2929 \repeat "percent" 4 { c'4 }
2930 \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
2936 Program reference: @internalsref{RepeatSlash}, @internalsref{PercentRepeat},
2937 @internalsref{PercentRepeatedMusic}, and
2938 @internalsref{DoublePercentRepeat}.
2942 @node Rhythmic music
2943 @section Rhythmic music
2947 * Showing melody rhythms::
2948 * Entering percussion::
2949 * Percussion staves::
2953 @node Showing melody rhythms
2954 @subsection Showing melody rhythms
2956 Sometimes you might want to show only the rhythm of a melody. This
2957 can be done with the rhythmic staff. All pitches of notes on such a
2958 staff are squashed, and the staff itself has a single line
2960 @lilypond[quote,fragment,relative=1,verbatim]
2961 \context RhythmicStaff {
2963 c4 e8 f g2 | r4 g r2 | g1:32 | r1 |
2969 Program reference: @internalsref{RhythmicStaff}.
2971 Examples: @inputfileref{input/regression,rhythmic-staff.ly}.
2974 @node Entering percussion
2975 @subsection Entering percussion
2981 Percussion notes may be entered in @code{\drums} mode, which is
2982 similar to @code{notes}. Each piece of percussion has a full name and
2983 an abbreviated name, and both be used in input files
2986 hihat hh bassdrum bd
2988 @lilypond[quote,raggedright]
2989 \new DrumStaff \drums { hihat hh bassdrum bd }
2992 The complete list of drum names is in the init file
2993 @file{ly/drumpitch-init.ly}.
2994 @c TODO: properly document this.
2998 Program reference: @internalsref{DrumNoteEvent}.
3000 @node Percussion staves
3001 @subsection Percussion staves
3005 A percussion part for more than one instrument typically uses a
3006 multiline staff where each position in the staff refers to one piece
3010 To typeset the music, the notes must be interpreted in a
3011 @internalsref{DrumStaff} and @internalsref{DrumVoice} contexts
3014 @lilypond[quote,raggedright,verbatim]
3015 up = \drums { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
3016 down = \drums { bassdrum4 snare8 bd r bd sn4 }
3018 \new DrumVoice { \voiceOne \up }
3019 \new DrumVoice { \voiceTwo \down }
3023 The above example shows verbose polyphonic notation. The short
3024 polyphonic notation, described in @ref{Polyphony}, can also be used if
3025 the @internalsref{DrumVoices} are instantiated by hand first. For example,
3027 @lilypond[quote,fragment,verbatim]
3029 \context DrumVoice = "1" { s1 *2 }
3030 \context DrumVoice = "2" { s1 *2 }
3034 { \repeat unfold 16 hh16 }
3043 There are also other layout possibilities. To use these, set the
3044 property @code{drumStyleTable} in context @internalsref{DrumVoice}.
3045 The following variables have been predefined
3049 is the default. It typesets a typical drum kit on a five-line staff
3051 @lilypond[quote,noindent]
3052 nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc
3053 bd sn ss tomh tommh tomml toml tomfh tomfl }
3054 mus = \drums { cymc cyms cymr hh | hhc hho hhho hhp | \break cb hc
3055 bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
3057 << \new DrumStaff\with {
3058 \remove Bar_engraver
3059 \remove Time_signature_engraver
3060 \override Stem #'transparent = ##t
3061 \override Stem #'Y-extent-callback = ##f
3062 minimumVerticalExtent = #'(-4.0 . 5.0)
3064 \context Lyrics \nam
3067 %% need to do this, because of indented @itemize
3070 \override LyricText #'font-family = #'typewriter
3071 \override BarNumber #'transparent =##T
3075 The drum scheme supports six different toms. When there fewer toms, simply
3076 select the toms that produce the desired result, i.e. to get toms on
3077 the three middle lines you use @code{tommh}, @code{tomml} and
3080 @item timbales-style
3081 to typeset timbales on a two line staff
3083 @lilypond[quote,raggedright]
3084 nam = \lyrics { timh ssh timl ssl cb }
3085 mus = \drums { timh ssh timl ssl cb s16 }
3088 \context DrumStaff \with {
3089 \remove Bar_engraver
3090 \remove Time_signature_engraver
3091 \override Stem #'transparent = ##t
3092 \override Stem #'Y-extent-callback = ##f
3093 \override StaffSymbol #'line-count = #2
3094 \override StaffSymbol #'staff-space = #2
3095 minimumVerticalExtent = #'(-3.0 . 4.0)
3096 drumStyleTable = #timbales-style
3099 \override LyricText #'font-family = #'typewriter
3105 to typeset congas on a two line staff
3107 @lilypond[quote,raggedright]
3108 nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl }
3109 mus = \drums { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
3111 \context DrumStaff\with {
3112 \remove Bar_engraver
3113 \remove Time_signature_engraver
3114 drumStyleTable = #congas-style
3115 \override StaffSymbol #'line-count = #2
3117 %% this sucks; it will lengthen stems.
3118 \override StaffSymbol #'staff-space = #2
3119 \override Stem #'transparent = ##t
3120 \override Stem #'Y-extent-callback = ##f
3123 \override LyricText #'font-family = #'typewriter
3128 to typeset bongos on a two line staff
3130 @lilypond[quote,raggedright]
3131 nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl }
3132 mus = \drums { boh boho bohm ssh bol bolo bolm ssl s16 }
3134 \context DrumStaff\with {
3135 \remove Bar_engraver
3136 \remove Time_signature_engraver
3137 \override StaffSymbol #'line-count = #2
3138 drumStyleTable = #bongos-style
3140 %% this sucks; it will lengthen stems.
3141 \override StaffSymbol #'staff-space = #2
3142 \override Stem #'transparent = ##t
3143 \override Stem #'Y-extent-callback = ##f
3146 \override LyricText #'font-family = #'typewriter
3151 @item percussion-style
3152 to typeset all kinds of simple percussion on one line staves
3153 @lilypond[quote,raggedright]
3154 nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc }
3155 mus = \drums { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
3157 \context DrumStaff\with{
3158 \remove Bar_engraver
3159 drumStyleTable = #percussion-style
3160 \override StaffSymbol #'line-count = #1
3161 \remove Time_signature_engraver
3162 \override Stem #'transparent = ##t
3163 \override Stem #'Y-extent-callback = ##f
3167 \override LyricText #'font-family = #'typewriter
3173 If you do not like any of the predefined lists you can define your own
3174 list at the top of your file
3176 @lilypond[quote,raggedright,verbatim]
3178 (bassdrum default #f -1)
3179 (snare default #f 0)
3181 (pedalhihat xcircle "stopped" 2)
3182 (lowtom diamond #f 3)))
3183 up = \drums { hh8 hh hh hh hhp4 hhp }
3184 down = \drums { bd4 sn bd toml8 toml }
3187 \set DrumStaff.drumStyleTable
3188 = #(alist->hash-table mydrums)
3189 \new DrumVoice { \voiceOne \up }
3190 \new DrumVoice { \voiceTwo \down }
3197 Init files: @file{ly/drumpitch-init.ly}.
3199 Program reference: @internalsref{DrumStaff}, @internalsref{DrumVoice}.
3203 Because general MIDI does not contain rim shots, the sidestick is used
3204 for this purpose instead.
3207 @section Piano music
3209 Piano staves are two normal staves coupled with a brace. The staves
3210 are largely independent, but sometimes voices can cross between the
3211 two staves. The same notation is also used for harps and other key
3212 instruments. The @internalsref{PianoStaff} is especially built to
3213 handle this cross-staffing behavior. In this section we discuss the
3214 @internalsref{PianoStaff} and some other pianistic peculiarities.
3218 * Automatic staff changes::
3219 * Manual staff switches::
3222 * Staff switch lines::
3223 * Cross staff stems::
3228 Dynamics are not centered, but kludges do exist. See
3229 @inputfileref{input/template,piano-dynamics.ly}.
3231 @cindex cross staff stem
3232 @cindex stem, cross staff
3233 @cindex distance between staves in piano music
3235 The distance between the two staves is normally fixed across the
3236 entire score. It is possible to tune this per system, but it does
3237 require arcane command incantations. See
3238 @inputfileref{input/test,piano-staff-distance.ly}.
3241 @node Automatic staff changes
3242 @subsection Automatic staff changes
3243 @cindex Automatic staff changes
3245 Voices can switch automatically between the top and the bottom
3246 staff. The syntax for this is
3250 \autochange \context Voice @{ @dots{}@var{music}@dots{} @}
3255 The two staves of the piano staff must be named @code{up} and
3258 A @code{\relative} section that is outside of @code{\autochange} has
3259 no effect on the pitches of @var{music}, so, if necessary, put
3260 @code{\relative} inside @code{\autochange} like
3264 \autochange \relative @dots{} \new Voice @dots{}
3269 The autochanger switches on basis of pitch (middle C is the turning
3270 point), and it looks ahead skipping over rests to switch in
3271 advance. Here is a practical example
3273 @lilypond[quote,verbatim,raggedright]
3274 \context PianoStaff <<
3275 \context Staff = "up" {
3276 \autochange \new Voice \relative c' {
3277 g4 a b c d r4 a g } }
3278 \context Staff = "down" {
3285 In this example, spacer rests are used to prevent the bottom staff from
3286 terminating too soon.
3291 In this manual: @ref{Manual staff switches}.
3293 Program reference: @internalsref{AutoChangeMusic}.
3299 The staff switches often do not end up in optimal places. For high
3300 quality output, staff switches should be specified manually.
3303 @code{\autochange} cannot be inside @code{\times}.
3305 Internally, the @code{\partcombine} interprets both arguments as
3306 @code{Voice}s named @code{one} and @code{two}, and then decides when
3307 the parts can be combined. Consequently, if the arguments switch to
3308 differently named @internalsref{Voice} contexts, the events in those
3312 @node Manual staff switches
3313 @subsection Manual staff switches
3315 @cindex manual staff switches
3316 @cindex staff switch, manual
3318 Voices can be switched between staves manually, using the following command
3320 \change Staff = @var{staffname} @var{music}
3324 The string @var{staffname} is the name of the staff. It switches the
3325 current voice from its current staff to the Staff called
3326 @var{staffname}. Typically @var{staffname} is @code{"up"} or
3327 @code{"down"}. The @context{Staff} referred to must already exist, so
3328 usually the setup for a score will start with a setup of the staves,
3332 \context Staff = up @{
3333 \skip 1 * 10 %@emph{ keep staff alive}
3335 \context Staff = down @{
3336 \skip 1 * 10 %@emph{idem}
3342 and the @context{Voice} is inserted afterwards
3345 \context Staff = down
3346 \new Voice @{ @dots{} \change Staff = up @dots{} @}
3354 Pianos have pedals that alter the way sound are produced. Generally, a
3355 piano has three pedals, sustain, una corda, and sostenuto.
3358 Piano pedal instruction can be expressed by attaching
3359 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
3360 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
3363 @lilypond[quote,fragment,verbatim]
3364 c'4\sustainDown c'4\sustainUp
3367 What is printed can be modified by setting @code{pedal@var{X}Strings},
3368 where @var{X} is one of the pedal types: @code{Sustain},
3369 @code{Sostenuto} or @code{UnaCorda}. Refer to
3370 @internalsref{SustainPedal} in the program reference for more
3373 Pedals can also be indicated by a sequence of brackets, by setting the
3374 @code{pedalSustainStyle} property to @code{bracket} objects
3376 @lilypond[quote,fragment,verbatim,relative=2]
3377 \set Staff.pedalSustainStyle = #'bracket
3379 b\sustainUp\sustainDown
3380 b g \sustainUp a \sustainDown \bar "|."
3383 A third style of pedal notation is a mixture of text and brackets,
3384 obtained by setting the @code{pedalSustainStyle} style property to
3387 @lilypond[quote,fragment,verbatim,relative=2]
3388 \set Staff.pedalSustainStyle = #'mixed
3390 b\sustainUp\sustainDown
3391 b g \sustainUp a \sustainDown \bar "|."
3394 The default `*Ped.' style for sustain and damper pedals corresponds to
3395 style @code{#'text}. The sostenuto pedal uses @code{mixed} style by
3398 @lilypond[quote,fragment,verbatim,relative=2]
3399 c\sostenutoDown d e c, f g a\sostenutoUp
3402 For fine-tuning of the appearance of a pedal bracket, the properties
3403 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
3404 @code{PianoPedalBracket} objects (see
3405 @internalsref{PianoPedalBracket} in the Program reference) can be modified. For example, the
3406 bracket may be extended to the end of the note head
3408 @lilypond[quote,fragment,verbatim,relative=2]
3409 \override Staff.PianoPedalBracket
3410 #'shorten-pair = #'(0 . -1.0)
3411 c\sostenutoDown d e c, f g a\sostenutoUp
3415 @subsection Arpeggio
3418 @cindex broken arpeggio
3419 @cindex @code{\arpeggio}
3421 You can specify an arpeggio sign on a chord by attaching an
3422 @code{\arpeggio} to a chord
3425 @lilypond[quote,fragment,relative=1,verbatim]
3429 When an arpeggio crosses staves, you attach an arpeggio to the chords
3430 in both staves, and set
3431 @internalsref{PianoStaff}.@code{connectArpeggios}
3433 @lilypond[quote,fragment,relative=1,verbatim]
3434 \context PianoStaff <<
3435 \set PianoStaff.connectArpeggios = ##t
3436 \new Staff { <c' e g c>\arpeggio }
3437 \new Staff { \clef bass <c,, e g>\arpeggio }
3441 The direction of the arpeggio is sometimes denoted by adding an
3442 arrowhead to the wiggly line
3444 @lilypond[quote,fragment,relative=1,verbatim]
3453 A square bracket on the left indicates that the player should not
3454 arpeggiate the chord
3456 @lilypond[quote,fragment,relative=1,verbatim]
3463 @cindex @code{\arpeggio}
3465 @cindex @code{\arpeggioUp}
3467 @cindex @code{\arpeggioDown}
3468 @code{\arpeggioDown},
3469 @cindex @code{\arpeggioBoth}
3470 @code{\arpeggioBoth},
3471 @cindex @code{\arpeggioBracket}
3472 @code{\arpeggioBracket}.
3476 Program reference: @internalsref{ArpeggioEvent} music expressions lead to
3477 @internalsref{Arpeggio} objects. Cross staff arpeggios are
3478 @internalsref{PianoStaff}.@internalsref{Arpeggio}.
3482 It is not possible to mix connected arpeggios and unconnected
3483 arpeggios in one @internalsref{PianoStaff} at the same time.
3485 @node Staff switch lines
3486 @subsection Staff switch lines
3489 @cindex follow voice
3490 @cindex staff switching
3493 @cindex @code{followVoice}
3495 Whenever a voice switches to another staff a line connecting the notes
3496 can be printed automatically. This is enabled if the property
3497 @code{PianoStaff.followVoice} is set to true
3499 @lilypond[quote,fragment,relative=1,verbatim]
3500 \context PianoStaff <<
3501 \set PianoStaff.followVoice = ##t
3502 \context Staff \context Voice {
3507 \context Staff=two { \clef bass \skip 1*2 }
3513 The associated object is @internalsref{VoiceFollower}.
3517 @cindex @code{\showStaffSwitch}
3518 @code{\showStaffSwitch},
3519 @cindex @code{\hideStaffSwitch}
3520 @code{\hideStaffSwitch}.
3523 @node Cross staff stems
3524 @subsection Cross staff stems
3526 The chords which cross staves may be produced by increasing the length
3527 of the stem in the lower stave, so it reaches the stem in the upper
3528 stave, or vice versa.
3530 @lilypond[raggedright,verbatim]
3531 stemExtend = \once \override Stem #'length = #22
3532 noFlag = \once \override Stem #'flag-style = #'no-flag
3533 \context PianoStaff <<
3535 \stemDown \stemExtend
3549 @section Vocal music
3552 The easiest way to add lyrics to a melody, is by appending
3557 \addlyrics @{ @var{the lyrics} @}
3560 to a melody. Here is an example,
3562 @lilypond[raggedright,verbatim]
3563 \relative { \time 3/4 c2 e4 g2. }
3564 \addlyrics { play the game }
3567 More stanzas can be added by adding more
3568 @code{\addlyrics} sections
3570 @lilypond[raggedright,verbatim]
3571 \relative { \time 3/4 c2 e4 g2. }
3572 \addlyrics { play the game }
3573 \addlyrics { speel het spel }
3574 \addlyrics { joue le jeu }
3577 The @code{\addlyrics} keyword has three functions: it interprets the
3578 following words as texts instead of notes, it sets up a context for
3579 printing texts (the @code{Lyrics} context), and it couples the melody
3580 with the lyrics, so the durations of both are aligned.
3582 These three functions can be controlled separately, and that is what
3583 the following sections are about.
3587 * The Lyrics context::
3588 * Flexibility in alignment::
3593 @node Entering lyrics
3594 @subsection Entering lyrics
3598 @cindex @code{\lyrics}
3601 Lyrics are entered in a special input mode. This mode is is introduced
3602 by the keyword @code{\lyrics}. In this mode you can enter lyrics,
3603 with punctuation and accents without any hassle. Syllables are
3604 entered like notes, but with pitches replaced by text. For example,
3606 \lyrics @{ Twin-4 kle4 twin- kle litt- le star2 @}
3609 A word in Lyrics mode begins with: an alphabetic character, @code{_},
3610 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
3611 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
3612 any 8-bit character with ASCII code over 127, or a two-character
3613 combination of a backslash followed by one of @code{`}, @code{'},
3614 @code{"}, or @code{^}.
3616 Subsequent characters of a word can be any character that is not a digit
3617 and not white space. One important consequence of this is that a word
3618 can end with @code{@}}. The following example is usually a bug. The
3619 syllable includes a @code{@}}, and hence the opening brace is not balanced
3621 \lyrics @{ twinkle@}
3624 @cindex @code{\property}, in @code{\lyrics}
3625 Similarly, a period following a alphabetic sequence, is included in
3626 the resulting string. As a consequence, spaces must be inserted around
3629 \override Score . LyricText #'font-shape = #'italic
3633 @cindex spaces, in lyrics
3634 @cindex quotes, in lyrics
3636 Any @code{_} character which appears in an unquoted word is converted
3637 to a space. This provides a mechanism for introducing spaces into words
3638 without using quotes. Quoted words can also be used in Lyrics mode to
3639 specify words that cannot be written with the above rules. The
3640 following example incorporates double quotes
3643 \lyrics @{ He said: "\"Let" my peo ple "go\"" @}
3646 This example is slightly academic, since it gives better looking
3647 results to use matched single quotes, @code{``} and @code{''}
3649 \lyrics @{ He said: ``Let my peo ple go'' @}
3654 Centered hyphens are entered as `@code{-}@code{-}' between syllables.
3655 The hyphen will have variable length depending on the space between
3656 the syllables and it will be centered between the syllables.
3661 When a lyric is sung over many notes (this is called a melisma), this is
3662 indicated with a horizontal line centered between a syllable and the
3663 next one. Such a line is called an extender line, and it is entered as
3668 Program reference: events @internalsref{LyricEvent},
3669 @internalsref{HyphenEvent}, and @internalsref{ExtenderEvent}. Objects
3670 @internalsref{LyricHyphen}, @internalsref{LyricExtender} and
3671 @internalsref{LyricText}.
3673 Examples: @inputfileref{input/test,lyric-hyphen-retain.ly}.
3677 The definition of lyrics mode is too complex.
3681 @node The Lyrics context
3682 @subsection The Lyrics context
3685 Lyrics are printed by interpreting them in a @internalsref{Lyrics} context
3687 \context Lyrics \lyrics @dots{}
3690 @cindex automatic syllable durations
3691 @cindex @code{\lyricsto}
3692 @cindex lyrics and melodies
3694 This will place the lyrics according to the durations that were
3695 entered. The lyrics can also be aligned under a given melody
3696 automatically. In this case, it is no longer necessary to enter the
3697 correct duration for each syllable. This is achieved by combining the
3698 melody and the lyrics with the @code{\lyricsto} expression
3700 \lyricsto @var{name} \new Lyrics @dots{}
3703 This aligns the lyrics to the
3705 notes of the @internalsref{Voice} context called @var{name}, which has
3706 to exist. Therefore, normally the @code{Voice} is specified first, and
3707 then the lyrics are specified with @code{\lyricsto}. The command
3708 @code{\lyricsto} switches to @code{\lyrics} mode automatically, so the
3709 @code{\lyrics} keyword may be omitted.
3711 For different or more complex orderings, the best way is to setup the
3712 hierarchy of staves and lyrics first, e.g.
3714 \context ChoirStaff <<
3715 \context Lyrics = sopranoLyrics @{ s1 @}
3716 \context Voice = soprano @{ @emph{music} @}
3717 \context Lyrics = tenorLyrics @{ s1 @}
3718 \context Voice = tenor @{ @emph{music} @}
3721 and then combine the appropriate melodies and lyric lines
3723 \lyricsto "soprano" \context Lyrics = sopranoLyrics
3728 The final input would resemble
3731 << \context ChoirStaff << @emph{setup the music} >>
3732 \lyricsto "soprano" @emph{etc}
3733 \lyricsto "alto" @emph{etc}
3739 The @code{\lyricsto} command detects melismata: it only puts one
3740 syllable under a tied or slurred group of notes. If you want to force
3741 an unslurred group of notes to be a melisma, insert @code{\melisma}
3742 after the first note of the group, and @code{\melismaEnd} after the
3745 @lilypond[quote,relative=2,raggedright,fragment,verbatim]
3747 \context Voice = "lala" {
3755 \lyricsto "lala" \new Lyrics {
3761 In addition, notes are considered a melisma if they are manually
3762 beamed, and automatic beaming (see @ref{Setting automatic beam
3763 behavior}) is switched off. The criteria for deciding melismata can
3764 be tuned with the property @code{melismaBusyProperties}. See
3765 @internalsref{Melisma_translator} in the program reference for more
3768 Lyrics can also be entered without @code{\lyricsto}. In this case the
3769 durations of each syllable must be entered explicitly, for example,
3776 Alignment to a melody can be specified with the @code{associatedVoice}
3780 \set associatedVoice = #"melody"
3783 Here is an example demonstrating manual lyric durations,
3785 @lilypond[relative=1,verbatim,fragment]
3786 << \context Voice = melody {
3790 \new Lyrics \lyrics {
3791 \set associatedVoice = #"melody"
3797 @cindex choral score
3799 A complete example of a SATB score setup is in the file
3800 @inputfileref{input/template,satb.ly}.
3805 @code{\melisma}, @code{\melismaEnd}
3806 @cindex @code{\melismaEnd}
3807 @cindex @code{\melisma}
3811 Program reference: Music expressions: @internalsref{LyricCombineMusic},
3812 Contexts: @internalsref{Lyrics}, @internalsref{Melisma_translator}.
3814 Examples: @inputfileref{input/template,satb.ly},
3815 @inputfileref{input/regression,lyric-combine-new.ly},
3816 @c TODO: make separate section for melismata
3817 @inputfileref{input/test,lyrics-melisma-variants.ly}.
3818 @inputfileref{input/test,lyrics-melisma-faster.ly}.
3822 Melismata are not detected automatically, and extender lines must be
3826 For proper processing of extender lines, the
3827 @internalsref{Lyrics} and @internalsref{Voice} should be
3828 linked. This can be achieved either by using @code{\lyricsto} or by
3829 setting corresponding names for both contexts. The latter is explained
3830 in @ref{More stanzas}.
3832 @c TODO: document \new Staff << Voice \lyricsto >> bug
3834 @node Flexibility in alignment
3835 @subsection Flexibility in alignment
3838 Often, different stanzas of one song are put to one melody in slightly
3839 differing ways. Such variations can still be captured with
3842 One possibility is that the text has a melisma in one stanza, but
3843 multiple syllables in another one. One solution is to make the faster
3844 voice ignore the melisma. This is done by setting
3845 @code{ignoreMelismata} in the Lyrics context.
3847 There has one tricky aspect. The setting for @code{ignoreMelismata}
3848 must be set one syllable @emph{before} the non-melismatic syllable
3849 in the text, as shown here,
3851 @lilypond[verbatim,raggedright]
3853 \relative \context Voice = "lahlah" {
3854 \set Staff.autoBeaming = ##f
3860 \new Lyrics \lyricsto "lahlah" {
3863 \new Lyrics \lyricsto "lahlah" {
3864 \set ignoreMelismata = ##t % applies to "fas"
3866 \unset ignoreMelismata
3873 The @code{ignoreMelismata} applies to the syllable ``fas'', so it
3874 should bev entered before ``go''.
3876 The reverse is also possible: making a lyric line slower than the
3877 standard. This can be achieved by insert @code{\skip}s into the
3878 lyrics. For every @code{\skip}, the text will be delayed another note.
3881 @lilypond[verbatim,raggedright]
3882 \relative { c c g' }
3889 More complex variations in text underlay are possible. It is possible
3890 to switch the melody for a line of lyrics during the text. This is
3891 done by setting the @code{associatedVoice} property. In the example
3893 @lilypond[raggedright]
3895 \relative \context Voice = "lahlah" {
3896 \set Staff.autoBeaming = ##f
3899 \context Voice = alternative {
3903 % show associations clearly.
3904 \override NoteColumn #'force-hshift = #-3
3916 \new Lyrics \lyricsto "lahlah" {
3917 Ju -- ras -- sic Park
3919 \new Lyrics \lyricsto "lahlah" {
3921 % Tricky: need to set associatedVoice
3922 % one syllable too soon!
3923 \set associatedVoice = alternative % applies to "ran"
3927 \set associatedVoice = lahlah % applies to "rus"
3933 the text for the first stanza is set to a melody called ``lahlah'',
3936 \new Lyrics \lyricsto "lahlah" {
3937 Ju -- ras -- sic Park
3942 The second stanza initially is set to the @code{lahlah} context, but
3943 for the syllable ``ran'', it switches to a different melody.
3944 This is achieved with
3946 \set associatedVoice = alternative
3950 Here, @code{alternative} is the name of the @code{Voice} context
3951 containing the triplet.
3953 Again, the command must be one syllable too early, before ``Ty'' in
3957 \new Lyrics \lyricsto "lahlah" {
3958 \set associatedVoice = alternative % applies to "ran"
3962 \set associatedVoice = lahlah % applies to "rus"
3968 The underlay is switched back to the starting situation by assigning
3969 @code{lahlah} to @code{associatedVoice}.
3975 @subsection More stanzas
3977 @cindex phrasing, in lyrics
3980 @cindex stanza number
3981 @cindex singer's names
3982 @cindex name of singer
3984 Stanza numbers can be added by setting @code{stanza}, e.g.
3986 @lilypond[quote,verbatim,relative=2,fragment]
3988 \time 3/4 g2 e4 a2 f4 g2.
3991 Hi, my name is Bert.
3994 Oh, che -- ri, je t'aime
3998 These numbers are put just before the start of first syllable.
4000 Names of singers can also be added. They are printed at the start of
4001 the line, just like instrument names. They are created by setting
4002 @code{vocalName}. A short version may be entered as @code{vocNam}.
4005 @lilypond[fragment,quote,verbatim,relative=2]
4007 \time 3/4 g2 e4 a2 f4 g2.
4009 \set vocalName = "Bert "
4010 Hi, my name is Bert.
4012 \set vocalName = "Ernie "
4013 Oh, che -- ri, je t'aime
4019 Program reference: Layout objects @internalsref{LyricText} and
4020 @internalsref{VocalName}. Music expressions
4021 @internalsref{LyricEvent}.
4029 The term @emph{ambitus} denotes a range of pitches for a given voice
4030 in a part of music. It also may denote the pitch range that a musical
4031 instrument is capable of playing. Ambits are printed on vocal
4032 parts, so singers can easily determine if it meets his or her
4035 It denoted at the beginning of a piece near the initial clef. The
4036 range is graphically specified by two note heads, that represent the
4037 minimum and maximum pitch. To print such ambits, add the
4038 @internalsref{Ambitus_engraver} to the @internalsref{Voice} context,
4045 \consists Ambitus_engraver
4050 This results in the following output
4052 @lilypond[quote,raggedright]
4056 \consists Ambitus_engraver
4071 If you have multiple voices in a single staff, and you want a single
4072 ambitus per staff rather than per each voice, add the
4073 @internalsref{Ambitus_engraver} to the @internalsref{Staff} context
4074 rather than to the @internalsref{Voice} context. Here is an example,
4076 @lilypond[verbatim,raggedright]
4079 \consists "Ambitus_engraver"
4081 \override Ambitus #'X-offset-callbacks
4082 = #(list (lambda (grob axis) -1.0))
4087 \consists "Ambitus_engraver"
4096 This example uses one advanced feature,
4099 \override Ambitus #'X-offset-callbacks
4100 = #(list (lambda (grob axis) -1.0))
4104 This code moves the ambitus to the left. The same effect could have
4105 been achieved with @code{extra-offset}, but then the formatting system
4106 would not reserve space for the moved object.
4110 Program reference: @internalsref{Ambitus},
4111 @internalsref{AmbitusLine}, @internalsref{AmbitusNoteHead},
4112 @internalsref{AmbitusAccidental}.
4114 Examples: @inputfileref{input/regression,ambitus.ly}.
4118 There is no collision handling in the case of multiple per-voice
4121 @node Other instrument specific notation
4122 @section Other instrument specific notation
4128 @node Harmonic notes
4129 @subsection Harmonic notes
4131 @cindex artificial harmonics
4134 Artificial harmonics are notated with a different notehead style. They
4136 marking the harmonic pitch with @code{\harmonic}.
4138 @lilypond[raggedright,verbatim]
4149 @cindex guitar tablature
4151 Tablature notation is used for notating music for plucked string
4152 instruments. It notates pitches not by using note heads, but by
4153 indicating on which string and fret a note must be played. LilyPond
4154 offers limited support for tablature.
4157 * Tablatures basic::
4158 * Non-guitar tablatures::
4161 @node Tablatures basic
4162 @subsection Tablatures basic
4163 @cindex Tablatures basic
4165 The string number associated to a note is given as a backslash
4166 followed by a number, e.g. @code{c4\3} for a C quarter on the third
4167 string. By default, string 1 is the highest one, and the tuning
4168 defaults to the standard guitar tuning (with 6 strings). The notes
4169 are printed as tablature, by using @internalsref{TabStaff} and
4170 @internalsref{TabVoice} contexts
4172 @lilypond[quote,fragment,verbatim]
4179 @cindex @code{minimumFret}
4182 When no string is specified, the first string that does not give a
4183 fret number less than @code{minimumFret} is selected. The default
4184 value for @code{minimumFret} is 0
4189 \set TabStaff.minimumFret = #8
4192 @lilypond[quote,noindent,raggedright]
4196 \set TabStaff.minimumFret = #8
4199 \context StaffGroup <<
4200 \context Staff { \clef "G_8" \frag }
4201 \context TabStaff { \frag }
4207 Program reference: @internalsref{TabStaff}, @internalsref{TabVoice}, and
4208 @internalsref{StringNumberEvent}.
4212 Chords are not handled in a special way, and hence the automatic
4213 string selector may easily select the same string to two notes in a
4217 @node Non-guitar tablatures
4218 @subsection Non-guitar tablatures
4219 @cindex Non-guitar tablatures
4221 You can change the number of strings, by setting the number of lines
4222 in the @internalsref{TabStaff}.
4224 You can change the tuning of the strings. A string tuning is given as
4225 a Scheme list with one integer number for each string, the number
4226 being the pitch (measured in semitones relative to middle C) of an
4227 open string. The numbers specified for @code{stringTuning} are the
4228 numbers of semitones to subtract or add, starting the specified pitch
4229 by default middle C, in string order. Thus, the notes are e, a, d, and
4232 @lilypond[quote,fragment,verbatim]
4233 \context TabStaff <<
4234 \set TabStaff.stringTunings = #'(-5 -10 -15 -20)
4237 a,4 c' a e' e c' a e'
4244 No guitar special effects have been implemented.
4248 Program reference: @internalsref{Tab_note_heads_engraver}.
4252 @section Popular music
4259 * Printing chord names::
4264 @subsection Chord names
4267 LilyPond has support for both printing chord names. Chords may be
4268 entered in musical chord notation, i.e. @code{< .. >}, but they can
4269 also be entered by name. Internally, the chords are represented as a
4270 set of pitches, so they can be transposed
4273 @lilypond[quote,verbatim,raggedright]
4274 twoWays = \transpose c c' {
4283 << \context ChordNames \twoWays
4284 \context Voice \twoWays >>
4287 This example also shows that the chord printing routines do not try to
4288 be intelligent. The last chord (@code{f bes d}) is not interpreted as
4294 * Printing chord names::
4299 @subsection Chords mode
4302 Chord mode is a mode where you can input sets of pitches using common
4303 names. It is introduced by the keyword @code{\chords}.
4304 In chords mode, a chord is entered by the root, which is entered
4306 @lilypond[quote,fragment,verbatim,relative=2]
4307 \chords { es4. d8 c2 }
4312 Other chords may be entered by suffixing a colon, and introducing a
4313 modifier, and optionally, a number
4315 @lilypond[quote,fragment,verbatim]
4316 \chords { e1:m e1:7 e1:m7 }
4318 The first number following the root is taken to be the `type' of the
4319 chord, thirds are added to the root until it reaches the specified
4321 @lilypond[quote,fragment,verbatim]
4322 \chords { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 }
4325 @cindex root of chord
4326 @cindex additions, in chords
4327 @cindex removals, in chords
4329 More complex chords may also be constructed adding separate steps
4330 to a chord. Additions are added after the number following
4331 the colon, and are separated by dots
4333 @lilypond[quote,verbatim,fragment]
4334 \chords { c:5.6 c:3.7.8 c:3.6.13 }
4336 Chord steps can be altered by suffixing a @code{-} or @code{+} sign
4338 @lilypond[quote,verbatim,fragment]
4339 \chords { c:7+ c:5+.3- c:3-.5-.7- }
4341 Removals are specified similarly, and are introduced by a caret. They
4342 must come after the additions
4343 @lilypond[quote,verbatim,fragment]
4344 \chords { c^3 c:7^5 c:9^3.5 }
4347 Modifiers can be used to change pitches. The following modifiers are
4351 is the minor chord. This modifier lowers the 3rd and (if present) the 7th step.
4353 is the diminished chord. This modifier lowers the 3rd, 5th and (if present)
4356 is the augmented chord. This modifier raises the 5th step.
4358 is the major 7th chord. This modifier raises the 7th step if present.
4360 is the suspended 4th or 2nd. This modifier removes the 3rd
4361 step. Append either @code{2} or @code{4} to add the 2nd or 4th step to
4364 Modifiers can be mixed with additions
4365 @lilypond[quote,verbatim,fragment]
4366 \chords { c:sus4 c:7sus4 c:dim7 c:m6 }
4369 @cindex modifiers, in chords.
4376 Since an unaltered 11 does not sound good when combined with an
4377 unaltered 3, the 11 is removed in this case (unless it is added
4380 @lilypond[quote,fragment,verbatim]
4381 \chords { c:13 c:13.11 c:m13 }
4386 An inversion (putting one pitch of the chord on the bottom), as well
4387 as bass notes, can be specified by appending
4388 @code{/}@var{pitch} to the chord
4389 @lilypond[quote,fragment,verbatim]
4390 \chords { c1 c/g c/f }
4394 A bass note can be added instead of transposed out of the chord,
4395 by using @code{/+}@var{pitch}.
4397 @lilypond[quote,fragment,verbatim]
4398 \chords { c1 c/+g c/+f }
4401 Chords is a mode similar to @code{\lyrics} etc. Most
4402 of the commands continue to work, for example, @code{r} and
4403 @code{\skip} can be used to insert rests and spaces, and property
4404 commands may be used to change various settings.
4410 Each step can only be present in a chord once. The following
4411 simply produces the augmented chord, since @code{5+} is interpreted
4414 @lilypond[quote,verbatim,fragment]
4415 \chords { c:5.5-.5+ }
4419 @node Printing chord names
4420 @subsection Printing chord names
4422 @cindex printing chord names
4426 For displaying printed chord names, use the @internalsref{ChordNames} context.
4427 The chords may be entered either using the notation
4428 described above, or directly using @code{<} and @code{>}
4430 @lilypond[quote,verbatim,raggedright]
4432 \chords {a1 b c} <d' f' a'> <e' g' b'>
4436 \context ChordNames \scheme
4437 \context Staff \scheme
4441 You can make the chord changes stand out by setting
4442 @internalsref{ChordNames}.@code{chordChanges} to true. This will only
4443 display chord names when there is a change in the chords scheme and at
4444 the start of a new line
4446 @lilypond[quote,verbatim,linewidth=9\cm]
4448 c1:m c:m \break c:m c:m d
4451 \context ChordNames {
4452 \set chordChanges = ##t
4454 \context Staff \transpose c c' \scheme
4458 The previous examples all show chords over a staff. This is not
4459 necessary. Chords may also be printed separately. It may be necessary
4460 to add @internalsref{Volta_engraver} and @internalsref{Bar_engraver}
4461 for showing repeats.
4463 @lilypond[raggedright,verbatim]
4464 \new ChordNames \with {
4465 \override BarLine #'bar-size = #4
4466 voltaOnThisStaff = ##t
4467 \consists Bar_engraver
4468 \consists "Volta_engraver"
4470 \repeat volta 2 \chords {
4479 The default chord name layout is a system for Jazz music, proposed by
4480 Klaus Ignatzek (see @ref{Literature list}). It can be tuned through the
4481 following properties
4484 @cindex @code{chordNameExceptions}
4485 @item chordNameExceptions
4486 This is a list that contains the chords that have special formatting.
4488 @inputfileref{input/regression,chord-name-exceptions.ly}.
4489 @cindex exceptions, chord names.
4492 @cindex @code{majorSevenSymbol}
4493 @item majorSevenSymbol
4494 This property contains the markup object used for the 7th step, when
4495 it is major. Predefined options are @code{whiteTriangleMarkup} and
4496 @code{blackTriangleMarkup}. See
4497 @inputfileref{input/regression,chord-name-major7.ly} for an example.
4499 @cindex @code{chordNameSeparator}
4500 @item chordNameSeparator
4501 Different parts of a chord name are normally separated by a
4502 slash. By setting @code{chordNameSeparator}, you can specify other
4504 @lilypond[quote,fragment,verbatim]
4505 \context ChordNames \chords {
4507 \set chordNameSeparator
4508 = \markup { \typewriter "|" }
4513 @cindex @code{chordRootNamer}
4514 @item chordRootNamer
4515 The root of a chord is usually printed as a letter with an optional
4516 alteration. The transformation from pitch to letter is done by this
4517 function. Special note names (for example, the German ``H'' for a
4518 B-chord) can be produced by storing a new function in this property.
4520 @cindex @code{chordNoteNamer}
4521 @item chordNoteNamer
4522 The default is to print single pitch, e.g. the bass note, using the
4523 @code{chordRootNamer}. The @code{chordNoteNamer} property can be set
4524 to a specialized function to change this behavior. For example, the
4525 base can be printed in lower case.
4529 The predefined variables @code{\germanChords},
4530 @code{\semiGermanChords} set these variables. The effect is
4533 @lilypondfile[notexidoc]{chord-names-german.ly}
4535 There are also two other chord name schemes implemented: an alternate
4536 Jazz chord notation, and a systematic scheme called Banter chords. The
4537 alternate jazz notation is also shown on the chart in @ref{Chord name
4538 chart}. Turning on these styles is described in the input file
4539 @inputfileref{input/test,chord-names-jazz.ly}.
4543 @cindex chords, jazz
4548 @cindex @code{\germanChords}
4549 @code{\germanChords},
4550 @cindex @code{\semiGermanChords}
4551 @code{\semiGermanChords}.
4558 Examples: @inputfileref{input/regression,chord-name-major7.ly},
4559 @inputfileref{input/regression,chord-name-exceptions.ly},
4560 @inputfileref{input/test,chord-names-jazz.ly},
4561 @inputfileref{input/test,chords-without-melody.ly}.
4564 Init files: @file{scm/chords-ignatzek.scm}, and @file{scm/chord-entry.scm}.
4569 Chord names are determined solely from the list of pitches. Chord
4570 inversions are not identified, and neither are added bass notes. This
4571 may result in strange chord names when chords are entered with the
4572 @code{< .. >} syntax.
4576 @subsection Improvisation
4578 Improvisation is sometimes denoted with slashed note heads. Such note
4579 heads can be created by adding a @internalsref{Pitch_squash_engraver}
4580 to the @internalsref{Staff} or @internalsref{Voice} context. Then, the
4584 \set squashedPosition = #0
4585 \override NoteHead #'style = #'slash
4589 switches on the slashes.
4591 There are shortcuts @code{\improvisationOn} (and an accompanying
4592 @code{\improvisationOff}) for this command sequence. They are used in
4593 the following example
4595 @lilypond[verbatim,raggedright]
4597 \consists Pitch_squash_engraver
4599 e8 e g a a16(bes)(a8) g \improvisationOn
4602 ~fis2 \improvisationOff a16(bes) a8 g e
4608 @node Orchestral music
4609 @section Orchestral music
4611 @cindex Writing parts
4613 Orchestral music involves some special notation, both in the full
4614 score and the individual parts. This section explains how to tackle
4615 some common problems in orchestral music.
4620 * Multiple staff contexts::
4621 * Aligning to cadenzas::
4624 * Instrument names::
4626 * Instrument transpositions::
4627 * Multi measure rests::
4628 * Automatic part combining::
4630 * Different editions from one source::
4631 * Quoting other voices::
4634 @node Multiple staff contexts
4635 @subsection Multiple staff contexts
4637 Polyphonic scores consist of many staves. These staves can be
4638 constructed in three different ways
4640 @item The group is started with a brace at the left, and bar lines are
4641 connected. This is done with the @internalsref{GrandStaff} context.
4643 @item The group is started with a bracket, and bar lines are connected. This is done with the
4644 @internalsref{StaffGroup} context
4647 @item The group is started with a vertical line. Bar lines are not
4648 connected. This is the default for the score.
4652 @cindex Staff, multiple
4653 @cindex bracket, vertical
4654 @cindex brace, vertical
4659 @node Aligning to cadenzas
4660 @subsection Aligning to cadenzas
4663 In an orchestral context, cadenzas present a special problem:
4664 when constructing a score that includes a cadenza, all other
4665 instruments should skip just as many notes as the length of the
4666 cadenza, otherwise they will start too soon or too late.
4668 A solution to this problem are the functions @code{mmrest-of-length}
4669 and @code{skip-of-length}. These Scheme functions take a piece music
4670 as argument, and generate a @code{\skip} or multi rest, exactly as
4671 long as the piece. The use of @code{mmrest-of-length} is demonstrated
4672 in the following example.
4674 @lilypond[verbatim,raggedright]
4675 cadenza = \relative c' {
4676 c4 d8 << { e f g } \\ { d4. } >>
4681 \new Staff { \cadenza c'4 }
4683 #(ly:export (mmrest-of-length cadenza))
4693 @node Rehearsal marks
4694 @subsection Rehearsal marks
4695 @cindex Rehearsal marks
4697 @cindex @code{\mark}
4699 To print a rehearsal mark, use the @code{\mark} command
4700 @lilypond[quote,fragment,verbatim]
4711 (The letter I is skipped in accordance with engraving traditions.)
4713 The mark is incremented automatically if you use @code{\mark
4714 \default}, but you can also use an integer argument to set the mark
4715 manually. The value to use is stored in the property
4716 @code{rehearsalMark}.
4718 The style is defined by the property @code{markFormatter}. It is a
4719 function taking the current mark (an integer) and the current context
4720 as argument. It should return a markup object. In the following
4721 example, @code{markFormatter} is set to a canned procedure. After a
4722 few measures, it is set to function that produces a boxed number.
4724 @lilypond[quote,verbatim,fragment,relative=2]
4725 \set Score.markFormatter = #format-mark-numbers
4728 \set Score.markFormatter
4729 = #(lambda (mark context)
4730 (make-bold-markup (make-box-markup (number->string mark))))
4735 The file @file{scm/translation-functions.scm} contains the definitions
4736 of @code{format-mark-numbers} (the default format) and
4737 @code{format-mark-letters}. They can be used as inspiration for other
4738 formatting functions.
4741 @cindex coda on bar line
4742 @cindex segno on bar line
4743 @cindex fermata on bar line
4744 @cindex bar lines, symbols on
4746 The @code{\mark} command can also be used to put signs like coda,
4747 segno and fermatas on a bar line. Use @code{\markup} to
4748 to access the appropriate symbol
4750 @lilypond[quote,fragment,verbatim,relative=2]
4751 c1 \mark \markup { \musicglyph #"scripts-ufermata" }
4755 In the case of a line break, marks must also be printed at the end of
4756 the line, and not at the beginning. Use the following to force that
4759 \override Score.RehearsalMark
4760 #'break-visibility = #begin-of-line-invisible
4766 @cindex bar lines, putting symbols on
4770 Program reference: @internalsref{MarkEvent}, @internalsref{RehearsalMark}.
4772 Init files: @file{scm/translation-functions.scm} contains the
4773 definition of @code{format-mark-numbers} and
4774 @code{format-mark-letters}. They can be used as inspiration for other
4775 formatting functions.
4777 Examples: @inputfileref{input/regression,rehearsal-mark-letter.ly},
4778 @inputfileref{input/regression,rehearsal-mark-number.ly}.
4782 @subsection Bar numbers
4786 @cindex measure numbers
4787 @cindex @code{currentBarNumber}
4789 Bar numbers are printed by default at the start of the line. The
4790 number itself is stored in the @code{currentBarNumber} property, which
4791 is normally updated automatically for every measure.
4793 Bar numbers can be typeset at regular intervals instead of at the
4794 beginning of each line. This is illustrated in the following example,
4795 whose source is available as
4796 @inputfileref{input/test,bar-number-regular-interval.ly}
4798 @lilypondfile[quote]{bar-number-regular-interval.ly}
4802 Program reference: @internalsref{BarNumber}.
4804 Examples: @inputfileref{input/test,bar-number-every-five-reset.ly},
4805 and @inputfileref{input/test,bar-number-regular-interval.ly}.
4809 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
4810 there is one at the top. To solve this, the
4811 @code{padding} property of @internalsref{BarNumber} can be
4812 used to position the number correctly.
4814 @node Instrument names
4815 @subsection Instrument names
4817 In an orchestral score, instrument names are printed left side of the
4820 This can be achieved by setting @internalsref{Staff}.@code{instrument}
4821 and @internalsref{Staff}.@code{instr}. This will print a string before
4822 the start of the staff. For the first start, @code{instrument} is
4823 used, for the next ones @code{instr} is used.
4825 @lilypond[quote,verbatim,raggedright,relative=1,fragment]
4826 \set Staff.instrument = "Ploink "
4827 \set Staff.instr = "Plk "
4833 You can also use markup texts to construct more complicated instrument
4836 @lilypond[quote,fragment,verbatim,raggedright]
4838 \set Staff.instrument = \markup {
4839 \column < "Clarinetti" { "in B"
4840 \smaller \flat } > }
4845 For longer instrument names, it may be useful to increase the
4846 @code{indent} setting in the @code{\paper} block.
4850 Program reference: @internalsref{InstrumentName}.
4854 When you put a name on a grand staff or piano staff the width of the
4855 brace is not taken into account. You must add extra spaces to the end of
4856 the name to avoid a collision.
4859 @subsection Transpose
4861 @cindex transposition of pitches
4862 @cindex @code{\transpose}
4864 A music expression can be transposed with @code{\transpose}. The
4867 \transpose @var{from} @var{to} @var{musicexpr}
4870 This means that @var{musicexpr} is transposed by the interval between
4871 the pitches @var{from} and @var{to}: any note with pitch @code{from}
4872 is changed to @code{to}.
4875 For example, consider a piece written in the key of D major. If
4876 this piece is a little too low for its performer, it can be
4877 transposed up to E major with
4879 \transpose d e @dots{}
4882 Consider a part written for violin (a C instrument). If
4883 this part is to be played on the A clarinet, the following
4884 transposition will produce the appropriate part
4887 \transpose a c @dots{}
4890 @code{\transpose} distinguishes between enharmonic pitches: both
4891 @code{\transpose c cis} or @code{\transpose c des} will transpose up
4892 half a tone. The first version will print sharps and the second
4893 version will print flats
4895 @lilypond[quote,raggedright,verbatim]
4896 mus = { \key d \major cis d fis g }
4900 \transpose c g' \mus
4901 \transpose c f' \mus
4908 Program reference: @internalsref{TransposedMusic}, and
4909 @internalsref{UntransposableMusic}.
4913 If you want to use both @code{\transpose} and @code{\relative},
4914 you must put @code{\transpose} outside of @code{\relative}, since
4915 @code{\relative} will have no effect music that appears inside a
4918 @node Instrument transpositions
4919 @subsection Instrument transpositions
4921 The key of a transposing instrument can also be specified. This
4922 applies to many wind instruments, for example, clarinets (B-flat, A and
4923 E-flat), horn (F) and trumpet (B-flat, C, D and E-flat).
4926 The transposition is entered after the keyword @code{\transposition}
4929 \transposition bes %% B-flat clarinet
4932 This command sets the property @code{instrumentTransposition}. The value of
4933 this property is used for MIDI output and quotations. It does not
4934 affect how notes are printed in the current staff.
4936 @cindex transposition, MIDI
4937 @cindex transposition, instrument
4940 @node Multi measure rests
4941 @subsection Multi measure rests
4942 @cindex multi measure rests
4943 @cindex Rests, multi measure
4947 Multi measure rests are entered using `@code{R}'. It is specifically
4948 meant for full bar rests and for entering parts: the rest can expand
4949 to fill a score with rests, or it can be printed as a single
4950 multimeasure rest. This expansion is controlled by the property
4951 @code{Score.skipBars}. If this is set to true, empty measures will not
4952 be expanded, and the appropriate number is added automatically
4954 @lilypond[quote,fragment,verbatim]
4955 \time 4/4 r1 | R1 | R1*2
4956 \set Score.skipBars = ##t R1*17 R1*4
4959 The @code{1} in @code{R1} is similar to the duration notation used for
4960 notes. Hence, for time signatures other than 4/4, you must enter other
4961 durations. This can be done with augmentation dots or fractions
4963 @lilypond[quote,fragment,verbatim]
4964 \set Score.skipBars = ##t
4972 An @code{R} spanning a single measure is printed as either a whole rest
4973 or a breve, centered in the measure regardless of the time signature.
4975 @cindex text on multi-measure rest
4976 @cindex script on multi-measure rest
4977 @cindex fermata on multi-measure rest
4979 Texts can be added to multi-measure rests by using the
4980 @var{note}-@code{markup} syntax (see @ref{Text markup}). In this case, the number is
4981 replaced. If you need both texts and the number, you must add the
4982 number by hand. A variable (@code{\fermataMarkup}) is provided for
4986 @lilypond[quote,verbatim,fragment]
4988 R2._\markup { "Ad lib" }
4992 If you want to have a text on the left end of a multi-measure rest,
4993 attach the text to a zero-length skip note, i.e.
5001 @cindex whole rests for a full measure
5005 Program reference: @internalsref{MultiMeasureRestEvent},
5006 @internalsref{MultiMeasureTextEvent},
5007 @internalsref{MultiMeasureRestMusicGroup}, and
5008 @internalsref{MultiMeasureRest}.
5010 The layout object @internalsref{MultiMeasureRestNumber} is for the
5011 default number, and @internalsref{MultiMeasureRestText} for user
5016 It is not possible to use fingerings (e.g. @code{R1-4}) to put numbers
5017 over multi-measure rests.
5019 @cindex condensing rests
5021 There is no way to automatically condense multiple rests into a single
5022 multimeasure rest. Multi measure rests do not take part in rest
5025 Be careful when entering multimeasure rests followed by whole
5026 notes. The following will enter two notes lasting four measures each
5030 When @code{skipBars} is set, the result will look OK, but the bar
5031 numbering will be off.
5033 @node Automatic part combining
5034 @subsection Automatic part combining
5035 @cindex automatic part combining
5036 @cindex part combiner
5039 Automatic part combining is used to merge two parts of music onto a
5040 staff. It is aimed at typesetting orchestral scores. When the two
5041 parts are identical for a period of time, only one is shown. In
5042 places where the two parts differ, they are typeset as separate
5043 voices, and stem directions are set automatically. Also, solo and
5044 @emph{a due} parts are identified and can be marked.
5046 The syntax for part combining is
5049 \partcombine @var{musicexpr1} @var{musicexpr2}
5052 The music expressions will be interpreted as @internalsref{Voice}
5053 contexts. If using relative octaves, @code{\relative} should be
5054 specified for both music expressions, i.e.
5057 \partcombine \relative @dots{} @var{musicexpr1}
5058 \relative @dots{} @var{musicexpr2}
5062 A @code{\relative} section that is outside of @code{\partcombine} has
5063 no effect on the pitches of @var{musicexpr1} and @var{musicexpr2}.
5066 The following example demonstrates the basic functionality of the part
5067 combiner: putting parts on one staff, and setting stem directions and
5070 @lilypond[quote,verbatim,raggedright,fragment]
5071 \new Staff \partcombine
5072 \relative g' { g g a( b) c c r r }
5073 \relative g' { g g r4 r e e g g }
5076 The first @code{g} appears only once, although it was
5077 specified twice (once in each part). Stem, slur and tie directions are
5078 set automatically, depending whether there is a solo or unisono. The
5079 first part (with context called @code{one}) always gets up stems, and
5080 `solo', while the second (called @code{two}) always gets down stems and
5083 If you just want the merging parts, and not the textual markings, you
5084 may set the property @code{soloADue} to false
5086 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
5088 \set Staff.soloADue = ##f
5090 \relative g' { g a( b) r }
5091 \relative g' { g r4 r f }
5097 Program reference: @internalsref{PartCombineMusic},
5098 @internalsref{SoloOneEvent}, and
5099 @internalsref{SoloTwoEvent}, and
5100 @internalsref{UnisonoEvent}.
5104 In @code{soloADue} mode, when the two voices play the same notes on and
5105 off, the part combiner may typeset @code{a2} more than once in a
5108 @code{\partcombine} cannot be inside @code{\times}.
5110 @code{\partcombine} cannot be inside @code{\relative}.
5112 Internally, the @code{\partcombine} interprets both arguments as
5113 @code{Voice}s named @code{one} and @code{two}, and then decides when
5114 the parts can be combined. Consequently, if the arguments switch to
5115 differently named @internalsref{Voice} contexts, the events in those
5119 @subsection Hiding staves
5121 @cindex Frenched scores
5122 @cindex Hiding staves
5124 In orchestral scores, staff lines that only have rests are usually
5125 removed. This saves some space. This style is called `French Score'.
5126 For @internalsref{Lyrics},
5127 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
5128 switched on by default. When these line of these contexts turn out
5129 empty after the line-breaking process, they are removed.
5131 For normal staves, a specialized @internalsref{Staff} context is
5132 available, which does the same: staves containing nothing (or only
5133 multi measure rests) are removed. The context definition is stored in
5134 @code{\RemoveEmptyStaffContext} variable. Observe how the second staff
5135 in this example disappears in the second line
5138 @lilypond[quote,verbatim]
5141 \context { \RemoveEmptyStaffContext }
5146 \new Staff { e4 f g a \break c1 }
5147 \new Staff { c4 d e f \break R1 }
5152 The first page shows all staves in full. If empty staves should be
5153 removed from the first page too, set @code{remove-first} to false in
5154 @internalsref{RemoveEmptyVerticalGroup}.
5156 Another application is making ossia sections, i.e. alternative
5157 melodies on a separate piece of staff, with help of a Frenched
5158 staff. See @inputfileref{input/test,ossia.ly} for an example.
5161 @node Different editions from one source
5162 @subsection Different editions from one source
5164 The @code{\tag} command marks music expressions with a name. These
5165 tagged expressions can be filtered out later. With this mechanism it
5166 is possible to make different versions of the same music source.
5168 In the following example, we see two versions of a piece of music, one
5169 for the full score, and one with cue notes for the instrumental part
5185 The same can be applied to articulations, texts, etc.: they are
5188 -\tag #@var{your-tag}
5190 to an articulation, for example,
5195 This defines a note with a conditional fingering indication.
5197 By applying the @code{remove-tag} function, tagged expressions can be
5198 filtered. For example,
5202 \applymusic #(remove-tag 'score) @var{the music}
5203 \applymusic #(remove-tag 'part) @var{the music}
5208 @lilypondfile[quote]{tag-filter.ly}
5210 The argument of the @code{\tag} command should be a symbol, or a list
5211 of symbols, for example,
5213 \tag #'(original-part transposed-part) @dots{}
5218 Examples: @inputfileref{input/regression,tag-filter.ly}.
5221 @node Quoting other voices
5222 @subsection Quoting other voices
5224 With quotations, fragments of other parts can be inserted into a part
5225 directly. Before a part can be quoted, it must be marked especially as
5226 quotable. This is done with code @code{\addquote} command. The
5227 quotation may then be done with @code{\quote}
5230 \addquote @var{name} @var{music}
5231 \quote @var{name} @var{duration}
5236 Here, @var{name} is an identifying string. The @var{music} is any kind
5237 of music. This is an example of @code{\addquote}
5240 \addquote clarinet \relative c' {
5245 During a part, a piece of music can be quoted with the @code{\quote}
5252 This would cite 3 quarter notes (a dotted half note) of the previously
5253 added clarinet voice.
5255 Quotations take into account the transposition both source and target
5256 instruments, if they are specified using the @code{\transposition} command.
5258 @lilypond[quote,raggedright,verbatim]
5259 \addquote clarinet \relative c' {
5265 e'8 f'8 \quote clarinet 2
5271 Only the contents of the first @internalsref{Voice} occurring in an
5272 @code{\addquote} command will be considered for quotation, so
5273 @var{music} can not contain @code{\new} and @code{\context Voice}
5274 statements that would switch to a different Voice.
5279 In this manual: @ref{Instrument transpositions}.
5281 Examples: @inputfileref{input/regression,quote.ly}
5282 @inputfileref{input/regression,quote-transposition.ly}
5284 Program reference: @internalsref{QuoteMusic}.
5286 @node Formatting cue notes
5287 @section Formatting cue notes
5290 The previous section deals with inserting notes from another
5291 voice. When making a part, these notes need to be specially formatted.
5292 Here is an example of formatted cue notes
5297 \override Stem #'length = #5.5
5298 \override Beam #'thickness = #0.384
5299 \override Beam #'space-function =
5300 #(lambda (beam mult) (* 0.8 (Beam::space_function beam mult)))
5304 \set Staff.instrument = #"Horn in F"
5305 \set Score.skipBars = ##t
5308 \once \override Staff.MultiMeasureRest #'staff-position = #-6
5315 r8^"Bsn." c'8 f'8[ f'8]
5325 There are a couple of points to take care of:
5329 The multi rest of the original part should be moved up or down during
5332 Cue notes have smaller font sizes.
5334 When cued notes have a clef change relative to the original part, the
5335 clef should be restored after the cue section. This minimizes
5336 confusion for the reader,
5338 When the original part starts, this should be marked with the name of
5339 the instrument, in this case ``Horn.'' Of course, the cue part is
5340 marked with the instrument playing the cue.
5345 @node Ancient notation
5346 @section Ancient notation
5348 @cindex Vaticana, Editio
5349 @cindex Medicaea, Editio
5354 Support for ancient notation includes features for mensural notation
5355 and Gregorian Chant notation. There is also limited support for
5356 figured bass notation.
5358 Many graphical objects provide a @code{style} property, see
5359 @ref{Ancient note heads}, @ref{Ancient accidentals}, @ref{Ancient
5360 rests}, @ref{Ancient clefs}, @ref{Ancient flags} and @ref{Ancient time
5361 signatures}. By manipulating such a grob property, the typographical
5362 appearance of the affected graphical objects can be accommodated for a
5363 specific notation flavor without need for introducing any new
5366 Other aspects of ancient notation can not that easily be expressed as
5367 in terms of just changing a style property of a graphical object.
5368 Therefore, some notational concepts are introduced specifically for
5369 ancient notation, see @ref{Custodes}, @ref{Divisiones},
5370 @ref{Ligatures}, and @ref{Figured bass}.
5374 * Ancient note heads::
5375 * Ancient accidentals::
5379 * Ancient time signatures::
5383 * Vaticana style contexts::
5387 If this all is way too much of documentation for you, and you just
5388 want to dive into typesetting without worrying too much about the
5389 details on how to customize a context, you may have a look at the
5390 predefined contexts (see @ref{Vaticana style contexts}). Use them to
5391 set up predefined style-specific voice and staff contexts, and
5392 directly go ahead with the note entry.
5396 Ligatures need special spacing that has not yet been implemented. As
5397 a result, there is too much space between ligatures most of the time,
5398 and line breaking often is unsatisfactory. Also, lyrics do not
5399 correctly align with ligatures.
5401 Accidentals must not be printed within a ligature, but instead need to
5402 be collected and printed in front of it.
5404 Augmentum dots within ligatures are not handled correctly.
5407 @node Ancient note heads
5408 @subsection Ancient note heads
5413 For ancient notation, a note head style other than the @code{default}
5414 style may be chosen. This is accomplished by setting the @code{style}
5415 property of the NoteHead object to the desired value (@code{baroque},
5416 @code{neomensural} or @code{mensural}). The @code{baroque} style
5417 differs from the @code{default} style only in using a square shape for
5418 @code{\breve} note heads. The @code{neomensural} style differs from
5419 the @code{baroque} style in that it uses rhomboidal heads for whole
5420 notes and all smaller durations. Stems are centered on the note
5421 heads. This style is in particular useful when transcribing mensural
5422 music, e.g. for the incipit. The @code{mensural} style finally
5423 produces note heads that mimic the look of note heads in historic
5424 printings of the 16th century.
5426 The following example demonstrates the @code{neomensural} style
5428 @lilypond[quote,fragment,raggedright,verbatim]
5429 \override NoteHead #'style = #'neomensural
5430 a'\longa a'\breve a'1 a'2 a'4 a'8 a'16
5433 When typesetting a piece in Gregorian Chant notation, a Gregorian
5434 ligature engraver will automatically select the proper note heads,
5435 such there is no need to explicitly set the note head style. Still,
5436 the note head style can be set e.g. to @code{vaticana_punctum} to
5437 produce punctum neumes. Similarly, a mensural ligature engraver is
5438 used to automatically assemble mensural ligatures. See
5439 @ref{Ligatures} for how ligature engravers work.
5444 @ref{Percussion staves} use note head styles of their own that are
5445 frequently used in contemporary music notation.
5447 Examples: @inputfileref{input/regression,note-head-style.ly} gives an
5448 overview over all available note head styles.
5451 @node Ancient accidentals
5452 @subsection Ancient accidentals
5457 Use the @code{style} property of grob @internalsref{Accidental} to
5458 select ancient accidentals. Supported styles are
5459 @code{mensural}, @code{vaticana}, @code{hufnagel} and @code{medicaea}.
5461 @lilypond[quote,raggedright,staffsize=26]
5469 { " " \musicglyph #"accidentals-vaticana-1"
5470 " " \musicglyph #"accidentals-vaticana0" }
5474 { " " \musicglyph #"accidentals-medicaea-1" }
5478 { " " \musicglyph #"accidentals-hufnagel-1" }
5482 { " " \musicglyph #"accidentals-mensural-1"
5483 " " \musicglyph #"accidentals-mensural1" }
5492 \remove "Bar_number_engraver"
5496 \remove "Clef_engraver"
5497 \remove "Key_engraver"
5498 \remove "Time_signature_engraver"
5499 \remove "Staff_symbol_engraver"
5500 minimumVerticalExtent = ##f
5506 As shown, not all accidentals are supported by each style. When
5507 trying to access an unsupported accidental, LilyPond will switch to a
5508 different style, as demonstrated in
5509 @inputfileref{input/test,ancient-accidentals.ly}.
5511 Similarly to local accidentals, the style of the key signature can be
5512 controlled by the @code{style} property of the
5513 @internalsref{KeySignature} grob.
5517 In this manual: @ref{Pitches}, @ref{Chromatic alterations} and
5518 @ref{Accidentals} give a general introduction into the use of
5519 accidentals. @ref{Key signature} gives a general introduction into
5520 the use of key signatures.
5522 Program reference: @internalsref{KeySignature}.
5524 Examples: @inputfileref{input/test,ancient-accidentals.ly}.
5527 @subsection Ancient rests
5532 Use the @code{style} property of grob @internalsref{Rest} to select
5533 ancient accidentals. Supported styles are @code{classical},
5534 @code{neomensural} and @code{mensural}. @code{classical} differs
5535 from the @code{default} style only in that the quarter rest looks like
5536 a horizontally mirrored 8th rest. The @code{neomensural} style suits
5537 well for e.g. the incipit of a transcribed mensural piece of music.
5538 The @code{mensural} style finally mimics the appearance of rests as
5539 in historic prints of the 16th century.
5541 The following example demonstrates the @code{neomensural} style
5543 @lilypond[quote,fragment,raggedright,verbatim]
5544 \override Rest #'style = #'neomensural
5545 r\longa r\breve r1 r2 r4 r8 r16
5548 There are no 32th and 64th rests specifically for the mensural or
5549 neo-mensural style. Instead, the rests from the default style will be
5550 taken. See @inputfileref{input/test,rests.ly} for a chart of all
5553 There are no rests in Gregorian Chant notation; instead, it uses
5558 In this manual: @ref{Rests} gives a general introduction into the use of rests.
5562 @subsection Ancient clefs
5567 LilyPond supports a variety of clefs, many of them ancient.
5569 The following table shows all ancient clefs that are supported via the
5570 @code{\clef} command. Some of the clefs use the same glyph, but
5571 differ only with respect to the line they are printed on. In such
5572 cases, a trailing number in the name is used to enumerate these clefs.
5573 Still, you can manually force a clef glyph to be typeset on an
5574 arbitrary line, as described in @ref{Clef}. The note printed to the
5575 right side of each clef in the example column denotes the @code{c'}
5576 with respect to that clef.
5578 @multitable @columnfractions .4 .4 .2
5581 @b{Description} @tab
5582 @b{Supported Clefs} @tab
5586 modern style mensural C clef @tab
5587 @code{neomensural_c1}, @code{neomensural_c2},
5588 @code{neomensural_c3}, @code{neomensural_c4} @tab
5589 @lilypond[fragment,quote,relative=1,notime]
5591 \clef "neomensural_c2" c
5595 petrucci style mensural C clefs, for use on different staff lines
5596 (the examples shows the 2nd staff line C clef).
5606 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5608 \clef "petrucci_c2" c
5612 petrucci style mensural F clef @tab
5613 @code{petrucci_f} @tab
5614 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5616 \clef "petrucci_f" c
5620 petrucci style mensural G clef @tab
5621 @code{petrucci_g} @tab
5622 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5624 \clef "petrucci_g" c
5628 historic style mensural C clef @tab
5629 @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3},
5630 @code{mensural_c4} @tab
5631 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5633 \clef "mensural_c2" c
5637 historic style mensural F clef @tab
5638 @code{mensural_f} @tab
5639 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5641 \clef "mensural_f" c
5645 historic style mensural G clef @tab
5646 @code{mensural_g} @tab
5647 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5649 \clef "mensural_g" c
5653 Editio Vaticana style do clef @tab
5654 @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab
5655 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5656 \override Staff.StaffSymbol #'line-count = #4
5658 \clef "vaticana_do2" c
5662 Editio Vaticana style fa clef @tab
5663 @code{vaticana_fa1}, @code{vaticana_fa2} @tab
5664 @lilypond[quote,relative=1,notime,indent=0.0\mm,fragment]
5665 \override Staff.StaffSymbol #'line-count = #4
5667 \clef "vaticana_fa2" c
5671 Editio Medicaea style do clef @tab
5672 @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab
5673 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5674 \override Staff.StaffSymbol #'line-count = #4
5676 \clef "medicaea_do2" c
5680 Editio Medicaea style fa clef @tab
5681 @code{medicaea_fa1}, @code{medicaea_fa2} @tab
5682 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5683 \override Staff.StaffSymbol #'line-count = #4
5685 \clef "medicaea_fa2" c
5689 historic style hufnagel do clef @tab
5690 @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab
5691 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5692 \override Staff.StaffSymbol #'line-count = #4
5694 \clef "hufnagel_do2" c
5698 historic style hufnagel fa clef @tab
5699 @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab
5700 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5701 \override Staff.StaffSymbol #'line-count = #4
5703 \clef "hufnagel_fa2" c
5707 historic style hufnagel combined do/fa clef @tab
5708 @code{hufnagel_do_fa} @tab
5709 @lilypond[fragment,quote,relative=1,notime,indent=0.0\mm]
5710 \clef "hufnagel_do_fa" c
5717 @emph{Modern style} means ``as is typeset in contemporary editions of
5718 transcribed mensural music''.
5720 @emph{Petrucci style} means ``inspired by printings published by the
5721 famous engraver Petrucci (1466-1539)''.
5723 @emph{Historic style} means ``as was typeset or written in historic
5724 editions (other than those of Petrucci)''.
5726 @emph{Editio XXX style} means ``as is/was printed in Editio XXX''.
5728 Petrucci used C clefs with differently balanced left-side vertical
5729 beams, depending on which staff line it is printed.
5733 In this manual: see @ref{Clef}.
5737 The mensural g clef is mapped to the Petrucci g clef, until a new
5738 mensural g clef is implemented.
5743 @subsection Ancient flags
5748 Use the @code{flag-style} property of grob @internalsref{Stem} to
5749 select ancient flags. Besides the @code{default} flag style,
5750 only @code{mensural} style is supported
5752 @lilypond[quote,fragment,raggedright,verbatim]
5753 \override Stem #'flag-style = #'mensural
5754 \override Stem #'thickness = #1.0
5755 \override NoteHead #'style = #'mensural
5757 c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 s8
5758 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
5761 Note that the innermost flare of each mensural flag always is
5762 vertically aligned with a staff line. If you do not like this
5763 behavior, you can set the @code{adjust-if-on-staffline} property of
5764 grob @internalsref{Stem} to @code{##f}. Then, the vertical position
5765 of the end of each flare is different between notes on staff lines and
5766 notes between staff lines
5768 @lilypond[quote,fragment,raggedright]
5769 \override Stem #'flag-style = #'mensural
5770 \override Stem #'thickness = #1.0
5771 \override Stem #'adjust-if-on-staffline = ##f
5772 \override NoteHead #'style = #'mensural
5774 c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 s8
5775 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
5778 There is no particular flag style for neo-mensural notation. Hence,
5779 when typesetting e.g. the incipit of a transcribed piece of mensural
5780 music, the default flag style should be used. There are no flags in
5781 Gregorian Chant notation.
5784 @node Ancient time signatures
5785 @subsection Ancient time signatures
5787 @cindex time signatures
5790 There is limited support for mensural time signatures. The
5791 glyphs are hard-wired to particular time fractions. In other words,
5792 to get a particular mensural signature glyph with the @code{\time n/m}
5793 command, @code{n} and @code{m} have to be chosen according to the
5802 \remove Staff_symbol_engraver
5803 \remove Clef_engraver
5804 \remove Time_signature_engraver
5807 \set Score.timing = ##f
5808 \set Score.barAlways = ##t
5809 s_\markup { "$\\backslash$time 4/4" }
5810 ^\markup { " " \musicglyph #"timesig-neomensural4/4" }
5812 s_\markup { "$\\backslash$time 2/2" }
5813 ^\markup { " " \musicglyph #"timesig-neomensural2/2" }
5815 s_\markup { "$\\backslash$time 6/4" }
5816 ^\markup { " " \musicglyph #"timesig-neomensural6/4" }
5818 s_\markup { "$\\backslash$time 6/8" }
5819 ^\markup { " " \musicglyph #"timesig-neomensural6/8" }
5821 s_\markup { "$\\backslash$time 3/2" }
5822 ^\markup { " " \musicglyph #"timesig-neomensural3/2" }
5824 s_\markup { "$\\backslash$time 3/4" }
5825 ^\markup { " " \musicglyph #"timesig-neomensural3/4" }
5827 s_\markup { "$\\backslash$time 9/4" }
5828 ^\markup { " " \musicglyph #"timesig-neomensural9/4" }
5830 s_\markup { "$\\backslash$time 9/8" }
5831 ^\markup { " " \musicglyph #"timesig-neomensural9/8" }
5833 s_\markup { "$\\backslash$time 4/8" }
5834 ^\markup { " " \musicglyph #"timesig-neomensural4/8" }
5836 s_\markup { "$\\backslash$time 2/4" }
5837 ^\markup { " " \musicglyph #"timesig-neomensural2/4" }
5842 Use the @code{style} property of grob @internalsref{TimeSignature} to
5843 select ancient time signatures. Supported styles are
5844 @code{neomensural} and @code{mensural}. The above table uses the
5845 @code{neomensural} style. This style is appropriate e.g. for the
5846 incipit of transcriptions of mensural pieces. The @code{mensural}
5847 style mimics the look of historical printings of the 16th century.
5849 The following examples shows the differences in style,
5850 @lilypond[raggedright]
5853 c1^\markup { \hspace #-2.0 \typewriter default }
5855 \override Staff.TimeSignature #'style = #'numbered
5857 c1^\markup { \hspace #-2.0 \typewriter numbered }
5859 \override Staff.TimeSignature #'style = #'mensural
5861 c1^\markup { \hspace #-2.0 \typewriter mensural }
5863 \override Staff.TimeSignature #'style = #'neomensural
5865 c1^\markup { \hspace #-2.0 \typewriter neomensural }
5866 \override Staff.TimeSignature #'style = #'single-digit
5868 c1^\markup { \hspace #-2.0 \typewriter single-digit }
5874 This manual: @ref{Time signature} gives a general introduction into
5875 the use of time signatures.
5879 Ratios of note durations do not change with the time signature. For
5880 example, the ratio of 1 brevis = 3 semibrevis (tempus perfectum) must
5881 be made by hand, by setting
5884 breveTP = #(ly:make-duration -1 0 3 2)
5888 This sets breveTP to 3/2 times 2 = 3 times a whole note.
5890 The @code{old6/8alt} symbol (an alternate symbol for 6/8) is not
5891 addressable with @code{\time}. Use a @code{\markup} instead
5894 @subsection Custodes
5899 A @emph{custos} (plural: @emph{custodes}; Latin word for `guard') is a
5900 symbol that appears at the end of a staff. It anticipates the pitch
5901 of the first note(s) of the following line and thus helps the player
5902 or singer to manage line breaks during performance, thus enhancing
5903 readability of a score.
5905 Custodes were frequently used in music notation until the 17th
5906 century. Nowadays, they have survived only in a few particular forms
5907 of musical notation such as contemporary editions of Gregorian chant
5908 like the @emph{editio vaticana}. There are different custos glyphs
5909 used in different flavors of notational style.
5911 For typesetting custodes, just put a @internalsref{Custos_engraver} into the
5912 @internalsref{Staff} context when declaring the @code{\paper} block,
5913 as shown in the following example
5919 \consists Custos_engraver
5920 Custos \override #'style = #'mensural
5925 The result looks like this
5927 @lilypond[quote,raggedright]
5931 \override Staff.Custos #'style = #'mensural
5938 \consists Custos_engraver
5944 The custos glyph is selected by the @code{style} property. The styles
5945 supported are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
5946 @code{mensural}. They are demonstrated in the following fragment
5950 \new Lyrics \lyrics {
5954 { " " \musicglyph #"custodes-vaticana-u0" }
5958 { " " \musicglyph #"custodes-medicaea-u0" }
5963 { " " \musicglyph #"custodes-hufnagel-u0" }
5968 { " " \musicglyph #"custodes-mensural-u0" }
5980 Program reference: @internalsref{Custos}.
5982 Examples: @inputfileref{input/regression,custos.ly}.
5986 @subsection Divisiones
5992 A @emph{divisio} (plural: @emph{divisiones}; Latin word for
5993 `division') is a staff context symbol that is used to structure
5994 Gregorian music into phrases and sections. The musical meaning of
5995 @emph{divisio minima}, @emph{divisio maior} and @emph{divisio maxima}
5996 can be characterized as short, medium and long pause, somewhat like
5997 @ref{Breath marks}. The @emph{finalis} sign not only marks the end of
5998 a chant, but is also frequently used within a single
5999 antiphonal/responsorial chant to mark the end of each section.
6002 To use divisiones, include the file @code{gregorian-init.ly}. It
6003 contains definitions that you can apply by just inserting
6004 @code{\divisioMinima}, @code{\divisioMaior}, @code{\divisioMaxima},
6005 and @code{\finalis} at proper places in the input. Some editions use
6006 @emph{virgula} or @emph{caesura} instead of divisio minima.
6007 Therefore, @code{gregorian-init.ly} also defines @code{\virgula} and
6010 @lilypondfile[quote,raggedright]{divisiones.ly}
6014 @cindex @code{\virgula}
6016 @cindex @code{\caesura}
6018 @cindex @code{\divisioMinima}
6019 @code{\divisioMinima},
6020 @cindex @code{\divisioMaior}
6021 @code{\divisioMaior},
6022 @cindex @code{\divisioMaxima}
6023 @code{\divisioMaxima},
6024 @cindex @code{\finalis}
6029 In this manual: @ref{Breath marks}.
6031 Program reference: @internalsref{BreathingSign}, @internalsref{BreathingSignEvent}.
6033 Examples: @inputfileref{input/test,divisiones.ly}.
6036 @subsection Ligatures
6040 @c TODO: Should double check if I recalled things correctly when I wrote
6041 @c down the following paragraph by heart.
6043 A ligature is a coherent graphical symbol that represents at least two
6044 distinct notes. Ligatures originally appeared in the manuscripts of
6045 Gregorian chant notation roughly since the 9th century to denote
6046 ascending or descending sequences of notes.
6048 Ligatures are entered by enclosing them in @code{\[} and @code{\]}.
6049 Some ligature styles may need additional input syntax specific for
6050 this particular type of ligature. By default, the
6051 @internalsref{LigatureBracket} engraver just puts a square bracket
6054 @lilypond[quote,raggedright,verbatim]
6062 To select a specific style of ligatures, a proper ligature engraver
6063 has to be added to the @internalsref{Voice} context, as explained in
6064 the following subsections. Only white mensural ligatures
6065 are supported with certain limitations.
6068 * White mensural ligatures::
6069 * Gregorian square neumes ligatures::
6072 @node White mensural ligatures
6073 @subsubsection White mensural ligatures
6075 @cindex Mensural ligatures
6076 @cindex White mensural ligatures
6078 There is limited support for white mensural ligatures.
6080 To engrave white mensural ligatures, in the paper block the
6081 @internalsref{Mensural_ligature_engraver} has to be put into the
6082 @internalsref{Voice} context, and remove the
6083 @internalsref{Ligature_bracket_engraver}
6089 \remove Ligature_bracket_engraver
6090 \consists Mensural_ligature_engraver
6095 There is no additional input language to describe the shape of a
6096 white mensural ligature. The shape is rather determined solely from
6097 the pitch and duration of the enclosed notes. While this approach may
6098 take a new user a while to get accustomed, it has the great advantage
6099 that the full musical information of the ligature is known internally.
6100 This is not only required for correct MIDI output, but also allows for
6101 automatic transcription of the ligatures.
6106 \set Score.timing = ##f
6107 \set Score.defaultBarType = "empty"
6108 \override NoteHead #'style = #'neomensural
6109 \override Staff.TimeSignature #'style = #'neomensural
6111 \[ g\longa c\breve a\breve f\breve d'\longa \]
6113 \[ e1 f1 a\breve g\longa \]
6115 @lilypond[quote,raggedright]
6118 \set Score.timing = ##f
6119 \set Score.defaultBarType = "empty"
6120 \override NoteHead #'style = #'neomensural
6121 \override Staff.TimeSignature #'style = #'neomensural
6123 \[ g\longa c\breve a\breve f\breve d'\longa \]
6125 \[ e1 f1 a\breve g\longa \]
6130 \remove Ligature_bracket_engraver
6131 \consists Mensural_ligature_engraver
6137 Without replacing @internalsref{Ligature_bracket_engraver} with
6138 @internalsref{Mensural_ligature_engraver}, the same music transcribes
6141 @lilypond[quote,raggedright]
6143 \set Score.timing = ##f
6144 \set Score.defaultBarType = "empty"
6145 \override NoteHead #'style = #'neomensural
6146 \override Staff.TimeSignature #'style = #'neomensural
6148 \[ g\longa c\breve a\breve f\breve d'\longa \]
6150 \[ e1 f1 a\breve g\longa \]
6156 The implementation is experimental; it may output strange warnings or
6157 even crash in some cases or produce weird results on more complex
6160 @node Gregorian square neumes ligatures
6161 @subsubsection Gregorian square neumes ligatures
6163 @cindex Square neumes ligatures
6164 @cindex Gregorian square neumes ligatures
6166 Gregorian square neumes notation (following the style of the Editio
6167 Vaticana) is under heavy development, but not yet really usable for
6168 production purposes. Core ligatures can already be typeset, but
6169 essential issues for serious typesetting are still under development,
6170 such as (among others) horizontal alignment of multiple ligatures,
6171 lyrics alignment and proper accidentals handling. Still, this section
6172 gives a sneak preview of what Gregorian chant may look like once it
6175 The following table contains the extended neumes table of the 2nd
6176 volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published
6177 1983 by the monks of Solesmes.
6179 @multitable @columnfractions .4 .2 .2 .2
6182 @b{Neuma aut@*Neumarum Elementa} @tab
6183 @b{Figurae@*Rectae} @tab
6184 @b{Figurae@*Liquescentes Auctae} @tab
6185 @b{Figurae@*Liquescentes Deminutae}
6187 @c TODO: \paper block is identical in all of the below examples.
6188 @c Therefore, it should somehow be included rather than duplicated all
6191 @c why not make identifiers in ly/engraver-init.ly? --hwn
6193 @c Because it's just used to typeset plain notes without
6194 @c a staff for demonstration purposes rather than something
6195 @c special of Gregorian chant notation. --jr
6200 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.5\cm]
6201 \include "gregorian-init.ly"
6206 \noBreak s^\markup {"a"} \noBreak
6208 % Punctum Inclinatum
6210 \noBreak s^\markup {"b"}
6212 \paper { \neumeDemoPaper }}
6215 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.5\cm]
6216 \include "gregorian-init.ly"
6219 % Punctum Auctum Ascendens
6220 \[ \auctum \ascendens b \]
6221 \noBreak s^\markup {"c"} \noBreak
6223 % Punctum Auctum Descendens
6224 \[ \auctum \descendens b \]
6225 \noBreak s^\markup {"d"} \noBreak
6227 % Punctum Inclinatum Auctum
6228 \[ \inclinatum \auctum b \]
6229 \noBreak s^\markup {"e"}
6231 \paper { \neumeDemoPaper }}
6234 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6235 \include "gregorian-init.ly"
6238 % Punctum Inclinatum Parvum
6239 \[ \inclinatum \deminutum b \]
6240 \noBreak s^\markup {"f"}
6242 \paper { \neumeDemoPaper }}
6248 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6249 \include "gregorian-init.ly"
6254 \noBreak s^\markup {"g"}
6256 \paper { \neumeDemoPaper }}
6262 @code{3. Apostropha vel Stropha}
6264 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6265 \include "gregorian-init.ly"
6270 \noBreak s^\markup {"h"}
6272 \paper { \neumeDemoPaper }}
6275 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6276 \include "gregorian-init.ly"
6280 \[ \stropha \auctum b \]
6281 \noBreak s^\markup {"i"}
6283 \paper { \neumeDemoPaper }}
6290 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6291 \include "gregorian-init.ly"
6296 \noBreak s^\markup {"j"}
6298 \paper { \neumeDemoPaper }}
6304 @code{5. Clivis vel Flexa}
6306 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6307 \include "gregorian-init.ly"
6314 \paper { \neumeDemoPaper }}
6317 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.0\cm]
6318 \include "gregorian-init.ly"
6321 % Clivis Aucta Descendens
6322 \[ b \flexa \auctum \descendens g \]
6323 \noBreak s^\markup {"l"} \noBreak
6325 % Clivis Aucta Ascendens
6326 \[ b \flexa \auctum \ascendens g \]
6327 \noBreak s^\markup {"m"}
6329 \paper { \neumeDemoPaper }}
6332 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6333 \include "gregorian-init.ly"
6337 \[ b \flexa \deminutum g \]
6340 \paper { \neumeDemoPaper }}
6344 @code{6. Podatus vel Pes}
6346 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6347 \include "gregorian-init.ly"
6354 \paper { \neumeDemoPaper }}
6357 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=2.0\cm]
6358 \include "gregorian-init.ly"
6361 % Pes Auctus Descendens
6362 \[ g \pes \auctum \descendens b \]
6363 \noBreak s^\markup {"p"} \noBreak
6365 % Pes Auctus Ascendens
6366 \[ g \pes \auctum \ascendens b \]
6367 \noBreak s^\markup {"q"}
6369 \paper { \neumeDemoPaper }}
6372 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6373 \include "gregorian-init.ly"
6377 \[ g \pes \deminutum b \]
6380 \paper { \neumeDemoPaper }}
6384 @code{7. Pes Quassus}
6386 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6387 \include "gregorian-init.ly"
6391 \[ \oriscus g \pes \virga b \]
6394 \paper { \neumeDemoPaper }}
6397 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6398 \include "gregorian-init.ly"
6401 % Pes Quassus Auctus Descendens
6402 \[ \oriscus g \pes \auctum \descendens b \]
6405 \paper { \neumeDemoPaper }}
6410 @code{8. Quilisma Pes}
6412 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6413 \include "gregorian-init.ly"
6417 \[ \quilisma g \pes b \]
6420 \paper { \neumeDemoPaper }}
6423 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6424 \include "gregorian-init.ly"
6427 % Quilisma Pes Auctus Descendens
6428 \[ \quilisma g \pes \auctum \descendens b \]
6431 \paper { \neumeDemoPaper }}
6436 @code{9. Podatus Initio Debilis}
6438 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6439 \include "gregorian-init.ly"
6442 % Pes Initio Debilis
6443 \[ \deminutum g \pes b \]
6446 \paper { \neumeDemoPaper }}
6449 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6450 \include "gregorian-init.ly"
6453 % Pes Auctus Descendens Initio Debilis
6454 \[ \deminutum g \pes \auctum \descendens b \]
6457 \paper { \neumeDemoPaper }}
6464 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6465 \include "gregorian-init.ly"
6469 \[ a \pes b \flexa g \]
6472 \paper { \neumeDemoPaper }}
6475 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6476 \include "gregorian-init.ly"
6479 % Torculus Auctus Descendens
6480 \[ a \pes b \flexa \auctum \descendens g \]
6483 \paper { \neumeDemoPaper }}
6486 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6487 \include "gregorian-init.ly"
6490 % Torculus Deminutus
6491 \[ a \pes b \flexa \deminutum g \]
6494 \paper { \neumeDemoPaper }}
6498 @code{11. Torculus Initio Debilis}
6500 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6501 \include "gregorian-init.ly"
6504 % Torculus Initio Debilis
6505 \[ \deminutum a \pes b \flexa g \]
6508 \paper { \neumeDemoPaper }}
6511 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6512 \include "gregorian-init.ly"
6515 % Torculus Auctus Descendens Initio Debilis
6516 \[ \deminutum a \pes b \flexa \auctum \descendens g \]
6519 \paper { \neumeDemoPaper }}
6522 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6523 \include "gregorian-init.ly"
6526 % Torculus Deminutus Initio Debilis
6527 \[ \deminutum a \pes b \flexa \deminutum g \]
6530 \paper { \neumeDemoPaper }}
6534 @code{12. Porrectus}
6536 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6537 \include "gregorian-init.ly"
6541 \[ a \flexa g \pes b \]
6544 \paper { \neumeDemoPaper }}
6547 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6548 \include "gregorian-init.ly"
6551 % Porrectus Auctus Descendens
6552 \[ a \flexa g \pes \auctum \descendens b \]
6555 \paper { \neumeDemoPaper }}
6558 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6559 \include "gregorian-init.ly"
6562 % Porrectus Deminutus
6563 \[ a \flexa g \pes \deminutum b \]
6566 \paper { \neumeDemoPaper }}
6572 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6573 \include "gregorian-init.ly"
6577 \[ \virga b \inclinatum a \inclinatum g \]
6580 \paper { \neumeDemoPaper }
6584 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6585 \include "gregorian-init.ly"
6589 \[ \virga b \inclinatum a \inclinatum \auctum g \]
6592 \paper { \neumeDemoPaper }}
6595 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6596 \include "gregorian-init.ly"
6599 % Climacus Deminutus
6600 \[ \virga b \inclinatum a \inclinatum \deminutum g \]
6603 \paper { \neumeDemoPaper }}
6607 @code{14. Scandicus}
6609 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6610 \include "gregorian-init.ly"
6614 \[ g \pes a \virga b \]
6617 \paper { \neumeDemoPaper }}
6620 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6621 \include "gregorian-init.ly"
6624 % Scandicus Auctus Descendens
6625 \[ g \pes a \pes \auctum \descendens b \]
6628 \paper { \neumeDemoPaper }}
6631 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6632 \include "gregorian-init.ly"
6635 % Scandicus Deminutus
6636 \[ g \pes a \pes \deminutum b \]
6639 \paper { \neumeDemoPaper }}
6645 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6646 \include "gregorian-init.ly"
6650 \[ g \oriscus a \pes \virga b \]
6653 \paper { \neumeDemoPaper }}
6656 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6657 \include "gregorian-init.ly"
6660 % Salicus Auctus Descendens
6661 \[ g \oriscus a \pes \auctum \descendens b \]
6664 \paper { \neumeDemoPaper }}
6671 @lilypond[quote,noindent,staffsize=26,nofragment,linewidth=1.0\cm]
6672 \include "gregorian-init.ly"
6676 \[ \stropha b \stropha b \stropha a \]
6679 \paper { \neumeDemoPaper }
6688 Unlike most other neumes notation systems, the input language for
6689 neumes does not necessarily reflect directly the typographical
6690 appearance, but is designed to solely focuse on musical meaning. For
6691 example, @code{\[ a \pes b \flexa g \]} produces a Torculus consisting
6692 of three Punctum heads, while @code{\[ a \flexa g \pes b \]} produces
6693 a Porrectus with a curved flexa shape and only a single Punctum head.
6694 There is no command to explicitly typeset the curved flexa shape; the
6695 decision of when to typeset a curved flexa shape is purely taken from
6696 the musical input. The idea of this approach is to separate the
6697 musical aspects of the input from the notation style of the output.
6698 This way, the same input can be reused to typeset the same music in a
6699 different style of Gregorian chant notation.
6701 The following table shows the code fragments that produce the
6702 ligatures in the above neumes table. The letter in the first column
6703 in each line of the below table indicates to which ligature in the
6704 above table it refers. The second column gives the name of the
6705 ligature. The third column shows the code fragment that produces this
6706 ligature, using @code{g}, @code{a} and @code{b} as example pitches.
6708 @multitable @columnfractions .1 .4 .5
6722 Punctum Inclinatum @tab
6723 @code{\[ \inclinatum b \]}
6727 Punctum Auctum Ascendens @tab
6728 @code{\[ \auctum \ascendens b \]}
6732 Punctum Auctum Descendens @tab
6733 @code{\[ \auctum \descendens b \]}
6737 Punctum Inclinatum Auctum @tab
6738 @code{\[ \inclinatum \auctum b \]}
6742 Punctum Inclinatum Parvum @tab
6743 @code{\[ \inclinatum \deminutum b \]}
6748 @code{\[ \virga b \]}
6753 @code{\[ \stropha b \]}
6758 @code{\[ \stropha \auctum b \]}
6763 @code{\[ \oriscus b \]}
6767 Clivis vel Flexa @tab
6768 @code{\[ b \flexa g \]}
6772 Clivis Aucta Descendens @tab
6773 @code{\[ b \flexa \auctum \descendens g \]}
6777 Clivis Aucta Ascendens @tab
6778 @code{\[ b \flexa \auctum \ascendens g \]}
6783 @code{\[ b \flexa \deminutum g \]}
6787 Podatus vel Pes @tab
6788 @code{\[ g \pes b \]}
6792 Pes Auctus Descendens @tab
6793 @code{\[ g \pes \auctum \descendens b \]}
6797 Pes Auctus Ascendens @tab
6798 @code{\[ g \pes \auctum \ascendens b \]}
6803 @code{\[ g \pes \deminutum b \]}
6808 @code{\[ \oriscus g \pes \virga b \]}
6812 Pes Quassus Auctus Descendens @tab
6813 @code{\[ \oriscus g \pes \auctum \descendens b \]}
6818 @code{\[ \quilisma g \pes b \]}
6822 Quilisma Pes Auctus Descendens @tab
6823 @code{\[ \quilisma g \pes \auctum \descendens b \]}
6827 Pes Initio Debilis @tab
6828 @code{\[ \deminutum g \pes b \]}
6832 Pes Auctus Descendens Initio Debilis @tab
6833 @code{\[ \deminutum g \pes \auctum \descendens b \]}
6838 @code{\[ a \pes b \flexa g \]}
6842 Torculus Auctus Descendens @tab
6843 @code{\[ a \pes b \flexa \auctum \descendens g \]}
6847 Torculus Deminutus @tab
6848 @code{\[ a \pes b \flexa \deminutum g \]}
6852 Torculus Initio Debilis @tab
6853 @code{\[ \deminutum a \pes b \flexa g \]}
6857 Torculus Auctus Descendens Initio Debilis @tab
6858 @code{\[ \deminutum a \pes b \flexa \auctum \descendens g \]}
6862 Torculus Deminutus Initio Debilis @tab
6863 @code{\[ \deminutum a \pes b \flexa \deminutum g \]}
6868 @code{\[ a \flexa g \pes b \]}
6872 Porrectus Auctus Descendens @tab
6873 @code{\[ a \flexa g \pes \auctum \descendens b \]}
6877 Porrectus Deminutus @tab
6878 @code{\[ a \flexa g \pes \deminutum b \]}
6883 @code{\[ \virga b \inclinatum a \inclinatum g \]}
6887 Climacus Auctus @tab
6888 @code{\[ \virga b \inclinatum a \inclinatum \auctum g \]}
6892 Climacus Deminutus @tab
6893 @code{\[ \virga b \inclinatum a \inclinatum \deminutum g \]}
6898 @code{\[ g \pes a \virga b \]}
6902 Scandicus Auctus Descendens @tab
6903 @code{\[ g \pes a \pes \auctum \descendens b \]}
6907 Scandicus Deminutus @tab
6908 @code{\[ g \pes a \pes \deminutum b \]}
6913 @code{\[ g \oriscus a \pes \virga b \]}
6917 Salicus Auctus Descendens @tab
6918 @code{\[ g \oriscus a \pes \auctum \descendens b \]}
6923 @code{\[ \stropha b \stropha b \stropha a \]}
6929 The following head prefixes are supported
6931 @cindex @code{\virga}
6933 @cindex @code{\stropha}
6935 @cindex @code{\inclinatum}
6937 @cindex @code{\auctum}
6939 @cindex @code{\descendens}
6941 @cindex @code{\ascendens}
6943 @cindex @code{\oriscus}
6945 @cindex @code{\quilisma}
6947 @cindex @code{\deminutum}
6950 Head prefixes can be accumulated, though restrictions apply. For
6951 example, either @code{\descendens} or @code{\ascendens} can be applied
6952 to a head, but not both to the same head.
6955 @cindex @code{\flexa}
6956 Two adjacent heads can be tied together with the @code{\pes} and
6957 @code{\flexa} infix commands for a rising and falling line of melody,
6962 @node Vaticana style contexts
6963 @subsection Vaticana style contexts
6965 @cindex VaticanaVoiceContext
6966 @cindex VaticanaStaffContext
6968 The predefined @code{VaticanaVoiceContext} and
6969 @code{VaticanaStaffContext} can be used to easily engrave a piece of
6970 Gregorian Chant in the style of the Editio Vaticana. These contexts
6971 initialize all relevant context properties and grob properties to
6972 proper values. With these contexts, you can immediately go ahead
6973 entering the chant, as the following short excerpt demonstrates
6975 @lilypond[quote,raggedright,verbatim,noindent]
6976 \include "gregorian-init.ly"
6979 \context VaticanaVoice = "cantus" {
6980 \override Score.BarNumber #'transparent = ##t
6982 \[ c'\melisma c' \flexa a \]
6983 \[ a \flexa \deminutum g\melismaEnd \]
6985 \[ f\melisma \pes a c' c' \pes d'\melismaEnd \]
6986 c' \divisioMinima \break
6987 \[ c'\melisma c' \flexa a \]
6988 \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima
6991 \lyricsto "cantus" \new Lyrics {
6992 San- ctus, San- ctus, San- ctus
6999 @subsection Figured bass
7001 @cindex Basso continuo
7003 @c TODO: musicological blurb about FB
7006 LilyPond has limited support for figured bass
7008 @lilypond[quote,verbatim,fragment]
7010 \context Voice { \clef bass dis4 c d ais }
7011 \context FiguredBass \figures {
7012 < 6 >4 < 7 >8 < 6+ [_!] >
7018 The support for figured bass consists of two parts: there is an input
7019 mode, introduced by @code{\figures}, where you can enter bass figures
7020 as numbers, and there is a context called @internalsref{FiguredBass} that
7021 takes care of making @internalsref{BassFigure} objects.
7023 In figures input mode, a group of bass figures is delimited by
7024 @code{<} and @code{>}. The duration is entered after the @code{>>}
7028 @lilypond[quote,fragment]
7029 \context FiguredBass
7033 Accidentals are added when you append @code{-}, @code{!} and @code{+}
7039 @lilypond[quote,fragment]
7040 \context FiguredBass
7041 \figures { <4- 6+ 7!> }
7044 Spaces or dashes may be inserted by using @code{_}. Brackets are
7045 introduced with @code{[} and @code{]}
7050 @lilypond[quote,fragment]
7051 \context FiguredBass
7052 \figures { < [4 6] 8 [_! 12]> }
7055 Although the support for figured bass may superficially resemble chord
7056 support, it works much simpler. The @code{\figures} mode simply
7057 stores the numbers , and @internalsref{FiguredBass} context prints
7058 them as entered. There is no conversion to pitches, and no
7059 realizations of the bass are played in the MIDI file.
7061 Internally, the code produces markup texts. You can use any of the
7062 markup text properties to override formatting. For example, the
7063 vertical spacing of the figures may be set with @code{baseline-skip}.
7067 Program reference: @internalsref{BassFigureEvent} music, @internalsref{BassFigure} object,
7068 and @internalsref{FiguredBass} context.
7072 Slash notation for alterations is not supported.
7074 @node Contemporary notation
7075 @section Contemporary notation
7077 In the 20th century, composers have greatly expanded the musical
7078 vocabulary. With this expansion, many innovations in musical notation
7079 have been tried. The book by Stone (1980) gives a comprehensive
7080 overview (see @ref{Literature list}). In general, the use of new,
7081 innovative notation makes a piece harder to understand and perform and
7082 its use should therefore be avoided if possible. For this reason,
7083 support for contemporary notation in LilyPond is limited.
7087 * Polymetric notation::
7093 @node Polymetric notation
7094 @subsection Polymetric notation
7096 Double time signatures are not supported explicitly, but they can be
7097 faked. In the next example, the markup for the time signature is
7098 created with a markup text. This markup text is inserted in the
7099 @internalsref{TimeSignature} grob.
7101 @lilypond[verbatim,raggedright]
7107 \musicglyph #"scripts-stopped"
7108 \bracket \column < "5" "8" >
7113 \override Staff.TimeSignature #'print-function = #Text_item::print
7114 \override Staff.TimeSignature #'text = #tsMarkup
7116 c'2 \bar ":" c'4 c'4.
7120 Each staff can also have its own time signature. This is done by
7121 moving the @internalsref{Timing_engraver} to @internalsref{Staff}
7128 \remove "Timing_engraver"
7132 \consists "Timing_engraver"
7138 Now, each staff has its own time signature.
7152 c4. c8 c c c4. c8 c c
7157 @lilypond[raggedright]
7161 \remove "Timing_engraver"
7165 \consists "Timing_engraver"
7181 c4. c8 c c c4. c8 c c
7187 A different form of polymetric notation is where note lengths have
7188 different values across staves.
7190 This notation can be created by setting a common time signature for
7191 each staff but replacing it manually using
7192 @code{timeSignatureFraction} to the desired fraction. Then the printed
7193 durations in each staff are scaled to the common time signature.
7194 The latter is done with @code{\compressmusic}, which is similar to
7195 @code{\times}, but does not create a tuplet bracket.
7198 In this example, music with the time signatures of 3/4, 9/8 and 10/8 are
7199 used in parallel. In the second staff, shown durations are multiplied by
7200 2/3, so that 2/3 * 9/8 = 3/4, and in the third staff, shown durations are
7201 multiplied by 3/5, so that 3/5 * 10/8 = 3/4.
7203 @lilypond[raggedright,verbatim]
7211 \set Staff.timeSignatureFraction = #'(9 . 8)
7212 \compressmusic #'(2 . 3)
7213 \repeat unfold 6 { c8[ c c] }
7217 \set Staff.timeSignatureFraction = #'(10 . 8)
7218 \compressmusic #'(3 . 5)
7219 { \repeat unfold 2 { c8[ c c] }
7220 \repeat unfold 2 { c8[ c] }
7221 | c4. c4. \times 2/3 { c8 c c } c4 }
7231 When using different time signatures in parallel, the spacing is
7232 aligned vertically, but bar lines distort the regular spacing.
7237 @subsection Clusters
7241 A cluster indicates a continuous range of pitches to be played. They
7242 can be denoted as the envelope of a set of notes. They are entered by
7243 applying the function @code{notes-to-clusters} to a sequence of
7246 @lilypond[quote,relative=2,verbatim]
7247 \applymusic #notes-to-clusters { <c e > <b f'> }
7250 The following example (from
7251 @inputfileref{input/regression,cluster.ly}) shows what the result
7254 @lilypondfile[quote]{cluster.ly}
7256 Ordinary notes and clusters can be put together in the same staff,
7257 even simultaneously. In such a case no attempt is made to
7258 automatically avoid collisions between ordinary notes and clusters.
7262 Program reference: @internalsref{ClusterSpanner},
7263 @internalsref{ClusterSpannerBeacon},
7264 @internalsref{Cluster_spanner_engraver}, and
7265 @internalsref{ClusterNoteEvent}.
7267 Examples: @inputfileref{input/regression,cluster.ly}.
7271 Music expressions like @code{<< @{ g8 e8 @} a4 >>} are not printed
7272 accurately. Use @code{<g a>8 <e a>8} instead.
7277 @subsection Fermatas
7283 Contemporary music notation frequently uses special fermata symbols to
7284 indicate fermatas of differing lengths. The following fermatas are
7287 @lilypond[quote,raggedright]
7309 \context Lyrics \lyrics {
7310 \override LyricText #'font-family = #'typewriter
7311 "shortfermata" "fermata" "longfermata" "verylongfermata"
7316 See @ref{Articulations} for general instructions how to apply scripts
7317 such as fermatas to notes.
7319 @node Feathered beams
7320 @subsection Feathered beams
7322 Feathered beams are not supported natively, but they can be faked by
7323 forcing two beams to overlap. Here is an example,
7325 @lilypond[raggedright]
7326 \relative \new Staff <<
7330 \once \override Voice.Beam #'positions = #'(0 . 0.5)
7335 \once \override Voice.Beam #'positions = #'(0 . -0.5)
7343 @node Educational use
7344 @section Educational use
7348 * Blank music paper::
7349 * Notation for excercises::
7350 * Easy Notation note heads::
7354 @subsection Balloon help
7356 Elements of notation can be marked and named with the help of a square
7357 balloon. The primary purpose of this feature is to explain notation.
7359 The following example demonstrates its use.
7361 @lilypond[quote,verbatim,fragment,raggedright,relative=2]
7364 #(add-balloon-text 'NoteHead "heads, or tails?"
7370 The function @code{add-balloon-text} takes the name of a grob, the
7371 label to print, and the position where to put the label relative to
7372 the object. In the above example, the text ``heads or tails?'' ends
7373 3 spaces below the `balloon.'
7376 @cindex notation, explaining
7380 Program reference: @internalsref{text-balloon-interface}.
7382 Examples: @inputfileref{input/regression,balloon.ly}.
7387 @node Blank music paper
7388 @subsection Blank music paper
7390 A blank music paper can be produced also by using invisible notes, and
7391 removing @code{Bar_number_engraver}.
7396 \repeat unfold 2 % Change this for more lines.
7401 \override TimeSignature #'transparent = ##t
7402 defaultBarType = #""
7403 \remove Bar_number_engraver
7405 \context Staff \emptymusic
7406 \context TabStaff \emptymusic
7411 @node Notation for excercises
7412 @subsection Notation for excercises
7416 Invisible (or transparent) notes can be useful, when weird tricks are
7417 needed; especially, a slur cannot be attach to a rest or spacer rest.
7421 blanknotes = { \override NoteHead #'transparent = ##t
7422 \override Stem #'transparent = ##t }
7423 unblanknotes = { \revert NoteHead #'transparent
7424 \revert Stem #'transparent }
7429 \blanknotes e4 f4 \unblanknotes
7435 @node Easy Notation note heads
7436 @subsection Easy Notation note heads
7438 @cindex easy notation
7441 The `easy play' note head includes a note name inside the head. It is
7442 used in music for beginners
7444 @lilypond[quote,raggedright,verbatim,fragment,staffsize=26]
7449 The command @code{\setEasyHeads} overrides settings for the
7450 @internalsref{NoteHead} object. To make the letters readable, it has
7451 to be printed in a large font size. To print with a larger font, see
7452 @ref{Setting global staff size}.
7457 If you view the result with Xdvi, staff lines may show through the
7458 letters. Printing the PostScript file obtained does produce the
7463 @cindex @code{\setEasyHeads}
7464 @code{\setEasyHeads}