3 @c A menu is needed before every deeper *section nesting of @node's; run
4 @c M-x texinfo-all-menus-update
5 @c to automagically fill in these menus before saving changes
7 @c FIXME: singular vs. plural: Beams/Beam
11 @chapter Notation manual
15 * Easier music entry::
22 * Fingering instructions::
31 * Contemporary notation::
37 @c FIXME: Note entry vs Music entry at top level menu is confusing.
43 This chapter describes all the different types of notation supported
44 by LilyPond. It is intended as a reference for users that are already
45 somewhat familiar with using LilyPond.
51 * Chromatic alterations::
59 * Easy Notation note heads ::
67 A note is printed by specifying its pitch and then its duration:
68 @footnote{Notes constitute the most basic elements of LilyPond input,
69 but they do not form valid input on their own without a @code{\score}
70 block. However, for the sake of brevity and simplicity we will
71 generally omit @code{\score} blocks and @code{\paper} declarations in
74 @lilypond[fragment,verbatim]
83 @cindex Note specification
85 @cindex entering notes
87 The most common syntax for pitch entry is used in @code{\chords} and
88 @code{\notes} mode. In Note and Chord mode, pitches may be designated
89 by names. The notes are specified by the letters @code{a} through
90 @code{g}, while the octave is formed with notes ranging from @code{c}
91 to @code{b}. The pitch @code{c} is an octave below middle C and the
92 letters span the octave above that C:
94 @lilypond[fragment,verbatim]
96 a,4 b, c d e f g a b c' d' e' \clef treble f' g' a' b' c''
99 @cindex note names, Dutch
101 A sharp is formed by adding @code{-is} to the end of a pitch name and
102 a flat is formed by adding @code{-es}. Double sharps and double flats
103 are obtained by adding @code{-isis} or @code{-eses}. These
104 names are the Dutch note names. In Dutch, @code{aes} is contracted to
105 @code{as} in Dutch, but both forms are accepted. Similarly, both
106 @code{es} and @code{ees} are accepted.
108 There are predefined sets of note names for various other languages.
109 To use them, include the language specific init file. For
110 example: @code{\include "english.ly"}. The available language files
111 and the note names they define are:
116 Note Names sharp flat
117 nederlands.ly c d e f g a bes b -is -es
118 english.ly c d e f g a bf b -s/-sharp -f/-flat
119 deutsch.ly c d e f g a b h -is -es
120 norsk.ly c d e f g a b h -iss/-is -ess/-es
121 svenska.ly c d e f g a b h -iss -ess
122 italiano.ly do re mi fa sol la sib si -d -b
123 catalan.ly do re mi fa sol la sib si -d/-s -b
124 espanol.ly do re mi fa sol la sib si -s -b
133 The optional octave specification takes the form of a series of
134 single quote (`@code{'}') characters or a series of comma
135 (`@code{,}') characters. Each @code{'} raises the pitch by one
136 octave; each @code{,} lowers the pitch by an octave:
138 @lilypond[fragment,verbatim,center]
139 c' c'' es' g' as' gisis' ais'
143 There is also a verbose syntax for pitch specification:
146 @cindex @code{\pitch}
148 \pitch @var{scmpitch}
152 where @var{scmpitch} is a Scheme object of the @code{Pitch} type.
156 Notes can be hidden and unhidden with the following commands:
158 @cindex @code{\hideNotes}
160 @cindex @code{\unHideNotes}
167 @internalsref{NoteEvent}, and @internalsref{NoteHead}.
169 @node Chromatic alterations
170 @subsection Chromatic alterations
172 Normally accidentals are printed automatically, but you may also
173 print them manually. A reminder accidental
174 @cindex reminder accidental
176 can be forced by adding an exclamation mark @code{!}
177 after the pitch. A cautionary accidental
178 @cindex cautionary accidental
179 @cindex parenthesized accidental
180 (an accidental within parentheses) can be obtained by adding the
181 question mark `@code{?}' after the pitch:
183 @lilypond[fragment,verbatim]
184 cis' cis' cis'! cis'?
188 The automatic production of accidentals can be tuned in many
189 ways. For more information, refer to @ref{Accidentals}.
194 A chord is formed by a enclosing a set of pitches in @code{<<} and
195 @code{>>}. A chord may be followed by a duration, and a set of
196 articulations, just like simple notes.
206 Rests are entered like notes, with the note name @code{r}:
208 @lilypond[singleline,verbatim]
212 Whole bar rests, centered in middle of the bar,
213 must be done with multi measure rests. They are discussed in
214 @ref{Multi measure rests}.
217 A rest's vertical position may be explicitly specified by entering a
218 note with the @code{\rest} keyword appended. This makes manual
219 formatting in polyphonic music easier. Rest collision testing will
220 leave these rests alone:
222 @lilypond[singleline,verbatim]
228 @internalsref{RestEvent}, and @internalsref{Rest}.
235 @cindex Invisible rest
238 An invisible rest (also called a `skip') can be entered like a note
239 with note name `@code{s}' or with @code{\skip @var{duration}}:
241 @lilypond[singleline,verbatim]
245 The @code{s} syntax is only available in Note mode and Chord mode. In
246 other situations, you should use the @code{\skip} command:
248 @lilypond[singleline,verbatim]
251 { \time 4/8 \skip 2 \time 4/4 }
252 \notes\relative c'' { a2 a1 }
257 The skip command is merely an empty musical placeholder. It does not
258 produce any output, not even transparent output.
262 @internalsref{SkipEvent}.
267 @subsection Durations
271 @cindex @code{\duration}
274 In Note, Chord, and Lyrics mode, durations are designated by numbers
275 and dots: durations are entered as their reciprocal values. For example,
276 a quarter note is entered using a @code{4} (since it is a 1/4 note), while
277 a half note is entered using a @code{2} (since it is a 1/2 note). For notes
278 longer than a whole you must use variables:
280 @c FIXME: what is an identifier? I do not think it's been introduced yet.
281 @c and if it has, I obviously skipped that part. - Graham
285 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64
287 r1 r2 r4 r8 r16 r32 r64 r64
292 \notes \relative c'' {
294 a1 a2 a4 a8 a16 a32 a64 a64
296 r1 r2 r4 r8 r16 r32 r64 r64
301 \remove "Clef_engraver"
302 \remove "Staff_symbol_engraver"
303 \remove "Time_signature_engraver"
304 \consists "Pitch_squash_engraver"
311 If the duration is omitted then it is set to the previously entered
312 duration. The default for the first note is a quarter note. The duration
313 can be followed by dots (`@code{.}') in order to obtain dotted note
317 @lilypond[fragment,verbatim,center]
318 a' b' c''8 b' a'4 a'4. b'4.. c'8.
323 You can alter the length of duration by a fraction @var{N/M}
324 appending `@code{*}@var{N/M}' (or `@code{*}@var{N}' if @var{M=1}). This
325 will not affect the appearance of the notes or rests produced.
326 In the following example, the first three notes take up exactly two
328 @lilypond[fragment,relative 2,verbatim]
330 a4*2/3 gis4*2/3 a4*2/3
334 Durations can also be produced using the verbose syntax
335 @code{\duration @var{Scheme object}}:
336 @lilypond[verbatim,fragment]
337 c'\duration #(ly:make-duration 4 1)
344 Dots are normally moved up to avoid staff lines, except in polyphonic
345 situations. The following commands may be used to force a particular
348 @cindex @code{\dotsUp}
350 @cindex @code{\dotsDown}
352 @cindex @code{\dotsBoth}
357 @internalsref{Dots}, and @internalsref{DotColumn}.
361 In dense chords, dots can overlap.
366 Whenever a note is found, a
367 @internalsref{Stem} object is created automatically. For whole notes
368 and rests, stem objects are also created, but in those cases, the stem
373 @cindex @code{\stemUp}
375 @cindex @code{\stemDown}
377 @cindex @code{\stemBoth}
388 A tie connects two adjacent note heads of the same pitch. The tie in
389 effect extends the length of a note. Ties should not be confused with
390 slurs, which indicate articulation, or phrasing slurs, which indicate
391 musical phrasing. A tie is entered using the tilde symbol `@code{~}':
393 @lilypond[fragment,verbatim,center]
394 e' ~ e' <<c' e' g'>> ~ <<c' e' g'>>
397 When a tie is applied to a chord, all note heads whose pitches match
398 are connected. When no note heads match, no ties will be created.
400 In its meaning a tie is just a way of extending a note duration, similar
401 to the augmentation dot; in the following example there are two ways of
402 notating exactly the same concept:
404 @lilypond[fragment, singleline,quote]
405 \time 3/4 c'2. c'2 ~ c'4
407 If you need to tie a lot of notes over bars, it may be easier to use automatic
408 note splitting (See @ref{Automatic note splitting}).
413 @cindex @code{\tieUp}
415 @cindex @code{\tieDown}
417 @cindex @code{\tieBoth}
419 @cindex @code{\tieDotted}
421 @cindex @code{\tieSolid}
426 @internalsref{TieEvent}, @internalsref{NewTieEvent},
427 @internalsref{Tie}, and @ref{Automatic note splitting}.
430 ties created for a chord, see @inputfileref{input/test,tie-sparse.ly}.
434 Tieing only a subset of the note heads of a pair of chords is not
435 supported in a simple way. It can be achieved by moving the
436 tie-engraver into the @internalsref{Thread} context and turning on and
437 off ties per @internalsref{Thread}.
439 Switching staves when a tie is active, will not produce a slanted tie.
441 Formatting of ties is a difficult subject. The results are often not
451 @cindex @code{\times}
453 Tuplets are made out of a music expression by multiplying all durations
456 @cindex @code{\times}
458 \times @var{fraction} @var{musicexpr}
461 The duration of @var{musicexpr} will be multiplied by the fraction.
462 In the sheet music, the fraction's denominator will be printed over
463 the notes, optionally with a bracket. The most common tuplet is the
464 triplet in which 3 notes have the length of 2, so the notes are 2/3
465 of their written length:
467 @lilypond[fragment,verbatim,center]
468 g'4 \times 2/3 {c'4 c' c'} d'4 d'4
471 The property @code{tupletSpannerDuration} specifies how long each
472 bracket should last. With this, you can make lots of tuplets while
473 typing @code{\times} only once, saving lots of typing. In the next
474 example, there are two triplets shown, while @code{\times} was only
477 @lilypond[fragment, relative, singleline, verbatim]
478 \property Voice.tupletSpannerDuration = #(ly:make-moment 1 4)
479 \times 2/3 { c'8 c c c c c }
482 The format of the number is determined by the property
483 @code{tupletNumberFormatFunction}. The default prints only the
484 denominator, but if it is set to the Scheme function
485 @code{fraction-tuplet-formatter}, @var{num}:@var{den} will be printed
489 @cindex @code{tupletNumberFormatFunction}
490 @cindex tuplet formatting
495 @cindex @code{\tupletUp}
497 @cindex @code{\tupletDown}
499 @cindex @code{\tupletBoth}
504 @internalsref{TupletBracket}, and @internalsref{TimeScaledMusic}.
508 Nested tuplets are not formatted automatically. In this case, outer
509 tuplet brackets should be moved manually.
511 @node Easy Notation note heads
512 @subsection Easy Notation note heads
514 @cindex easy notation
517 The `easyplay' note head includes a note name inside the head. It is
518 used in music aimed at beginners.
520 @lilypond[singleline,verbatim,26pt]
522 \notes { c'2 e'4 f' | g'1 }
523 \paper { \translator { \EasyNotation } }
527 The @code{EasyNotation} variable overrides a @internalsref{Score} context.
528 You probably will want to print it with magnification or a
529 large font size to make it more readable. To print with
530 magnification, you must create a DVI file (with @file{ly2dvi}) and
531 then enlarge it with something like @file{dvips -x 2000 file.dvi}.
532 See the @code{dvips} documentation for more details. To print with a
533 larger font, see @ref{Font Size}.
539 If you view the result with Xdvi, then staff lines will show through
540 the letters. Printing the PostScript file obtained with ly2dvi does
541 produce the correct result.
544 @node Easier music entry
545 @section Easier music entry
548 When entering music it is easy to introduce errors. This section deals
549 with tricks and features of the input language that help when entering
550 music, and find and correct mistakes. Some features of the input
551 language ease entering music, but also have other applications. They
552 are not described in this section.
554 It is also possible to use external programs, for example GUI
555 interfaces, or MIDI transcription programs, to enter or edit
556 music. Refer to the website for more information. Finally, there are
557 tools make debugging easier, by linking the input file and the output
558 shown on screen. See @ref{Point and click} for more information.
564 * Skipping corrected music::
565 * Automatic note splitting ::
571 @node Relative octaves
572 @subsection Relative octaves
574 @cindex relative octave specification
576 Octaves are specified by adding @code{'} and @code{,} to pitch names.
577 When you copy existing music, it is easy to accidentally put a pitch
578 in the wrong octave and hard to find such an error. The relative
579 octave mode prevents these errors: a single error puts the rest of the
580 piece off by one octave:
582 @cindex @code{\relative}
584 \relative @var{startpitch} @var{musicexpr}
587 The octave of notes that appear in @var{musicexpr} are calculated as
588 follows: If no octave changing marks are used, the basic interval
589 between this and the last note is always taken to be a fourth or less
590 (; this distance is determined without regarding alterations: a
591 @code{fisis} following a @code{ceses} will be put above the
594 The octave changing marks @code{'} and @code{,} can be added to raise
595 or lower the pitch by an extra octave. Upon entering relative mode,
596 an absolute starting pitch must be specified that will act as the
597 predecessor of the first note of @var{musicexpr}.
599 Here is the relative mode shown in action:
600 @lilypond[fragment,singleline,verbatim,center]
606 Octave changing marks are used for intervals greater than a fourth:
607 @lilypond[fragment,verbatim,center]
612 If the preceding item is a chord, the first note of the chord is used
613 to determine the first note of the next chord:
615 @lilypond[fragment,verbatim,center]
622 @cindex @code{\notes}
624 The pitch after the @code{\relative} contains a note name. To parse
625 the pitch as a note name, you have to be in note mode, so there must
626 be a surrounding @code{\notes} keyword (which is not
629 The relative conversion will not affect @code{\transpose},
630 @code{\chords} or @code{\relative} sections in its argument. If you
631 want to use relative within transposed music, you must place an
632 additional @code{\relative} inside the @code{\transpose}.
636 @subsection Bar check
640 @cindex @code{barCheckSynchronize}
643 Bar checks help detect errors in the durations. A bar check is
644 entered using the bar symbol, `@code{|}'. Whenever it is encountered
645 during interpretation, it should fall on a measure boundary. If it
646 does not, a warning is printed. Depending on the value of
647 @code{barCheckSynchronize}, the beginning of the measure will be
650 In the next example, the second bar check will signal an error:
652 \time 3/4 c2 e4 | g2 |
657 @cindex skipTypesetting
659 Failed bar checks are caused by entering incorrect
660 durations. Incorrect durations often completely garble up the score,
661 especially if it is polyphonic, so you should start correcting the
662 score by scanning for failed bar checks and incorrect durations. To
663 speed up this process, you can use @code{skipTypesetting}, described
666 @node Skipping corrected music
667 @subsection Skipping corrected music
669 The property @code{Score.skipTypesetting} can be used to switch on and
670 off typesetting completely during the interpretation phase. When
671 typesetting is switched off, the music is processed much more quickly.
672 This can be used to skip over the parts of a score that have already
673 been checked for errors:
675 @lilypond[fragment,singleline,verbatim]
677 \property Score.skipTypesetting = ##t
679 \property Score.skipTypesetting = ##f
683 @node Automatic note splitting
684 @subsection Automatic note splitting
686 Long notes can be converted automatically to tied notes. This is done
687 by replacing the @internalsref{Note_heads_engraver} by the
688 @internalsref{Completion_heads_engraver}:
691 \paper @{ \translator @{
693 \remove "Note_heads_engraver"
694 \consists "Completion_heads_engraver"
698 which will make long notes tied in the following example:
701 c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2
708 c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2
710 \paper { \translator {
712 \remove "Note_heads_engraver"
713 \consists "Completion_heads_engraver"
718 This engraver splits all running notes at the bar line, and inserts
719 ties. One of its uses is to debug complex scores: if the measures are
720 not entirely filled, then the ties exactly show how much each measure
725 Not all durations (especially those containing tuplets) can be
726 represented exactly; the engraver will not insert tuplets.
732 @section Staff notation
734 This section describes music notation that occurs on staff level,
735 such as keys, clefs and time signatures.
737 @cindex Staff notation
751 @subsection Staff symbol
753 @cindex adjusting staff symbol
754 @cindex StaffSymbol, using \property
755 @cindex staff lines, setting number of
757 Notes, dynamic signs, etc. are grouped
758 with a set of horizontal lines, into a staff (plural `staves'). In our
759 system, these lines are drawn using a separate layout object called
762 This object is created whenever a @internalsref{Staff} context is
763 created. The appearance of the staff symbol cannot be changed by
764 using @code{\override} or @code{\set}. At the moment that
765 @code{\property Staff} is interpreted, a @internalsref{Staff} context
766 is made, and the @internalsref{StaffSymbol} is created before any
767 @code{\override} is effective. Properties can be changed in a
768 @code{\translator} definition, or by using @code{\outputproperty}.
772 If a staff is ended halfway a piece, the staff symbol may not end
773 exactly on the barline.
777 @subsection Key signature
778 @cindex Key signature
782 The key signature indicates the scale in which a piece is played. It
783 is denoted by a set of alterations (flats or sharps) at the start of
788 Setting or changing the key signature is done with the @code{\key}
791 @code{\key} @var{pitch} @var{type}
794 @cindex @code{\minor}
795 @cindex @code{\major}
796 @cindex @code{\minor}
797 @cindex @code{\ionian}
798 @cindex @code{\locrian}
799 @cindex @code{\aeolian}
800 @cindex @code{\mixolydian}
801 @cindex @code{\lydian}
802 @cindex @code{\phrygian}
803 @cindex @code{\dorian}
805 Here, @var{type} should be @code{\major} or @code{\minor} to get
806 @var{pitch}-major or @var{pitch}-minor, respectively.
807 The standard mode names @code{\ionian},
808 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
809 @code{\phrygian}, and @code{\dorian} are also defined.
811 This command sets the context property
812 @internalsref{Staff}.@code{keySignature}. Non-standard key signatures
813 can be specified by setting this property directly.
817 The ordering of a key cancellation is wrong when it is combined with
818 repeat bar lines. The cancellation is also printed after a line break.
822 @internalsref{KeyChangeEvent}, and @internalsref{KeySignature}.
824 @cindex @code{keySignature}
831 The clef indicates which lines of the staff correspond to which
836 The clef can be set or changed with the @code{\clef} command:
837 @lilypond[fragment,verbatim]
838 \key f\major c''2 \clef alto g'2
841 Supported clef-names include:
842 @c Moved standard clefs to the top /MB
844 @item treble, violin, G, G2
853 G clef on 1st line, so-called French violin clef
868 By adding @code{_8} or @code{^8} to the clef name, the clef is
869 transposed one octave down or up, respectively. Argument @var{clefname}
870 must be enclosed in quotes when it contains underscores or digits. For
876 This command is equivalent to setting @code{clefGlyph},
877 @code{clefPosition} (which controls the Y position of the clef),
878 @code{centralCPosition} and @code{clefOctavation}. A clef is printed
879 when any of these properties are changed.
883 The object for this symbol is @internalsref{Clef}.
887 @node Ottava brackets
888 @subsection Ottava brackets
890 ``Ottava'' brackets introduce an extra transposition of an octave for
891 the staff. They are created by invoking the function
892 @code{set-octavation}:
898 @lilypond[verbatim,fragment]
907 Internally the @code{set-octavation} function sets the properties
908 @code{ottavation} (eg. to @code{"8va"}) and @code{centralCPosition}.
912 @internalsref{OttavaBracket}.
916 @code{set-octavation} will get confused when clef changes happen
917 during an octavation bracket.
920 @subsection Time signature
921 @cindex Time signature
925 Time signature indicates the metrum of a piece: a regular pattern of
926 strong and weak beats. It is denoted by a fraction at the start of the
931 The time signature is set or changed by the @code{\time}
933 @lilypond[fragment,verbatim]
934 \time 2/4 c'2 \time 3/4 c'2.
937 The symbol that is printed can be customized with the @code{style}
938 property. Setting it to @code{#'()} uses fraction style for 4/4 and
939 2/2 time. There are many more options for its layout. See
940 @inputfileref{input/test,time.ly} for more examples.
943 This command sets the property @code{timeSignatureFraction},
944 @code{beatLength} and @code{measureLength} in the @code{Timing}
945 context, which is normally aliased to @internalsref{Score}. The
946 property @code{measureLength} determines where bar lines should be
947 inserted, and how automatic beams should be generated. Changing the
948 value of @code{timeSignatureFraction} also causes the symbol to be
951 More options are available through the Scheme function
952 @code{set-time-signature}. In combination with the
953 @internalsref{Measure_grouping_engraver}, it will create
954 @internalsref{MeasureGrouping} signs. Such signs ease reading
955 rhythmically complex modern music. In the following example, the 9/8
956 measure is subdivided in 2, 2, 2 and 3. This is passed to
957 @code{set-time-signature} as the third argument @code{(2 2 2 3)}:
960 \score { \notes \relative c'' {
961 #(set-time-signature 9 8 '(2 2 2 3))
962 g8-[ g-] d-[ d-] g-[ g-] a8-[-( bes g-]-) |
963 #(set-time-signature 5 8 '(3 2))
968 \translator { \StaffContext
969 \consists "Measure_grouping_engraver"
975 @internalsref{TimeSignature}, and @internalsref{Timing_engraver}.
980 Automatic beaming does not use measure grouping specified with
981 @code{set-time-signature}.
983 @node Partial measures
984 @subsection Partial measures
987 @cindex partial measure
988 @cindex measure, partial
989 @cindex shorten measures
990 @cindex @code{\partial}
992 Partial measures, for example in upsteps, are entered using the
993 @code{\partial} command:
994 @lilypond[fragment,verbatim]
995 \partial 16*5 c'16 c4 | a'2. ~ a'8. a'16 | g'1
998 The syntax for this command is
1000 \partial @var{duration}
1002 This is internally translated into
1004 \property Timing.measurePosition = -@var{length of duration}
1007 The property @code{measurePosition} contains a rational number
1008 indicating how much of the measure has passed at this point.
1010 @node Unmetered music
1011 @subsection Unmetered music
1013 Bar lines and bar numbers are calculated automatically. For unmetered
1014 music (e.g. cadenzas), this is not desirable. By setting
1015 @code{Score.timing} to false, this automatic timing can be switched
1021 @cindex @code{\cadenzaOn}
1023 @cindex @code{\cadenzaOff}
1027 @subsection Bar lines
1031 @cindex measure lines
1035 Bar lines delimit measures, but are also used to indicate repeats.
1036 Normally, they are inserted automatically. Line breaks may only
1042 of barlines can be forced with the @code{\bar} command:
1043 @lilypond[relative=1,fragment,verbatim]
1047 The following bar types are available:
1048 @lilypond[fragment, relative, singleline, verbatim]
1060 In scores with many staves, a @code{\bar} command in one staff is
1061 automatically applied to all staves. The resulting bar lines are
1062 connected between different staves of a @internalsref{StaffGroup}:
1064 @lilypond[fragment, verbatim]
1065 < \context StaffGroup <
1066 \context Staff = up { e'4 d'
1069 \context Staff = down { \clef bass c4 g e g } >
1070 \context Staff = pedal { \clef bass c2 c2 } >
1074 The command @code{\bar @var{bartype}} is a short cut for doing
1075 @code{\property Score.whichBar = @var{bartype}} Whenever
1076 @code{whichBar} is set to a string, a bar line of that type is
1077 created. At the start of a measure it is set to
1078 @code{defaultBarType}. The contents of @code{repeatCommands} are used
1079 to override default measure bars.
1081 Property @code{whichBar} can also be set directly, using @code{\property}
1082 or @code{\bar}. These settings take precedence over the automatic
1083 @code{whichBar} settings.
1086 @cindex repeatCommands
1087 @cindex defaultBarType
1089 You are encouraged to use @code{\repeat} for repetitions. See
1099 The bar line objects that are created at @internalsref{Staff} level
1100 are called @internalsref{BarLine}, the bar lines that span staves are
1101 @internalsref{SpanBar}s.
1103 @cindex bar lines at start of system
1104 @cindex start of system
1106 The barlines at the start of each system are
1107 @internalsref{SystemStartBar}, @internalsref{SystemStartBrace}, and
1108 @internalsref{SystemStartBracket}. They are spanner objects and
1109 typically must be tuned from a @code{\translator} block.
1116 The easiest way to enter fragments with more than one voice on a staff
1117 is to split chords using the separator @code{\\}. You can use it for
1118 small, short-lived voices or for single chords:
1120 @lilypond[verbatim,fragment]
1121 \context Voice = VA \relative c'' {
1122 c4 < { f d e } \\ { b c2 } > c4 < g' \\ b, \\ f' \\ d >
1126 The separator causes @internalsref{Voice} contexts to be
1128 bear the names @code{"1"}, @code{"2"}, etc. In each of these
1129 contexts, vertical direction of slurs, stems, etc. is set
1132 This can also be done by instantiating @internalsref{Voice} contexts
1133 by hand, and using @code{\voiceOne}, up to @code{\voiceFour} to assign
1134 a stem directions and horizontal shift for each part:
1137 @lilypond[singleline, verbatim]
1139 \context Staff < \context Voice = VA { \voiceOne cis2 b }
1140 \context Voice = VB { \voiceThree b4 ais ~ ais4 gis4 }
1141 \context Voice = VC { \voiceTwo fis4~ fis4 f ~ f } >
1144 Normally, note heads with a different number of dots are not merged, but
1145 when the object property @code{merge-differently-dotted} is set in
1146 the @internalsref{NoteCollision} object, they are merged:
1147 @lilypond[verbatim,fragment,singleline]
1148 \relative c'' \context Voice < {
1150 \property Staff.NoteCollision \override
1151 #'merge-differently-dotted = ##t
1153 } \\ { g8.-[ f16-] g8.-[ f16-] }
1157 Similarly, you can merge half note heads with eighth notes, by setting
1158 @code{merge-differently-headed}:
1159 @lilypond[fragment, relative=2,verbatim]
1162 \property Staff.NoteCollision
1163 \override #'merge-differently-headed = ##t
1164 c8 c4. } \\ { c2 c2 } >
1167 LilyPond also vertically shifts rests that are opposite of a stem:
1170 @lilypond[singleline,fragment,verbatim]
1171 \context Voice < c''4 \\ r4 >
1179 @cindex @code{\oneVoice}
1181 @cindex @code{\voiceOne}
1183 @cindex @code{\voiceTwo}
1185 @cindex @code{\voiceThree}
1187 @cindex @code{\voiceFour}
1190 The following commands specify in what chords of the current voice
1191 should be shifted: the outer voice has @code{\shiftOff}, and the inner
1192 voices have @code{\shiftOn}, @code{\shiftOnn}, etc.
1195 @cindex @code{\shiftOn}
1197 @cindex @code{\shiftOnn}
1199 @cindex @code{\shiftOnnn}
1201 @cindex @code{\shiftOff}
1208 The objects responsible for resolving collisions are
1209 @internalsref{NoteCollision} and @internalsref{RestCollision}. See
1210 also example files @inputfileref{input/regression,collision-dots.ly},
1211 @inputfileref{input/regression,collision-head-chords.ly},
1212 @inputfileref{input/regression,collision-heads.ly},
1213 @inputfileref{input/regression,collision-mesh.ly}, and
1214 @inputfileref{input/regression,collisions.ly}.
1219 Resolving collisions is a intricate subject, and only a few situations
1220 are handled. When LilyPond cannot cope, the @code{force-hshift}
1221 property of the @internalsref{NoteColumn} object and pitched rests can
1222 be used to override typesetting decisions.
1224 When using @code{merge-differently-headed} with an upstem 8th or a shorter
1225 note, and a downstem half note, the 8th note gets the wrong offset.
1230 Beams are used to group short notes into chunks that are aligned with
1231 the metrum. They are inserted automatically in most cases:
1233 @lilypond[fragment,verbatim, relative=2]
1234 \time 2/4 c8 c c c \time 6/8 c c c c8. c16 c8
1237 When these automatic decisions are not good enough, beaming can be
1238 entered explicitly. It is also possible to define beaming patterns
1239 that differ from the defaults.
1243 @internalsref{Beam}.
1246 @cindex Automatic beams
1247 @subsection Manual beams
1248 @cindex beams, manual
1252 In some cases it may be necessary to override the automatic beaming
1253 algorithm. For example, the auto beamer will not put beams over rests
1254 or bar lines. Such beams are specified by manually: the begin and end
1255 point are marked with @code{[} and @code{]}:
1257 @lilypond[fragment,relative,verbatim]
1259 r4 r8-[ g' a r8-] r8 g-[ | a-] r8
1263 @cindex @code{stemLeftBeamCount}
1265 Normally, beaming patterns within a beam are determined automatically.
1266 When this mechanism fouls up, the properties
1267 @code{Voice.stemLeftBeamCount} and @code{Voice.stemRightBeamCount} can
1268 be used to control the beam subdivision on a stem. If either property
1269 is set, its value will be used only once, and then it is erased.
1271 @lilypond[fragment,relative,verbatim]
1274 f8-[ r16 \property Voice.stemLeftBeamCount = #1 f g a-]
1277 @cindex @code{stemRightBeamCount}
1280 The property @code{subdivideBeams} can be set in order to subdivide
1281 all 16th or shorter beams at beat positions, as defined by the
1282 @code{beatLength} property . This accomplishes the same effect as
1283 twiddling with @code{stemLeftBeamCount} and @code{stemRightBeamCount},
1284 but it take less typing:
1287 @lilypond[relative=1,verbatim,noindent]
1288 c16-[ c c c c c c c-]
1289 \property Voice.subdivideBeams = ##t
1290 c16-[ c c c c c c c-]
1291 \property Score.beatLength = #(ly:make-moment 1 8)
1292 c16-[ c c c c c c c-]
1294 @cindex subdivideBeams
1296 Kneed beams are inserted automatically, when a large gap is detected
1297 between the note heads. This behavior can be tuned through the object
1298 property @code{auto-knee-gap}.
1300 @cindex beams, kneed
1302 @cindex auto-knee-gap
1308 @cindex Frenched staves
1310 Automatically kneed beams cannot be used together with hidden staves.
1315 * Setting automatic beam behavior ::
1319 @no de Beam typography
1320 @sub section Beam typography
1322 One of the strong points of LilyPond is how beams are formatted. Beams
1323 are quantized, meaning that the left and right endpoints beams start
1324 exactly on staff lines. Without quantization, small wedges of white
1325 space appear between the beam and staff line, and this looks untidy.
1327 Beams are also slope-damped: melodies that go up or down should also
1328 have beams that go up or down, but the slope of the beams should be
1329 less than the slope of the notes themselves.
1331 Some beams should be horizontal. These are so-called concave beams.
1333 [TODO: some pictures.]
1337 @node Setting automatic beam behavior
1338 @subsection Setting automatic beam behavior
1340 @cindex @code{autoBeamSettings}
1341 @cindex @code{(end * * * *)}
1342 @cindex @code{(begin * * * *)}
1343 @cindex automatic beams, tuning
1344 @cindex tuning automatic beaming
1346 @c [TODO: use \applycontext]
1348 In normal time signatures, automatic beams can start on any note but can
1349 only end in a few positions within the measure: beams can end on a beat,
1350 or at durations specified by the properties in
1351 @code{Voice.autoBeamSettings}. The defaults for @code{autoBeamSettings}
1352 are defined in @file{scm/auto-beam.scm}.
1354 The value of @code{autoBeamSettings} is changed using
1355 @code{\override} and restored with @code{\revert}:
1357 \property Voice.autoBeamSettings \override #'(@var{BE} @var{P} @var{Q} @var{N} @var{M}) = @var{dur}
1358 \property Voice.autoBeamSettings \revert #'(@var{BE} @var{P} @var{Q} @var{N} @var{M})
1360 Here, @var{BE} is the symbol @code{begin} or @code{end}. It determines
1361 whether the rule applies to begin or end-points. The quantity
1362 @var{P}/@var{Q} refers to the length of the beamed notes (and `@code{*
1363 *}' designates notes of any length), @var{N}/@var{M} refers to a time
1364 signature (wildcards, `@code{* *}' may be entered to designate all time
1367 For example, if automatic beams should end on every quarter note, use
1370 \property Voice.autoBeamSettings \override
1371 #'(end * * * *) = #(ly:make-moment 1 4)
1373 Since the duration of a quarter note is 1/4 of a whole note, it is
1374 entered as @code{(ly:make-moment 1 4)}.
1376 The same syntax can be used to specify beam starting points. In this
1377 example, automatic beams can only end on a dotted quarter note:
1379 \property Voice.autoBeamSettings \override
1380 #'(end * * * *) = #(ly:make-moment 3 8)
1382 In 4/4 time signature, this means that automatic beams could end only on
1383 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
1384 3/8 has passed within the measure).
1386 Rules can also be restricted to specific time signatures. A rule that
1387 should only be applied in @var{N}/@var{M} time signature is formed by
1388 replacing the second asterisks by @var{N} and @var{M}. For example, a
1389 rule for 6/8 time exclusively looks like
1391 \property Voice.autoBeamSettings \override
1392 #'(begin * * 6 8) = ...
1395 If a rule should be to applied only to certain types of beams, use the
1396 first pair of asterisks. Beams are classified according to the
1397 shortest note they contain. For a beam ending rule that only applies
1398 to beams with 32nd notes (and no shorter notes), use @code{(end 1 32 *
1401 If a score ends while an automatic beam has not been ended and is still
1402 accepting notes, this last beam will not be typeset at all.
1404 @cindex automatic beam generation
1406 @cindex @code{Voice.autoBeaming}
1409 For melodies that have lyrics, you may want to switch off
1410 automatic beaming. This is done by setting @code{Voice.autoBeaming} to
1415 @cindex @code{\autoBeamOff}
1416 @code{\autoBeamOff},
1417 @cindex @code{\autoBeamOn}
1423 The rules for ending a beam depend on the shortest note in a beam.
1424 So, while it is possible to have different ending rules for eight
1425 beams and sixteenth beams, a beam that contains both eight and
1426 sixteenth notes will use the rules for the sixteenth beam.
1428 In the example below, the autobeamer makes eight beams and sixteenth
1429 end at 3 eights; the third beam can only be corrected by specifying
1432 @lilypond[singleline,fragment,relative,noverbatim,quote]
1433 \property Voice.autoBeamSettings
1434 \override #'(end * * * *) = #(ly:make-moment 3 8)
1435 % rather show case where it goes wrong
1436 %\time 12/8 c'8 c c c16 c c c c c c-[ c c c-] c8-[ c-] c4
1437 \time 12/8 c'8 c c c16 c c c c c c c c c c8 c c4
1439 It is not possible to specify beaming parameters that act differently in
1440 different parts of a measure. This means that it is not possible to use
1441 automatic beaming in irregular meters such as @code{5/8}.
1444 @section Accidentals
1447 This section describes how to change the way that accidentals are
1448 inserted automatically before the running notes.
1452 * Using the predefined accidental variables::
1453 * Customized accidental rules::
1456 @node Using the predefined accidental variables
1457 @subsection Using the predefined accidental variables
1459 The constructs for describing the accidental typesetting rules are
1460 quite hairy, so non-experts should stick to the variables
1461 defined in @file{ly/property-init.ly}.
1462 @cindex @file{property-init.ly}
1464 The variables set properties in the ``@code{Current}'' context (see
1465 @ref{Context properties}). This means that the variables should
1466 normally be added right after the creation of the context in which the
1467 accidental typesetting described by the variable is to take
1468 effect. For example, if you want to use piano-accidentals in a piano
1469 staff then issue @code{\pianoAccidentals} first thing after the
1470 creation of the piano staff:
1473 \notes \relative c'' <
1474 \context Staff = sa @{ cis4 d e2 @}
1475 \context GrandStaff <
1477 \context Staff = sb @{ cis4 d e2 @}
1478 \context Staff = sc @{ es2 c @}
1480 \context Staff = sd @{ es2 c @}
1484 @lilypond[singleline]
1486 \notes \relative c'' <
1487 \context Staff = sa { cis4 d e2 }
1488 \context GrandStaff <
1490 \context Staff = sb { cis4 d e2 }
1491 \context Staff = sc { es2 c }
1493 \context Staff = sd { es2 c }
1498 minimumVerticalExtent = #'(-4.0 . 4.0)
1506 @item \defaultAccidentals
1507 @cindex @code{\defaultAccidentals}
1508 This is the default typesetting behaviour. It should correspond
1509 to 18th century common practice: Accidentals are
1510 remembered to the end of the measure in which they occur and
1511 only on their own octave.
1513 @item \voiceAccidentals
1514 @cindex @code{\voiceAccidentals}
1516 The normal behaviour is to
1517 remember the accidentals on Staff-level. This variable, however,
1518 typesets accidentals individually for each voice. Apart from that the
1519 rule is similar to @code{\defaultAccidentals}.
1521 This leads to some weird and often unwanted results
1522 because accidentals from one voice do not get cancelled in other
1524 @lilypond[singleline,relative,fragment,verbatim,quote]
1532 Hence you should only use @code{\voiceAccidentals} if the voices
1533 are to be read solely by individual musicians. If the staff is to be
1534 used by one musician (e.g. a conductor) then you use
1535 @code{\modernVoiceAccidentals} or @code{\modernVoiceCautionaries}
1538 @item \modernAccidentals
1539 @cindex @code{\modernAccidentals}
1540 This rule corresponds to the common practice in the 20th
1542 The rule is more complex than @code{\defaultAccidentals}.
1543 You get all the same accidentals, but temporary
1544 accidentals also get cancelled in other octaves. Furthermore,
1545 in the same octave, they also get cancelled in the following measure:
1546 @lilypond[singleline,fragment,verbatim]
1548 cis' c'' cis'2 | c'' c'
1551 @item \modernCautionaries
1552 @cindex @code{\modernCautionaries}
1553 This rule is similar to @code{\modernAccidentals}, but the
1554 ``extra'' accidentals (the ones not typeset by
1555 @code{\defaultAccidentals}) are typeset as cautionary accidentals.
1556 They are printed in reduced size or with parentheses:
1557 @lilypond[singleline,fragment,verbatim]
1559 cis' c'' cis'2 | c'' c'
1562 @cindex @code{\modernVoiceAccidentals}
1563 @item \modernVoiceAccidentals
1564 is used for multivoice accidentals to be read both by musicians
1565 playing one voice and musicians playing all voices. Accidentals are
1566 typeset for each voice, but they @emph{are} cancelled across voices in
1567 the same @internalsref{Staff}.
1569 @cindex @code{\modernVoiceCautionaries}
1570 @item \modernVoiceCautionaries
1571 is the same as @code{\modernVoiceAccidentals}, but with the extra
1572 accidentals (the ones not typeset by @code{\voiceAccidentals}) typeset
1573 as cautionaries. Even though all accidentals typeset by
1574 @code{\defaultAccidentals} @emph{are} typeset by this variable then
1575 some of them are typeset as cautionaries.
1577 @item \pianoAccidentals
1578 @cindex @code{\pianoAccidentals}
1579 20th century practice for piano notation. Very similar to
1580 @code{\modernAccidentals} but accidentals also get cancelled
1581 across the staves in the same @internalsref{GrandStaff} or
1582 @internalsref{PianoStaff}.
1584 @item \pianoCautionaries
1585 @cindex @code{\pianoCautionaries}
1586 As @code{\pianoAccidentals} but with the extra accidentals
1587 typeset as cautionaries.
1590 @cindex @code{\noResetKey}
1591 Same as @code{\defaultAccidentals} but with accidentals lasting
1592 ``forever'' and not only until the next measure:
1593 @lilypond[singleline,fragment,verbatim,relative]
1598 @item \forgetAccidentals
1599 @cindex @code{\forgetAccidentals}
1600 This is sort of the opposite of @code{\noResetKey}: Accidentals
1601 are not remembered at all---and hence all accidentals are
1602 typeset relative to the key signature, regardless of what was
1603 before in the music:
1604 @lilypond[singleline,fragment,verbatim,relative]
1606 \key d\major c4 c cis cis d d dis dis
1610 @node Customized accidental rules
1611 @subsection Customized accidental rules
1613 This section must be considered gurus-only, and hence it must be
1614 sufficient with a short description of the system and a reference to
1615 the internal documentation.
1617 The algorithm tries several different rules, and uses the rule
1618 that gives the highest number of accidentals. Each rule consists of
1621 In which context is the rule applied. For example, if
1622 @var{context} is @internalsref{Score} then all staves share
1623 accidentals, and if @var{context} is @internalsref{Staff} then all
1624 voices in the same staff share accidentals, but staves do not.
1626 Whether the accidental changes all octaves or only the current
1629 Over how many barlines the accidental lasts.
1630 If @var{lazyness} is @code{-1} then the accidental is forget
1631 immediately, and if @var{lazyness} is @code{#t} then the accidental
1634 @c [TODO: should use +infinity for this case?]
1640 @cindex @code{\defaultAccidentals}
1641 @code{\defaultAccidentals},
1642 @cindex @code{\voiceAccidentals}
1643 @code{\voiceAccidentals},
1644 @cindex @code{\modernAccidentals}
1645 @code{\modernAccidentals},
1646 @cindex @code{\modernCautionaries}
1647 @code{\modernCautionaries},
1648 @cindex @code{\modernVoiceAccidentals}
1649 @code{\modernVoiceAccidentals},
1650 @cindex @code{\modernVoiceCautionaries}
1651 @code{\modernVoiceCautionaries},
1652 @cindex @code{\pianoAccidentals}
1653 @code{\pianoAccidentals},
1654 @cindex @code{\pianoCautionaries}
1655 @code{\pianoCautionaries},
1656 @cindex @code{\noResetKey}
1658 @cindex @code{\forgetAccidentals}
1659 @code{\forgetAccidentals}.
1663 @internalsref{Accidental_engraver}, @internalsref{Accidental}, and
1664 @internalsref{AccidentalPlacement}.
1669 Currently the simultaneous notes are considered to be entered in
1670 sequential mode. This means that in a chord the accidentals are
1671 typeset as if the notes in the chord happened once at a time - in the
1672 order in which they appear in the input file.
1674 This is only a problem when there are simultaneous notes whose
1675 accidentals depend on each other. The problem only occurs when using
1676 non-default accidentals. In the default scheme, accidentals only
1677 depend on other accidentals with the same pitch on the same staff, so
1678 no conflicts possible.
1680 This example shows two examples of the same music giving different
1681 accidentals depending on the order in which the notes occur in the
1684 @lilypond[singleline,fragment,verbatim]
1685 \property Staff.autoAccidentals = #'( Staff (any-octave . 0) )
1686 cis'4 <<c'' c'>> r2 | cis'4 <<c' c''>> r2
1687 | <<cis' c''>> r | <<c'' cis'>> r |
1690 This problem can be solved by manually inserting @code{!} and @code{?}
1691 for the problematic notes.
1693 @node Expressive marks
1694 @section Expressive marks
1702 * Analysis brackets::
1709 A slur indicates that notes are to be played bound or @emph{legato}.
1713 They are entered using parentheses:
1714 @lilypond[fragment,verbatim,center]
1715 f'-( g'-)-( a'-) a'8-[ b'-(-] a'4 g'2 f'4-)
1716 <<c' e'>>2-( <<b d'>>2-)
1720 @c TODO: should explain that ^( and _( set directions
1721 @c should set attachments with ^ and _ ?
1723 Slurs avoid crossing stems, and are generally attached to note heads.
1724 However, in some situations with beams, slurs may be attached to stem
1725 ends. If you want to override this layout you can do this through the
1726 object property @code{attachment} of @internalsref{Slur} in
1727 @internalsref{Voice} context. Its value is a pair of symbols, specifying
1728 the attachment type of the left and right end points:
1730 @lilypond[fragment,relative,verbatim]
1732 \property Voice.Stem \set #'length = #5.5
1734 \property Voice.Slur \set #'attachment = #'(stem . stem)
1738 If a slur would strike through a stem or beam, the slur will be moved
1739 away upward or downward. If this happens, attaching the slur to the
1740 stems might look better:
1742 @lilypond[fragment,relative,verbatim]
1745 \property Voice.Slur \set #'attachment = #'(stem . stem)
1752 @cindex @code{\slurUp}
1754 @cindex @code{\slurDown}
1756 @cindex @code{\slurBoth}
1758 @cindex @code{\slurDotted}
1760 @cindex @code{\slurSolid}
1765 @seeinternals{Slur}, and @internalsref{SlurEvent}.
1770 Producing nice slurs is a difficult problem, and LilyPond currently
1771 uses a simple, empiric method to produce slurs. In some cases, its
1775 @cindex Adjusting slurs
1777 @node Phrasing slurs
1778 @subsection Phrasing slurs
1780 @cindex phrasing slurs
1781 @cindex phrasing marks
1783 A phrasing slur (or phrasing mark) connects chords and is used to
1784 indicate a musical sentence. It is started using @code{\(} and @code{\)}
1787 @lilypond[fragment,verbatim,center,relative]
1788 \time 6/4 c'-\( d-( e-) f-( e-) d-\)
1791 Typographically, the phrasing slur behaves almost exactly like a
1792 normal slur. However, they are treated as different objects. A
1793 @code{\slurUp} will have no effect on a phrasing slur; instead, you
1794 should use @code{\phrasingSlurUp}, @code{\phrasingSlurDown}, and
1795 @code{\phrasingSlurBoth}.
1797 The commands @code{\slurUp}, @code{\slurDown}, and @code{\slurBoth}
1798 will only affect normal slurs and not phrasing slurs.
1802 @cindex @code{\phrasingSlurUp}
1803 @code{\phrasingSlurUp},
1804 @cindex @code{\phrasingSlurDown}
1805 @code{\phrasingSlurDown},
1806 @cindex @code{\phrasingSlurBoth}
1807 @code{\phrasingSlurBoth},
1811 See also @internalsref{PhrasingSlur}, and
1812 @internalsref{PhrasingSlurEvent}.
1816 Phrasing slurs have the same limitations in their formatting as normal
1817 slurs. Putting phrasing slurs over rests leads to spurious warnings.
1820 @subsection Breath marks
1822 Breath marks are entered using @code{\breathe}:
1825 @lilypond[fragment,relative,verbatim]
1829 The glyph of the breath mark can be tweaked by overriding the
1830 @code{text} property of the @code{BreathingSign} layout object with the name of
1831 any glyph of @ref{The Feta font}. For example,
1832 @lilypond[fragment,verbatim,relative]
1834 \property Voice.BreathingSign \override #'text = #"scripts-rvarcomma"
1841 @internalsref{BreathingSign}, @internalsref{BreathingSignEvent}, and
1842 @inputfileref{input/regression,breathing-sign.ly}.
1845 @node Metronome marks
1846 @subsection Metronome marks
1849 @cindex beats per minute
1850 @cindex metronome marking
1852 Metronome settings can be entered as follows:
1854 \tempo @var{duration} = @var{perminute}
1857 In the MIDI output, they are interpreted as a tempo change, and in the
1858 paper output, a metronome marking is printed:
1859 @cindex @code{\tempo}
1860 @lilypond[fragment,verbatim]
1866 @internalsref{TempoEvent}.
1871 @subsection Text spanners
1872 @cindex Text spanners
1874 Some performance indications, e.g. @i{rallentando} or @i{accelerando},
1875 are written as texts, and extended over many measures with dotted
1876 lines. You can create such texts using text spanners: attach
1877 @code{\startTextSpan} and @code{\stopTextSpan} to the
1878 start and ending note of the spanner.
1880 The string to be printed, as well as the style, is set through object
1883 @lilypond[fragment,relative,verbatim]
1885 \property Voice.TextSpanner \set #'direction = #-1
1886 \property Voice.TextSpanner \set #'edge-text = #'("rall " . "")
1887 c2-\startTextSpan b c-\stopTextSpan a }
1893 @internalsref{TextSpanEvent},
1894 @internalsref{TextSpanner}, and
1895 @inputfileref{input/regression,text-spanner.ly}.
1898 @node Analysis brackets
1899 @subsection Analysis brackets
1901 @cindex phrasing brackets
1902 @cindex musicological analysis
1903 @cindex note grouping bracket
1905 Brackets are used in musical analysis to indicate structure in musical
1906 pieces. LilyPond supports a simple form of nested horizontal brackets.
1907 To use this, add the @internalsref{Horizontal_bracket_engraver} to
1908 @internalsref{Staff} context. A bracket is started with
1909 @code{\startGroup} and closed with @code{\stopGroup}:
1911 @lilypond[singleline,verbatim]
1912 \score { \notes \relative c'' {
1913 c4-\startGroup-\startGroup
1916 c4-\stopGroup-\stopGroup
1918 \paper { \translator {
1919 \StaffContext \consists "Horizontal_bracket_engraver"
1925 @internalsref{HorizontalBracket}, @internalsref{NoteGroupingEvent}, and
1926 @inputfileref{input/regression,note-group-bracket.ly}.
1930 @section Articulations
1931 @cindex Articulations
1933 @cindex articulations
1937 A variety of symbols can appear above and below notes to indicate
1938 different characteristics of the performance. They are added to a note
1939 by adding a dash and the character signifying the
1940 articulation. They are demonstrated here:
1942 @lilypondfile[notexidoc]{script-abbreviations.ly}
1944 The script is automatically placed, but if you need to force
1945 directions, you can use @code{_} to force them down, or @code{^} to
1947 @lilypond[fragment, verbatim]
1954 Other symbols can be added using the syntax
1955 @var{note}@code{-\}@var{name}, e.g. @code{c4-\fermata}. Again, they
1956 can be forced up or down using @code{^} and @code{_}:
1960 @cindex staccatissimo
1969 @cindex organ pedal marks
1978 @cindex prallmordent
1982 @cindex thumb marking
1987 @lilypondfile[notexidoc]{script-chart.ly}
1992 @cindex @code{\scriptUp}
1994 @cindex @code{\scriptDown}
1996 @cindex @code{\scriptBoth}
2001 @internalsref{ScriptEvent}, and @internalsref{Script}.
2005 All of these note ornaments appear in the printed output but have no
2006 effect on the MIDI rendering of the music.
2009 @node Fingering instructions
2010 @section Fingering instructions
2014 Fingering instructions can be entered using
2016 @var{note}-@var{digit}
2018 For finger changes, use markup texts:
2020 @lilypond[verbatim, singleline, fragment]
2021 c'4-1 c'4-2 c'4-3 c'4-4
2022 c'^\markup { \fontsize #-3 \number "2-3" }
2025 @cindex finger change
2030 You can use the thumb-script to indicate that a note should be
2031 played with your thumb (used in cello music):
2033 @lilypond[verbatim, singleline, fragmnt]
2034 <<a' a''-3>>8-(_\thumb-[ <<b' b''-3>>-)_\thumb
2035 <<c'' c'''-3>>-(_\thumb <<d'' d'''-3>>-)_\thumb-]
2038 Fingerings for chords can also be added to individual notes
2039 of the chord by adding them after the pitches:
2040 @lilypond[verbatim,singleline,fragment,relative=1]
2041 << c-1 e-2 g-3 b-5 >> 4
2044 Setting @code{fingerHorizontalDirection} will put the fingerings next
2047 @lilypond[verbatim,singleline,fragment,relative=1]
2048 \property Voice.fingerHorizontalDirection = #LEFT
2049 << c-1 es-2 g-4 bes-5 >> 4
2050 \property Voice.fingerHorizontalDirection = #RIGHT
2051 << c-1 es-2 g-4 bes-5 >> 4
2056 @internalsref{FingerEvent}, and @internalsref{Fingering}.
2067 @subsection Text scripts
2068 @cindex Text scripts
2070 It is possible to place arbitrary strings of text or markup text (see
2071 @ref{Text markup}) above or below notes by using a string:
2072 @code{c^"text"}. By default, these indications do not influence the
2073 note spacing, but by using the command @code{\fatText}, the widths
2074 will be taken into account:
2076 @lilypond[fragment,singleline,verbatim] \relative c' {
2077 c4^"longtext" \fatText c4_"longlongtext" c4 }
2080 It is possible to use @TeX{} commands in the strings, but this should
2081 be avoided because the exact dimensions of the string can then no
2087 @internalsref{TextScriptEvent}, @internalsref{TextScript}, and
2093 @subsection Grace notes
2095 @cindex @code{\grace}
2099 Grace notes are ornaments that are written out:
2101 @lilypond[relative=2,verbatim,fragment] c4 \grace c16 c4 \grace {
2105 In normal notation, grace notes take up no logical
2106 time in a measure. Such an idea is practical for normal notation, but
2107 is not strict enough to put it into a program. The model that LilyPond
2108 uses for grace notes internally is that all timing is done in two
2111 Every point in musical time consists of two rational numbers: one
2112 denotes the logical time, one denotes the grace timing. The above
2113 example is shown here with timing tuples:
2116 \score { \notes \relative c''{
2117 c4^"(0,0)" \grace c16_" "_"(1/4,-1/16)" c4^"(1/4,0)" \grace {
2118 c16_"(2/4,-1/8)"-[ d16^"(2/4,-1/16)" ] } c4_" "_"(2/4,0)"
2120 \paper { linewidth = 12.\cm }
2125 The placement of grace notes is synchronized between different staves.
2126 In the following example, there are two sixteenth graces notes for
2127 every eighth grace note:
2129 @lilypond[relative=2,verbatim,fragment]
2130 < \context Staff = SA { e4 \grace { c16-[ d e f-] } e4 }
2131 \context Staff = SB { c'4 \grace { g8-[ b-] } c4 } >
2135 Unbeamed eighth notes and shorter by default have a slash through the
2136 stem. This can be controlled with object property @code{stroke-style} of
2137 @internalsref{Stem}. For proper matching of override and reverts of
2138 such properties, it is necessary to use a Scheme function.
2140 The following fragment overrides the default formatting Grace style stems:
2142 #(add-to-grace-init "Voice" 'Stem 'stroke-style '())
2145 The @code{\override} is carefully matched with a @code{\revert}:
2150 @lilypond[fragment,verbatim]
2151 \relative c'' \context Voice {
2152 \grace c8 c4 \grace { c16-[ c16-] } c4
2154 \property Voice.Stem \override #'stroke-style = #'()
2156 \property Voice.Stem \revert #'stroke-style
2161 If you want to end a note with a grace note, then the standard trick
2162 is to put the grace notes before a phantom ``space note'', e.g.
2163 @lilypond[fragment,verbatim, relative=2]
2166 { s2 \grace { c16-[ d-] } } >
2172 By adjusting the duration of the skip note (here it is a half-note),
2173 the space between the main-note and the grace is adjusted.
2175 A @code{\grace} section has some default values, and LilyPond will
2176 use those default values unless you specify otherwise inside the
2177 @code{\grace} section. For example, if you specify \slurUp
2178 @emph{before} your @code{\grace} section, a slur which starts inside
2179 the @code{\grace} will not be forced up, even if the slur ends outside
2180 of the @code{\grace}. Note the difference between the first and
2181 second bars in this example:
2183 @lilypond[fragment,verbatim]
2184 \relative c'' \context Voice {
2202 @internalsref{GraceMusic}.
2206 Grace notes cannot be used in the smallest size (@file{paper11.ly}).
2208 A score that starts with an @code{\grace} section needs an explicit
2209 @code{\context Voice} declaration, otherwise the main note and grace
2210 note end up on different staves.
2212 Grace note synchronization can also lead to surprises. Staff notation,
2213 such as key signatures, barlines, etc. are also synchronized. Take
2214 care when you mix staves with grace notes and staves without, for example,
2216 @lilypond[relative=2,verbatim,fragment]
2217 < \context Staff = SA { e4 \bar "|:" \grace c16 d4 }
2218 \context Staff = SB { c4 \bar "|:" d4 } >
2221 Grace sections should only be used within sequential music
2222 expressions. Nesting or juxtaposing grace sections is not supported,
2223 and might produce crashes or other errors.
2225 Overriding settings for grace music globally cannot be done in a
2226 modular way. A kludge (@code{add-to-grace-init}) is defined in
2227 @file{ly/grace-init.ly}.
2231 @subsection Glissando
2234 @cindex @code{\glissando}
2236 A glissando is a smooth change in pitch. It is denoted by a line or a
2237 wavy line between two notes.
2241 A glissando line can be requested by attaching a @code{\glissando} to
2244 @lilypond[fragment,relative,verbatim]
2250 @internalsref{Glissando}, and @internalsref{GlissandoEvent}.
2255 Additional texts (such as @emph{gliss.}) is not supported.
2259 @subsection Dynamics
2272 @cindex @code{\ffff}
2282 Absolute dynamic marks are specified using an variable after a
2283 note: @code{c4-\ff}. The available dynamic marks are @code{\ppp},
2284 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
2285 @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
2286 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}:
2288 @lilypond[verbatim,singleline,fragment,relative]
2289 c'-\ppp c-\pp c -\p c-\mp c-\mf c-\f c-\ff c-\fff
2295 @cindex @code{\decr}
2296 @cindex @code{\rced}
2303 A crescendo mark is started with @code{\<} and terminated with
2304 @code{\!}. A decrescendo is started with @code{\>} and also terminated
2305 with @code{\!}. Because these marks are bound to notes, if you must
2306 use spacer notes if multiple marks during one note are needed:
2308 @lilypond[fragment,verbatim,center,quote]
2309 c''-\< c''-\! d''-\decr e''-\rced
2310 < f''1 { s4 s4-\< s4-\! \> s4-\! } >
2312 This may give rise to very short hairpins. Use @code{minimum-length}
2313 in @internalsref{Voice}.@internalsref{HairPin} to lengthen them, for
2317 \property Staff.Hairpin \override #'minimum-length = #5
2320 You can also use a text saying @emph{cresc.} instead of hairpins. Here
2321 is an example how to do it:
2323 @lilypond[fragment,relative=2,verbatim]
2324 c4 \cresc c4 c c c \endcresc c4
2330 You can also supply your own texts:
2331 @lilypond[fragment,relative,verbatim]
2333 \property Voice.crescendoText = \markup { \italic "cresc. poco" }
2334 \property Voice.crescendoSpanner = #'dashed-line
2344 @cindex @code{\dynamicUp}
2346 @cindex @code{\dynamicDown}
2347 @code{\dynamicDown},
2348 @cindex @code{\dynamicBoth}
2349 @code{\dynamicBoth}.
2351 @cindex direction, of dynamics
2355 @internalsref{CrescendoEvent}, @internalsref{DecrescendoEvent}, and
2356 @internalsref{AbsoluteDynamicEvent}.
2358 Dynamics are objects of @internalsref{DynamicText} and
2359 @internalsref{Hairpin}. Vertical positioning of these symbols is
2360 handled by the @internalsref{DynamicLineSpanner} object.
2362 If you want to adjust padding or vertical direction of the dynamics, you
2363 must set properties for the @internalsref{DynamicLineSpanner} object.
2371 @cindex @code{\repeat}
2374 Repetition is a central concept in music, and multiple notations exist
2375 for repetitions. In LilyPond, most of these notations can be captured
2376 in a uniform syntax. One of the advantages is, all these repetitions
2377 can be rendered in MIDI accurately.
2379 The following types of repetition are supported:
2383 Repeated music is fully written (played) out. Useful for MIDI
2384 output, and entering repetitive music.
2387 This is the normal notation: Repeats are not written out, but
2388 alternative endings (voltas) are printed, left to right.
2392 Alternative endings are written stacked. This has limited use but may be
2393 used to typeset two lines of lyrics in songs with repeats, see
2394 @inputfileref{input,star-spangled-banner.ly}.
2401 Make beat or measure repeats. These look like percent signs.
2407 * Repeats and MIDI::
2408 * Manual repeat commands::
2410 * Tremolo subdivisions::
2415 @subsection Repeat syntax
2419 LilyPond has one syntactic construct for specifying different types of
2420 repeats. The syntax is
2423 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
2426 If you have alternative endings, you may add
2427 @cindex @code{\alternative}
2429 \alternative @code{@{} @var{alternative1}
2431 @var{alternative3} @dots{} @code{@}}
2433 where each @var{alternative} is a music expression. If you do not
2434 give enough alternatives for all of the repeats, then the first
2435 alternative is assumed to be played more than once.
2437 Normal notation repeats are used like this:
2438 @lilypond[fragment,verbatim]
2440 \repeat volta 2 { c'4 d' e' f' }
2441 \repeat volta 2 { f' e' d' c' }
2444 With alternative endings:
2445 @lilypond[fragment,verbatim]
2447 \repeat volta 2 {c'4 d' e' f'}
2448 \alternative { {d'2 d'} {f' f} }
2452 @lilypond[fragment,verbatim]
2456 \repeat volta 4 { e | c2 d2 | e2 f2 | }
2457 \alternative { { g4 g g } { a | a a a a | b2. } }
2464 If you do a nested repeat like
2473 then it is ambiguous to which @code{\repeat} the @code{\alternative}
2474 belongs. This ambiguity is resolved by always having the
2475 @code{\alternative} belong to the inner @code{\repeat}. For clarity,
2476 it is advisable to use braces in such situations.
2479 @node Repeats and MIDI
2480 @subsection Repeats and MIDI
2482 @cindex expanding repeats
2484 For instructions on how to unfold repeats for MIDI output, see the
2485 example file @inputfileref{input/test,unfold-all-repeats.ly}.
2490 Timing information is not remembered at the start of an alternative,
2491 so after a repeat timing information must be reset by hand, for
2492 example by setting @code{Score.measurePosition} or entering
2493 @code{\partial}. Similarly, slurs or ties are also not repeated.
2496 @node Manual repeat commands
2497 @subsection Manual repeat commands
2499 @cindex @code{repeatCommands}
2501 The property @code{repeatCommands} can be used to control the layout of
2502 repeats. Its value is a Scheme list of repeat commands, where each repeat
2506 @item the symbol @code{start-repeat},
2507 which prints a @code{|:} bar line,
2508 @item the symbol @code{end-repeat},
2509 which prints a @code{:|} bar line,
2510 @item the list @code{(volta @var{text})},
2511 which prints a volta bracket saying @var{text}: The text can be specified as
2512 a text string or as a markup text, see @ref{Text markup}. Do not
2513 forget to change the font, as the default number font does not contain
2514 alphabetic characters. Or,
2515 @item the list @code{(volta #f)}, which
2516 stops a running volta bracket:
2519 @lilypond[verbatim, fragment]
2521 \property Score.repeatCommands = #'((volta "93") end-repeat)
2523 \property Score.repeatCommands = #'((volta #f))
2530 @internalsref{VoltaBracket}, @internalsref{RepeatedMusic},
2531 @internalsref{VoltaRepeatedMusic},
2532 @internalsref{UnfoldedRepeatedMusic}, and
2533 @internalsref{FoldedRepeatedMusic}.
2535 @node Tremolo repeats
2536 @subsection Tremolo repeats
2537 @cindex tremolo beams
2539 To place tremolo marks between notes, use @code{\repeat} with tremolo
2541 @lilypond[verbatim,center,singleline]
2543 \context Voice \notes\relative c' {
2544 \repeat "tremolo" 8 { c16 d16 }
2545 \repeat "tremolo" 4 { c16 d16 }
2546 \repeat "tremolo" 2 { c16 d16 }
2547 \repeat "tremolo" 4 c16
2554 Tremolo beams are @internalsref{Beam} objects. Single stem tremolos
2555 are @internalsref{StemTremolo}s. The music expression is
2556 @internalsref{TremoloEvent}.
2561 The single stem tremolo must be entered without @code{@{} and
2564 @node Tremolo subdivisions
2565 @subsection Tremolo subdivisions
2566 @cindex tremolo marks
2567 @cindex @code{tremoloFlags}
2569 Tremolo marks can be printed on a single note by adding
2570 `@code{:}[@var{length}]' after the note. The length must be at least 8.
2571 A @var{length} value of 8 gives one line across the note stem. If the
2572 length is omitted, then then the last value (stored in
2573 @code{Voice.tremoloFlags}) is used:
2575 @lilypond[verbatim,fragment,center]
2576 c'2:8 c':32 | c': c': |
2579 @c [TODO : stok is te kort bij 32en]
2583 Tremolos in this style do not carry over into the MIDI output.
2586 @node Measure repeats
2587 @subsection Measure repeats
2589 @cindex percent repeats
2590 @cindex measure repeats
2592 In the @code{percent} style, a note pattern can be repeated. It is
2593 printed once, and then the pattern is replaced with a special sign.
2594 Patterns of a one and two measures are replaced by percent-like signs,
2595 patterns that divide the measure length are replaced by slashes:
2597 @lilypond[verbatim,singleline]
2598 \context Voice { \repeat "percent" 4 { c'4 }
2599 \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
2605 @internalsref{RepeatSlash}, @internalsref{PercentRepeat},
2606 @internalsref{PercentRepeatedMusic}, and
2607 @internalsref{DoublePercentRepeat}.
2611 @node Rhythmic music
2612 @section Rhythmic music
2614 Sometimes you might want to show only the rhythm of a melody. This
2615 can be done with the rhythmic staff. All pitches of notes on such a
2616 staff are squashed, and the staff itself has a single line:
2618 @lilypond[fragment,relative,verbatim]
2619 \context RhythmicStaff {
2621 c4 e8 f g2 | r4 g r2 | g1:32 | r1 |
2626 * Percussion staves::
2627 * Percussion MIDI output::
2630 @node Percussion staves
2631 @subsection Percussion staves
2635 A percussion part for more than one instrument typically uses a
2636 multiline staff where each position in the staff refers to one piece
2641 Percussion staves are typeset with help of a set of Scheme
2642 functions. The system is based on the general MIDI drum-pitches.
2643 Include @file{drumpitch-init.ly} to use drum pitches. This file
2644 defines the pitches from the Scheme variable @code{drum-pitch-names},
2645 the definition of which can be read in @file{scm/drums.scm}. Each
2646 piece of percussion has a full name and an abbreviated name, and either
2647 the full name or the abbreviation may be used in input files.
2649 To typeset the music on a staff apply the function @code{drums->paper}
2650 to the percussion music. This function takes a list of percussion
2651 instrument names, notehead scripts and staff positions (that is:
2652 pitches relative to the C-clef) and transforms the input
2653 music by moving the pitch, changing the notehead and (optionally)
2656 @lilypond[singleline,verbatim,quote]
2657 \include "drumpitch-init.ly"
2658 up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
2659 down = \notes { bassdrum4 snare8 bd r bd sn4 }
2661 \apply #(drums->paper 'drums) \context Staff <
2663 \context Voice = up { \voiceOne \up }
2664 \context Voice = down { \voiceTwo \down }
2669 In the above example the music was transformed using the list @code{'drums}.
2670 Currently the following lists are defined in @file{scm/drums.scm}:
2673 to typeset a typical drum kit on a five-line staff:
2676 \include "drumpitch-init.ly"
2677 nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc
2678 bd sn ss tomh tommh tomml toml tomfh tomfl }
2679 mus = \notes { cymc cyms cymr hh hhc hho hhho hhp cb hc
2680 bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
2683 \apply #(drums->paper 'drums) \context Staff <
2687 \context Lyrics \nam
2690 linewidth = 100.0\mm
2693 \remove Bar_engraver
2694 \remove Time_signature_engraver
2695 minimumVerticalExtent = #'(-4.0 . 5.0)
2699 \remove Stem_engraver
2705 The drum scheme supports six different toms. When there fewer toms, simply
2706 select the toms that produce the desired result, i.e. to get toms on
2707 the three middle lines you use @code{tommh}, @code{tomml} and
2710 Because general MIDI does not contain rimshots the sidestick is used
2711 for this purpose instead.
2713 to typeset timbales on a two line staff:
2715 @lilypond[singleline]
2716 \include "drumpitch-init.ly"
2717 nam = \lyrics { timh ssh timl ssl cb }
2718 mus = \notes { timh ssh timl ssl cb s16 }
2721 \apply #(drums->paper 'timbales) \context Staff <
2725 \context Lyrics \nam
2730 \remove Bar_engraver
2731 \remove Time_signature_engraver
2732 StaffSymbol \override #'line-count = #2
2733 StaffSymbol \override #'staff-space = #2
2734 minimumVerticalExtent = #'(-3.0 . 4.0)
2738 \remove Stem_engraver
2745 to typeset congas on a two line staff:
2747 @lilypond[singleline]
2748 \include "drumpitch-init.ly"
2749 nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl }
2750 mus = \notes { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
2753 \apply #(drums->paper 'congas) \context Staff <
2757 \context Lyrics \nam
2762 \remove Bar_engraver
2763 \remove Time_signature_engraver
2764 StaffSymbol \override #'line-count = #2
2765 StaffSymbol \override #'staff-space = #2
2766 minimumVerticalExtent = #'(-3.0 . 4.0)
2770 \remove Stem_engraver
2776 to typeset bongos on a two line staff:
2778 @lilypond[singleline]
2779 \include "drumpitch-init.ly"
2780 nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl }
2781 mus = \notes { boh boho bohm ssh bol bolo bolm ssl s16 }
2784 \apply #(drums->paper 'bongos) \context Staff <
2788 \context Lyrics \nam
2793 \remove Bar_engraver
2794 \remove Time_signature_engraver
2795 StaffSymbol \override #'line-count = #2
2796 StaffSymbol \override #'staff-space = #2
2797 minimumVerticalExtent = #'(-3.0 . 4.0)
2801 \remove Stem_engraver
2807 to typeset all kinds of simple percussion on one line staves:
2808 @lilypond[singleline]
2809 \include "drumpitch-init.ly"
2810 nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc }
2811 mus = \notes { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
2814 \apply #(drums->paper 'percussion) \context Staff <
2818 \context Lyrics \nam
2823 \remove Bar_engraver
2824 \remove Time_signature_engraver
2825 StaffSymbol \override #'line-count = #1
2826 minimumVerticalExtent = #'(-2.0 . 3.0)
2830 \remove Stem_engraver
2837 If you do not like any of the predefined lists you can define your own
2838 list at the top of your file:
2840 @lilypond[singleline, verbatim]
2841 #(set-drum-kit 'mydrums `(
2842 (bassdrum default #f ,(ly:make-pitch -1 2 0))
2843 (snare default #f ,(ly:make-pitch 0 1 0))
2844 (hihat cross #f ,(ly:make-pitch 0 5 0))
2845 (pedalhihat xcircle "stopped" ,(ly:make-pitch 0 5 0))
2846 (lowtom diamond #f ,(ly:make-pitch -1 6 0))
2848 \include "drumpitch-init.ly"
2849 up = \notes { hh8 hh hh hh hhp4 hhp }
2850 down = \notes { bd4 sn bd toml8 toml }
2852 \apply #(drums->paper 'mydrums) \context Staff <
2854 \context Voice = up { \voiceOne \up }
2855 \context Voice = down { \voiceTwo \down }
2860 To use a modified existing list, one can prepend modifications to the
2864 #(set-drum-kit 'mydrums (append `(
2865 (bassdrum default #f ,(ly:make-pitch -1 2 0))
2866 (lowtom diamond #f ,(ly:make-pitch -1 6 0))
2867 ) (get-drum-kit 'drums)))
2870 You can easily combine percussion notation with pitched notation.
2871 Indeed, the file @file{drumpitch-init.ly} replaces the normal pitch
2872 names, so you will have to reinclude @file{nederlands.ly} after the
2873 drum-pattern-definitions to enter normal notes:
2875 @lilypond[singleline,verbatim]
2876 \include "drumpitch-init.ly"
2877 up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
2878 down = \notes { bassdrum4 snare8 bd r bd sn4 }
2879 \include "nederlands.ly"
2880 bass = \notes \transpose c c,, { a4. e8 r e g e }
2883 \apply #(drums->paper 'drums) \context Staff = drums <
2885 \context Voice = up { \voiceOne \up }
2886 \context Voice = down { \voiceTwo \down }
2888 \context Staff = bass { \clef "F_8" \bass }
2893 @node Percussion MIDI output
2894 @subsection Percussion MIDI output
2896 In order to produce correct MIDI output you need to produce two score
2897 blocks---one for the paper and one for the MIDI output. To use the
2898 percussion channel you set the property @code{instrument} to
2899 @code{'drums}. Because the drum-pitches themselves are similar to the
2900 general MIDI pitches all you have to do is to insert the voices with
2901 none of the scheme functions to get the correct MIDI output:
2905 \apply #(drums->paper 'mydrums) \context Staff <
2914 \property Staff.instrument = #'drums
2923 This scheme is a temporary implementation.
2927 @section Piano music
2929 Piano staves are two normal staves coupled with a brace. The staves
2930 are largely independent, but sometimes voices can cross between the
2931 two staves. The same notation is also used for harps and other key
2932 instruments. The @internalsref{PianoStaff} is especially built to
2933 handle this cross-staffing behavior. In this section we discuss the
2934 @internalsref{PianoStaff} and some other pianistic peculiarities.
2938 * Automatic staff changes::
2939 * Manual staff switches::
2942 * Staff switch lines::
2947 There is no support for putting chords across staves. You can get
2948 this result by increasing the length of the stem in the lower stave so
2949 it reaches the stem in the upper stave, or vice versa. An example is
2950 included with the distribution as @inputfileref{input/test,stem-cross-staff.ly}.
2952 Dynamics are not centered, but kludges do exist. See
2953 @inputfileref{input/templates,piano-dynamics.ly}.
2955 @cindex cross staff stem
2956 @cindex stem, cross staff
2959 @c fixme: should have hyperlinks as well.
2965 @node Automatic staff changes
2966 @subsection Automatic staff changes
2967 @cindex Automatic staff changes
2969 Voices can switch automatically between the top and the bottom
2970 staff. The syntax for this is
2972 \autochange Staff \context Voice @{ @dots{}@var{music}@dots{} @}
2974 The autochanger switches on basis of pitch (central C is the turning
2975 point), and it looks ahead skipping over rests to switch in
2976 advance. Here is a practical example:
2978 @lilypond[verbatim,singleline,quote]
2979 \score { \notes \context PianoStaff <
2980 \context Staff = "up" {
2981 \autochange Staff \context Voice = VA < \relative c' {
2982 g4 a b c d r4 a g } > }
2983 \context Staff = "down" {
2990 In this example, spacer rests are used to prevent the bottom staff from
2991 terminating too soon.
2996 @internalsref{AutoChangeMusic}.
3000 The staff switches often do not end up in optimal places. For high
3001 quality output staff switches should be specified manually.
3005 @node Manual staff switches
3006 @subsection Manual staff switches
3008 @cindex manual staff switches
3009 @cindex staff switch, manual
3011 Voices can be switched between staves manually, using the following command:
3013 \translator Staff = @var{staffname} @var{music}
3017 The string @var{staffname} is the name of the staff. It switches the
3018 current voice from its current staff to the Staff called
3019 @var{staffname}. Typically @var{staffname} is @code{"up"} or
3027 Pianos have pedals that alter the way sound are produced. Generally, a
3028 piano has three pedals, sustain, una corda, and sostenuto.
3032 Piano pedal instruction can be expressed by attaching
3033 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
3034 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
3037 @lilypond[fragment,verbatim]
3038 c'4-\sustainDown c'4-\sustainUp
3041 What is printed can be modified by setting @code{pedal@var{X}Strings},
3042 where @var{X} is one of the pedal types: @code{Sustain},
3043 @code{Sostenuto} or @code{UnaCorda}. Refer to the generated
3044 documentation of @internalsref{SustainPedal} for more information.
3046 Pedals can also be indicated by a sequence of brackets, by setting the
3047 @code{pedalSustainStyle} property to @code{bracket} objects:
3049 @lilypond[fragment,verbatim]
3050 \property Staff.pedalSustainStyle = #'bracket
3051 c''4-\sustainDown d''4 e''4
3052 a'4-\sustainUp-\sustainDown
3053 f'4 g'4 a'4-\sustainUp
3056 A third style of pedal notation is a mixture of text and brackets,
3057 obtained by setting @code{pedal-type} to @code{mixed}:
3059 @lilypond[fragment,verbatim]
3060 \property Staff.pedalSustainStyle = #'mixed
3061 c''4-\sustainDown d''4 e''4
3062 c'4-\sustainUp-\sustainDown
3063 f'4 g'4 a'4-\sustainUp
3066 The default `*Ped' style for sustain and damper pedals corresponds to
3067 @code{\pedal-type = #'text}. However, @code{mixed} is the default style
3068 for a sostenuto pedal:
3070 @lilypond[fragment,verbatim]
3071 c''4-\sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4-\sostenutoUp
3074 For fine-tuning of the appearance of a pedal bracket, the properties
3075 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
3076 @code{PianoPedalBracket} objects (, see the detailed documentation of
3077 @internalsref{PianoPedalBracket},) can be modified. For example, the bracket
3078 may be extended to the end of the note head:
3080 @lilypond[fragment,verbatim]
3081 \property Staff.PianoPedalBracket \override
3082 #'shorten-pair = #'(0 . -1.0)
3083 c''4-\sostenutoDown d''4 e''4 c'4
3084 f'4 g'4 a'4-\sostenutoUp
3088 @subsection Arpeggio
3091 @cindex broken arpeggio
3092 @cindex @code{\arpeggio}
3094 You can specify an arpeggio sign on a chord by attaching an
3095 @code{\arpeggio} to a chord:
3098 @lilypond[fragment,relative,verbatim]
3099 <<c e g c>>-\arpeggio
3102 When an arpeggio crosses staves, you attach an arpeggio to the chords
3103 in both staves, and set
3104 @internalsref{PianoStaff}.@code{connectArpeggios}:
3106 @lilypond[fragment,relative,verbatim]
3107 \context PianoStaff <
3108 \property PianoStaff.connectArpeggios = ##t
3109 \context Voice = one { <<c' e g c>>-\arpeggio }
3110 \context Voice = other { \clef bass <<c,, e g>>-\arpeggio }
3114 The direction of the arpeggio is sometimes denoted by adding an
3115 arrowhead to the wiggly line. This can be typeset by setting
3116 @code{arpeggio-direction}:
3118 @lilypond[fragment,relative,verbatim]
3120 \property Voice.Arpeggio \set #'arpeggio-direction = #1
3121 <<c e g c>>-\arpeggio
3122 \property Voice.Arpeggio \set #'arpeggio-direction = #-1
3123 <<c e g c>>-\arpeggio
3127 A square bracket on the left indicates that the player should not
3128 arpeggiate the chord. To draw these brackets, set the
3129 @code{molecule-callback} property of @code{Arpeggio} or
3130 @code{PianoStaff.Arpeggio} objects to @code{\arpeggioBracket}, and use
3131 @code{\arpeggio} statements within the chords as before:
3133 @lilypond[fragment,relative,verbatim]
3134 \property PianoStaff.Arpeggio \override
3135 #'molecule-callback = \arpeggioBracket
3136 <<c' e g c>>-\arpeggio
3141 @cindex @code{\arpeggioBracket}
3142 @code{\arpeggioBracket},
3143 @cindex @code{\arpeggio}
3148 @internalsref{ArpeggioEvent} expression lead to
3149 @internalsref{Arpeggio} objects. Cross staff arpeggios are
3150 @internalsref{PianoStaff}.@internalsref{Arpeggio}.
3154 It is not possible to mix connected arpeggios and unconnected
3155 arpeggios in one @internalsref{PianoStaff} at the same time.
3157 @node Staff switch lines
3158 @subsection Staff switch lines
3161 @cindex follow voice
3162 @cindex staff switching
3165 @cindex @code{followVoice}
3167 Whenever a voice switches to another staff a line connecting the notes
3168 can be printed automatically. This is enabled if the property
3169 @code{PianoStaff.followVoice} is set to true:
3171 @lilypond[fragment,relative,verbatim]
3172 \context PianoStaff <
3173 \property PianoStaff.followVoice = ##t
3174 \context Staff \context Voice {
3176 \translator Staff=two
3179 \context Staff=two { \clef bass \skip 1*2 }
3183 The associated object is @internalsref{VoiceFollower}.
3187 @cindex @code{\showStaffSwitch}
3188 @code{\showStaffSwitch},
3189 @cindex @code{\hideStaffSwitch}
3190 @code{\hideStaffSwitch}.
3194 @section Vocal music
3196 This section discusses how to enter and print lyrics.
3200 * The Lyrics context::
3205 @node Entering lyrics
3206 @subsection Entering lyrics
3210 @cindex @code{\lyrics}
3213 Lyrics are entered in a special input mode. This mode is is introduced
3214 by the keyword @code{\lyrics}. In this mode you can enter lyrics, with
3215 punctuation and accents without any hassle. Syllables are entered like
3216 notes, but with pitches replaced by text. For example,
3218 \lyrics @{ Twin-4 kle4 twin- kle litt- le star2 @}
3221 A word in Lyrics mode begins with: an alphabetic character, @code{_},
3222 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
3223 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
3224 any 8-bit character with ASCII code over 127, or a two-character
3225 combination of a backslash followed by one of @code{`}, @code{'},
3226 @code{"}, or @code{^}.
3228 Subsequent characters of a word can be any character that is not a digit
3229 and not white space. One important consequence of this is that a word
3230 can end with @code{@}}. The following example is usually a bug. The
3231 syllable includes a @code{@}}, and hence the opening brace is not balanced:
3233 \lyrics @{ twinkle@}
3236 @cindex @code{\property}, in @code{\lyrics}
3237 Similarly, a period following a alphabetic sequence, is included in the
3238 resulting string. As a consequence, spaces must be inserted around
3239 @code{\property} commands:
3241 \property Lyrics . LyricText \set #'font-shape = #'italic
3245 @cindex spaces, in lyrics
3246 @cindex quotes, in lyrics
3248 Any @code{_} character which appears in an unquoted word is converted
3249 to a space. This provides a mechanism for introducing spaces into words
3250 without using quotes. Quoted words can also be used in Lyrics mode to
3251 specify words that cannot be written with the above rules:
3254 \lyrics @{ He said: "\"Let" my peo ple "go\"" @}
3258 Hyphens can be entered as ordinary hyphens at the end of a syllable, i.e.
3263 These will be attached to the end of the first syllable.
3265 Centered hyphens are entered using the special `@code{-}@code{-}' lyric
3266 as a separate word between syllables. The hyphen will have variable
3267 length depending on the space between the syllables and it will be
3268 centered between the syllables.
3273 When a lyric is sung over many notes (this is called a melisma), this is
3274 indicated with a horizontal line centered between a syllable and the
3275 next one. Such a line is called an extender line, and it is entered as
3280 @internalsref{LyricEvent}, @internalsref{HyphenEvent}, and
3281 @internalsref{ExtenderEvent}.
3285 The definition of lyrics mode is too complex.
3287 @node The Lyrics context
3288 @subsection The Lyrics context
3290 Lyrics are printed by interpreting them in @internalsref{Lyrics} context:
3292 \context Lyrics \lyrics @dots{}
3295 @cindex automatic syllable durations
3296 @cindex @code{\addlyrics}
3297 @cindex lyrics and melodies
3299 This will place the lyrics according to the durations that were
3300 entered. The lyrics can also be aligned under a given melody
3301 automatically. In this case, it is no longer necessary to enter the
3302 correct duration for each syllable. This is achieved by combining the
3303 melody and the lyrics with the @code{\addlyrics} expression:
3307 \context Lyrics @dots{}
3310 @cindex staff order, with @code{\addlyrics}
3312 Normally, this will put the lyrics below the staff. For different or
3313 more complex orderings, the best way is to setup the hierarchy of
3314 staves and lyrics first, e.g.
3316 \context ChoirStaff \notes <
3317 \context Lyrics = LA @{ s1 @}
3318 \context Staff = SA @{ s1 @}
3319 \context Lyrics = LB @{ s1 @}
3320 \context Staff = SB @{ s1 @}
3323 and then combine the appropriate melodies and lyric lines:
3326 \context Staff = SA @emph{the music}
3327 \context Lyrics = LA @emph{the lyrics}
3330 putting both together, you would get
3332 \context ChoirStaff \notes <
3333 \context Lyrics = LA @dots{}
3334 \context Staff = SB @dots{}
3340 @cindex choral score
3342 A complete example of a SATB score setup is in the file
3343 @inputfileref{input/template,satb}.
3347 @internalsref{LyricCombineMusic}, @internalsref{Lyrics}, and
3348 @inputfileref{input/template,satb}.
3352 @code{\addlyrics} is not automatic enough: melismata are not detected
3353 automatically, and melismata are not stopped when they hit a rest. A
3354 melisma on the last note in a melody is not printed.
3358 @subsection More stanzas
3361 @cindex phrasing, in lyrics
3363 When multiple stanzas are printed underneath each other, the vertical
3364 groups of syllables should be aligned around punctuation. This can be
3365 done automatically when corresponding lyric lines and melodies are
3368 To this end, give the @internalsref{Voice} context an identity:
3370 \context Voice = duet @{
3375 Then set the @internalsref{LyricsVoice} contexts to names starting with
3376 that identity followed by a dash. In the preceding example, the
3377 @internalsref{Voice} identity is @code{duet}, so the identities of the
3378 @internalsref{LyricsVoices} are marked @code{duet-1} and @code{duet-2}:
3380 \context LyricsVoice = "duet-1" @{
3381 Hi, my name is bert. @}
3382 \context LyricsVoice = "duet-2" @{
3383 Ooooo, ch\'e -- ri, je t'aime. @}
3385 The convention for naming @internalsref{LyricsVoice} and
3386 @internalsref{Voice} must also be used to get melismata correct in
3387 conjunction with rests.
3389 The complete example is shown here:
3390 @lilypond[singleline,verbatim]
3393 \notes \relative c'' \context Voice = duet { \time 3/4
3395 \lyrics \context Lyrics <
3396 \context LyricsVoice = "duet-1" {
3397 \property LyricsVoice . stanza = "Bert"
3398 Hi, my name is bert. }
3399 \context LyricsVoice = "duet-2" {
3400 \property LyricsVoice . stanza = "Ernie"
3401 Ooooo, ch\'e -- ri, je t'aime. }
3406 Stanza numbers, or the names of the singers can be added by setting
3407 @code{LyricsVoice.Stanza} (for the first system) and
3408 @code{LyricsVoice.stz} for the following systems. Notice how dots are
3409 surrounded with spaces in @code{\lyrics} mode:
3412 \property LyricsVoice . stanza = "Bert"
3414 \property LyricsVoice . stanza = "Ernie"
3417 To make empty spaces in lyrics, use @code{\skip}.
3425 Input for lyrics introduces a syntactical ambiguity:
3432 is interpreted as assigning a string identifier @code{\foo} such that
3433 it contains @code{"bar"}. However, it could also be interpreted as
3434 making or a music identifier @code{\foo} containing the syllable
3435 `bar'. The force the latter interpretation, use
3445 The term @emph{ambitus} denotes a range of pitches for a given voice in
3446 a part of music. It also may denote the pitch range that a musical
3447 instrument is capable of playing. Most musical instruments have their
3448 ambitus standardized (or at least there is agreement upon the minimal
3449 ambitus of a particular type of instrument), such that a composer or
3450 arranger of a piece of music can easily meet the ambitus constraints of
3451 the targeted instrument. However, the ambitus of the human voice
3452 depends on individual physiological state, including education and
3453 training of the voice. Therefore, a singer potentially has to check for
3454 each piece of music if the ambitus of that piece meets his individual
3455 capabilities. This is why the ambitus of a piece may be of particular
3456 value to vocal performers.
3458 The ambitus is typically notated on a per-voice basis at the very
3459 beginning of a piece, e.g. nearby the initial clef or time signature of
3460 each staff. The range is graphically specified by two noteheads, that
3461 represent the minimum and maximum pitch. Some publishers use a textual
3462 notation: they put the range in words in front of the corresponding
3463 staff. LilyPond currently only supports the graphical ambitus notation.
3465 To apply, add the @internalsref{Ambitus_engraver} to the
3466 @internalsref{Voice} context, i.e.
3469 \paper @{ \translator @{
3471 \consists Ambitus_engraver
3477 @lilypond[singleline]
3478 upper = \notes \relative c {
3481 as'' c e2 bes f cis d4 e f2 g
3483 lower = \notes \relative c {
3486 e'4 b g a c es fis a cis b a g f e d2
3489 \context ChoirStaff {
3491 \context Staff = one { \upper }
3492 \context Staff = three { \lower }
3498 \consists Ambitus_engraver
3507 @internalsref{Ambitus}, and @inputfileref{input/regression,ambitus.ly}.
3512 Tablature notation is used for notating music for plucked string
3513 instruments. It notates pitches not by using note heads, but by
3514 indicating on which string and fret a note must be played. LilyPond
3515 offers limited support for tablature.
3518 * Tablatures basic::
3519 * Non-guitar tablatures::
3522 @node Tablatures basic
3523 @subsection Tablatures basic
3524 @cindex Tablatures basic
3526 The string number associated to a note is given as a backslash
3527 followed by a number, e.g. @code{c4\3} for a C quarter on the third
3528 string. By default, string 1 is the highest one, and the tuning
3529 defaults to the standard guitar tuning (with 6 strings). The notes
3530 are printed as tablature, by using @internalsref{TabStaff} and
3531 @internalsref{TabVoice} contexts:
3533 @lilypond[fragment,verbatim]
3534 \notes \context TabStaff {
3540 When no string is specified, the first string that does not give a
3541 fret number less than @code{minimumFret} is selected. The default
3542 value for @code{minimumFret} is 0:
3546 e8 fis gis a b cis' dis' e'
3547 \property TabStaff.minimumFret = #8
3548 e8 fis gis a b cis' dis' e'
3553 e8 fis gis a b cis' dis' e'
3554 \property TabStaff.minimumFret = #8
3555 e8 fis gis a b cis' dis' e'
3558 \context StaffGroup <
3559 \context Staff { \clef "G_8" \frag }
3560 \context TabStaff { \frag }
3567 @internalsref{TabStaff}, @internalsref{TabVoice}, and
3568 @internalsref{StringNumberEvent}.
3572 Chords are not handled in a special way, and hence the automatic
3573 string selector may easily select the same string to two notes in a
3577 @node Non-guitar tablatures
3578 @subsection Non-guitar tablatures
3579 @cindex Non-guitar tablatures
3581 You can change the number of strings, by setting the number of lines
3582 in the @internalsref{TabStaff} (the @code{line-count} property of
3583 @internalsref{TabStaff} can only be changed using
3584 @code{\outputproperty}, for more information, see @ref{Tuning
3587 You can change the tuning of the strings. A string tuning is given as
3588 a Scheme list with one integer number for each string, the number
3589 being the pitch (measured in semitones relative to central C) of an
3590 open string. The numbers specified for @code{stringTuning} are the
3591 numbers of semitones to subtract or add, starting the specified pitch
3592 by default middle C, in string order. Thus, the notes are e, a, d, and
3595 @lilypond[fragment,verbatim]
3598 \outputproperty #(make-type-checker 'staff-symbol-interface)
3600 \property TabStaff.stringTunings = #'(-5 -10 -15 -20)
3603 a,4 c' a e' e c' a e'
3608 It is possible to change the Scheme function to format the tablature
3609 note text. The default is @code{fret-number-tablature-format}, which
3610 uses the fret number. For instruments that do not use this notation,
3611 you can create a special tablature formatting function. This function
3612 takes three argument: string number, string tuning and note pitch.
3616 Most of the guitar special effects such as bend have not been
3622 @section Chord names
3625 LilyPond has support for both printing chord names. Chords may be
3626 entered in musical chord notation, i.e. @code{<< .. >>}, but they can
3627 also be entered by name. Internally, the chords are represented as a
3628 set of pitches, so they can be transposed:
3631 @lilypond[verbatim,singleline]
3632 twoWays = \notes \transpose c c' {
3642 < \context ChordNames \twoWays
3643 \context Voice \twoWays > }
3646 This example also shows that the chord printing routines do not try to
3647 be intelligent. The last chord (@code{f bes d}) is not interpreted as
3653 * Printing chord names::
3658 @subsection Chords mode
3661 Chord mode is a mode where you can input sets of pitches using common
3662 names. It is introduced by the keyword @code{\chords}.
3663 In chords mode, a chord is entered by the root, which is entered
3664 like a common pitch:
3665 @lilypond[fragment,verbatim,quote, relative=1]
3666 \chords { es4. d8 c2 }
3671 Other chords may be entered by suffixing a colon, and introducing a
3672 modifier, and optionally, a number:
3674 @lilypond[fragment,verbatim,quote]
3675 \chords { e1:m e1:7 e1:m7 }
3677 The first number following the root is taken to be the `type' of the
3678 chord, thirds are added to the root until it reaches the specified
3680 @lilypond[fragment,verbatim]
3681 \chords { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 }
3684 @cindex root of chord
3685 @cindex additions, in chords
3686 @cindex removals, in chords
3688 More complex chords may also be constructed adding separate steps
3689 to a chord. Additions are added after the number following
3690 the colon, and are separated by dots:
3692 @lilypond[verbatim,fragment,quote]
3693 \chords { c:5.6 c:3.7.8 c:3.6.13 }
3695 Chord steps can be altered by suffixing a @code{-} or @code{+} sign
3697 @lilypond[verbatim,fragment,quote]
3698 \chords { c:7+ c:5+.3- c:3-.5-.7- }
3700 Removals are specified similarly, and are introduced by a caret. They
3701 must come after the additions:
3702 @lilypond[verbatim,fragment]
3703 \chords { c^3 c:7^5 c:9^3.5 }
3706 Modifiers can be used to change pitches. The following modifiers are
3710 is the minor chord. This modifier lowers the 3rd and (if present) the 7th step.
3712 is the diminished chord. This modifier lowers the 3rd, 5th and (if present)
3715 is the augmented chord. This modifier raises the 5th step.
3717 is the major 7th chord. This modifier raises the 7th step if present.
3719 is the suspended 4th or 2nd. This modifier removes the 3rd
3720 step. Append either @code{2} or @code{4} to add the 2nd or 4th step to
3723 Modifiers can be mixed with additions:
3724 @lilypond[verbatim,fragment]
3725 \chords { c:sus4 c:7sus4 c:dim7 c:m6 }
3728 @cindex modifiers, in chords.
3735 Since an unaltered 11 does not sound good when combined with an
3736 unaltered 13, the 11 is removed in this case (, unless it is added
3738 @lilypond[fragment,verbatim]
3739 \chords { c:13 c:13.11 c:m13 }
3744 An inversion (putting one pitch of the chord on the bottom), as well
3745 as bass notes, can be specified by appending
3746 @code{/}@var{pitch} to the chord:
3747 @lilypond[fragment,verbatim,center]
3748 \chords { c1 c/g c/f }
3752 A bass note can be added instead of transposed out of the chord,
3753 by using @code{/+}@var{pitch}.
3755 @lilypond[fragment,verbatim,center]
3756 \chords { c1 c/+g c/+f }
3759 Chords is a mode similar to @code{\lyrics}, @code{\notes} etc. Most
3760 of the commands continue to work, for example, @code{r} and
3761 @code{\skip} can be used to insert rests and spaces, and
3762 @code{\property} may be used to change various settings.
3768 Each step can only be present in a chord once. The following
3769 simply produces the augmented chord, since @code{5+} is interpreted
3772 @lilypond[verbatim,fragment]
3773 \chords { c:5.5-.5+ }
3777 @node Printing chord names
3778 @subsection Printing chord names
3780 @cindex printing chord names
3784 For displaying printed chord names, use the @internalsref{ChordNames} context.
3785 The chords may be entered either using the notation
3786 described above, or directly using @code{<<} and @code{>>}:
3788 @lilypond[verbatim,singleline]
3790 \chords {a1 b c} <<d' f' a'>> <<e' g' b'>>
3794 \context ChordNames \scheme
3795 \context Staff \scheme
3800 You can make the chord changes stand out by setting
3801 @internalsref{ChordNames}.@code{chordChanges} to true. This will only
3802 display chord names when there is a change in the chords scheme and at
3803 the start of a new line:
3805 @lilypond[verbatim, linewidth=9cm]
3807 c1:m c:m \break c:m c:m d
3811 \context ChordNames {
3812 \property ChordNames.chordChanges = ##t
3814 \context Staff \transpose c c' \scheme
3819 The default chord name layout is a system for Jazz music, proposed by
3820 Klaus Ignatzek (see @ref{Literature}). It can be tuned through the
3821 following properties:
3824 @cindex chordNameExceptions
3825 @item chordNameExceptions
3826 This is a list that contains the chords that have special formatting.
3828 @inputfileref{input/regression,chord-name-exceptions.ly}.
3829 @cindex exceptions, chord names.
3832 @cindex majorSevenSymbol
3833 @item majorSevenSymbol
3834 This property contains the markup object used for the 7th step, when
3835 it is major. Predefined options are @code{whiteTriangleMarkup} and
3836 @code{blackTriangleMarkup}. See
3837 @inputfileref{input/regression,chord-name-major7.ly} for an example.
3839 @cindex chordNameSeparator
3840 @item chordNameSeparator
3841 Different parts of a chord name are normally separated by a
3842 slash. By setting @code{chordNameSeparator}, you can specify other
3844 @lilypond[fragment,verbatim]
3845 \context ChordNames \chords {
3847 \property ChordNames.chordNameSeparator
3848 = \markup { \typewriter "|" }
3852 @cindex chordRootNamer
3853 @item chordRootNamer
3854 The root of a chord is usually printed as a letter with an optional
3855 alteration. The transformation from pitch to letter is done by this
3856 function. Special note names (for example, the German ``H'' for a
3857 B-chord) can be produced by storing a new function in this property.
3859 @cindex chordNoteNamer
3860 @item chordNoteNamer
3861 The default is to print single pitch, e.g. the bass note, using the
3862 @code{chordRootNamer}. The @code{chordNoteNamer} property can be set
3863 to a specialized function to change this behavior. For example, the
3864 base can be printed in lower case.
3869 There are also two other chord name schemes implemented: an alternate
3870 Jazz chord notation, and a systematic scheme called Banter chords. The
3871 alternate jazz notation is also shown on the chart in @ref{Chord name
3872 chart}. Turning on these styles is described in the input file
3873 @inputfileref{input/test/,chord-names-jazz.ly}.
3877 @cindex chords, jazz
3882 @cindex @code{\germanChords}
3883 @code{\germanChords},
3884 @cindex @code{\semiGermanChords}
3885 @code{\semiGermanChords}.
3892 @inputfileref{input/regression,chord-name-major7.ly},
3893 @inputfileref{input/regression,chord-name-exceptions.ly},
3894 @inputfileref{input/test,chord-names-jazz.ly},
3895 @inputfileref{input/test,chord-names-german.ly},
3896 @file{scm/chords-ignatzek.scm}, and @file{scm/chord-entry.scm}.
3901 Chord names are determined solely from the list of pitches. Chord
3902 inversions are not identified, and neither are added bass notes. This
3903 may result in strange chord names when chords are entered with the
3904 @code{<< .. >>} syntax.
3909 @node Orchestral music
3910 @section Orchestral music
3912 @cindex Writing parts
3914 Orchestral music involves some special notation, both in the full
3915 score and the individual parts. This section explains how to tackle
3916 some common problems in orchestral music.
3921 * Multiple staff contexts::
3924 * Instrument names::
3926 * Multi measure rests::
3927 * Automatic part combining::
3929 * Sound output for transposing instruments::
3932 @node Multiple staff contexts
3933 @subsection Multiple staff contexts
3935 Polyphonic scores consist of many staves. These staves can be
3936 constructed in three different ways:
3938 @item The group is started with a brace at the left. This is done with the
3939 @internalsref{GrandStaff} context.
3940 @item The group is started with a bracket. This is done with the
3941 @internalsref{StaffGroup} context
3942 @item The group is started with a vertical line. This is the default
3946 @cindex Staff, multiple
3947 @cindex bracket, vertical
3948 @cindex brace, vertical
3955 @node Rehearsal marks
3956 @subsection Rehearsal marks
3957 @cindex Rehearsal marks
3959 @cindex @code{\mark}
3961 To print a rehearsal mark, use the @code{\mark} command:
3962 @lilypond[fragment,verbatim]
3972 The mark is incremented automatically if you use @code{\mark
3973 \default}. The value to use is stored in the property
3974 @code{rehearsalMark} is used and automatically incremented.
3976 The @code{\mark} command can also be used to put signs like coda,
3977 segno and fermatas on a barline. Use @code{\markup} to
3978 to access the appropriate symbol:
3980 @lilypond[fragment,verbatim,relative=1]
3981 c1 \mark \markup { \musicglyph #"scripts-ufermata" }
3985 In this case, during line breaks,
3986 marks must also be printed at the end of the line, and not at the
3987 beginning. Use the following to force that behavior:
3989 \property Score.RehearsalMark \override
3990 #'break-visibility = #begin-of-line-invisible
3993 See @inputfileref{input/test,boxed-molecule.ly} for putting boxes
3999 @cindex barlines, putting symbols on
4003 @internalsref{MarkEvent}, @internalsref{RehearsalMark}, and
4004 @inputfileref{input/test,boxed-molecule.ly}.
4008 @subsection Bar numbers
4012 @cindex measure numbers
4013 @cindex currentBarNumber
4015 Bar numbers are printed by default at the start of the line. The
4016 number itself is stored in the
4017 @code{currentBarNumber} property,
4018 which is normally updated automatically for every measure.
4020 Bar numbers can be typeset at regular intervals instead of at the
4021 beginning of each line. This is illustrated in the following example,
4022 whose source is available as
4023 @inputfileref{input/test,bar-number-regular-interval.ly}:
4025 @lilypondfile[notexidoc]{bar-number-regular-interval.ly}
4030 @internalsref{BarNumber},
4031 @inputfileref{input/test,bar-number-every-five-reset.ly}, and
4032 @inputfileref{input/test,bar-number-regular-interval.ly}.
4036 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
4037 there is one at the top. To solve this, the
4038 @internalsref{padding} property of @internalsref{BarNumber} can be
4039 used to position the number correctly.
4041 @node Instrument names
4042 @subsection Instrument names
4044 In an orchestral score, instrument names are printed left side of the
4047 This can be achieved by setting @internalsref{Staff}.@code{instrument}
4048 and @internalsref{Staff}.@code{instr}. This will print a string before
4049 the start of the staff. For the first start, @code{instrument} is
4050 used, for the next ones @code{instr} is used:
4052 @lilypond[verbatim,singleline]
4053 \property Staff.instrument = "ploink " { c''4 }
4056 You can also use markup texts to construct more complicated instrument
4059 @lilypond[fragment,verbatim,singleline]
4060 \notes \context Staff = treble {
4061 \property Staff.instrument = \markup {
4062 \column << "Clarinetti"
4064 \smaller \musicglyph #"accidentals--1"
4075 @internalsref{InstrumentName}.
4079 When you put a name on a grand staff or piano staff the width of the
4080 brace is not taken into account. You must add extra spaces to the end of
4081 the name to avoid a collision.
4084 @subsection Transpose
4086 @cindex transposition of pitches
4087 @cindex @code{\transpose}
4089 A music expression can be transposed with @code{\transpose}. The syntax
4092 \transpose @var{from} @var{to} @var{musicexpr}
4095 This means that @var{musicexpr} is transposed by the interval
4096 between @var{from} and @var{to}.
4098 @code{\transpose} distinguishes between enharmonic pitches: both
4099 @code{\transpose c cis} or @code{\transpose c des} will transpose up
4100 half a tone. The first version will print sharps and the second
4101 version will print flats:
4103 @lilypond[singleline, verbatim]
4104 mus =\notes { \key d \major cis d fis g }
4105 \score { \notes \context Staff {
4108 \transpose c g' \mus
4109 \transpose c f' \mus
4115 @internalsref{TransposedMusic}, and @internalsref{UntransposableMusic}.
4119 If you want to use both @code{\transpose} and @code{\relative}, then
4120 you must put @code{\transpose} outside of @code{\relative}, since
4121 @code{\relative} will have no effect music that appears inside a
4127 @node Multi measure rests
4128 @subsection Multi measure rests
4129 @cindex multi measure rests
4130 @cindex Rests, multi measure
4134 Multi measure rests are entered using `@code{R}'. It is specifically
4135 meant for full bar rests and for entering parts: the rest can expand to
4136 fill a score with rests, or it can be printed as a single multimeasure
4137 rest. This expansion is controlled by the property
4138 @code{Score.skipBars}. If this is set to true, Lily will not expand
4139 empty measures, and the appropriate number is added automatically:
4141 @lilypond[fragment,verbatim]
4142 \time 4/4 r1 | R1 | R1*2
4143 \property Score.skipBars = ##t R1*17 R1*4
4146 The @code{1} in @code{R1} is similar to the duration notation used for
4147 notes. Hence, for time signatures other than 4/4, you must enter other
4148 durations. This can be done with augmentation dots or fractions:
4150 @lilypond[fragment,verbatim]
4151 \property Score.skipBars = ##t
4159 An @code{R} spanning a single measure is printed as either a whole rest
4160 or a breve, centered in the measure regardless of the time signature.
4162 @cindex text on multi-measure rest
4163 @cindex script on multi-measure rest
4164 @cindex fermata on multi-measure rest
4166 Texts can be added to multi-measure rests by using the
4167 @var{note}-@code{markup} syntax (see @ref{Text markup}). In this case, the number is
4168 replaced. If you need both texts and the number, you must add the
4169 number by hand. A variable (@code{\fermataMarkup}) is provided for
4173 @lilypond[verbatim,fragment]
4175 R2._\markup { "Ad lib" }
4180 @cindex whole rests for a full measure
4184 @internalsref{MultiMeasureRestEvent},
4185 @internalsref{MultiMeasureTextEvent},
4186 @internalsref{MultiMeasureRestMusicGroup}, and
4187 @internalsref{MultiMeasureRest}.
4189 The layout object @internalsref{MultiMeasureRestNumber} is for the
4190 default number, and @internalsref{MultiMeasureRestText} for user
4195 It is not possible to use fingerings (e.g. @code{R1-4}) to put numbers
4196 over multi-measure rests.
4198 @cindex condensing rests
4200 There is no way to automatically condense multiple rests into a single
4201 multimeasure rest. Multi measure rests do not take part in rest
4204 Be careful when entering multimeasure rests followed by whole notes,
4208 will enter two notes lasting four measures each. When @code{skipBars}
4209 is set, then the result will look OK, but the bar numbering will be
4212 @node Automatic part combining
4213 @subsection Automatic part combining
4214 @cindex automatic part combining
4215 @cindex part combiner
4218 Automatic part combining is used to merge two parts of music onto a
4219 staff. It is aimed at typesetting orchestral scores. When the two
4220 parts are identical for a period of time, only one is shown. In
4221 places where the two parts differ, they are typeset as separate
4222 voices, and stem directions are set automatically. Also, solo and
4223 @emph{a due} parts are identified and can be marked.
4227 The syntax for part combining is
4230 \partcombine @var{context} @var{musicexpr1} @var{musicexpr2}
4232 where the pieces of music @var{musicexpr1} and @var{musicexpr2} will be
4233 combined into one context of type @var{context}. The music expressions
4234 must be interpreted by contexts whose names should start with @code{one}
4237 The following example demonstrates the basic functionality of the part
4238 combiner: putting parts on one staff, and setting stem directions and
4241 @lilypond[verbatim,singleline,fragment]
4243 \context Voice=one \partcombine Voice
4244 \context Thread=one \relative c'' {
4247 \context Thread=two \relative c'' {
4253 The first @code{g} appears only once, although it was
4254 specified twice (once in each part). Stem, slur and tie directions are
4255 set automatically, depending whether there is a solo or unisono. The
4256 first part (with context called @code{one}) always gets up stems, and
4257 `solo', while the second (called @code{two}) always gets down stems and
4260 If you just want the merging parts, and not the textual markings, you
4261 may set the property @var{soloADue} to false:
4263 @lilypond[verbatim,singleline,fragment]
4265 \property Staff.soloADue = ##f
4266 \context Voice=one \partcombine Voice
4267 \context Thread=one \relative c'' {
4270 \context Thread=two \relative c'' {
4278 @internalsref{PartCombineMusic},
4279 @internalsref{Thread_devnull_engraver}, and
4280 @internalsref{Voice_devnull_engraver} and @internalsref{A2_engraver}.
4284 The syntax for naming contexts in inconsistent with the syntax for
4287 In @code{soloADue} mode, when the two voices play the same notes on and
4288 off, the part combiner may typeset @code{a2} more than once in a
4291 @lilypond[fragment,singleline]
4293 \context Voice=one \partcombine Voice
4294 \context Thread=one \relative c'' {
4297 \context Thread=two \relative c'' {
4303 The part combiner is slated to be rewritten [TODO: explain why].
4305 @cindex @code{Thread_devnull_engraver}
4306 @cindex @code{Voice_engraver}
4307 @cindex @code{A2_engraver}
4310 @subsection Hiding staves
4312 @cindex Frenched scores
4313 @cindex Hiding staves
4315 In orchestral scores, staff lines that only have rests are usually
4316 removed. This saves some space. This style is called `French Score'.
4317 For @internalsref{Lyrics}, @internalsref{LyricsVoice},
4318 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
4319 switched on by default. When these line of these contexts turn out
4320 empty after the line-breaking process, they are removed.
4322 For normal staves, a specialized @internalsref{Staff} context is
4323 available, which does the same: staves containing nothing (or only
4324 multi measure rests) are removed. The context definition is stored in
4325 @code{\RemoveEmptyStaffContext} variable. Observe how the second staff
4326 in this example disappears in the second line:
4331 \notes \relative c' <
4332 \context Staff = SA { e4 f g a \break c1 }
4333 \context Staff = SB { c4 d e f \break R1 }
4337 \translator { \RemoveEmptyStaffContext }
4343 @node Sound output for transposing instruments
4344 @subsection Sound output for transposing instruments
4346 When you want to make a MIDI file from a score containing transposed
4347 and untransposed instruments, you have to instruct LilyPond the pitch
4348 offset (in semitones) for the transposed instruments. This is done
4349 using the @code{transposing} property. It does not affect printed
4352 @cindex @code{transposing}
4355 \property Staff.instrument = #"Cl. in B-flat"
4356 \property Staff.transposing = #-2
4360 @node Ancient notation
4361 @section Ancient notation
4363 @cindex Vaticana, Editio
4364 @cindex Medicaea, Editio
4369 @c [TODO: write introduction on ancient notation]
4372 * Ancient note heads::
4373 * Ancient accidentals::
4384 @node Ancient note heads
4385 @subsection Ancient note heads
4389 For ancient notation, a note head style other than the @code{default}
4390 style may be chosen. This is accomplished by setting the @code{style}
4391 property of the NoteHead object to the desired value (@code{baroque},
4392 @code{neo_mensural} or @code{mensural}). The @code{baroque} style
4393 differs from the @code{default} style only in using a square shape for
4394 @code{\breve} note heads. The @code{neo_mensural} style differs from
4395 the @code{baroque} style in that it uses rhomboidal heads for whole
4396 notes and all smaller durations. Stems are centered on the note
4397 heads. This style is in particular useful when transcribing mensural
4398 music, e.g. for the incipit. The @code{mensural} style finally
4399 produces note heads that mimick the look of note heads in historic
4400 printings of the 16th century.
4402 To get a longa note head, you have to use mensural note heads. This
4403 is accomplished by setting the @code{style} property of the
4404 NoteHead object to @code{mensural}. There is also a note head style
4405 @code{baroque} which gives mensural note heads for @code{\longa} and
4406 @code{\breve} but standard note heads for shorter notes:
4408 The following example demonstrates the @code{neo_mensural} style:
4410 @lilypond[fragment,singleline,verbatim]
4411 \property Voice.NoteHead \set #'style = #'neo_mensural
4412 a'\longa a'\breve a'1 a'2 a'4 a'8 a'16
4415 When typesetting a piece in Gregorian Chant notation, a Gregorian
4416 ligature engraver will automatically select the proper note heads,
4417 such there is no need to explicitly set the note head style. Still,
4418 the note head style can be set e.g. to @code{vaticana_punctum} to
4419 produce punctum neumes. Similarly, a mensural ligature engraver is
4420 used to automatically assemble mensural ligatures. See section
4421 @ref{Ligatures} for how ligature engravers work.
4425 @inputfileref{input/regression,note-head-style.ly} gives an overview
4426 over all available note head styles.
4428 @ref{Percussion staves} use note head styles of their own that are
4429 frequently used in contemporary music notation.
4431 @node Ancient accidentals
4432 @subsection Ancient accidentals
4436 Use the @code{style} property of grob @internalsref{Accidental} to
4437 select ancient accidentals. Currently supported styles are
4438 @code{mensural}, @code{vaticana}, @code{hufnagel} and @code{medicaea}.
4440 @lilypond[singleline,26pt]
4448 { " " \musicglyph #"accidentals-vaticana-1"
4449 " " \musicglyph #"accidentals-vaticana0" }
4453 { " " \musicglyph #"accidentals-medicaea-1" }
4457 { " " \musicglyph #"accidentals-hufnagel-1" }
4461 { " " \musicglyph #"accidentals-mensural-1"
4462 " " \musicglyph #"accidentals-mensural1" }
4471 \remove "Bar_number_engraver"
4475 \remove "Clef_engraver"
4476 \remove "Key_engraver"
4477 \remove "Time_signature_engraver"
4478 \remove "Staff_symbol_engraver"
4479 minimumVerticalExtent = ##f
4485 As shown, not all accidentals are supported by each style. When
4486 trying to access an unsupported accidental, LilyPond will switch to a
4487 different style, as demonstrated in
4488 @inputfileref{input/test,ancient-accidentals.ly}.
4490 Similarly to local accidentals, the style of the key signature can be
4491 controlled by the @code{style} property of the
4492 @internalsref{KeySignature} grob.
4496 @subsection Ancient rests
4500 Use the @code{style} property of grob @internalsref{Rest} to select
4501 ancient accidentals. Currently supported styles are @code{classical},
4502 @code{neo_mensural} and @code{mensural}. @code{classical} differs
4503 from the @code{default} style only in that the quarter rest looks like
4504 a horizontally mirrored 8th rest. The @code{neo_mensural} style suits
4505 well for e.g. the incipit of a transcribed mensural piece of music.
4506 The @code{mensural} style finally mimicks the appearance of rests as
4507 in historic prints of the 16th century.
4509 The following example demonstrates the @code{neo_mensural} style:
4511 @lilypond[fragment,singleline,verbatim]
4512 \property Voice.Rest \set #'style = #'neo_mensural
4513 r\longa r\breve r1 r2 r4 r8 r16
4516 There are no 32th and 64th rests specifically for the mensural or
4517 neo-mensural style. Instead, the rests from the default style will be
4518 taken. See @inputfileref{input/test,rests.ly} for a chart of all
4521 There are no rests in Gregorian Chant notation; instead, it uses
4526 @subsection Ancient clefs
4530 LilyPond supports a variety of clefs, many of them ancient.
4532 For modern clefs, see section @ref{Clef}. For the percussion clef, see
4533 section @ref{Percussion staves}. For the @code{TAB} clef, see section
4536 The following table shows all ancient clefs that are supported via the
4537 @code{\clef} command. Some of the clefs use the same glyph, but
4538 differ only with respect to the line they are printed on. In such
4539 cases, a trailing number in the name is used to enumerate these clefs.
4540 Still, you can manually force a clef glyph to be typeset on an
4541 arbitrary line, as described in section @ref{Clef}. The note printed
4542 to the right side of each clef in the example column denotes the
4543 @code{c'} with respect to that clef.
4545 @multitable @columnfractions .3 .3 .3 .1
4549 @b{Description} @tab
4550 @b{Supported Clefs} @tab
4554 @code{clefs-neo_mensural_c} @tab
4555 modern style mensural C clef @tab
4556 @code{neo_mensural_c1}, @code{neo_mensural_c2},
4557 @code{neo_mensural_c3}, @code{neo_mensural_c4} @tab
4558 @lilypond[relative 0, notime]
4559 \property Staff.TimeSignature \set #'transparent = ##t
4560 \clef "neo_mensural_c2" c
4564 @code{clefs-petrucci_c1}
4565 @code{clefs-petrucci_c2}
4566 @code{clefs-petrucci_c3}
4567 @code{clefs-petrucci_c4}
4568 @code{clefs-petrucci_c5}
4571 petrucci style mensural C clefs, for use on different stafflines
4572 (the examples shows the 2nd staffline C clef).
4582 @lilypond[relative 0, notime]
4583 \property Staff.TimeSignature \set #'transparent = ##t
4584 \clef "petrucci_c2" c
4588 @code{clefs-petrucci_f} @tab
4589 petrucci style mensural F clef @tab
4590 @code{petrucci_f} @tab
4591 @lilypond[relative 0, notime]
4592 \property Staff.TimeSignature \set #'transparent = ##t
4593 \clef "petrucci_f" c
4597 @code{clefs-petrucci_g} @tab
4598 petrucci style mensural G clef @tab
4599 @code{petrucci_g} @tab
4600 @lilypond[relative 0, notime]
4601 \property Staff.TimeSignature \set #'transparent = ##t
4602 \clef "petrucci_g" c
4606 @code{clefs-mensural_c} @tab
4607 historic style mensural C clef @tab
4608 @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3},
4609 @code{mensural_c4} @tab
4610 @lilypond[relative 0, notime]
4611 \property Staff.TimeSignature \set #'transparent = ##t
4612 \clef "mensural_c2" c
4616 @code{clefs-mensural_f} @tab
4617 historic style mensural F clef @tab
4618 @code{mensural_f} @tab
4619 @lilypond[relative 0, notime]
4620 \property Staff.TimeSignature \set #'transparent = ##t
4621 \clef "mensural_f" c
4625 @code{clefs-mensural_g} @tab
4626 historic style mensural G clef @tab
4627 @code{mensural_g} @tab
4628 @lilypond[relative 0, notime]
4629 \property Staff.TimeSignature \set #'transparent = ##t
4630 \clef "mensural_g" c
4634 @code{clefs-vaticana_do} @tab
4635 Editio Vaticana style do clef @tab
4636 @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab
4637 @lilypond[relative 0, notime]
4639 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4640 \property Staff.TimeSignature \set #'transparent = ##t
4641 \clef "vaticana_do2" c
4645 @code{clefs-vaticana_fa} @tab
4646 Editio Vaticana style fa clef @tab
4647 @code{vaticana_fa1}, @code{vaticana_fa2} @tab
4648 @lilypond[relative 0, notime]
4650 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4651 \property Staff.TimeSignature \set #'transparent = ##t
4652 \clef "vaticana_fa2" c
4656 @code{clefs-medicaea_do} @tab
4657 Editio Medicaea style do clef @tab
4658 @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab
4659 @lilypond[relative 0, notime]
4661 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4662 \property Staff.TimeSignature \set #'transparent = ##t
4663 \clef "medicaea_do2" c
4667 @code{clefs-medicaea_fa} @tab
4668 Editio Medicaea style fa clef @tab
4669 @code{medicaea_fa1}, @code{medicaea_fa2} @tab
4670 @lilypond[relative 0, notime]
4672 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4673 \property Staff.TimeSignature \set #'transparent = ##t
4674 \clef "medicaea_fa2" c
4678 @code{clefs-hufnagel_do} @tab
4679 historic style hufnagel do clef @tab
4680 @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab
4681 @lilypond[relative 0, notime]
4683 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4684 \property Staff.TimeSignature \set #'transparent = ##t
4685 \clef "hufnagel_do2" c
4689 @code{clefs-hufnagel_fa} @tab
4690 historic style hufnagel fa clef @tab
4691 @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab
4692 @lilypond[relative 0, notime]
4694 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4695 \property Staff.TimeSignature \set #'transparent = ##t
4696 \clef "hufnagel_fa2" c
4700 @code{clefs-hufnagel_do_fa} @tab
4701 historic style hufnagel combined do/fa clef @tab
4702 @code{hufnagel_do_fa} @tab
4703 @lilypond[relative 0, notime]
4704 \property Staff.TimeSignature \set #'transparent = ##t
4705 \clef "hufnagel_do_fa" c
4710 @c --- This should go somewhere else: ---
4711 @c @item modern style percussion clef (glyph: @code{clefs-percussion})
4714 @c @code{percussion}
4716 @c @lilypond{\property Staff.TimeSignature \set #'transparent = ##t \clef "percussion" c'}
4718 @c @item modern style tab clef (glyph: @code{clefs-tab})
4723 @c @lilypond{\context Staff \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #6 \property Staff.TimeSignature \set #'transparent = ##t \clef "tab" c'}
4725 @emph{Modern style} means ``as is typeset in contemporary editions of
4726 transcribed mensural music''.
4728 @emph{Petrucci style} means ``inspired by printings published by the
4729 famous engraver Petrucci (1466-1539)''.
4731 @emph{Historic style} means ``as was typeset or written in historic
4732 editions (other than those of Petrucci)''.
4734 @emph{Editio XXX style} means ``as is/was printed in Editio XXX''.
4736 Petrucci used C clefs with differently balanced left-side vertical
4737 beams, depending on which staffline it is printed.
4741 @subsection Ancient flags
4745 Use the @code{flag-style} property of grob @internalsref{Stem} to
4746 select ancient flags. Besides the @code{default} flag style,
4747 currently only @code{mensural} style is supported:
4749 @lilypond[fragment,singleline,verbatim]
4750 \property Voice.Stem \set #'flag-style = #'mensural
4751 \property Voice.Stem \set #'thickness = #1.0
4752 \property Voice.NoteHead \set #'style = #'mensural
4754 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
4755 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
4758 Note that the innermost flare of each mensural flag always is
4759 vertically aligned with a staff line. If you do not like this
4760 behaviour, you can set the @code{adjust-if-on-staffline} property of
4761 grob @internalsref{Stem} to @code{##f}. Then, the vertical position
4762 of the end of each flare is different between notes on staff lines and
4763 notes between staff lines:
4765 @lilypond[fragment,singleline]
4766 \property Voice.Stem \set #'flag-style = #'mensural
4767 \property Voice.Stem \set #'thickness = #1.0
4768 \property Voice.Stem \set #'adjust-if-on-staffline = ##f
4769 \property Voice.NoteHead \set #'style = #'mensural
4771 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
4772 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
4775 There is no particular flag style for neo-mensural notation. Hence,
4776 when typesetting e.g. the incipit of a transcibed piece of mensural
4777 music, the default flag style should be used. There are no flags in
4778 Gregorian Chant notation.
4781 @subsection Custodes
4786 A @emph{custos} (plural: @emph{custodes}; latin word for `guard') is a
4787 symbol that appears at the end of a staff. It anticipates the pitch
4788 of the first note(s) of the following line and thus helps the player
4789 or singer to manage line breaks during performance, thus enhancing
4790 readability of a score.
4792 Custodes were frequently used in music notation until the 17th
4793 century. Nowadays, they have survived only in a few particular forms
4794 of musical notation such as contemporary editions of Gregorian chant
4795 like the @emph{editio vaticana}. There are different custos glyphs
4796 used in different flavours of notational style.
4798 For typesetting custodes, just put a @internalsref{Custos_engraver} into the
4799 @internalsref{Staff} context when declaring the @code{\paper} block,
4800 as shown in the following example:
4806 \consists Custos_engraver
4807 Custos \override #'style = #'mensural
4812 The result looks like this:
4818 \property Staff.Custos \set #'style = #'mensural
4825 \consists Custos_engraver
4832 The custos glyph is selected by the @code{style} property. The styles
4833 supported are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
4834 @code{mensural}. They are demonstrated in the following fragment:
4844 { " " \musicglyph #"custodes-vaticana-u0" }
4848 { " " \musicglyph #"custodes-medicaea-u0" }
4852 { " " \musicglyph #"custodes-hufnagel-u0" }
4856 { " " \musicglyph #"custodes-mensural-u0" }
4865 \remove "Bar_number_engraver"
4869 \remove "Clef_engraver"
4870 \remove "Key_engraver"
4871 \remove "Time_signature_engraver"
4872 \remove "Staff_symbol_engraver"
4873 minimumVerticalExtent = ##f
4879 If the boolean property @code{adjust-if-on-staffline} is set to
4880 @code{#t} (which it is by default), lily typesets slightly different
4881 variants of the custos glyph, depending on whether the custos, is
4882 typeset on or between stafflines. The glyph will
4883 optically fit well into the staff, with the appendage on the right of
4884 the custos always ending at the same vertical position between two
4885 stafflines regardless of the pitch. If you set
4886 @code{adjust-if-on-staffline} to @code{#f}, then
4887 a compromise between both forms is used.
4889 Just like stems can be attached to noteheads in two directions
4890 @emph{up} and @emph{down}, each custos glyph is available with its
4891 appendage pointing either up or down. If the pitch of a custos is
4892 above a selectable position, the appendage will point downwards; if
4893 the pitch is below this position, the appendage will point upwards.
4894 Use property @code{neutral-position} to select this position. By
4895 default, it is set to @code{0}, such that the neutral position is the
4896 center of the staff. Use property @code{neutral-direction} to control
4897 what happens if a custos is typeset on the neutral position itself.
4898 By default, this property is set to @code{-1}, such that the appendage
4899 will point downwards. If set to @code{1}, the appendage will point
4900 upwards. Other values such as @code{0} are reserved for future
4901 extensions and should not be used.
4906 @internalsref{Custos} and @inputfileref{input/regression,custos.ly}.
4910 @subsection Divisiones
4916 A @emph{divisio} (plural: @emph{divisiones}; latin word for
4917 `division') is a staff context symbol that is used to structure
4918 Gregorian music into phrases and sections. The musical meaning of
4919 @emph{divisio minima}, @emph{divisio maior} and @emph{divisio maxima}
4920 can be characterized as short, medium and long pause, somewhat like
4921 @ref{Breath marks}. The @emph{finalis} sign not only marks the end of
4922 a chant, but is also frequently used within a single
4923 antiphonal/responsorial chant to mark the end of each section.
4927 To use divisiones, include the file @code{gregorian-init.ly}. It
4928 contains definitions that you can apply by just inserting
4929 @code{\divisioMinima}, @code{\divisioMaior}, @code{\divisioMaxima},
4930 and @code{\finalis} at proper places in the input. Some editions use
4931 @emph{virgula} or @emph{caesura} instead of divisio minima.
4932 Therefore, @code{gregorian-init.ly} also defines @code{\virgula} and
4936 @lilypondfile[notexidoc]{divisiones.ly}
4940 @internalsref{BreathingSign}, @internalsref{BreathingSignEvent},
4941 @inputfileref{input/test,divisiones.ly}, and @ref{Breath marks}.
4944 @subsection Ligatures
4948 @c TODO: Should double check if I recalled things correctly when I wrote
4949 @c down the following paragraph by heart.
4951 In musical terminology, a ligature is a coherent graphical symbol that
4952 represents at least two distinct notes. Ligatures originally appeared
4953 in the manuscripts of Gregorian chant notation roughly since the 9th
4954 century as an allusion to the accent symbols of greek lyric poetry to
4955 denote ascending or descending sequences of notes. Both, the shape
4956 and the exact meaning of ligatures changed tremendously during the
4957 following centuries: In early notation, ligatures were used for
4958 monophonic tunes (Gregorian chant) and very soon denoted also the way
4959 of performance in the sense of articulation. With upcoming
4960 multiphony, the need for a metric system arised, since multiple voices
4961 of a piece have to be synchronized some way. New notation systems
4962 were invented that used the manifold shapes of ligatures to now denote
4963 rhythmical patterns (e.g. black mensural notation, mannered notation,
4964 ars nova). With the invention of the metric system of the white
4965 mensural notation, the need for ligatures to denote such patterns
4966 disappeared. Nevertheless, ligatures were still in use in the
4967 mensural system for a couple of decades until they finally disappeared
4968 during the late 16th / early 17th century. Still, ligatures have
4969 survived in contemporary editions of Gregorian chant such as the
4970 Editio Vaticana from 1905/08.
4974 Syntactically, ligatures are simply enclosed by @code{\[} and
4975 @code{\]}. Some ligature styles (such as Editio Vaticana) may need
4976 additional input syntax specific for this particular type of ligature.
4977 By default, the @internalsref{LigatureBracket} engraver just puts a
4978 square bracket above the ligature:
4980 @lilypond[singleline,verbatim]
4982 \notes \transpose c c' {
4990 To select a specific style of ligatures, a proper ligature engraver
4991 has to be added to the @internalsref{Voice} context, as explained in
4992 the following subsections. Currently, only white mensural ligatures
4993 are supported with certain limitations. Support for Editio Vaticana
4994 will be added in the future.
4997 * White mensural ligatures::
4998 * Gregorian square neumes ligatures::
5001 @node White mensural ligatures
5002 @subsubsection White mensural ligatures
5004 @cindex Mensural ligatures
5005 @cindex White mensural ligatures
5007 There is limited support for white mensural ligatures. The
5008 implementation is still experimental; it currently may output strange
5009 warnings or even crash in some cases or produce weird results on more
5010 complex ligatures. To engrave white mensural ligatures, in the paper
5011 block the @internalsref{Mensural_ligature_engraver} has to be put into
5012 the @internalsref{Voice} context, and remove the
5013 @internalsref{Ligature_bracket_engraver}:
5019 \remove Ligature_bracket_engraver
5020 \consists Mensural_ligature_engraver
5025 There is no additional input language to describe the shape of a
5026 white mensural ligature. The shape is rather determined solely from
5027 the pitch and duration of the enclosed notes. While this approach may
5028 take a new user a while to get accustomed, it has the great advantage
5029 that the full musical information of the ligature is known internally.
5030 This is not only required for correct MIDI output, but also allows for
5031 automatic transcription of the ligatures.
5036 \property Score.timing = ##f
5037 \property Score.defaultBarType = "empty"
5038 \property Voice.NoteHead \set #'style = #'neo_mensural
5039 \property Staff.TimeSignature \set #'style = #'neo_mensural
5041 \[ g\longa c\breve a\breve f\breve d'\longa \]
5043 \[ e1 f1 a\breve g\longa \]
5045 @lilypond[singleline]
5047 \notes \transpose c c' {
5048 \property Score.timing = ##f
5049 \property Score.defaultBarType = "empty"
5050 \property Voice.NoteHead \set #'style = #'neo_mensural
5051 \property Staff.TimeSignature \set #'style = #'neo_mensural
5053 \[ g\longa c\breve a\breve f\breve d'\longa \]
5055 \[ e1 f1 a\breve g\longa \]
5060 \remove Ligature_bracket_engraver
5061 \consists Mensural_ligature_engraver
5067 Without replacing @internalsref{Ligature_bracket_engraver} with
5068 @internalsref{Mensural_ligature_engraver}, the same music transcribes
5071 @lilypond[singleline]
5073 \notes \transpose c c' {
5074 \property Score.timing = ##f
5075 \property Score.defaultBarType = "empty"
5076 \property Voice.NoteHead \set #'style = #'neo_mensural
5077 \property Staff.TimeSignature \set #'style = #'neo_mensural
5079 \[ g\longa c\breve a\breve f\breve d'\longa \]
5081 \[ e1 f1 a\breve g\longa \]
5086 @node Gregorian square neumes ligatures
5087 @subsubsection Gregorian square neumes ligatures
5089 @cindex Square neumes ligatures
5090 @cindex Gregorian square neumes ligatures
5092 Gregorian square neumes notation (following the style of the Editio
5093 Vaticana) is under heavy development, but not yet really usable for
5094 production purposes. Core ligatures can already be typeset, but
5095 essential issues for serious typesetting are still under development,
5096 such as (among others) horizontal alignment of multiple ligatures,
5097 lyrics alignment and proper accidentals handling. Still, this section
5098 gives a sneak preview of what Gregorian chant may look like once it
5101 The following table contains the extended neumes table of the 2nd
5102 volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published
5103 1983 by the monks of Solesmes.
5105 @multitable @columnfractions .4 .2 .2 .2
5108 @b{Neuma aut@*Neumarum Elementa} @tab
5109 @b{Figurae@*Rectae} @tab
5110 @b{Figurae@*Liquescentes Auctae} @tab
5111 @b{Figurae@*Liquescentes Deminutae}
5113 @c TODO: \paper block is identical in all of the below examples.
5114 @c Therefore, it should somehow be included rather than duplicated all
5117 @c why not make identifiers in ly/engraver-init.ly? --hwn
5119 @c Because it's just used to typeset plain notes without
5120 @c a staff for demonstration purposes rather than something
5121 @c special of Gregorian chant notation. --jr
5126 @lilypond[noindent, 26pt, nofragment, linewidth=1.5cm]
5127 \include "gregorian-init.ly"
5129 \notes \transpose c c' {
5132 \noBreak s^\markup {"a"} \noBreak
5134 % Punctum Inclinatum
5136 \noBreak s^\markup {"b"}
5142 \remove "Bar_number_engraver"
5146 \remove "Clef_engraver"
5147 \remove "Key_engraver"
5148 StaffSymbol \set #'transparent = ##t
5149 \remove "Time_signature_engraver"
5150 \remove "Bar_engraver"
5151 minimumVerticalExtent = ##f
5155 \remove Ligature_bracket_engraver
5156 \consists Vaticana_ligature_engraver
5157 NoteHead \set #'style = #'vaticana_punctum
5158 Stem \set #'transparent = ##t
5164 @lilypond[noindent, 26pt, nofragment, linewidth=2.5cm]
5165 \include "gregorian-init.ly"
5167 \notes \transpose c c' {
5168 % Punctum Auctum Ascendens
5169 \[ \auctum \ascendens b \]
5170 \noBreak s^\markup {"c"} \noBreak
5172 % Punctum Auctum Descendens
5173 \[ \auctum \descendens b \]
5174 \noBreak s^\markup {"d"} \noBreak
5176 % Punctum Inclinatum Auctum
5177 \[ \inclinatum \auctum b \]
5178 \noBreak s^\markup {"e"}
5184 \remove "Bar_number_engraver"
5188 \remove "Clef_engraver"
5189 \remove "Key_engraver"
5190 StaffSymbol \set #'transparent = ##t
5191 \remove "Time_signature_engraver"
5192 \remove "Bar_engraver"
5193 minimumVerticalExtent = ##f
5197 \remove Ligature_bracket_engraver
5198 \consists Vaticana_ligature_engraver
5199 NoteHead \set #'style = #'vaticana_punctum
5200 Stem \set #'transparent = ##t
5206 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5207 \include "gregorian-init.ly"
5209 \notes \transpose c c' {
5210 % Punctum Inclinatum Parvum
5211 \[ \inclinatum \deminutum b \]
5212 \noBreak s^\markup {"f"}
5218 \remove "Bar_number_engraver"
5222 \remove "Clef_engraver"
5223 \remove "Key_engraver"
5224 StaffSymbol \set #'transparent = ##t
5225 \remove "Time_signature_engraver"
5226 \remove "Bar_engraver"
5227 minimumVerticalExtent = ##f
5231 \remove Ligature_bracket_engraver
5232 \consists Vaticana_ligature_engraver
5233 NoteHead \set #'style = #'vaticana_punctum
5234 Stem \set #'transparent = ##t
5243 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5244 \include "gregorian-init.ly"
5246 \notes \transpose c c' {
5249 \noBreak s^\markup {"g"}
5255 \remove "Bar_number_engraver"
5259 \remove "Clef_engraver"
5260 \remove "Key_engraver"
5261 StaffSymbol \set #'transparent = ##t
5262 \remove "Time_signature_engraver"
5263 \remove "Bar_engraver"
5264 minimumVerticalExtent = ##f
5268 \remove Ligature_bracket_engraver
5269 \consists Vaticana_ligature_engraver
5270 NoteHead \set #'style = #'vaticana_punctum
5271 Stem \set #'transparent = ##t
5280 @code{3. Apostropha vel Stropha}
5282 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5283 \include "gregorian-init.ly"
5285 \notes \transpose c c' {
5288 \noBreak s^\markup {"h"}
5294 \remove "Bar_number_engraver"
5298 \remove "Clef_engraver"
5299 \remove "Key_engraver"
5300 StaffSymbol \set #'transparent = ##t
5301 \remove "Time_signature_engraver"
5302 \remove "Bar_engraver"
5303 minimumVerticalExtent = ##f
5307 \remove Ligature_bracket_engraver
5308 \consists Vaticana_ligature_engraver
5309 NoteHead \set #'style = #'vaticana_punctum
5310 Stem \set #'transparent = ##t
5316 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5317 \include "gregorian-init.ly"
5319 \notes \transpose c c' {
5321 \[ \stropha \auctum b \]
5322 \noBreak s^\markup {"i"}
5328 \remove "Bar_number_engraver"
5332 \remove "Clef_engraver"
5333 \remove "Key_engraver"
5334 StaffSymbol \set #'transparent = ##t
5335 \remove "Time_signature_engraver"
5336 \remove "Bar_engraver"
5337 minimumVerticalExtent = ##f
5341 \remove Ligature_bracket_engraver
5342 \consists Vaticana_ligature_engraver
5343 NoteHead \set #'style = #'vaticana_punctum
5344 Stem \set #'transparent = ##t
5354 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5355 \include "gregorian-init.ly"
5357 \notes \transpose c c' {
5360 \noBreak s^\markup {"j"}
5366 \remove "Bar_number_engraver"
5370 \remove "Clef_engraver"
5371 \remove "Key_engraver"
5372 StaffSymbol \set #'transparent = ##t
5373 \remove "Time_signature_engraver"
5374 \remove "Bar_engraver"
5375 minimumVerticalExtent = ##f
5379 \remove Ligature_bracket_engraver
5380 \consists Vaticana_ligature_engraver
5381 NoteHead \set #'style = #'vaticana_punctum
5382 Stem \set #'transparent = ##t
5391 @code{5. Clivis vel Flexa}
5393 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5394 \include "gregorian-init.ly"
5396 \notes \transpose c c' {
5405 \remove "Bar_number_engraver"
5409 \remove "Clef_engraver"
5410 \remove "Key_engraver"
5411 StaffSymbol \set #'transparent = ##t
5412 \remove "Time_signature_engraver"
5413 \remove "Bar_engraver"
5414 minimumVerticalExtent = ##f
5418 \remove Ligature_bracket_engraver
5419 \consists Vaticana_ligature_engraver
5420 NoteHead \set #'style = #'vaticana_punctum
5421 Stem \set #'transparent = ##t
5427 @lilypond[noindent, 26pt, nofragment, linewidth=2.0cm]
5428 \include "gregorian-init.ly"
5430 \notes \transpose c c' {
5431 % Clivis Aucta Descendens
5432 \[ b \flexa \auctum \descendens g \]
5433 \noBreak s^\markup {"l"} \noBreak
5435 % Clivis Aucta Ascendens
5436 \[ b \flexa \auctum \ascendens g \]
5437 \noBreak s^\markup {"m"}
5443 \remove "Bar_number_engraver"
5447 \remove "Clef_engraver"
5448 \remove "Key_engraver"
5449 StaffSymbol \set #'transparent = ##t
5450 \remove "Time_signature_engraver"
5451 \remove "Bar_engraver"
5452 minimumVerticalExtent = ##f
5456 \remove Ligature_bracket_engraver
5457 \consists Vaticana_ligature_engraver
5458 NoteHead \set #'style = #'vaticana_punctum
5459 Stem \set #'transparent = ##t
5465 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5466 \include "gregorian-init.ly"
5468 \notes \transpose c c' {
5470 \[ b \flexa \deminutum g \]
5477 \remove "Bar_number_engraver"
5481 \remove "Clef_engraver"
5482 \remove "Key_engraver"
5483 StaffSymbol \set #'transparent = ##t
5484 \remove "Time_signature_engraver"
5485 \remove "Bar_engraver"
5486 minimumVerticalExtent = ##f
5490 \remove Ligature_bracket_engraver
5491 \consists Vaticana_ligature_engraver
5492 NoteHead \set #'style = #'vaticana_punctum
5493 Stem \set #'transparent = ##t
5500 @code{6. Podatus vel Pes}
5502 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5503 \include "gregorian-init.ly"
5505 \notes \transpose c c' {
5514 \remove "Bar_number_engraver"
5518 \remove "Clef_engraver"
5519 \remove "Key_engraver"
5520 StaffSymbol \set #'transparent = ##t
5521 \remove "Time_signature_engraver"
5522 \remove "Bar_engraver"
5523 minimumVerticalExtent = ##f
5527 \remove Ligature_bracket_engraver
5528 \consists Vaticana_ligature_engraver
5529 NoteHead \set #'style = #'vaticana_punctum
5530 Stem \set #'transparent = ##t
5536 @lilypond[noindent, 26pt, nofragment, linewidth=2.0cm]
5537 \include "gregorian-init.ly"
5539 \notes \transpose c c' {
5540 % Pes Auctus Descendens
5541 \[ g \pes \auctum \descendens b \]
5542 \noBreak s^\markup {"p"} \noBreak
5544 % Pes Auctus Ascendens
5545 \[ g \pes \auctum \ascendens b \]
5546 \noBreak s^\markup {"q"}
5552 \remove "Bar_number_engraver"
5556 \remove "Clef_engraver"
5557 \remove "Key_engraver"
5558 StaffSymbol \set #'transparent = ##t
5559 \remove "Time_signature_engraver"
5560 \remove "Bar_engraver"
5561 minimumVerticalExtent = ##f
5565 \remove Ligature_bracket_engraver
5566 \consists Vaticana_ligature_engraver
5567 NoteHead \set #'style = #'vaticana_punctum
5568 Stem \set #'transparent = ##t
5574 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5575 \include "gregorian-init.ly"
5577 \notes \transpose c c' {
5579 \[ g \pes \deminutum b \]
5586 \remove "Bar_number_engraver"
5590 \remove "Clef_engraver"
5591 \remove "Key_engraver"
5592 StaffSymbol \set #'transparent = ##t
5593 \remove "Time_signature_engraver"
5594 \remove "Bar_engraver"
5595 minimumVerticalExtent = ##f
5599 \remove Ligature_bracket_engraver
5600 \consists Vaticana_ligature_engraver
5601 NoteHead \set #'style = #'vaticana_punctum
5602 Stem \set #'transparent = ##t
5609 @code{7. Pes Quassus}
5611 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5612 \include "gregorian-init.ly"
5614 \notes \transpose c c' {
5616 \[ \oriscus g \pes \virga b \]
5623 \remove "Bar_number_engraver"
5627 \remove "Clef_engraver"
5628 \remove "Key_engraver"
5629 StaffSymbol \set #'transparent = ##t
5630 \remove "Time_signature_engraver"
5631 \remove "Bar_engraver"
5632 minimumVerticalExtent = ##f
5636 \remove Ligature_bracket_engraver
5637 \consists Vaticana_ligature_engraver
5638 NoteHead \set #'style = #'vaticana_punctum
5639 Stem \set #'transparent = ##t
5645 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5646 \include "gregorian-init.ly"
5648 \notes \transpose c c' {
5649 % Pes Quassus Auctus Descendens
5650 \[ \oriscus g \pes \auctum \descendens b \]
5657 \remove "Bar_number_engraver"
5661 \remove "Clef_engraver"
5662 \remove "Key_engraver"
5663 StaffSymbol \set #'transparent = ##t
5664 \remove "Time_signature_engraver"
5665 \remove "Bar_engraver"
5666 minimumVerticalExtent = ##f
5670 \remove Ligature_bracket_engraver
5671 \consists Vaticana_ligature_engraver
5672 NoteHead \set #'style = #'vaticana_punctum
5673 Stem \set #'transparent = ##t
5681 @code{8. Quilisma Pes}
5683 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5684 \include "gregorian-init.ly"
5686 \notes \transpose c c' {
5688 \[ \quilisma g \pes b \]
5695 \remove "Bar_number_engraver"
5699 \remove "Clef_engraver"
5700 \remove "Key_engraver"
5701 StaffSymbol \set #'transparent = ##t
5702 \remove "Time_signature_engraver"
5703 \remove "Bar_engraver"
5704 minimumVerticalExtent = ##f
5708 \remove Ligature_bracket_engraver
5709 \consists Vaticana_ligature_engraver
5710 NoteHead \set #'style = #'vaticana_punctum
5711 Stem \set #'transparent = ##t
5717 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5718 \include "gregorian-init.ly"
5720 \notes \transpose c c' {
5721 % Quilisma Pes Auctus Descendens
5722 \[ \quilisma g \pes \auctum \descendens b \]
5729 \remove "Bar_number_engraver"
5733 \remove "Clef_engraver"
5734 \remove "Key_engraver"
5735 StaffSymbol \set #'transparent = ##t
5736 \remove "Time_signature_engraver"
5737 \remove "Bar_engraver"
5738 minimumVerticalExtent = ##f
5742 \remove Ligature_bracket_engraver
5743 \consists Vaticana_ligature_engraver
5744 NoteHead \set #'style = #'vaticana_punctum
5745 Stem \set #'transparent = ##t
5753 @code{9. Podatus Initio Debilis}
5755 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5756 \include "gregorian-init.ly"
5758 \notes \transpose c c' {
5759 % Pes Initio Debilis
5760 \[ \deminutum g \pes b \]
5767 \remove "Bar_number_engraver"
5771 \remove "Clef_engraver"
5772 \remove "Key_engraver"
5773 StaffSymbol \set #'transparent = ##t
5774 \remove "Time_signature_engraver"
5775 \remove "Bar_engraver"
5776 minimumVerticalExtent = ##f
5780 \remove Ligature_bracket_engraver
5781 \consists Vaticana_ligature_engraver
5782 NoteHead \set #'style = #'vaticana_punctum
5783 Stem \set #'transparent = ##t
5789 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5790 \include "gregorian-init.ly"
5792 \notes \transpose c c' {
5793 % Pes Auctus Descendens Initio Debilis
5794 \[ \deminutum g \pes \auctum \descendens b \]
5801 \remove "Bar_number_engraver"
5805 \remove "Clef_engraver"
5806 \remove "Key_engraver"
5807 StaffSymbol \set #'transparent = ##t
5808 \remove "Time_signature_engraver"
5809 \remove "Bar_engraver"
5810 minimumVerticalExtent = ##f
5814 \remove Ligature_bracket_engraver
5815 \consists Vaticana_ligature_engraver
5816 NoteHead \set #'style = #'vaticana_punctum
5817 Stem \set #'transparent = ##t
5827 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5828 \include "gregorian-init.ly"
5830 \notes \transpose c c' {
5832 \[ a \pes b \flexa g \]
5839 \remove "Bar_number_engraver"
5843 \remove "Clef_engraver"
5844 \remove "Key_engraver"
5845 StaffSymbol \set #'transparent = ##t
5846 \remove "Time_signature_engraver"
5847 \remove "Bar_engraver"
5848 minimumVerticalExtent = ##f
5852 \remove Ligature_bracket_engraver
5853 \consists Vaticana_ligature_engraver
5854 NoteHead \set #'style = #'vaticana_punctum
5855 Stem \set #'transparent = ##t
5861 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5862 \include "gregorian-init.ly"
5864 \notes \transpose c c' {
5865 % Torculus Auctus Descendens
5866 \[ a \pes b \flexa \auctum \descendens g \]
5873 \remove "Bar_number_engraver"
5877 \remove "Clef_engraver"
5878 \remove "Key_engraver"
5879 StaffSymbol \set #'transparent = ##t
5880 \remove "Time_signature_engraver"
5881 \remove "Bar_engraver"
5882 minimumVerticalExtent = ##f
5886 \remove Ligature_bracket_engraver
5887 \consists Vaticana_ligature_engraver
5888 NoteHead \set #'style = #'vaticana_punctum
5889 Stem \set #'transparent = ##t
5895 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5896 \include "gregorian-init.ly"
5898 \notes \transpose c c' {
5899 % Torculus Deminutus
5900 \[ a \pes b \flexa \deminutum g \]
5907 \remove "Bar_number_engraver"
5911 \remove "Clef_engraver"
5912 \remove "Key_engraver"
5913 StaffSymbol \set #'transparent = ##t
5914 \remove "Time_signature_engraver"
5915 \remove "Bar_engraver"
5916 minimumVerticalExtent = ##f
5920 \remove Ligature_bracket_engraver
5921 \consists Vaticana_ligature_engraver
5922 NoteHead \set #'style = #'vaticana_punctum
5923 Stem \set #'transparent = ##t
5930 @code{11. Torculus Initio Debilis}
5932 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5933 \include "gregorian-init.ly"
5935 \notes \transpose c c' {
5936 % Torculus Initio Debilis
5937 \[ \deminutum a \pes b \flexa g \]
5944 \remove "Bar_number_engraver"
5948 \remove "Clef_engraver"
5949 \remove "Key_engraver"
5950 StaffSymbol \set #'transparent = ##t
5951 \remove "Time_signature_engraver"
5952 \remove "Bar_engraver"
5953 minimumVerticalExtent = ##f
5957 \remove Ligature_bracket_engraver
5958 \consists Vaticana_ligature_engraver
5959 NoteHead \set #'style = #'vaticana_punctum
5960 Stem \set #'transparent = ##t
5966 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5967 \include "gregorian-init.ly"
5969 \notes \transpose c c' {
5970 % Torculus Auctus Descendens Initio Debilis
5971 \[ \deminutum a \pes b \flexa \auctum \descendens g \]
5978 \remove "Bar_number_engraver"
5982 \remove "Clef_engraver"
5983 \remove "Key_engraver"
5984 StaffSymbol \set #'transparent = ##t
5985 \remove "Time_signature_engraver"
5986 \remove "Bar_engraver"
5987 minimumVerticalExtent = ##f
5991 \remove Ligature_bracket_engraver
5992 \consists Vaticana_ligature_engraver
5993 NoteHead \set #'style = #'vaticana_punctum
5994 Stem \set #'transparent = ##t
6000 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6001 \include "gregorian-init.ly"
6003 \notes \transpose c c' {
6004 % Torculus Deminutus Initio Debilis
6005 \[ \deminutum a \pes b \flexa \deminutum g \]
6012 \remove "Bar_number_engraver"
6016 \remove "Clef_engraver"
6017 \remove "Key_engraver"
6018 StaffSymbol \set #'transparent = ##t
6019 \remove "Time_signature_engraver"
6020 \remove "Bar_engraver"
6021 minimumVerticalExtent = ##f
6025 \remove Ligature_bracket_engraver
6026 \consists Vaticana_ligature_engraver
6027 NoteHead \set #'style = #'vaticana_punctum
6028 Stem \set #'transparent = ##t
6035 @code{12. Porrectus}
6037 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6038 \include "gregorian-init.ly"
6040 \notes \transpose c c' {
6042 \[ a \flexa g \pes b \]
6049 \remove "Bar_number_engraver"
6053 \remove "Clef_engraver"
6054 \remove "Key_engraver"
6055 StaffSymbol \set #'transparent = ##t
6056 \remove "Time_signature_engraver"
6057 \remove "Bar_engraver"
6058 minimumVerticalExtent = ##f
6062 \remove Ligature_bracket_engraver
6063 \consists Vaticana_ligature_engraver
6064 NoteHead \set #'style = #'vaticana_punctum
6065 Stem \set #'transparent = ##t
6071 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6072 \include "gregorian-init.ly"
6074 \notes \transpose c c' {
6075 % Porrectus Auctus Descendens
6076 \[ a \flexa g \pes \auctum \descendens b \]
6083 \remove "Bar_number_engraver"
6087 \remove "Clef_engraver"
6088 \remove "Key_engraver"
6089 StaffSymbol \set #'transparent = ##t
6090 \remove "Time_signature_engraver"
6091 \remove "Bar_engraver"
6092 minimumVerticalExtent = ##f
6096 \remove Ligature_bracket_engraver
6097 \consists Vaticana_ligature_engraver
6098 NoteHead \set #'style = #'vaticana_punctum
6099 Stem \set #'transparent = ##t
6105 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6106 \include "gregorian-init.ly"
6108 \notes \transpose c c' {
6109 % Porrectus Deminutus
6110 \[ a \flexa g \pes \deminutum b \]
6117 \remove "Bar_number_engraver"
6121 \remove "Clef_engraver"
6122 \remove "Key_engraver"
6123 StaffSymbol \set #'transparent = ##t
6124 \remove "Time_signature_engraver"
6125 \remove "Bar_engraver"
6126 minimumVerticalExtent = ##f
6130 \remove Ligature_bracket_engraver
6131 \consists Vaticana_ligature_engraver
6132 NoteHead \set #'style = #'vaticana_punctum
6133 Stem \set #'transparent = ##t
6142 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6143 \include "gregorian-init.ly"
6145 \notes \transpose c c' {
6147 \[ \virga b \inclinatum a \inclinatum g \]
6154 \remove "Bar_number_engraver"
6158 \remove "Clef_engraver"
6159 \remove "Key_engraver"
6160 StaffSymbol \set #'transparent = ##t
6161 \remove "Time_signature_engraver"
6162 \remove "Bar_engraver"
6163 minimumVerticalExtent = ##f
6167 \remove Ligature_bracket_engraver
6168 \consists Vaticana_ligature_engraver
6169 NoteHead \set #'style = #'vaticana_punctum
6170 Stem \set #'transparent = ##t
6176 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6177 \include "gregorian-init.ly"
6179 \notes \transpose c c' {
6181 \[ \virga b \inclinatum a \inclinatum \auctum g \]
6188 \remove "Bar_number_engraver"
6192 \remove "Clef_engraver"
6193 \remove "Key_engraver"
6194 StaffSymbol \set #'transparent = ##t
6195 \remove "Time_signature_engraver"
6196 \remove "Bar_engraver"
6197 minimumVerticalExtent = ##f
6201 \remove Ligature_bracket_engraver
6202 \consists Vaticana_ligature_engraver
6203 NoteHead \set #'style = #'vaticana_punctum
6204 Stem \set #'transparent = ##t
6210 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6211 \include "gregorian-init.ly"
6213 \notes \transpose c c' {
6214 % Climacus Deminutus
6215 \[ \virga b \inclinatum a \inclinatum \deminutum g \]
6222 \remove "Bar_number_engraver"
6226 \remove "Clef_engraver"
6227 \remove "Key_engraver"
6228 StaffSymbol \set #'transparent = ##t
6229 \remove "Time_signature_engraver"
6230 \remove "Bar_engraver"
6231 minimumVerticalExtent = ##f
6235 \remove Ligature_bracket_engraver
6236 \consists Vaticana_ligature_engraver
6237 NoteHead \set #'style = #'vaticana_punctum
6238 Stem \set #'transparent = ##t
6245 @code{14. Scandicus}
6247 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6248 \include "gregorian-init.ly"
6250 \notes \transpose c c' {
6252 \[ g \pes a \virga b \]
6259 \remove "Bar_number_engraver"
6263 \remove "Clef_engraver"
6264 \remove "Key_engraver"
6265 StaffSymbol \set #'transparent = ##t
6266 \remove "Time_signature_engraver"
6267 \remove "Bar_engraver"
6268 minimumVerticalExtent = ##f
6272 \remove Ligature_bracket_engraver
6273 \consists Vaticana_ligature_engraver
6274 NoteHead \set #'style = #'vaticana_punctum
6275 Stem \set #'transparent = ##t
6281 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6282 \include "gregorian-init.ly"
6284 \notes \transpose c c' {
6285 % Scandicus Auctus Descendens
6286 \[ g \pes a \pes \auctum \descendens b \]
6293 \remove "Bar_number_engraver"
6297 \remove "Clef_engraver"
6298 \remove "Key_engraver"
6299 StaffSymbol \set #'transparent = ##t
6300 \remove "Time_signature_engraver"
6301 \remove "Bar_engraver"
6302 minimumVerticalExtent = ##f
6306 \remove Ligature_bracket_engraver
6307 \consists Vaticana_ligature_engraver
6308 NoteHead \set #'style = #'vaticana_punctum
6309 Stem \set #'transparent = ##t
6315 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6316 \include "gregorian-init.ly"
6318 \notes \transpose c c' {
6319 % Scandicus Deminutus
6320 \[ g \pes a \pes \deminutum b \]
6327 \remove "Bar_number_engraver"
6331 \remove "Clef_engraver"
6332 \remove "Key_engraver"
6333 StaffSymbol \set #'transparent = ##t
6334 \remove "Time_signature_engraver"
6335 \remove "Bar_engraver"
6336 minimumVerticalExtent = ##f
6340 \remove Ligature_bracket_engraver
6341 \consists Vaticana_ligature_engraver
6342 NoteHead \set #'style = #'vaticana_punctum
6343 Stem \set #'transparent = ##t
6352 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6353 \include "gregorian-init.ly"
6355 \notes \transpose c c' {
6357 \[ g \oriscus a \pes \virga b \]
6364 \remove "Bar_number_engraver"
6368 \remove "Clef_engraver"
6369 \remove "Key_engraver"
6370 StaffSymbol \set #'transparent = ##t
6371 \remove "Time_signature_engraver"
6372 \remove "Bar_engraver"
6373 minimumVerticalExtent = ##f
6377 \remove Ligature_bracket_engraver
6378 \consists Vaticana_ligature_engraver
6379 NoteHead \set #'style = #'vaticana_punctum
6380 Stem \set #'transparent = ##t
6386 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6387 \include "gregorian-init.ly"
6389 \notes \transpose c c' {
6390 % Salicus Auctus Descendens
6391 \[ g \oriscus a \pes \auctum \descendens b \]
6398 \remove "Bar_number_engraver"
6402 \remove "Clef_engraver"
6403 \remove "Key_engraver"
6404 StaffSymbol \set #'transparent = ##t
6405 \remove "Time_signature_engraver"
6406 \remove "Bar_engraver"
6407 minimumVerticalExtent = ##f
6411 \remove Ligature_bracket_engraver
6412 \consists Vaticana_ligature_engraver
6413 NoteHead \set #'style = #'vaticana_punctum
6414 Stem \set #'transparent = ##t
6424 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6425 \include "gregorian-init.ly"
6427 \notes \transpose c c' {
6429 \[ \stropha b \stropha b \stropha a \]
6436 \remove "Bar_number_engraver"
6440 \remove "Clef_engraver"
6441 \remove "Key_engraver"
6442 StaffSymbol \set #'transparent = ##t
6443 \remove "Time_signature_engraver"
6444 \remove "Bar_engraver"
6445 minimumVerticalExtent = ##f
6449 \remove Ligature_bracket_engraver
6450 \consists Vaticana_ligature_engraver
6451 NoteHead \set #'style = #'vaticana_punctum
6452 Stem \set #'transparent = ##t
6463 Unlike most other neumes notation systems, the input language for
6464 neumes does not necessarily reflect directly the typographical
6465 appearance, but is designed to solely focuse on musical meaning. For
6466 example, @code{\[ a \pes b \flexa g \]} produces a Torculus consisting
6467 of three Punctum heads, while @code{\[ a \flexa g \pes b \]} produces
6468 a Porrectus with a curved flexa shape and only a single Punctum head.
6469 There is no command to explicitly typeset the curved flexa shape; the
6470 decision of when to typeset a curved flexa shape is purely taken from
6471 the musical input. The idea of this approach is to separate the
6472 musical aspects of the input from the notation style of the output.
6473 This way, the same input can be reused to typeset the same music in a
6474 different style of Gregorian chant notation such as Hufnagel (also
6475 known as German gothic neumes) or Medicaea (kind of a very simple
6476 forerunner of the Editio Vaticana). As soon as Hufnagel ligature
6477 engraver and Medicaea ligature engraver will have been implemented, it
6478 will be as simple as replacing the ligature engraver in the
6479 @internalsref{Voice} context to get the desired notation style from
6482 The following table shows the code fragments that produce the
6483 ligatures in the above neumes table. The letter in the first column
6484 in each line of the below table indicates to which ligature in the
6485 above table it refers. The second column gives the name of the
6486 ligature. The third column shows the code fragment that produces this
6487 ligature, using @code{g}, @code{a} and @code{b} as example pitches.
6489 @multitable @columnfractions .1 .4 .5
6503 Punctum Inclinatum @tab
6504 @code{\[ \inclinatum b \]}
6508 Punctum Auctum Ascendens @tab
6509 @code{\[ \auctum \ascendens b \]}
6513 Punctum Auctum Descendens @tab
6514 @code{\[ \auctum \descendens b \]}
6518 Punctum Inclinatum Auctum @tab
6519 @code{\[ \inclinatum \auctum b \]}
6523 Punctum Inclinatum Parvum @tab
6524 @code{\[ \inclinatum \deminutum b \]}
6529 @code{\[ \virga b \]}
6534 @code{\[ \stropha b \]}
6539 @code{\[ \stropha \auctum b \]}
6544 @code{\[ \oriscus b \]}
6548 Clivis vel Flexa @tab
6549 @code{\[ b \flexa g \]}
6553 Clivis Aucta Descendens @tab
6554 @code{\[ b \flexa \auctum \descendens g \]}
6558 Clivis Aucta Ascendens @tab
6559 @code{\[ b \flexa \auctum \ascendens g \]}
6564 @code{\[ b \flexa \deminutum g \]}
6568 Podatus vel Pes @tab
6569 @code{\[ g \pes b \]}
6573 Pes Auctus Descendens @tab
6574 @code{\[ g \pes \auctum \descendens b \]}
6578 Pes Auctus Ascendens @tab
6579 @code{\[ g \pes \auctum \ascendens b \]}
6584 @code{\[ g \pes \deminutum b \]}
6589 @code{\[ \oriscus g \pes \virga b \]}
6593 Pes Quassus Auctus Descendens @tab
6594 @code{\[ \oriscus g \pes \auctum \descendens b \]}
6599 @code{\[ \quilisma g \pes b \]}
6603 Quilisma Pes Auctus Descendens @tab
6604 @code{\[ \quilisma g \pes \auctum \descendens b \]}
6608 Pes Initio Debilis @tab
6609 @code{\[ \deminutum g \pes b \]}
6613 Pes Auctus Descendens Initio Debilis @tab
6614 @code{\[ \deminutum g \pes \auctum \descendens b \]}
6619 @code{\[ a \pes b \flexa g \]}
6623 Torculus Auctus Descendens @tab
6624 @code{\[ a \pes b \flexa \auctum \descendens g \]}
6628 Torculus Deminutus @tab
6629 @code{\[ a \pes b \flexa \deminutum g \]}
6633 Torculus Initio Debilis @tab
6634 @code{\[ \deminutum a \pes b \flexa g \]}
6638 Torculus Auctus Descendens Initio Debilis @tab
6639 @code{\[ \deminutum a \pes b \flexa \auctum \descendens g \]}
6643 Torculus Deminutus Initio Debilis @tab
6644 @code{\[ \deminutum a \pes b \flexa \deminutum g \]}
6649 @code{\[ a \flexa g \pes b \]}
6653 Porrectus Auctus Descendens @tab
6654 @code{\[ a \flexa g \pes \auctum \descendens b \]}
6658 Porrectus Deminutus @tab
6659 @code{\[ a \flexa g \pes \deminutum b \]}
6664 @code{\[ \virga b \inclinatum a \inclinatum g \]}
6668 Climacus Auctus @tab
6669 @code{\[ \virga b \inclinatum a \inclinatum \auctum g \]}
6673 Climacus Deminutus @tab
6674 @code{\[ \virga b \inclinatum a \inclinatum \deminutum g \]}
6679 @code{\[ g \pes a \virga b \]}
6683 Scandicus Auctus Descendens @tab
6684 @code{\[ g \pes a \pes \auctum \descendens b \]}
6688 Scandicus Deminutus @tab
6689 @code{\[ g \pes a \pes \deminutum b \]}
6694 @code{\[ g \oriscus a \pes \virga b \]}
6698 Salicus Auctus Descendens @tab
6699 @code{\[ g \oriscus a \pes \auctum \descendens b \]}
6704 @code{\[ \stropha b \stropha b \stropha a \]}
6710 Scandicus Deminutus: Punctum Auctum Ascendens overlaps with
6711 Semivocalis head; this looks awful.
6713 Trigonus: apply equal spacing, regardless of pitch.
6716 @subsection Figured bass
6718 @cindex Basso continuo
6720 @c TODO: musicological blurb about FB
6724 LilyPond has limited support for figured bass:
6726 @lilypond[verbatim,fragment]
6728 \context Voice \notes { \clef bass dis4 c d ais}
6729 \context FiguredBass
6731 < 6 >4 < 7 >8 < 6+ [_!] >
6737 The support for figured bass consists of two parts: there is an input
6738 mode, introduced by @code{\figures}, where you can enter bass figures
6739 as numbers, and there is a context called @internalsref{FiguredBass} that
6740 takes care of making @internalsref{BassFigure} objects.
6742 In figures input mode, a group of bass figures is delimited by
6743 @code{<} and @code{>}. The duration is entered after the @code{>}:
6748 \context FiguredBass
6752 Accidentals are added when you append @code{-}, @code{!} and @code{+}
6759 \context FiguredBass
6760 \figures { <4- 6+ 7!> }
6763 Spaces or dashes may be inserted by using @code{_}. Brackets are
6764 introduced with @code{[} and @code{]}:
6770 \context FiguredBass
6771 \figures { < [4 6] 8 [_! 12]> }
6774 Although the support for figured bass may superficially resemble chord
6775 support, it works much simpler. The @code{\figures} mode simply
6776 stores the numbers , and @internalsref{FiguredBass} context prints
6777 them as entered. There is no conversion to pitches, and no
6778 realizations of the bass are played in the MIDI file.
6780 Internally, the code produces markup texts. You can use any of the
6781 markup text properties to override formatting. For example, the
6782 vertical spacing of the figures may be set with @code{baseline-skip}.
6786 @internalsref{BassFigureEvent} music, @internalsref{BassFigure} object,
6787 and @internalsref{FiguredBass} context.
6791 Slash notation for alterations is not supported.
6794 @node Contemporary notation
6795 @section Contemporary notation
6797 In the 20th century, composers have greatly expanded the musical
6798 vocabulary. With this expansion, many innovations in musical notation
6799 have been tried. For a comprehensive overview, refer to @cite{Stone
6800 1980} (see @ref{Literature}). In general, the use of new, innovative
6801 notation makes a piece harder to understand and perform and its use
6802 should therefore be avoided if possible. For this reason, support for
6803 contemporary notation in LilyPond is limited.
6812 @subsection Clusters
6816 In musical terminology, a @emph{cluster} denotes a range of
6817 simultaneously sounding pitches that may change over time. The set of
6818 available pitches to apply usually depends on the accoustic source.
6819 Thus, in piano music, a cluster typically consists of a continous range
6820 of the semitones as provided by the piano's fixed set of a chromatic
6821 scale. In choral music, each singer of the choir typically may sing an
6822 arbitrary pitch within the cluster's range that is not bound to any
6823 diatonic, chromatic or other scale. In electronic music, a cluster
6824 (theoretically) may even cover a continuous range of pitches, thus
6825 resulting in coloured noise, such as pink noise.
6827 Clusters can be denoted in the context of ordinary staff notation by
6828 engraving simple geometrical shapes that replace ordinary notation of
6829 notes. Ordinary notes as musical events specify starting time and
6830 duration of pitches; however, the duration of a note is expressed by the
6831 shape of the note head rather than by the horizontal graphical extent of
6832 the note symbol. In contrast, the shape of a cluster geometrically
6833 describes the development of a range of pitches (vertical extent) over
6834 time (horizontal extent). Still, the geometrical shape of a cluster
6835 covers the area in wich any single pitch contained in the cluster would
6836 be notated as an ordinary note. From this point of view, it is
6837 reasonable to specify a cluster as the envelope of a set of notes.
6841 A cluster is engraved as the envelope of a set of
6842 cluster-notes. Cluster notes are created by applying the function
6843 @code{notes-to-clusters} to a sequence of chords, e.g.
6845 @lilypond[relative 1,verbatim]
6846 \apply #notes-to-clusters { <<c e >> <<b f'>> }
6849 The following example (from
6850 @inputfileref{input/regression,cluster.ly}) shows what the result
6853 @lilypondfile[notexidoc]{cluster.ly}
6855 By default, @internalsref{Cluster_engraver} is in the
6856 @internalsref{Voice} context. This allows putting ordinary notes and
6857 clusters together in the same staff, even simultaneously. In such a
6858 case no attempt is made to automatically avoid collisions between
6859 ordinary notes and clusters.
6863 @internalsref{ClusterSpanner}, @internalsref{ClusterSpannerBeacon},
6864 @inputfileref{input/regression,cluster.ly},
6865 @internalsref{Cluster_engraver}, and @internalsref{ClusterNoteEvent}.
6869 Music expressions like @code{< @{ g8 e8 @} a4 >} are not printed
6870 accurately. Use @code{<<g a>>8 <<e a>>8} instead.
6875 @subsection Fermatas
6881 Contemporary music notation frequently uses special fermata symbols to
6882 indicate fermatas of differing lengths.
6886 The following are supported
6888 @lilypond[singleline]
6890 < \addlyrics \notes {
6910 \context Lyrics \lyrics {
6911 "shortfermata" "fermata" "longfermata" "verylongfermata"
6916 See @ref{Articulations} for general instructions how to apply scripts
6917 such as fermatas to a @code{\notes@{@}} block.
6920 @section Tuning output
6922 There are situations where default layout decisions are not
6923 sufficient. In this section we discuss ways to override these
6926 Formatting is internally done by manipulating so called objects
6927 (graphic objects). Each object carries with it a set of properties
6928 (object or layout properties) specific to that object. For example, a
6929 stem object has properties that specify its direction, length and
6932 The most direct way of tuning the output is by altering the values of
6933 these properties. There are two ways of doing that: first, you can
6934 temporarily change the definition of one type of object, thus
6935 affecting a whole set of objects. Second, you can select one specific
6936 object, and set a layout property in that object.
6938 Do not confuse layout properties with translation
6939 properties. Translation properties always use a mixed caps style
6940 naming, and are manipulated using @code{\property}:
6942 \property Context.propertyName = @var{value}
6944 Layout properties are use Scheme style variable naming, i.e. lower
6945 case words separated with dashes. They are symbols, and should always
6946 be quoted using @code{#'}. For example, this could be an imaginary
6947 layout property name:
6949 #'layout-property-name
6954 * Constructing a tweak::
6963 @node Tuning objects
6964 @subsection Tuning objects
6966 @cindex object description
6968 The definition of an object is a list of default object
6969 properties. For example, the definition of the Stem object (available
6970 in @file{scm/define-grobs.scm}), includes the following definitions
6971 for @internalsref{Stem}:
6975 (beamed-lengths . (0.0 2.5 2.0 1.5))
6976 (Y-extent-callback . ,Stem::height)
6981 Adding variables on top of this existing definition overrides the
6982 system default, and alters the resulting appearance of the layout
6988 Changing a variable for only one object is commonly achieved with
6992 \once \property @var{context}.@var{objectname}
6993 \override @var{symbol} = @var{value}
6995 Here @var{symbol} is a Scheme expression of symbol type, @var{context}
6996 and @var{objectname} is a string and @var{value} is a Scheme expression.
6997 This command applies a setting only during one moment in the score.
6999 In the following example, only one @internalsref{Stem} object is
7000 changed from its original setting:
7002 @lilypond[verbatim, fragment, relative=1]
7004 \once \property Voice.Stem \set #'thickness = #4
7008 @cindex @code{\once}
7010 For changing more objects, the same command, without @code{\once} can
7013 \property @var{context}.@var{objectname} \override @var{symbol} = @var{value}
7015 This command adds @code{@var{symbol} = @var{value}} to the definition
7016 of @var{objectname} in the context @var{context}, and this definition
7017 stays in place until it is removed.
7019 An existing definition may be removed by the following command:
7022 \property @var{context}.@var{objectname} \revert @var{symbol}
7025 All @code{\override} and @code{\revert} commands should be balanced.
7026 The @code{\set} shorthand performs a revert followed by an override,
7027 and is often more convenient to use
7030 \property @var{context}.@var{objectname} \set @var{symbol} = @var{value}
7034 @lilypond[verbatim,quote]
7035 c'4 \property Voice.Stem \override #'thickness = #4.0
7037 c'4 \property Voice.Stem \revert #'thickness
7041 The following example gives exactly the same result as the previous
7042 one (assuming the system default for stem thickness is 1.3):
7044 @lilypond[verbatim,quote]
7045 c'4 \property Voice.Stem \set #'thickness = #4.0
7047 c'4 \property Voice.Stem \set #'thickness = #1.3
7051 Reverting a setting which was not set in the first place has no
7052 effect. However, if the setting was set as a system default, this may
7053 remove the default value, and this may give surprising results,
7054 including crashes. In other words, @code{\override} and
7055 @code{\revert} must be carefully balanced. The following are examples
7056 of correct nesting of @code{\override}, @code{\set}, @code{\revert}:
7060 a clumsy but correct form:
7062 \override \revert \override \revert \override \revert
7066 shorter version of the same:
7068 \override \set \set \revert
7072 a short form, using only @code{\set}. This requires you to know the
7075 \set \set \set \set @var{to default value}
7079 if there is no default (i.e. by default, the object property is unset),
7082 \set \set \set \revert
7086 For the digirati, the object description is an Scheme association
7087 list. Since a Scheme list is a singly linked list, we can treat it as
7088 a stack, and @code{\override} and @code{\revert} are push and pop
7089 operations. The association list is stored in a normal context
7092 \property Voice.NoteHead = #'()
7094 will effectively erase @internalsref{NoteHead}s from the current
7095 @internalsref{Voice}. However, this mechanism is not guaranteed to
7096 work, and may cause crashes or other anomalous behavior.
7100 @internalsref{OverrideProperty}, @internalsref{RevertProperty},
7101 @internalsref{PropertySet}, @internalsref{All-backend-properties}, and
7102 @internalsref{All-layout-objects}.
7107 The backend is not very strict in type-checking object properties.
7108 Cyclic references in @var{value} cause hangs and/or crashes.
7109 Similarly, reverting properties that are system defaults may also lead
7112 @node Constructing a tweak
7113 @subsection Constructing a tweak
7116 @cindex internal documentation
7117 @cindex finding graphical objects
7118 @cindex graphical object descriptions
7120 @cindex @code{\override}
7122 @cindex internal documentation
7126 Three pieces of information are required to use @code{\override} and
7127 @code{\set}: the name of the layout object, the context and the name
7128 of the property. We demonstrate how to glean this information from
7129 the notation manual and the generated documentation.
7131 The generated documentation is a set of HTML pages which should be
7132 included if you installed a binary distribution, typically in
7133 @file{/usr/share/doc/lilypond}. They are also available on the web:
7134 go to the @uref{http://lilypond.org,LilyPond website}, click
7135 ``Documentation'', and then ``Program reference'' on the side bar. It
7136 is advisable to bookmark either the local HTML files if possible. They
7137 will load faster than the ones on the web. If you use the version
7138 from the web, you must check whether the documentation matches the
7139 program version: the documentation is generated from the definitions
7140 that the program uses, and therefore it is strongly tied to the
7144 @c [TODO: revise for new site.]
7146 Suppose we want to move the fingering indication in the fragment below:
7148 @lilypond[relative=2,verbatim]
7154 If you visit the documentation of @code{Fingering} (in @ref{Fingering
7155 instructions}), you will notice that there is written:
7160 @internalsref{FingerEvent} and @internalsref{Fingering}.
7164 In other words, the fingerings once entered, are internally stored as
7165 @code{FingerEvent} music objects. When printed, a @code{Fingering}
7166 layout object is created for every @code{FingerEvent}.
7168 The Fingering object has a number of different functions, and each of
7169 those is captured in an interface, when we look up
7170 @internalsref{Fingering} in the generated documentation.
7174 The @code{Fingering} object has a fixed size
7175 (@internalsref{item-interface}), the symbol is a piece of text
7176 (@internalsref{text-interface}), whose font can be set
7177 (@internalsref{font-interface}). It is centered horizontally
7178 (@internalsref{self-alignment-interface}), it is placed next to other
7179 objects (@internalsref{side-position-interface}) vertically, and its
7180 placement is coordinated with other scripts
7181 (@internalsref{text-script-interface}). It also has the standard
7182 @internalsref{grob-interface} (grob stands for Graphical object)
7184 @cindex graphical object
7185 @cindex layout object
7186 @cindex object, layout
7187 with all the variables that come with
7188 it. Finally, it denotes a fingering instruction, so it has
7189 @internalsref{finger-interface}.
7191 For the vertical placement, we have to look under
7192 @code{side-position-interface}:
7194 @code{side-position-interface}
7196 Position a victim object (this one) next to other objects (the
7197 support). In this case, the direction signifies where to put the
7198 victim object relative to the support (left or right, up or down?)
7203 below this description, the variable @code{padding} is described as
7207 (dimension, in staff space)
7209 add this much extra space between objects that are next to each
7210 other. Default value: @code{0.6}
7214 By increasing the value of @code{padding}, we can move away the
7215 fingering. The following command inserts 3 staff spaces of white
7216 between the note and the fingering:
7218 \once \property Voice.Fingering \set #'padding = #3
7221 Inserting this command before the Fingering object is created,
7222 i.e. before @code{c2}, yields the following result:
7224 @lilypond[relative=2,fragment,verbatim]
7225 \once \property Voice.Fingering
7232 The context name @code{Voice} in the example above can be determined
7233 as follows. In the documentation for @internalsref{Fingering}, it says
7235 Fingering grobs are created by: @internalsref{Fingering_engraver}
7238 Clicking @code{Fingering_engraver} shows the documentation of
7239 the module responsible for interpreting the fingering instructions and
7240 translating them to a @code{Fingering} object. Such a module is called
7241 an @emph{engraver}. The documentation of the @code{Fingering_engraver}
7244 Fingering_engraver is part of contexts: Voice
7246 so tuning the settings for Fingering should be done with
7248 \property Voice.Fingering \set @dots{}
7251 Of course, the tweak may also done in a larger context than
7252 @code{Voice}, for example, @internalsref{Staff} or
7253 @internalsref{Score}.
7255 The internals document also contains alphabetical lists of
7256 @internalsref{Contexts}, @internalsref{All-layout-objects} and
7257 @internalsref{Music-expressions}, so you can also find which objects to
7258 tweak by browsing the internals document.
7262 @subsection Applyoutput
7264 The most versatile way of tuning an object is @code{\applyoutput}. Its
7267 \applyoutput @var{proc}
7271 where @var{proc} is a Scheme function, taking four arguments.
7273 When interpreted, the function @var{proc} is called for every layout object found
7274 in the context, with the following arguments:
7276 @item the layout object itself,
7277 @item the context where the layout object was created, and
7278 @item the context where @code{\applyoutput} is processed.
7281 In addition, the cause of the layout object, i.e. the music
7282 expression or object that was responsible for creating it, is in the
7283 object property @code{cause}. For example, for a note head, this is a
7284 @internalsref{NoteHead} event, and for a @internalsref{Stem} object,
7285 this is a @internalsref{NoteHead} object.
7288 @node Outputproperty
7289 @subsection Outputproperty
7291 @cindex @code{\outputproperty}
7293 Another way of tuning objects is the more arcane @code{\outputproperty}
7294 feature. The syntax is as follows:
7296 \outputproperty @var{predicate} @var{symbol} = @var{value}
7298 Here @code{predicate} is a Scheme function taking an object argument, and
7299 returning a boolean. This statement is processed by the
7300 @code{Output_property_engraver}. It instructs the engraver to feed all
7301 objects that it sees to @var{predicate}. Whenever the predicate returns
7302 true, the object property @var{symbol} will be set to @var{value}.
7304 You will need to combine this statement with @code{\context} to select
7305 the appropriate context to apply this to.
7306 @inputfileref{input/regression,output-property.ly} shows an example of
7307 the use of @code{\outputproperty}.
7311 This command is slated for removal. Please use the
7312 @code{\applyoutput} command, see @ref{Applyoutput}.
7315 @node Font selection
7316 @subsection Font selection
7318 The most common thing to change about the appearance of fonts is their
7319 size. The font size of any context can be easily changed by setting
7320 the @code{fontSize} property for that context. Its value is an
7321 integer: negative numbers make the font smaller, positive numbers
7322 larger. An example is given below:
7324 @lilypond[fragment,relative=1,verbatim,quote]
7325 c4 c4 \property Voice.fontSize = #-1
7328 This command will set @code{font-relative-size} (see below), and does
7329 not change the size of variable symbols, such as beams or slurs.
7332 One of the uses of @code{fontSize} is to get smaller symbol for cue
7333 notes. An elaborate example of those is in
7334 @inputfileref{input/test,cue-notes.ly}.
7336 @cindex magnification
7338 The size of the font may be scaled with the object property
7339 @code{font-magnification}. For example, @code{2.0} blows up all
7340 letters by a factor 2 in both directions.
7349 The font used for printing a object can be selected by setting
7350 @code{font-name}, e.g.
7352 \property Staff.TimeSignature
7353 \set #'font-name = #"cmr17"
7357 Any font can be used, as long as it is available to @TeX{}. Possible
7358 fonts include foreign fonts or fonts that do not belong to the
7359 Computer Modern font family.
7361 Font selection for the standard fonts, @TeX{}'s Computer Modern fonts,
7362 can also be adjusted with a more fine-grained mechanism. By setting
7363 the object properties described below, you can select a different font;
7364 all three mechanisms work for every object that supports
7365 @code{font-interface}:
7369 is a symbol indicating the general class of the typeface. Supported are
7370 @code{roman} (Computer Modern), @code{braces} (for piano staff
7371 braces), @code{music} (the standard music font, including ancient
7372 glyphs), @code{dynamic} (for dynamic signs) and @code{typewriter}.
7375 is a symbol indicating the shape of the font, there are typically several
7376 font shapes available for each font family. Choices are @code{italic},
7377 @code{caps} and @code{upright}.
7380 is a symbol indicating the series of the font. There are typically several
7381 font series for each font family and shape. Choices are @code{medium}
7384 @item font-relative-size
7385 is a number indicating the size relative the standard size. For example,
7386 with 20pt staff height, relative size -1 corresponds to 16pt staff
7387 height, and relative size +1 corresponds to 23 pt staff height.
7389 There are small differences in design between fonts designed for
7390 different sizes, hence @code{font-relative-size} is preferred over
7391 @code{font-magnification} for changing font sizes.
7394 @item font-design-size
7395 is a number indicating the design size of the font.
7397 This is a feature of the Computer Modern Font: each point size has a
7398 slightly different design. Smaller design sizes are relatively wider,
7399 which enhances readability.
7402 For any of these properties, the value @code{*} (i.e. the symbol
7403 @code{*}, entered as @code{#'*}), acts as a wildcard. This can be used
7404 to override default setting, which are always present. For example:
7406 \property Lyrics . LyricText \override #'font-series = #'bold
7407 \property Lyrics . LyricText \override #'font-family = #'typewriter
7408 \property Lyrics . LyricText \override #'font-shape = #'*
7411 @cindex @code{font-style}
7415 The following commands set @code{fontSize} for the current voice.
7417 @cindex @code{\tiny}
7419 @cindex @code{\small}
7421 @cindex @code{\normalsize}
7426 Relative size is not linked to any real size.
7428 There is no style sheet provided for other fonts besides the @TeX{}
7429 family, and the style sheet cannot be modified easily.
7431 @cindex font selection
7432 @cindex font magnification
7433 @cindex @code{font-interface}
7437 @subsection Text markup
7442 @cindex typeset text
7444 LilyPond has an internal mechanism to typeset texts. You can access it
7445 with the keyword @code{\markup}. Within markup mode, you can enter texts
7446 similar to lyrics: simply enter them, surrounded by spaces:
7449 @lilypond[verbatim,fragment,relative=1]
7450 c1^\markup { hello }
7451 c1_\markup { hi there }
7452 c1^\markup { hi \bold there, is \italic anyone home? }
7455 @cindex font switching
7457 The markup in the example demonstrates font switching commands. The
7458 command @code{\bold} and @code{\italic} only apply to the first
7459 following word; enclose a set of texts with braces to apply a command
7462 \markup @{ \bold @{ hi there @} @}
7466 For clarity, you can also do this for single arguments, e.g.
7468 \markup @{ is \italic @{ anyone @} home @}
7471 @cindex font size, texts
7473 The following size commands set absolute sizes:
7475 @cindex @code{\teeny}
7476 @cindex @code{\tiny}
7477 @cindex @code{\small}
7478 @cindex @code{\large}
7479 @cindex @code{\huge}
7489 You can also make letter larger or smaller relative to their neighbors,
7490 with the commands @code{\larger} and @code{\smaller}.
7494 @cindex font style, for texts
7495 @cindex @code{\bold}
7496 @cindex @code{\dynamic}
7497 @cindex @code{\number}
7498 @cindex @code{\italic}
7500 The following font change commands are defined:
7503 changes to the font used in dynamic signs. This font does not
7504 contain all characters of the alphabet, so when producing ``piu f'',
7505 the ``piu'' should be done in a different font.
7509 changes to the font used in time signatures. It only contains
7510 numbers and a few punctuation marks.
7512 changes @code{font-shape} to @code{italic}.
7514 changes @code{font-series} to @code{bold}.
7517 @cindex raising text
7518 @cindex lowering text
7520 @cindex translating text
7523 @cindex @code{\super}
7525 Raising and lowering texts can be done with @code{\super} and
7528 @lilypond[verbatim,fragment,relative=1]
7529 c1^\markup { E "=" mc \super "2" }
7532 @cindex @code{\raise}
7534 If you want to give an explicit amount for lowering or raising, use
7535 @code{\raise}. This command takes a Scheme valued first argument, and
7536 a markup object as second argument:
7538 @lilypond[verbatim,fragment,relative=1,quote]
7539 c1^\markup { C \small \raise #1.0 \bold { "9/7+" }}
7541 The argument to @code{\raise} is the vertical displacement amount,
7542 measured in (global) staff spaces. @code{\raise} and @code{\super}
7543 raise objects in relation to their surrounding markups. They cannot be
7544 used to move a single text up or down, when it is above or below a
7545 note, since the mechanism that positions it next to the note cancels
7546 any vertical shift. For vertical positioning, use the @code{padding}
7547 and/or @code{extra-offset} properties.
7549 Other commands taking single arguments include
7552 @item \bracket, \hbracket
7553 Bracket the argument markup with normal and horizontal brackets
7557 @cindex @code{\musicglyph}
7558 This is converted to a musical symbol, e.g. @code{\musicglyph
7559 #"accidentals-0"} will select the natural sign from the music font.
7560 See @ref{The Feta font} for a complete listing of the possible glyphs.
7562 This produces a single character, e.g. @code{\char #65} produces the
7565 @item \note @var{log} @var{dots} @var{dir}
7566 @cindex @code{\note}
7568 This produces a note with a stem pointing in @var{dir} direction, with
7569 duration log @var{log} and @var{dots} augmentation dots. The duration
7570 log is the negative 2-logarithm of the duration denominator. For
7571 example, a quarter note has log 2, an eighth note 3 and a breve has
7574 @item \hspace #@var{amount}
7575 @cindex @code{\hspace}
7576 This produces a invisible object taking horizontal space.
7578 \markup @{ A \hspace #2.0 B @}
7580 will put extra space between A and B, on top of the space that is
7581 normally inserted before elements on a line.
7583 @item \fontsize #@var{size}
7584 @cindex @code{\fontsize}
7585 This sets the relative font size, eg.
7587 A \fontsize #2 @{ B C @} D
7591 This will enlarge the B and the C by two steps.
7592 @item \translate #(cons @var{x} @var{y})
7594 This translates an object. Its first argument is a cons of numbers
7596 A \translate #(cons 2 -3) @{ B C @} D
7598 This moves `B C' 2 spaces to the right, and 3 down.
7600 @item \magnify #@var{mag}
7601 @cindex @code{\magnify}
7602 This sets the font magnification for the its argument. In the following
7603 example, the middle A will be 10% larger:
7605 A \magnify #1.1 @{ A @} A
7609 @item \override #(@var{key} . @var{value})
7610 @cindex @code{\override}
7611 This overrides a formatting property for its argument. The argument
7612 should be a key/value pair, e.g.
7614 m \override #'(font-family . math) m m
7618 In markup mode you can compose expressions, similar to mathematical
7619 expressions, XML documents and music expressions. The braces group
7620 notes into horizontal lines. Other types of lists also exist: you can
7621 stack expressions grouped with @code{<<}, and @code{>>} vertically with
7622 the command @code{\column}. Similarly, @code{\center} aligns texts by
7625 @lilypond[verbatim,fragment,relative=1]
7626 c1^\markup { \column << a bbbb c >> }
7627 c1^\markup { \center << a bbbb c >> }
7628 c1^\markup { \line << a b c >> }
7631 The markup mechanism is extensible. Refer to
7632 @file{scm/new-markup.scm} for more information.
7638 @internalsref{Markup-functions}, and @file{scm/new-markup.scm}.
7645 Text layout is ultimately done by @TeX{}, which does kerning of
7646 letters. LilyPond does not account for kerning, so texts will be
7647 spaced slightly too wide.
7649 Syntax errors for markup mode are confusing.
7655 @section Global layout
7657 The global layout determined by three factors: the page layout, the
7658 line breaks and the spacing. These all influence each other. The
7659 choice of spacing determines how densely each system of music is set,
7660 which influences where line breaks breaks are chosen, and thus
7661 ultimately how many pages a piece of music takes. In this section, the
7662 algorithm for spacing music is explained, and how spacing can be
7665 Globally spoken, this procedure happens in three steps: first,
7666 flexible distances (``springs'') are chosen, based on durations. All
7667 possible line breaking combination are tried, and the one with the
7668 best results---a layout that has uniform density and requires as
7669 little stretching or cramping as possible---is chosen. When the score
7670 is processed by @TeX{}, each page is filled with systems, and page breaks
7671 are chosen whenever the page gets full.
7676 * Vertical spacing::
7677 * Horizontal spacing::
7684 @node Vertical spacing
7685 @subsection Vertical spacing
7687 @cindex vertical spacing
7688 @cindex distance between staves
7689 @cindex staff distance
7690 @cindex between staves, distance
7691 @cindex staffs per page
7694 The height of each system is determined automatically by LilyPond, to
7695 keep systems from bumping into each other, some minimum distances are
7696 set. By changing these, you can put staves closer together, and thus
7697 put more systems onto one page.
7699 Normally staves are stacked vertically. To make
7700 staves maintain a distance, their vertical size is padded. This is
7701 done with the property @code{minimumVerticalExtent}. It takes a pair
7702 of numbers, so if you want to make it smaller from its, then you could
7705 \property Staff.minimumVerticalExtent = #'(-4 . 4)
7707 This sets the vertical size of the current staff to 4 staff-space on
7708 either side of the center staff line. The argument of
7709 @code{minimumVerticalExtent} is interpreted as an interval, where the
7710 center line is the 0, so the first number is generally negative. The
7711 staff can be made larger at the bottom by setting it to @code{(-6
7714 The piano staves are handled a little differently: to make cross-staff
7715 beaming work correctly, it is necessary that the distance between staves
7716 is fixed beforehand. This is also done with a
7717 @internalsref{VerticalAlignment} object, created in
7718 @internalsref{PianoStaff}. In this object the distance between the
7719 staves is fixed by setting @code{forced-distance}. If you want to
7720 override this, use a @code{\translator} block as follows:
7724 VerticalAlignment \override #'forced-distance = #9
7727 This would bring the staves together at a distance of 9 staff spaces,
7728 measured from the center line of each staff.
7732 Vertical alignment of staves is handled by the
7733 @internalsref{VerticalAlignment} object.
7737 @node Horizontal spacing
7738 @subsection Horizontal Spacing
7740 The spacing engine translates differences in durations into
7741 stretchable distances (``springs'') of differing lengths. Longer
7742 durations get more space, shorter durations get less. The shortest
7743 durations get a fixed amount of space (which is controlled by
7744 @code{shortest-duration-space} in the @internalsref{SpacingSpanner} object).
7745 /The longer the duration, the more space it gets: doubling a
7746 duration adds a fixed amount (this amount is controlled by
7747 @code{spacing-increment}) of space to the note.
7749 For example, the following piece contains lots of half, quarter and
7750 8th notes, the eighth note is followed by 1 note head width (NHW).
7751 The quarter note is followed by 2 NHW, the half by 3 NHW, etc.
7752 @lilypond[fragment, verbatim, relative=1] c2 c4. c8 c4. c8 c4. c8 c8
7756 Normally, @code{shortest-duration-space} is set to 1.2, which is the
7757 width of a note head, and @code{shortest-duration-space} is set to
7758 2.0, meaning that the shortest note gets 2 NHW (2 times
7759 @code{shortest-duration-space}) of space. For normal notes, this space
7760 is always counted from the left edge of the symbol, so the shortest
7761 notes are generally followed by one NHW of space.
7763 If one would follow the above procedure exactly, then adding a single
7764 32th note to a score that uses 8th and 16th notes, would widen up the
7765 entire score a lot. The shortest note is no longer a 16th, but a 32nd,
7766 thus adding 2 noteheads of space to every note. To prevent this, the
7767 shortest duration for spacing is not the shortest note in the score,
7768 but the most commonly found shortest note. Notes that are even
7769 shorter this are followed by a space that is proportonial to their
7770 duration relative to the common shortest note. So if we were to add
7771 only a few 16th notes to the example above, they would be followed by
7774 @lilypond[fragment, verbatim, relative=2]
7775 c2 c4. c8 c4. c16-[ c-] c4. c8 c8 c8 c4 c4 c4
7778 The most common shortest duration is determined as follows: in every
7779 measure, the shortest duration is determined. The most common short
7780 duration, is taken as the basis for the spacing, with the stipulation
7781 that this shortest duration should always be equal to or shorter than
7782 1/8th note. The shortest duration is printed when you run lilypond
7783 with @code{--verbose}. These durations may also be customized. If you
7784 set the @code{common-shortest-duration} in
7785 @internalsref{SpacingSpanner}, then this sets the base duration for
7786 spacing. The maximum duration for this base (normally 1/8th), is set
7787 through @code{base-shortest-duration}.
7789 @cindex @code{common-shortest-duration}
7790 @cindex @code{base-shortest-duration}
7791 @cindex @code{stem-spacing-correction}
7792 @cindex @code{spacing}
7794 In the introduction it was explained that stem directions influence
7795 spacing. This is controlled with @code{stem-spacing-correction}
7796 property in @internalsref{NoteSpacing}, which are generated for every
7797 @internalsref{Voice} context. The @code{StaffSpacing} object
7798 (generated at @internalsref{Staff} context) contains the same property
7799 for controlling the stem/barline spacing. The following example
7800 shows these corrections, once with default settings, and once with
7801 exaggerated corrections:
7807 \property Staff.NoteSpacing \override #'stem-spacing-correction
7809 \property Staff.StaffSpacing \override #'stem-spacing-correction
7814 \paper { raggedright = ##t } }
7817 @cindex SpacingSpanner, overriding properties
7819 Properties of the @internalsref{SpacingSpanner} must be overridden
7820 from the @code{\paper} block, since the @internalsref{SpacingSpanner} is
7821 created before any @code{\property} statements are interpreted.
7823 \paper @{ \translator @{
7825 SpacingSpanner \override #'spacing-increment = #3.0
7832 @internalsref{SpacingSpanner}, @internalsref{NoteSpacing},
7833 @internalsref{StaffSpacing}, @internalsref{SeparationItem}, and
7834 @internalsref{SeparatingGroupSpanner}.
7838 Spacing is determined on a score wide basis. If you have a score that
7839 changes its character (measured in durations) halfway during the
7840 score, the part containing the longer durations will be spaced too
7843 There is no convenient mechanism to manually override spacing.
7848 @subsection Font size
7849 @cindex font size, setting
7850 @cindex staff size, setting
7851 @cindex @code{paper} file
7853 The Feta font provides musical symbols at seven different sizes.
7854 These fonts are 11 point, 13 point, 16 point, 20 point, 23 point, and
7855 26 point. The point size of a font is the height of the corresponding
7856 staff (excluding line thicknesses).
7858 Definitions for these sizes are the files @file{paperSZ.ly}, where
7859 @code{SZ} is one of 11, 13, 16, 20, 23 and 26. If you include any
7860 of these files, the variables @code{paperEleven},
7861 @code{paperThirteen}, @code{paperSixteen},
7862 @code{paperTwenty}, @code{paperTwentythree}, and @code{paperTwentysix}
7863 are defined respectively. The default @code{\paper} block is also
7864 set. These files should be imported at toplevel, i.e.
7866 \include "paper26.ly"
7870 The default font size settings for each staff heights are generated
7871 from the 20pt style sheet. For more details, see the file
7872 @file{scm/font.scm}.
7876 @subsection Line breaking
7879 @cindex breaking lines
7881 Line breaks are normally computed automatically. They are chosen such
7882 that lines look neither cramped nor loose, and that consecutive lines
7883 have similar density.
7885 Occasionally you might want to override the automatic breaks; you can
7886 do this by specifying @code{\break}. This will force a line break at
7887 this point. Line breaks can only occur at places where there are bar
7888 lines. If you want to have a line break where there is no bar line,
7889 you can force an invisible bar line by entering @code{\bar
7890 ""}. Similarly, @code{\noBreak} forbids a line break at a
7894 @cindex regular line breaks
7895 @cindex four bar music.
7897 For linebreaks at regular intervals use @code{\break} separated by
7898 skips and repeated with @code{\repeat}:
7900 < \repeat unfold 7 @{ s1 * 4 \break @}
7901 @emph{the real music}
7906 This makes the following 28 measures (assuming 4/4 time) be broken every
7911 @internalsref{BreakEvent}.
7915 @subsection Page layout
7918 @cindex breaking pages
7920 @cindex @code{indent}
7921 @cindex @code{linewidth}
7923 The most basic settings influencing the spacing are @code{indent} and
7924 @code{linewidth}. They are set in the @code{\paper} block. They
7925 control the indentation of the first line of music, and the lengths of
7928 If @code{raggedright} is set to true in the @code{\paper}
7929 block, then the lines are justified at their natural length. This
7930 useful for short fragments, and for checking how tight the natural
7934 @cindex vertical spacing
7936 The page layout process happens outside the LilyPond formatting
7937 engine: variables controlling page layout are passed to the output,
7938 and are further interpreted by @code{ly2dvi}. @code{ly2dvi} responds
7939 to the following variables in the @code{\paper} block. The variable
7940 @code{textheight} sets the total height of the music on each page.
7941 The spacing between systems is controlled with @code{interscoreline},
7942 its default is 16pt. The distance between the score lines will
7943 stretch in order to fill the full page @code{interscorelinefill} is
7944 set to a positive number. In that case @code{interscoreline}
7945 specifies the minimum spacing.
7947 @cindex @code{textheight}
7948 @cindex @code{interscoreline}
7949 @cindex @code{interscorelinefill}
7951 If the variable @code{lastpagefill} is defined,
7952 @c fixme: this should only be done if lastpagefill == #t
7953 systems are evenly distributed vertically on the last page. This
7954 might produce ugly results in case there are not enough systems on the
7955 last page. The @command{lilypond-book} command ignores
7956 @code{lastpagefill}. See @ref{lilypond-book manual} for more
7959 @cindex @code{lastpagefill}
7961 Page breaks are normally computed by @TeX{}, so they are not under
7962 direct control of LilyPond. However, you can insert a commands into
7963 the @file{.tex} output to instruct @TeX{} where to break pages. This
7964 is done by setting the @code{between-systems-strings} on the
7965 @internalsref{NonMusicalPaperColumn} where the system is broken.
7966 An example is shown in @inputfileref{input/regression,between-systems.ly}.
7967 The predefined command @code{\newpage} also does this.
7971 @cindex @code{papersize}
7973 To change the paper size, you must first set the @code{papersize} paper
7974 variable variable as in the example below. Set it to
7975 the strings @code{a4}, @code{letter}, or @code{legal}. After this
7976 specification, you must set the font as described above. If you want
7977 the default font, then use the 20 point font.
7980 \paper@{ papersize = "a4" @}
7981 \include "paper16.ly"
7984 The file @code{paper16.ly} will now include a file named @file{a4.ly}, which
7985 will set the paper variables @code{hsize} and @code{vsize} (used by
7986 @code{lilypond} and @code{ly2dvi}).
7991 @cindex @code{\newpage}
7997 @ref{Invoking ly2dvi},
7998 @inputfileref{input/regression,between-systems.ly}, and
7999 @internalsref{NonMusicalPaperColumn}.
8003 LilyPond has no concept of page layout, which makes it difficult to
8004 reliably choose page breaks in longer pieces.
8013 Entered music can also be converted to MIDI output. The performance
8014 is good enough for proof-hearing the music for errors.
8016 Ties, dynamics and tempo changes are interpreted. Dynamic marks,
8017 crescendi and decrescendi translate into MIDI volume levels. Dynamic
8018 marks translate to a fixed fraction of the available MIDI volume
8019 range, crescendi and decrescendi make the volume vary linearly between
8020 their two extremities. The fractions can be adjusted by
8021 @code{dynamicAbsoluteVolumeFunction} in @internalsref{Voice} context.
8022 For each type of MIDI instrument, a volume range can be defined. This
8023 gives a basic equalizer control, which can enhance the quality of
8024 the MIDI output remarkably. The equalizer can be controlled by
8025 setting @code{instrumentEqualizer}.
8029 Many musically interesting effects, such as swing, articulation,
8030 slurring, etc., are not translated to MIDI.
8035 * MIDI instrument names::
8040 @subsection MIDI block
8044 The MIDI block is analogous to the paper block, but it is somewhat
8045 simpler. The @code{\midi} block can contain:
8049 @item a @code{\tempo} definition, and
8050 @item context definitions.
8053 Assignments in the @code{\midi} block are not allowed.
8057 @cindex context definition
8059 Context definitions follow precisely the same syntax as within the
8060 \paper block. Translation modules for sound are called performers.
8061 The contexts for MIDI output are defined in @file{ly/performer-init.ly}.
8064 @node MIDI instrument names
8065 @subsection MIDI instrument names
8067 @cindex instrument names
8068 @cindex @code{Staff.midiInstrument}
8069 @cindex @code{Staff.instrument}
8071 The MIDI instrument name is set by the @code{Staff.midiInstrument}
8072 property or, if that property is not set, the @code{Staff.instrument}
8073 property. The instrument name should be chosen from the list in
8074 @ref{MIDI instruments}.
8078 If the selected string does not exactly match, then LilyPond uses the
8079 default (Grand Piano). It is not possible to select an instrument by