1 q@c Note: -*-texinfo-*-
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
14 <!--- @@WEB-TITLE@@=Notation manual --->
20 * Easier music entry::
27 * Fingering instructions::
36 * Contemporary notation::
42 @c FIXME: Note entry vs Music entry at top level menu is confusing.
48 This chapter describes all the different types of notation supported
49 by LilyPond. It is intended as a reference for users that are already
50 somewhat familiar with using LilyPond.
56 * Chromatic alterations::
64 * Easy Notation note heads ::
72 A note is printed by specifying its pitch and then its duration.
73 @footnote{Notes constitute the most basic elements of LilyPond input,
74 but they do not form valid input on their own without a @code{\score}
75 block. However, for the sake of brevity and simplicity we will
76 generally omit @code{\score} blocks and @code{\paper} declarations in
79 @lilypond[fragment,verbatim]
88 @cindex Note specification
90 @cindex entering notes
92 The most common syntax for pitch entry is used in @code{\chords} and
93 @code{\notes} mode. In Note and Chord mode, pitches may be designated
94 by names. The notes are specified by the letters @code{a} through
95 @code{g}, while the octave is formed with notes ranging from @code{c}
96 to @code{b}. The pitch @code{c} is an octave below middle C and the
97 letters span the octave above that C.
99 @lilypond[fragment,verbatim]
101 a,4 b, c d e f g a b c' d' e' \clef treble f' g' a' b' c''
104 @cindex note names, Dutch
106 A sharp is formed by adding @code{-is} to the end of a pitch name and
107 a flat is formed by adding @code{-es}. Double sharps and double flats
108 are obtained by adding @code{-isis} or @code{-eses}. These
109 names are the Dutch note names. In Dutch, @code{aes} is contracted to
110 @code{as} in Dutch, but both forms are accepted. Similarly, both
111 @code{es} and @code{ees} are accepted.
113 There are predefined sets of note names for various other languages.
114 To use them, include the language specific init file. For
115 example: @code{\include "english.ly"}. The available language files
116 and the note names they define are:
121 Note Names sharp flat
122 nederlands.ly c d e f g a bes b -is -es
123 english.ly c d e f g a bf b -s/-sharp -f/-flat
124 deutsch.ly c d e f g a b h -is -es
125 norsk.ly c d e f g a b h -iss/-is -ess/-es
126 svenska.ly c d e f g a b h -iss -ess
127 italiano.ly do re mi fa sol la sib si -d -b
128 catalan.ly do re mi fa sol la sib si -d/-s -b
129 espanol.ly do re mi fa sol la sib si -s -b
138 The optional octave specification takes the form of a series of
139 single quote (`@code{'}') characters or a series of comma
140 (`@code{,}') characters. Each @code{'} raises the pitch by one
141 octave; each @code{,} lowers the pitch by an octave.
143 @lilypond[fragment,verbatim,center]
144 c' c'' es' g' as' gisis' ais'
148 There is also a verbose syntax for pitch specification.
151 @cindex @code{\pitch}
153 \pitch @var{scmpitch}
157 where @var{scmpitch} is a Scheme object of the @code{Pitch} type.
161 Notes can be hidden and unhidden with the following commands.
163 @cindex @code{\hideNotes }
165 @cindex @code{\unHideNotes }
172 @internalsref{NoteEvent}, @internalsref{NoteHead}
174 @node Chromatic alterations
175 @subsection Chromatic alterations
177 Normally accidentals are printed automatically, but you may also
178 print them manually. A reminder accidental
179 @cindex reminder accidental
181 can be forced by adding an exclamation mark @code{!}
182 after the pitch. A cautionary accidental
183 @cindex cautionary accidental
184 @cindex parenthesized accidental
185 (an accidental within parentheses) can be obtained by adding the
186 question mark `@code{?}' after the pitch.
188 @lilypond[fragment,verbatim]
189 cis' cis' cis'! cis'?
193 The automatic production of accidentals can be tuned in many
194 ways. For more information, refer to @ref{Accidentals}.
199 A chord is formed by a enclosing a set of pitches in @code{<<} and
200 @code{>>}. A chord may be followed by a duration, and a set of
201 articulations, just like simple notes.
211 Rests are entered like notes, with the note name @code{r}.
213 @lilypond[singleline,verbatim]
217 Whole bar rests, centered in middle of the bar,
218 must be done with multi measure rests. They are discussed in
219 @ref{Multi measure rests}.
222 A rest's vertical position may be explicitly specified by entering a
223 note with the @code{\rest} keyword appended. This makes manual
224 formatting in polyphonic music easier. Rest collision testing will
225 leave these rests alone.
227 @lilypond[singleline,verbatim]
233 @internalsref{RestEvent}, @internalsref{Rest}
240 @cindex Invisible rest
243 An invisible rest (also called a `skip') can be entered like a note
244 with note name `@code{s}' or with @code{\skip @var{duration}}:
246 @lilypond[singleline,verbatim]
250 The @code{s} syntax is only available in Note mode and Chord mode. In
251 other situations, you should use the @code{\skip} command.
253 @lilypond[singleline,verbatim]
256 { \time 4/8 \skip 2 \time 4/4 }
257 \notes\relative c'' { a2 a1 }
262 The skip command is merely an empty musical placeholder. It does not
263 produce any output, not even transparent output.
267 @internalsref{SkipEvent}
272 @subsection Durations
276 @cindex @code{\duration}
279 In Note, Chord, and Lyrics mode, durations are designated by numbers
280 and dots: durations are entered as their reciprocal values. For example,
281 a quarter note is entered using a @code{4} (since it is a 1/4 note), while
282 a half note is entered using a @code{2} (since it is a 1/2 note). For notes
283 longer than a whole you must use variables.
285 @c FIXME: what is an identifier? I do not think it's been introduced yet.
286 @c and if it has, I obviously skipped that part. - Graham
290 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64
292 r1 r2 r4 r8 r16 r32 r64 r64
297 \notes \relative c'' {
299 a1 a2 a4 a8 a16 a32 a64 a64
301 r1 r2 r4 r8 r16 r32 r64 r64
306 \remove "Clef_engraver"
307 \remove "Staff_symbol_engraver"
308 \remove "Time_signature_engraver"
309 \consists "Pitch_squash_engraver"
316 If the duration is omitted then it is set to the previously entered
317 duration. The default for the first note is a quarter note. The duration
318 can be followed by dots (`@code{.}') in order to obtain dotted note
322 @lilypond[fragment,verbatim,center]
323 a' b' c''8 b' a'4 a'4. b'4.. c'8.
328 You can alter the length of duration by a fraction @var{N/M}
329 appending `@code{*}@var{N/M}' (or `@code{*}@var{N}' if @var{M=1}). This
330 will not affect the appearance of the notes or rests produced.
331 In the following example, the first three notes take up exactly two
333 @lilypond[fragment,relative 2,verbatim]
335 a4*2/3 gis4*2/3 a4*2/3
339 Durations can also be produced using the verbose syntax
340 @code{\duration @var{Scheme object}}.
341 @lilypond[verbatim,fragment]
342 c'\duration #(ly:make-duration 4 1)
349 Dots are normally moved up to avoid staff lines, except in polyphonic
350 situations. The following commands may be used to force a particular
353 @cindex @code{\dotsUp }
355 @cindex @code{\dotsDown }
357 @cindex @code{\dotsBoth}
362 @internalsref{Dots}, @internalsref{DotColumn}.
366 In dense chords, dots can overlap.
371 Whenever a note is found, a
372 @internalsref{Stem} object is created automatically. For whole notes
373 and rests, stem objects are also created, but in those cases, the stem
378 @cindex @code{\stemUp}
380 @cindex @code{\stemDown}
382 @cindex @code{\stemBoth}
393 A tie connects two adjacent note heads of the same pitch. The tie in
394 effect extends the length of a note. Ties should not be confused with
395 slurs, which indicate articulation, or phrasing slurs, which indicate
396 musical phrasing. A tie is entered using the tilde symbol `@code{~}'.
398 @lilypond[fragment,verbatim,center]
399 e' ~ e' <<c' e' g'>> ~ <<c' e' g'>>
402 When a tie is applied to a chord, all note heads whose pitches match
403 are connected. When no note heads match, no ties will be created.
405 In its meaning a tie is just a way of extending a note duration, similar
406 to the augmentation dot: the following example are two ways of notating
407 exactly the same concept.
409 @lilypond[fragment, singleline,quote]
410 \time 3/4 c'2. c'2 ~ c'4
412 If you need to tie a lot of notes over bars, it may be easier to use automatic
413 note splitting (See @ref{Automatic note splitting}).
418 @cindex @code{\tieUp }
420 @cindex @code{\tieDown }
422 @cindex @code{\tieBoth }
424 @cindex @code{\tieDotted }
426 @cindex @code{\tieSolid}
431 @internalsref{TieEvent}, @internalsref{NewTieEvent},
432 @internalsref{Tie}, @ref{Automatic note splitting}.
435 ties created for a chord, see @inputfileref{input/test,tie-sparse.ly}.
439 Tieing only a subset of the note heads of a pair of chords is not
440 supported in a simple way. It can be achieved by moving the
441 tie-engraver into the @internalsref{Thread} context and turning on and
442 off ties per @internalsref{Thread}.
444 Switching staves when a tie is active, will not produce a slanted tie.
446 Formatting of ties is a difficult subject. The results are often not
456 @cindex @code{\times}
458 Tuplets are made out of a music expression by multiplying all durations
461 @cindex @code{\times}
463 \times @var{fraction} @var{musicexpr}
466 The duration of @var{musicexpr} will be multiplied by the fraction.
467 In the sheet music, the fraction's denominator will be printed over
468 the notes, optionally with a bracket. The most common tuplet is the
469 triplet in which 3 notes have the length of 2, so the notes are 2/3
470 of their written length:
472 @lilypond[fragment,verbatim,center]
473 g'4 \times 2/3 {c'4 c' c'} d'4 d'4
476 The property @code{tupletSpannerDuration} specifies how long each
477 bracket should last. With this, you can make lots of tuplets while
478 typing @code{\times} only once, saving lots of typing. In the next
479 example, there are two triplets shown, while @code{\times} was only
482 @lilypond[fragment, relative, singleline, verbatim]
483 \property Voice.tupletSpannerDuration = #(ly:make-moment 1 4)
484 \times 2/3 { c'8 c c c c c }
487 The format of the number is determined by the property
488 @code{tupletNumberFormatFunction}. The default prints only the
489 denominator, but if it is set to the Scheme function
490 @code{fraction-tuplet-formatter}, @var{num}:@var{den} will be printed
494 @cindex @code{tupletNumberFormatFunction}
495 @cindex tuplet formatting
500 @cindex @code{\tupletUp }
502 @cindex @code{\tupletDown }
504 @cindex @code{\tupletBoth}
509 @internalsref{TupletBracket}, @internalsref{TimeScaledMusic}.
513 Nested tuplets are not formatted automatically. In this case, outer
514 tuplet brackets should be moved manually.
516 @node Easy Notation note heads
517 @subsection Easy Notation note heads
519 @cindex easy notation
522 The `easyplay' note head includes a note name inside the head. It is
523 used in music aimed at beginners.
525 @lilypond[singleline,verbatim,26pt]
527 \notes { c'2 e'4 f' | g'1 }
528 \paper { \translator { \EasyNotation } }
532 The @code{EasyNotation} variable overrides a @internalsref{Score}
533 context. You probably will want to print it with magnification or a
534 large font size to make it more readable. To print with
535 magnification, you must create a DVI file (with @file{ly2dvi}) and
536 then enlarge it with something like @file{dvips -x 2000 file.dvi}.
537 See the @code{dvips} documentation for more details. To print with a
538 larger font, see @ref{Font Size}.
544 If you view the result with Xdvi, then staff lines will show through
545 the letters. Printing the PostScript file obtained with ly2dvi does
546 produce the correct result.
549 @node Easier music entry
550 @section Easier music entry
553 When entering music it is easy to introduce errors. This section deals
554 with tricks and features of the input language that help when entering
555 music, and find and correct mistakes. Some features of the input
556 language ease entering music, but also have other applications. They
557 are not described in this section.
559 It is also possible to use external programs, for example GUI
560 interfaces, or MIDI transcription programs, to enter or edit
561 music. Refer to the website for more information. Finally, there are
562 tools make debugging easier, by linking the input file and the output
563 shown on screen. See @ref{Point and click} for more information.
569 * Skipping corrected music::
570 * Automatic note splitting ::
576 @node Relative octaves
577 @subsection Relative octaves
579 @cindex relative octave specification
581 Octaves are specified by adding @code{'} and @code{,} to pitch names.
582 When you copy existing music, it is easy to accidentally put a pitch
583 in the wrong octave and hard to find such an error. The relative
584 octave mode prevents these errors: a single error puts the rest of the
585 piece off by one octave.
587 @cindex @code{\relative}
589 \relative @var{startpitch} @var{musicexpr}
592 The octave of notes that appear in @var{musicexpr} are calculated as
593 follows: If no octave changing marks are used, the basic interval
594 between this and the last note is always taken to be a fourth or less
595 (This distance is determined without regarding alterations; a
596 @code{fisis} following a @code{ceses} will be put above the
599 The octave changing marks @code{'} and @code{,} can be added to raise
600 or lower the pitch by an extra octave. Upon entering relative mode,
601 an absolute starting pitch must be specified that will act as the
602 predecessor of the first note of @var{musicexpr}.
604 Here is the relative mode shown in action:
605 @lilypond[fragment,singleline,verbatim,center]
611 Octave changing marks are used for intervals greater than a fourth.
612 @lilypond[fragment,verbatim,center]
617 If the preceding item is a chord, the first note of the chord is used
618 to determine the first note of the next chord.
620 @lilypond[fragment,verbatim,center]
627 @cindex @code{\notes}
629 The pitch after the @code{\relative} contains a note name. To parse
630 the pitch as a note name, you have to be in note mode, so there must
631 be a surrounding @code{\notes} keyword (which is not
634 The relative conversion will not affect @code{\transpose},
635 @code{\chords} or @code{\relative} sections in its argument. If you
636 want to use relative within transposed music, you must place an
637 additional @code{\relative} inside the @code{\transpose}.
641 @subsection Bar check
645 @cindex @code{barCheckSynchronize}
648 Bar checks help detect errors in the durations. A bar check is
649 entered using the bar symbol, `@code{|}'. Whenever it is encountered
650 during interpretation, it should fall on a measure boundary. If it
651 does not, a warning is printed. Depending on the value of
652 @code{barCheckSynchronize}, the beginning of the measure will be
655 In the next example, the second bar check will signal an error.
657 \time 3/4 c2 e4 | g2 |
662 @cindex skipTypesetting
664 Failed bar checks are caused by entering incorrect
665 durations. Incorrect durations often completely garble up the score,
666 especially if it is polyphonic, so you should start correcting the
667 score by scanning for failed bar checks and incorrect durations. To
668 speed up this process, you can use @code{skipTypesetting}, described
671 @node Skipping corrected music
672 @subsection Skipping corrected music
674 The property @code{Score.skipTypesetting} can be used to switch on and
675 off typesetting completely during the interpretation phase. When
676 typesetting is switched off, the music is processed much more quickly.
677 This can be used to skip over the parts of a score that have already
678 been checked for errors.
680 @lilypond[fragment,singleline,verbatim]
682 \property Score.skipTypesetting = ##t
684 \property Score.skipTypesetting = ##f
688 @node Automatic note splitting
689 @subsection Automatic note splitting
691 Long notes can be converted automatically to tied notes. This is done
692 by replacing the @internalsref{Note_heads_engraver} by the
693 @internalsref{Completion_heads_engraver}.
696 \paper @{ \translator @{
698 \remove "Note_heads_engraver"
699 \consists "Completion_heads_engraver"
706 c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2
713 c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2
715 \paper { \translator {
717 \remove "Note_heads_engraver"
718 \consists "Completion_heads_engraver"
723 This engraver splits all running notes at the bar line, and inserts
724 ties. One of its uses is to debug complex scores: if the measures are
725 not entirely filled, then the ties exactly show how much each measure
730 Not all durations (especially those containing tuplets) can be
731 represented exactly; the engraver will not insert tuplets.
737 @section Staff notation
739 This section describes music notation that occurs on staff level,
740 such as keys, clefs and time signatures.
742 @cindex Staff notation
756 @subsection Staff symbol
758 @cindex adjusting staff symbol
759 @cindex StaffSymbol, using \property
760 @cindex staff lines, setting number of
762 Notes, dynamic signs, etc. are grouped
763 with a set of horizontal lines, into a staff (plural `staves'). In our
764 system, these lines are drawn using a separate layout object called
767 This object is created whenever a @internalsref{Staff} context is
768 created. The appearance of the staff symbol cannot be changed by
769 using @code{\override} or @code{\set}. At the moment that
770 @code{\property Staff} is interpreted, a @internalsref{Staff} context
771 is made, and the @internalsref{StaffSymbol} is created before any
772 @code{\override} is effective. Properties can be changed in a
773 @code{\translator} definition, or by using @code{\outputproperty}.
777 If a staff is ended halfway a piece, the staff symbol may not end
778 exactly on the barline.
782 @subsection Key signature
783 @cindex Key signature
787 The key signature indicates the scale in which a piece is played. It
788 is denoted by a set of alterations (flats or sharps) at the start of
793 Setting or changing the key signature is done with the @code{\key}
796 @code{\key} @var{pitch} @var{type}
799 @cindex @code{\minor}
800 @cindex @code{\major}
801 @cindex @code{\minor}
802 @cindex @code{\ionian}
803 @cindex @code{\locrian}
804 @cindex @code{\aeolian}
805 @cindex @code{\mixolydian}
806 @cindex @code{\lydian}
807 @cindex @code{\phrygian}
808 @cindex @code{\dorian}
810 Here, @var{type} should be @code{\major} or @code{\minor} to get
811 @var{pitch}-major or @var{pitch}-minor, respectively.
812 The standard mode names @code{\ionian},
813 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
814 @code{\phrygian}, and @code{\dorian} are also defined.
816 This command sets the context property
817 @internalsref{Staff}.@code{keySignature}. Non-standard key signatures
818 can be specified by setting this property directly.
822 The ordering of a key cancellation is wrong when it is combined with
823 repeat bar lines. The cancellation is also printed after a line break.
827 @internalsref{KeyChangeEvent}, @internalsref{KeySignature}.
829 @cindex @code{keySignature}
836 The clef indicates which lines of the staff correspond to which
841 The clef can be set or changed with the @code{\clef} command:
842 @lilypond[fragment,verbatim]
843 \key f\major c''2 \clef alto g'2
846 Supported clef-names include
847 @c Moved standard clefs to the top /MB
849 @item treble, violin, G, G2
858 G clef on 1st line, so-called French violin clef
873 By adding @code{_8} or @code{^8} to the clef name, the clef is
874 transposed one octave down or up, respectively. @var{clefname} must
875 be enclosed in quotes when it contains underscores or digits. For
881 This command is equivalent to setting @code{clefGlyph},
882 @code{clefPosition} (which controls the Y position of the clef),
883 @code{centralCPosition} and @code{clefOctavation}. A clef is printed
884 when any of these properties are changed.
888 The object for this symbol is @internalsref{Clef}.
892 @node Ottava brackets
893 @subsection Ottava brackets
895 ``Ottava'' brackets introduce an extra transposition of an octave for
896 the staff. They are created by invoking the function
897 @code{set-octavation}
903 @lilypond[verbatim,fragment]
912 Internally the @code{set-octavation} function sets the properties
913 @code{ottavation} (eg. to @code{"8va"}) and @code{centralCPosition}.
917 @internalsref{OttavaBracket}
921 @code{set-octavation} will get confused when clef changes happen
922 during an octavation bracket.
925 @subsection Time signature
926 @cindex Time signature
930 Time signature indicates the metrum of a piece: a regular pattern of
931 strong and weak beats. It is denoted by a fraction at the start of the
936 The time signature is set or changed by the @code{\time}
938 @lilypond[fragment,verbatim]
939 \time 2/4 c'2 \time 3/4 c'2.
942 The symbol that is printed can be customized with the @code{style}
943 property. Setting it to @code{#'()} uses fraction style for 4/4 and
944 2/2 time. There are many more options for its layout. See
945 @inputfileref{input/test,time.ly} for more examples.
948 This command sets the property @code{timeSignatureFraction},
949 @code{beatLength} and @code{measureLength} in the @code{Timing}
950 context, which is normally aliased to @internalsref{Score}. The
951 property @code{measureLength} determines where bar lines should be
952 inserted, and how automatic beams should be generated. Changing the
953 value of @code{timeSignatureFraction} also causes the symbol to be
956 More options are available through the Scheme function
957 @code{set-time-signature}. In combination with the
958 @internalsref{Measure_grouping_engraver}, it will create
959 @internalsref{MeasureGrouping} signs. Such signs ease reading
960 rhythmically complex modern music. In the following example, the 9/8
961 measure is subdivided in 2, 2, 2 and 3. This is passed to
962 @code{set-time-signature} as the third argument @code{(2 2 2 3)}.
965 \score { \notes \relative c'' {
966 #(set-time-signature 9 8 '(2 2 2 3))
967 g8-[ g-] d-[ d-] g-[ g-] a8-[-( bes g-]-) |
968 #(set-time-signature 5 8 '(3 2))
973 \translator { \StaffContext
974 \consists "Measure_grouping_engraver"
980 @internalsref{TimeSignature}, @internalsref{Timing_engraver}.
985 Automatic beaming does not use measure grouping specified with
986 @code{set-time-signature}.
988 @node Partial measures
989 @subsection Partial measures
992 @cindex partial measure
993 @cindex measure, partial
994 @cindex shorten measures
995 @cindex @code{\partial}
997 Partial measures, for example in upsteps, are entered using the
998 @code{\partial} command:
999 @lilypond[fragment,verbatim]
1000 \partial 16*5 c'16 c4 | a'2. ~ a'8. a'16 | g'1
1003 The syntax for this command is
1005 \partial @var{duration}
1007 This is internally translated into
1009 \property Timing.measurePosition = -@var{length of duration}
1012 The property @code{measurePosition} contains a rational number
1013 indicating how much of the measure has passed at this point.
1015 @node Unmetered music
1016 @subsection Unmetered music
1018 Bar lines and bar numbers are calculated automatically. For unmetered
1019 music (e.g. cadenzas), this is not desirable. By setting
1020 @code{Score.timing} to false, this automatic timing can be switched
1026 @cindex @code{\cadenzaOn }
1028 @cindex @code{\cadenzaOff }
1032 @subsection Bar lines
1036 @cindex measure lines
1040 Bar lines delimit measures, but are also used to indicate repeats.
1041 Normally, tehy are inserted automatically. Line breaks may only
1047 of barlines can be forced with the @code{\bar} command:
1048 @lilypond[relative=1,fragment,verbatim]
1052 The following bar types are available
1053 @lilypond[fragment, relative, singleline, verbatim]
1065 In scores with many staves, a @code{\bar} command in one staff is
1066 automatically applied to all staffs. The resulting bar lines are
1067 connected between different staves of a @internalsref{StaffGroup}:
1069 @lilypond[fragment, verbatim]
1070 < \context StaffGroup <
1071 \context Staff = up { e'4 d'
1074 \context Staff = down { \clef bass c4 g e g } >
1075 \context Staff = pedal { \clef bass c2 c2 } >
1079 The command @code{\bar @var{bartype}} is a short cut for doing
1080 @code{\property Score.whichBar = @var{bartype}} Whenever
1081 @code{whichBar} is set to a string, a bar line of that type is
1082 created. At the start of a measure it is set to
1083 @code{defaultBarType}. The contents of @code{repeatCommands} are used
1084 to override default measure bars.
1086 @code{whichBar} can also be set directly, using @code{\property} or
1087 @code{\bar}. These settings take precedence over the automatic
1088 @code{whichBar} settings.
1091 @cindex repeatCommands
1092 @cindex defaultBarType
1094 You are encouraged to use @code{\repeat} for repetitions. See
1104 The bar line objects that are created at @internalsref{Staff} level
1105 are called @internalsref{BarLine}, the bar lines that span staffs are
1106 @internalsref{SpanBar}s.
1113 The easiest way to enter fragments with more than one voice on a staff
1114 is to split chords using the separator @code{\\}. You can use it for
1115 small, short-lived voices or for single chords:
1117 @lilypond[verbatim,fragment]
1118 \context Voice = VA \relative c'' {
1119 c4 < { f d e } \\ { b c2 } > c4 < g' \\ b, \\ f' \\ d >
1123 The separator causes @internalsref{Voice} contexts to be
1125 bear the names @code{"1"}, @code{"2"}, etc. In each of these
1126 contexts, vertical direction of slurs, stems, etc. is set
1129 This can also be done by instantiating @internalsref{Voice} contexts
1130 by hand, and using @code{\voiceOne}, up to @code{\voiceFour} to assign
1131 a stem directions and horizontal shift for each part.
1134 @lilypond[singleline, verbatim]
1136 \context Staff < \context Voice = VA { \voiceOne cis2 b }
1137 \context Voice = VB { \voiceThree b4 ais ~ ais4 gis4 }
1138 \context Voice = VC { \voiceTwo fis4~ fis4 f ~ f } >
1141 Normally, note heads with a different number of dots are not merged, but
1142 when the object property @code{merge-differently-dotted} is set in
1143 the @internalsref{NoteCollision} object, they are:
1144 @lilypond[verbatim,fragment,singleline]
1145 \relative c'' \context Voice < {
1147 \property Staff.NoteCollision \override
1148 #'merge-differently-dotted = ##t
1150 } \\ { g8.-[ f16-] g8.-[ f16-] }
1154 Similarly, you can merge half note heads with eighth notes, by setting
1155 @code{merge-differently-headed}:
1156 @lilypond[fragment, relative=2,verbatim]
1159 \property Staff.NoteCollision
1160 \override #'merge-differently-headed = ##t
1161 c8 c4. } \\ { c2 c2 } >
1164 LilyPond also vertically shifts rests that are opposite of a stem.
1167 @lilypond[singleline,fragment,verbatim]
1168 \context Voice < c''4 \\ r4 >
1176 @cindex @code{\oneVoice }
1178 @cindex @code{\voiceOne }
1180 @cindex @code{\voiceTwo }
1182 @cindex @code{\voiceThree }
1184 @cindex @code{\voiceFour }
1187 The following commands specify in what chords of the current voice
1188 should be shifted: the outer voice has @code{\shiftOff}, and the inner
1189 voices have @code{\shiftOn}, @code{\shiftOnn}, etc.
1192 @cindex @code{\shiftOn}
1194 @cindex @code{\shiftOnn}
1196 @cindex @code{\shiftOnnn}
1198 @cindex @code{\shiftOff}
1205 The objects responsible for resolving collisions are
1206 @internalsref{NoteCollision} and @internalsref{RestCollision}. See
1207 also example files @inputfileref{input/regression,collision-dots.ly},
1208 @inputfileref{input/regression,collision-head-chords.ly},
1209 @inputfileref{input/regression,collision-heads.ly},
1210 @inputfileref{input/regression,collision-mesh.ly}, and
1211 @inputfileref{input/regression,collisions.ly}.
1216 Resolving collisions is a intricate subject, and only a few situations
1217 are handled. When LilyPond cannot cope, the @code{force-hshift}
1218 property of the @internalsref{NoteColumn} object and pitched rests can
1219 be used to override typesetting decisions.
1221 When using @code{merge-differently-headed} with upstem 8th or shorter
1222 note, and a downstem half note, the 8th note gets the wrong offset.
1227 Beams are used to group short notes into chunks that are aligned with
1228 the metrum. They are inserted automatically in most cases.
1230 @lilypond[fragment,verbatim, relative=2]
1231 \time 2/4 c8 c c c \time 6/8 c c c c8. c16 c8
1234 When these automatic decisions are not good enough, beaming can be
1235 entered explicitly. It is also possible to define beaming patterns
1236 that differ from the defaults.
1240 @internalsref{Beam}.
1243 @cindex Automatic beams
1244 @subsection Manual beams
1245 @cindex beams, manual
1249 In some cases it may be necessary to override the automatic beaming
1250 algorithm. For example, the auto beamer will not put beams over rests
1251 or bar lines. Such beams are specified by manually: the begin and end
1252 point are marked with @code{[} and @code{]}.
1254 @lilypond[fragment,relative,verbatim]
1256 r4 r8-[ g' a r8-] r8 g-[ | a-] r8
1260 @cindex @code{stemLeftBeamCount}
1262 Normally, beaming patterns within a beam are determined automatically.
1263 When this mechanism fouls up, the properties
1264 @code{Voice.stemLeftBeamCount} and @code{Voice.stemRightBeamCount} can
1265 be used to control the beam subdivision on a stem. If either property
1266 is set, its value will be used only once, and then it is erased.
1268 @lilypond[fragment,relative,verbatim]
1271 f8-[ r16 \property Voice.stemLeftBeamCount = #1 f g a-]
1274 @cindex @code{stemRightBeamCount}
1277 The property @code{subdivideBeams} can be set in order to subdivide
1278 all 16th or shorter beams at beat positions, as defined by the
1279 @code{beatLength} property . This accomplishes the same effect as
1280 twiddling with @code{stemLeftBeamCount} and @code{stemRightBeamCount},
1281 but it take less typing.
1284 @lilypond[relative=1,verbatim,noindent]
1285 c16-[ c c c c c c c-]
1286 \property Voice.subdivideBeams = ##t
1287 c16-[ c c c c c c c-]
1288 \property Score.beatLength = #(ly:make-moment 1 8)
1289 c16-[ c c c c c c c-]
1291 @cindex subdivideBeams
1293 Kneed beams are inserted automatically, when a large gap is detected
1294 between the note heads. This behavior can be tuned through the object
1295 property @code{auto-knee-gap}.
1297 @cindex beams, kneed
1299 @cindex auto-knee-gap
1307 Automatically kneed beams cannot be used together with Hara Kiri
1312 * Setting automatic beam behavior ::
1316 @no de Beam typography
1317 @sub section Beam typography
1319 One of the strong points of LilyPond is how beams are formatted. Beams
1320 are quantized, meaning that the left and right endpoints beams start
1321 exactly on staff lines. Without quantization, small wedges of white
1322 space appear between the beam and staff line, and this looks untidy.
1324 Beams are also slope-damped: melodies that go up or down should also
1325 have beams that go up or down, but the slope of the beams should be
1326 less than the slope of the notes themselves.
1328 Some beams should be horizontal. These are so-called concave beams.
1330 [TODO: some pictures.]
1334 @node Setting automatic beam behavior
1335 @subsection Setting automatic beam behavior
1337 @cindex @code{autoBeamSettings}
1338 @cindex @code{(end * * * *)}
1339 @cindex @code{(begin * * * *)}
1340 @cindex automatic beams, tuning
1341 @cindex tuning automatic beaming
1343 @c [TODO: use \applycontext]
1345 In normal time signatures, automatic beams can start on any note but can
1346 only end in a few positions within the measure: beams can end on a beat,
1347 or at durations specified by the properties in
1348 @code{Voice.autoBeamSettings}. The defaults for @code{autoBeamSettings}
1349 are defined in @file{scm/auto-beam.scm}.
1351 The value of @code{autoBeamSettings} is changed using
1352 @code{\override} and restored with @code{\revert}:
1354 \property Voice.autoBeamSettings \override #'(@var{BE} @var{P} @var{Q} @var{N} @var{M}) = @var{dur}
1355 \property Voice.autoBeamSettings \revert #'(@var{BE} @var{P} @var{Q} @var{N} @var{M})
1357 Here, @var{BE} is the symbol @code{begin} or @code{end}. It determines
1358 whether the rule applies to begin or end-points. The quantity
1359 @var{P}/@var{Q} refers to the length of the beamed notes (and `@code{*
1360 *}' designates notes of any length), @var{N}/@var{M} refers to a time
1361 signature (wildcards, `@code{* *}' may be entered to designate all time
1364 For example, if automatic beams should end on every quarter note, use
1367 \property Voice.autoBeamSettings \override
1368 #'(end * * * *) = #(ly:make-moment 1 4)
1370 Since the duration of a quarter note is 1/4 of a whole note, it is
1371 entered as @code{(ly:make-moment 1 4)}.
1373 The same syntax can be used to specify beam starting points. In this
1374 example, automatic beams can only end on a dotted quarter note.
1376 \property Voice.autoBeamSettings \override
1377 #'(end * * * *) = #(ly:make-moment 3 8)
1379 In 4/4 time signature, this means that automatic beams could end only on
1380 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
1381 3/8 has passed within the measure).
1383 Rules can also be restricted to specific time signatures. A rule that
1384 should only be applied in @var{N}/@var{M} time signature is formed by
1385 replacing the second asterisks by @var{N} and @var{M}. For example, a
1386 rule for 6/8 time exclusively looks like
1388 \property Voice.autoBeamSettings \override
1389 #'(begin * * 6 8) = ...
1392 If a rule should be to applied only to certain types of beams, use the
1393 first pair of asterisks. Beams are classified according to the
1394 shortest note they contain. For a beam ending rule that only applies
1395 to beams with 32nd notes (and no shorter notes), use @code{(end 1 32 *
1398 If a score ends while an automatic beam has not been ended and is still
1399 accepting notes, this last beam will not be typeset at all.
1401 @cindex automatic beam generation
1403 @cindex @code{Voice.autoBeaming}
1406 For melodies that have lyrics, you may want to switch off
1407 automatic beaming. This is done by setting @code{Voice.autoBeaming} to
1412 @cindex @code{\autoBeamOff }
1413 @code{\autoBeamOff},
1414 @cindex @code{\autoBeamOn }
1420 It is not possible to specify beaming parameters for beams with mixed
1421 durations, that differ from the beaming parameters of all separate
1422 durations, i.e., you will have to specify manual beams to get:
1424 @lilypond[singleline,fragment,relative,noverbatim,quote]
1425 \property Voice.autoBeamSettings
1426 \override #'(end * * * *) = #(ly:make-moment 3 8)
1427 \time 12/8 c'8 c c c16 c c c c c c-[ c c c-] c8 c c4
1429 It is not possible to specify beaming parameters that act differently in
1430 different parts of a measure. This means that it is not possible to use
1431 automatic beaming in irregular meters such as @code{5/8}.
1434 @section Accidentals
1437 This section describes how to change the way that accidentals are
1438 inserted automatically before the running notes.
1442 * Using the predefined accidental variables::
1443 * Customized accidental rules::
1446 @node Using the predefined accidental variables
1447 @subsection Using the predefined accidental variables
1449 The constructs for describing the accidental typesetting rules are
1450 quite hairy, so non-experts should stick to the variables
1451 defined in @file{ly/property-init.ly}.
1452 @cindex @file{property-init.ly}
1454 The variables set properties in the ``@code{Current}'' context (see
1455 @ref{Context properties}). This means that the variables should
1456 normally be added right after the creation of the context in which the
1457 accidental typesetting described by the variable is to take
1458 effect. For example, if you want to use piano-accidentals in a piano
1459 staff then issue @code{\pianoAccidentals} first thing after the
1460 creation of the piano staff:
1463 \notes \relative c'' <
1464 \context Staff = sa @{ cis4 d e2 @}
1465 \context GrandStaff <
1467 \context Staff = sb @{ cis4 d e2 @}
1468 \context Staff = sc @{ es2 c @}
1470 \context Staff = sd @{ es2 c @}
1474 @lilypond[singleline]
1476 \notes \relative c'' <
1477 \context Staff = sa { cis4 d e2 }
1478 \context GrandStaff <
1480 \context Staff = sb { cis4 d e2 }
1481 \context Staff = sc { es2 c }
1483 \context Staff = sd { es2 c }
1488 minimumVerticalExtent = #'(-4.0 . 4.0)
1496 @item \defaultAccidentals
1497 @cindex @code{\defaultAccidentals}
1498 This is the default typesetting behaviour. It should correspond
1499 to 18th century common practice: Accidentals are
1500 remembered to the end of the measure in which they occur and
1501 only on their own octave.
1503 @item \voiceAccidentals
1504 @cindex @code{\voiceAccidentals}
1506 The normal behaviour is to
1507 remember the accidentals on Staff-level. This variable, however,
1508 typesets accidentals individually for each voice. Apart from that the
1509 rule is similar to @code{\defaultAccidentals}.
1511 This leads to some weird and often unwanted results
1512 because accidentals from one voice do not get cancelled in other
1514 @lilypond[singleline,relative,fragment,verbatim,quote]
1522 Hence you should only use @code{\voiceAccidentals} if the voices
1523 are to be read solely by individual musicians. If the staff is to be
1524 used by one musician (e.g., a conductor) then you use
1525 @code{\modernVoiceAccidentals} or @code{\modernVoiceCautionaries}
1528 @item \modernAccidentals
1529 @cindex @code{\modernAccidentals}
1530 This rule corresponds to the common practice in the 20th
1532 The rule is more complex than @code{\defaultAccidentals}.
1533 You get all the same accidentals, but temporary
1534 accidentals also get cancelled in other octaves. Further more,
1535 in the same octave, they also get cancelled in the following measure:
1536 @lilypond[singleline,fragment,verbatim]
1538 cis' c'' cis'2 | c'' c'
1541 @item \modernCautionaries
1542 @cindex @code{\modernCautionaries}
1543 This rule is similar to @code{\modernAccidentals}, but the
1544 ``extra'' accidentals (the ones not typeset by
1545 @code{\defaultAccidentals}) are typeset as cautionary accidentals.
1546 They are printed in reduced size or with parentheses.
1547 @lilypond[singleline,fragment,verbatim]
1549 cis' c'' cis'2 | c'' c'
1552 @cindex @code{\modernVoiceAccidentals}
1553 @item \modernVoiceAccidentals
1554 is used for multivoice accidentals to be read both by musicians
1555 playing one voice and musicians playing all voices. Accidentals are
1556 typeset for each voice, but they @emph{are} cancelled across voices in
1557 the same @internalsref{Staff}.
1559 @cindex @code{\modernVoiceCautionaries}
1560 @item \modernVoiceCautionaries
1561 is the same as @code{\modernVoiceAccidentals}, but with the extra
1562 accidentals (the ones not typeset by @code{\voiceAccidentals}) typeset
1563 as cautionaries. Even though all accidentals typeset by
1564 @code{\defaultAccidentals} @emph{are} typeset by this variable then
1565 some of them are typeset as cautionaries.
1567 @item \pianoAccidentals
1568 @cindex @code{\pianoAccidentals}
1569 20th century practice for piano notation. Very similar to
1570 @code{\modernAccidentals} but accidentals also get cancelled
1571 across the staves in the same @internalsref{GrandStaff} or
1572 @internalsref{PianoStaff}.
1574 @item \pianoCautionaries
1575 @cindex @code{\pianoCautionaries}
1576 As @code{\pianoAccidentals} but with the extra accidentals
1577 typeset as cautionaries.
1580 @cindex @code{\noResetKey}
1581 Same as @code{\defaultAccidentals} but with accidentals lasting
1582 ``forever'' and not only until the next measure:
1583 @lilypond[singleline,fragment,verbatim,relative]
1588 @item \forgetAccidentals
1589 @cindex @code{\forgetAccidentals}
1590 This is sort of the opposite of @code{\noResetKey}: Accidentals
1591 are not remembered at all---and hence all accidentals are
1592 typeset relative to the key signature, regardless of what was
1593 before in the music:
1594 @lilypond[singleline,fragment,verbatim,relative]
1596 \key d\major c4 c cis cis d d dis dis
1600 @node Customized accidental rules
1601 @subsection Customized accidental rules
1603 This section must be considered gurus-only, and hence it must be
1604 sufficient with a short description of the system and a reference to
1605 the internal documentation.
1607 The algorithm tries several different rules, and uses the rule
1608 that gives the highest number of accidentals. Each rule consists of
1611 In which context is the rule applied. For example, if
1612 @var{context} is @internalsref{Score} then all staves share
1613 accidentals, and if @var{context} is @internalsref{Staff} then all
1614 voices in the same staff share accidentals, but staves do not.
1616 Whether the accidental changes all octaves or only the current
1619 Over how many barlines the accidental lasts.
1620 If @var{lazyness} is @code{-1} then the accidental is forget
1621 immediately, and if @var{lazyness} is @code{#t} then the accidental
1624 @c [TODO: should use +infinity for this case?]
1630 @cindex @code{\defaultAccidentals }
1631 @code{\defaultAccidentals},
1632 @cindex @code{\voiceAccidentals }
1633 @code{\voiceAccidentals},
1634 @cindex @code{\modernAccidentals }
1635 @code{\modernAccidentals},
1636 @cindex @code{\modernCautionaries }
1637 @code{\modernCautionaries},
1638 @cindex @code{\modernVoiceAccidentals }
1639 @code{\modernVoiceAccidentals},
1640 @cindex @code{\modernVoiceCautionaries }
1641 @code{\modernVoiceCautionaries},
1642 @cindex @code{\pianoAccidentals }
1643 @code{\pianoAccidentals},
1644 @cindex @code{\pianoCautionaries }
1645 @code{\pianoCautionaries},
1646 @cindex @code{\noResetKey }
1648 @cindex @code{\forgetAccidentals }
1649 @code{\forgetAccidentals},
1653 @internalsref{Accidental_engraver}, @internalsref{Accidental},
1654 @internalsref{AccidentalPlacement}.
1659 Currently the simultaneous notes are considered to be entered in
1660 sequential mode. This means that in a chord the accidentals are
1661 typeset as if the notes in the chord happened one at a time - in the
1662 order in which they appear in the input file.
1664 This is only a problem when there are simultaneous notes whose
1665 accidentals depend on each other. The problem only occurs when using
1666 non-default accidentals. In the default scheme, accidentals only
1667 depend on other accidentals with the same pitch on the same staff, so
1668 no conflicts possible.
1670 This example shows two examples of the same music giving different
1671 accidentals depending on the order in which the notes occur in the
1674 @lilypond[singleline,fragment,verbatim]
1675 \property Staff.autoAccidentals = #'( Staff (any-octave . 0) )
1676 cis'4 <<c'' c'>> r2 | cis'4 <<c' c''>> r2
1677 | <<cis' c''>> r | <<c'' cis'>> r |
1680 This problem can be solved by manually inserting @code{!} and @code{?}
1681 for the problematic notes.
1683 @node Expressive marks
1684 @section Expressive marks
1692 * Analysis brackets::
1699 A slur indicates that notes are to be played bound or @emph{legato}.
1703 They are entered using parentheses:
1704 @lilypond[fragment,verbatim,center]
1705 f'-( g'-)-( a'-) a'8-[ b'-(-] a'4 g'2 f'4-)
1706 <<c' e'>>2-( <<b d'>>2-)
1710 @c TODO: should explain that ^( and _( set directions
1711 @c should set attachments with ^ and _ ?
1713 Slurs avoid crossing stems, and are generally attached to note heads.
1714 However, in some situations with beams, slurs may be attached to stem
1715 ends. If you want to override this layout you can do this through the
1716 object property @code{attachment} of @internalsref{Slur} in
1717 @internalsref{Voice} context. Its value is a pair of symbols, specifying
1718 the attachment type of the left and right end points.
1720 @lilypond[fragment,relative,verbatim]
1722 \property Voice.Stem \set #'length = #5.5
1724 \property Voice.Slur \set #'attachment = #'(stem . stem)
1728 If a slur would strike through a stem or beam, the slur will be moved
1729 away upward or downward. If this happens, attaching the slur to the
1730 stems might look better:
1732 @lilypond[fragment,relative,verbatim]
1735 \property Voice.Slur \set #'attachment = #'(stem . stem)
1742 @cindex @code{\slurUp }
1744 @cindex @code{\slurDown }
1746 @cindex @code{\slurBoth }
1748 @cindex @code{\slurDotted }
1750 @cindex @code{\slurSolid }
1755 @seeinternals{Slur}, @internalsref{SlurEvent}.
1760 Producing nice slurs is a difficult problem, and LilyPond currently
1761 uses a simple, empiric method to produce slurs. In some cases, its
1765 @cindex Adjusting slurs
1767 @node Phrasing slurs
1768 @subsection Phrasing slurs
1770 @cindex phrasing slurs
1771 @cindex phrasing marks
1773 A phrasing slur (or phrasing mark) connects chords and is used to
1774 indicate a musical sentence. It is started using @code{\(} and @code{\)}
1777 @lilypond[fragment,verbatim,center,relative]
1778 \time 6/4 c'-\( d-( e-) f-( e-) d-\)
1781 Typographically, the phrasing slur behaves almost exactly like a
1782 normal slur. However, they are treated as different objects. A
1783 @code{\slurUp} will have no effect on a phrasing slur; instead, you
1784 should use @code{\phrasingSlurUp}, @code{\phrasingSlurDown}, and
1785 @code{\phrasingSlurBoth}.
1787 The commands @code{\slurUp}, @code{\slurDown}, and @code{\slurBoth}
1788 will only affect normal slurs and not phrasing slurs.
1792 @cindex @code{\phrasingSlurUp }
1793 @code{\phrasingSlurUp},
1794 @cindex @code{\phrasingSlurDown }
1795 @code{\phrasingSlurDown},
1796 @cindex @code{\phrasingSlurBoth }
1797 @code{\phrasingSlurBoth},
1801 See also @internalsref{PhrasingSlur},
1802 @internalsref{PhrasingSlurEvent}.
1806 Phrasing slurs have the same limitations in their formatting as normal
1807 slurs. Putting phrasing slurs over rests leads to spurious warnings.
1810 @subsection Breath marks
1812 Breath marks are entered using @code{\breathe}.
1815 @lilypond[fragment,relative,verbatim]
1819 The glyph of the breath mark can be tweaked by overriding the
1820 @code{text} property of the @code{BreathingSign} layout object with the name of
1821 any glyph of @ref{The Feta font}. For example,
1822 @lilypond[fragment,verbatim,relative]
1824 \property Voice.BreathingSign \override #'text = #"scripts-rvarcomma"
1831 @internalsref{BreathingSign}, @internalsref{BreathingSignEvent},
1832 @inputfileref{input/regression,breathing-sign.ly}.
1835 @node Metronome marks
1836 @subsection Metronome marks
1839 @cindex beats per minute
1840 @cindex metronome marking
1842 Metronome settings can be entered as follows:
1844 \tempo @var{duration} = @var{perminute}
1847 In the MIDI output, they are interpreted as a tempo change, and in the
1848 paper output, a metronome marking is printed
1849 @cindex @code{\tempo}
1850 @lilypond[fragment,verbatim]
1856 @internalsref{TempoEvent}
1861 @subsection Text spanners
1862 @cindex Text spanners
1864 Some performance indications, e.g. @i{rallentando} or @i{accelerando},
1865 are written as texts, and extended over many measures with dotted
1866 lines. You can create such texts using text spanners: attach
1867 @code{\startTextSpan} and @code{\stopTextSpan} to the
1868 start and ending note of the spanner.
1870 The string to be printed, as well as the style, is set through object
1873 @lilypond[fragment,relative,verbatim]
1875 \property Voice.TextSpanner \set #'direction = #-1
1876 \property Voice.TextSpanner \set #'edge-text = #'("rall " . "")
1877 c2-\startTextSpan b c-\stopTextSpan a }
1883 @internalsref{TextSpanEvent},
1884 @internalsref{TextSpanner}, @inputfileref{input/regression,text-spanner.ly}.
1887 @node Analysis brackets
1888 @subsection Analysis brackets
1890 @cindex phrasing brackets
1891 @cindex musicological analysis
1892 @cindex note grouping bracket
1894 Brackets are used in musical analysis to indicate structure in musical
1895 pieces. LilyPond supports a simple form of nested horizontal brackets.
1896 To use this, add the @internalsref{Horizontal_bracket_engraver} to
1897 @internalsref{Staff} context. A bracket is started with
1898 @code{\startGroup} and closed with @code{\stopGroup}.
1900 @lilypond[singleline,verbatim]
1901 \score { \notes \relative c'' {
1902 c4-\startGroup-\startGroup
1905 c4-\stopGroup-\stopGroup
1907 \paper { \translator {
1908 \StaffContext \consists "Horizontal_bracket_engraver"
1914 @internalsref{HorizontalBracket}, @internalsref{NoteGroupingEvent},
1915 @inputfileref{input/regression,note-group-bracket.ly}.
1919 @section Articulations
1920 @cindex Articulations
1922 @cindex articulations
1926 A variety of symbols can appear above and below notes to indicate
1927 different characteristics of the performance. They are added to a note
1928 by adding a dash and the character signifying the
1929 articulation. They are demonstrated here.
1931 @lilypondfile[notexidoc]{script-abbreviations.ly}
1933 The script is automatically placed, but if you need to force
1934 directions, you can use @code{_} to force them down, or @code{^} to
1936 @lilypond[fragment, verbatim]
1943 Other symbols can be added using the syntax
1944 @var{note}@code{-\}@var{name}, e.g. @code{c4-\fermata}. Again, they
1945 can be forced up or down using @code{^} and @code{_}.
1949 @cindex staccatissimo
1958 @cindex organ pedal marks
1967 @cindex prallmordent
1971 @cindex thumb marking
1976 @lilypondfile[notexidoc]{script-chart.ly}
1981 @cindex @code{\scriptUp }
1983 @cindex @code{\scriptDown }
1985 @cindex @code{\scriptBoth}
1990 @internalsref{ScriptEvent}, @internalsref{Script}.
1994 All of these note ornaments appear in the printed output but have no
1995 effect on the MIDI rendering of the music.
1998 @node Fingering instructions
1999 @section Fingering instructions
2003 Fingering instructions can be entered using
2005 @var{note}-@var{digit}
2007 For finger changes, use markup texts:
2009 @lilypond[verbatim, singleline, fragment]
2010 c'4-1 c'4-2 c'4-3 c'4-4
2011 c'^\markup { \fontsize #-3 \number "2-3" }
2014 @cindex finger change
2019 You can use the thumb-script to indicate that a note should be
2020 played with your thumb (used in cello music):
2022 @lilypond[verbatim, singleline, fragmnt]
2023 <<a' a''-3>>8-(_\thumb-[ <<b' b''-3>>-)_\thumb
2024 <<c'' c'''-3>>-(_\thumb <<d'' d'''-3>>-)_\thumb-]
2027 Fingerings for chords can also be added to individual notes
2028 of the chord by adding them after the pitches
2029 @lilypond[verbatim,singleline,fragment,relative=1]
2030 << c-1 e-2 g-3 b-5 >> 4
2033 Setting @code{fingerHorizontalDirection} will put the fingerings next
2036 @lilypond[verbatim,singleline,fragment,relative=1]
2037 \property Voice.fingerHorizontalDirection = #LEFT
2038 << c-1 es-2 g-4 bes-5 >> 4
2039 \property Voice.fingerHorizontalDirection = #RIGHT
2040 << c-1 es-2 g-4 bes-5 >> 4
2045 @internalsref{FingerEvent} and @internalsref{Fingering}.
2056 @subsection Text scripts
2057 @cindex Text scripts
2059 It is possible to place arbitrary strings of text or markup text (see
2060 @ref{Text markup}) above or below notes by using a string:
2061 @code{c^"text"}. By default, these indications do not influence the
2062 note spacing, but by using the command @code{\fatText}, the widths
2063 will be taken into account.
2065 @lilypond[fragment,singleline,verbatim] \relative c' {
2066 c4^"longtext" \fatText c4_"longlongtext" c4 }
2069 It is possible to use @TeX{} commands in the strings, but this should
2070 be avoided because the exact dimensions of the string can then no
2076 @internalsref{TextScriptEvent}, @internalsref{TextScript},
2082 @subsection Grace notes
2084 @cindex @code{\grace}
2088 Grace notes are ornaments that are written out
2090 @lilypond[relative=2,verbatim,fragment] c4 \grace c16 c4 \grace {
2094 In normal notation, grace notes take up no logical
2095 time in a measure. Such an idea is practical for normal notation, but
2096 is not strict enough to put it into a program. The model that LilyPond
2097 uses for grace notes internally is that all timing is done in two
2100 Every point in musical time consists of two rational numbers: one
2101 denotes the logical time, one denotes the grace timing. The above
2102 example is shown here with timing tuples.
2105 \score { \notes \relative c''{
2106 c4^"(0,0)" \grace c16_" "_"(1/4,-1/16)" c4^"(1/4,0)" \grace {
2107 c16_"(2/4,-1/8)"-[ d16^"(2/4,-1/16)" ] } c4_" "_"(2/4,0)"
2109 \paper { linewidth = 12.\cm }
2114 The placement of grace notes is synchronized between different staves.
2115 In the following example, there are two sixteenth graces notes for
2116 every eighth grace note.
2118 @lilypond[relative=2,verbatim,fragment]
2119 < \context Staff = SA { e4 \grace { c16-[ d e f-] } e4 }
2120 \context Staff = SB { c'4 \grace { g8-[ b-] } c4 } >
2124 Unbeamed eighth notes and shorter by default have a slash through the
2125 stem. This can be controlled with object property @code{stroke-style} of
2126 @internalsref{Stem}. For proper matching of override and reverts of
2127 such properties, it is necessary to use a Scheme function.
2129 The following fragment overrides the default formatting Grace style stems.
2131 #(add-to-grace-init "Voice" 'Stem 'stroke-style '())
2134 The @code{\override} is carefully matched with a @code{\revert}.
2139 @lilypond[fragment,verbatim]
2140 \relative c'' \context Voice {
2141 \grace c8 c4 \grace { c16-[ c16-] } c4
2143 \property Voice.Stem \override #'stroke-style = #'()
2145 \property Voice.Stem \revert #'stroke-style
2150 If you want to end a note with a grace note, then the standard trick
2151 is to put the grace notes before a phantom ``space note'', e.g.
2152 @lilypond[fragment,verbatim, relative=2]
2155 { s2 \grace { c16-[ d-] } } >
2161 By adjusting the duration of the skip note (here it is a half-note),
2162 the space between the main-note and the grace is adjusted.
2164 A @code{\grace} section has some default values, and LilyPond will
2165 use those default values unless you specify otherwise inside the
2166 @code{\grace} section. For example, if you specify \slurUp
2167 @emph{before} your @code{\grace} section, a slur which starts inside
2168 the @code{\grace} will not be forced up, even if the slur ends outside
2169 of the @code{\grace}. Note the difference between the first and
2170 second bars in this example:
2172 @lilypond[fragment,verbatim]
2173 \relative c'' \context Voice {
2191 @internalsref{GraceMusic},
2195 Grace notes cannot be used in the smallest size (@file{paper11.ly}).
2197 A score that starts with an @code{\grace} section needs an explicit
2198 @code{\context Voice} declaration, otherwise the main note and grace
2199 note end up on different staffs.
2201 Grace note synchronization can also lead to surprises. Staff notation,
2202 such as key signatures, barlines, etc. are also synchronized. Take
2203 care when you mix staves with grace notes and staves without, for example:
2205 @lilypond[relative=2,verbatim,fragment]
2206 < \context Staff = SA { e4 \bar "|:" \grace c16 d4 }
2207 \context Staff = SB { c4 \bar "|:" d4 } >
2210 Grace sections should only be used within sequential music
2211 expressions. Nesting or juxtaposing grace sections is not supported,
2212 and might produce crashes or other errors.
2214 Overriding settings for grace music globally cannot be done in a
2215 modular way. A kludge (@code{add-to-grace-init}) is defined in
2216 @file{ly/grace-init.ly}.
2220 @subsection Glissando
2223 @cindex @code{\glissando}
2225 A glissando is a smooth change in pitch. It is denoted by a line or a
2226 wavy line between two notes.
2230 A glissando line can be requested by attaching a @code{\glissando} to
2233 @lilypond[fragment,relative,verbatim]
2239 @internalsref{Glissando}, @internalsref{GlissandoEvent}.
2244 Additional texts (such as @emph{gliss.}) is not supported.
2248 @subsection Dynamics
2261 @cindex @code{\ffff}
2271 Absolute dynamic marks are specified using an variable after a
2272 note: @code{c4-\ff}. The available dynamic marks are: @code{\ppp},
2273 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
2274 @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
2275 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}.
2277 @lilypond[verbatim,singleline,fragment,relative]
2278 c'-\ppp c-\pp c -\p c-\mp c-\mf c-\f c-\ff c-\fff
2284 @cindex @code{\decr}
2285 @cindex @code{\rced}
2292 A crescendo mark is started with @code{\<} and terminated with
2293 @code{\!}. A decrescendo is started with @code{\>} and also terminated
2294 with @code{\!}. Because these marks are bound to notes, if you must
2295 use spacer notes if multiple marks during one note are needed.
2297 @lilypond[fragment,verbatim,center,quote]
2298 c''-\< c''-\! d''-\decr e''-\rced
2299 < f''1 { s4 s4-\< s4-\! \> s4-\! } >
2301 This may give rise to very short hairpins. Use @code{minimum-length}
2302 in @internalsref{Voice}.@internalsref{HairPin} to lengthen them, for
2306 \property Staff.Hairpin \override #'minimum-length = #5
2309 You can also use a text saying @emph{cresc.} instead of hairpins. Here
2310 is an example how to do it:
2312 @lilypond[fragment,relative=2,verbatim]
2313 c4 \cresc c4 c c c \endcresc c4
2319 You can also supply your own texts:
2320 @lilypond[fragment,relative,verbatim]
2322 \property Voice.crescendoText = \markup { \italic "cresc. poco" }
2323 \property Voice.crescendoSpanner = #'dashed-line
2333 @cindex @code{\dynamicUp }
2335 @cindex @code{\dynamicDown }
2336 @code{\dynamicDown},
2337 @cindex @code{\dynamicBoth }
2338 @code{\dynamicBoth},
2340 @cindex direction, of dynamics
2344 @internalsref{CrescendoEvent}, @internalsref{DecrescendoEvent},
2345 @internalsref{AbsoluteDynamicEvent}.
2347 Dynamics are objects of @internalsref{DynamicText} and
2348 @internalsref{Hairpin}. Vertical positioning of these symbols is
2349 handled by the @internalsref{DynamicLineSpanner} object.
2351 If you want to adjust padding or vertical direction of the dynamics,
2352 you must set properties for the @internalsref{DynamicLineSpanner}
2361 @cindex @code{\repeat}
2364 Repetition is a central concept in music, and multiple notations exist
2365 for repetitions. In LilyPond, most of these notations can be captured
2366 in a uniform syntax. One of the advantages is, all these repetitions
2367 can be rendered in MIDI accurately.
2369 The following types of repetition are supported:
2373 Repeated music is fully written (played) out. Useful for MIDI
2374 output, and entering repetitive music.
2377 This is the normal notation: Repeats are not written out, but
2378 alternative endings (voltas) are printed, left to right.
2382 Alternative endings are written stacked. This has limited use but may be
2383 used to typeset two lines of lyrics in songs with repeats, see
2384 @inputfileref{input,star-spangled-banner.ly}.
2391 Make beat or measure repeats. These look like percent signs.
2397 * Repeats and MIDI::
2398 * Manual repeat commands::
2400 * Tremolo subdivisions::
2405 @subsection Repeat syntax
2409 LilyPond has one syntactic construct for specifying different types of
2410 repeats. The syntax is
2413 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
2416 If you have alternative endings, you may add
2417 @cindex @code{\alternative}
2419 \alternative @code{@{} @var{alternative1}
2421 @var{alternative3} @dots{} @code{@}}
2423 where each @var{alternative} is a music expression. If you do not
2424 give enough alternatives for all of the repeats, then the first
2425 alternative is assumed to be played more than once.
2427 Normal notation repeats are used like this:
2428 @lilypond[fragment,verbatim]
2430 \repeat volta 2 { c'4 d' e' f' }
2431 \repeat volta 2 { f' e' d' c' }
2434 With alternative endings:
2435 @lilypond[fragment,verbatim]
2437 \repeat volta 2 {c'4 d' e' f'}
2438 \alternative { {d'2 d'} {f' f} }
2442 @lilypond[fragment,verbatim]
2446 \repeat volta 4 { e | c2 d2 | e2 f2 | }
2447 \alternative { { g4 g g } { a | a a a a | b2. } }
2454 If you do a nested repeat like
2463 then it is ambiguous to which @code{\repeat} the @code{\alternative}
2464 belongs. This ambiguity is resolved by always having the
2465 @code{\alternative} belong to the inner @code{\repeat}. For clarity,
2466 it is advisable to use braces in such situations.
2469 @node Repeats and MIDI
2470 @subsection Repeats and MIDI
2472 @cindex expanding repeats
2474 For instructions on how to unfold repeats for MIDI output, see the
2475 example file @inputfileref{input/test,unfold-all-repeats.ly}.
2480 Timing information is not remembered at the start of an alternative,
2481 so after a repeat timing information must be reset by hand, for
2482 example by setting @code{Score.measurePosition} or entering
2483 @code{\partial}. Similarly, slurs or ties are also not repeated.
2486 @node Manual repeat commands
2487 @subsection Manual repeat commands
2489 @cindex @code{repeatCommands}
2491 The property @code{repeatCommands} can be used to control the layout of
2492 repeats. Its value is a Scheme list of repeat commands, where each repeat
2496 @item the symbol @code{start-repeat},
2497 which prints a @code{|:} bar line.
2498 @item The symbol @code{end-repeat},
2499 which prints a @code{:|} bar line
2500 @item The list @code{(volta @var{text})}
2501 which prints a volta bracket saying @var{text}. The text can be specified as
2502 a text string or as a markup text, see @ref{Text markup}. Do not
2503 forget to change the font, as the default number font does not contain
2504 alphabetic characters.
2505 @item The list @code{(volta #f)}, which
2506 stops a running volta bracket
2509 @lilypond[verbatim, fragment]
2511 \property Score.repeatCommands = #'((volta "93") end-repeat)
2513 \property Score.repeatCommands = #'((volta #f))
2520 @internalsref{VoltaBracket}, @internalsref{RepeatedMusic},
2521 @internalsref{VoltaRepeatedMusic},
2522 @internalsref{UnfoldedRepeatedMusic}
2523 @internalsref{FoldedRepeatedMusic}.
2525 @node Tremolo repeats
2526 @subsection Tremolo repeats
2527 @cindex tremolo beams
2529 To place tremolo marks between notes, use @code{\repeat} with tremolo
2531 @lilypond[verbatim,center,singleline]
2533 \context Voice \notes\relative c' {
2534 \repeat "tremolo" 8 { c16 d16 }
2535 \repeat "tremolo" 4 { c16 d16 }
2536 \repeat "tremolo" 2 { c16 d16 }
2537 \repeat "tremolo" 4 c16
2544 Tremolo beams are @internalsref{Beam} objects. Single stem tremolos
2545 are @internalsref{StemTremolo}. The music expression is
2546 @internalsref{TremoloEvent}.
2551 The single stem tremolo must be entered without @code{@{} and
2554 @node Tremolo subdivisions
2555 @subsection Tremolo subdivisions
2556 @cindex tremolo marks
2557 @cindex @code{tremoloFlags}
2559 Tremolo marks can be printed on a single note by adding
2560 `@code{:}[@var{length}]' after the note. The length must be at least 8.
2561 A @var{length} value of 8 gives one line across the note stem. If the
2562 length is omitted, then then the last value (stored in
2563 @code{Voice.tremoloFlags}) is used.
2565 @lilypond[verbatim,fragment,center]
2566 c'2:8 c':32 | c': c': |
2569 @c [TODO : stok is te kort bij 32en]
2573 Tremolos in this style do not carry over into the MIDI output.
2576 @node Measure repeats
2577 @subsection Measure repeats
2579 @cindex percent repeats
2580 @cindex measure repeats
2582 In the @code{percent} style, a note pattern can be repeated. It is
2583 printed once, and then the pattern is replaced with a special sign.
2584 Patterns of a one and two measures are replaced by percent-like signs,
2585 patterns that divide the measure length are replaced by slashes.
2587 @lilypond[verbatim,singleline]
2588 \context Voice { \repeat "percent" 4 { c'4 }
2589 \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
2595 @internalsref{RepeatSlash}, @internalsref{PercentRepeat},
2596 @internalsref{PercentRepeatedMusic}, and
2597 @internalsref{DoublePercentRepeat}.
2601 @node Rhythmic music
2602 @section Rhythmic music
2604 Sometimes you might want to show only the rhythm of a melody. This
2605 can be done with the rhythmic staff. All pitches of notes on such a
2606 staff are squashed, and the staff itself has a single line:
2608 @lilypond[fragment,relative,verbatim]
2609 \context RhythmicStaff {
2611 c4 e8 f g2 | r4 g r2 | g1:32 | r1 |
2616 * Percussion staves::
2617 * Percussion midi output::
2620 @node Percussion staves
2621 @subsection Percussion staves
2625 A percussion part for more than one instrument typically uses a
2626 multiline staff where each position in the staff refers to one piece
2631 Percussion staves are typeset with help of a set of Scheme
2632 functions. The system is based on the general MIDI drum-pitches.
2633 Include @file{drumpitch-init.ly} to use drum pitches. This file
2634 defines the pitches from the Scheme variable @code{drum-pitch-names},
2635 the definition of which can be read in @file{scm/drums.scm}. Each
2636 piece of percussion has a full name and an abbreviated name, and both
2637 the full name or the abbreviation may be used in input files.
2639 To typeset the music on a staff apply the function @code{drums->paper}
2640 to the percussion music. This function takes a list of percussion
2641 instrument names, notehead scripts and staff positions (that is:
2642 pitches relative to the C-clef) and transforms the input
2643 music by moving the pitch, changing the notehead and (optionally)
2646 @lilypond[singleline,verbatim,quote]
2647 \include "drumpitch-init.ly"
2648 up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
2649 down = \notes { bassdrum4 snare8 bd r bd sn4 }
2651 \apply #(drums->paper 'drums) \context Staff <
2653 \context Voice = up { \voiceOne \up }
2654 \context Voice = down { \voiceTwo \down }
2659 In the above example the music was transformed using the list @code{'drums}.
2660 Currently the following lists are defined in @file{scm/drums.scm}:
2663 To typeset a typical drum kit on a five-line staff.
2666 \include "drumpitch-init.ly"
2667 nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc
2668 bd sn ss tomh tommh tomml toml tomfh tomfl }
2669 mus = \notes { cymc cyms cymr hh hhc hho hhho hhp cb hc
2670 bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
2673 \apply #(drums->paper 'drums) \context Staff <
2677 \context Lyrics \nam
2680 linewidth = 100.0\mm
2683 \remove Bar_engraver
2684 \remove Time_signature_engraver
2685 minimumVerticalExtent = #'(-4.0 . 5.0)
2689 \remove Stem_engraver
2695 The drum scheme supports six different toms. When there fewer toms, simply
2696 select the toms that produce the desired result, i.e., to get toms on
2697 the three middle lines you use @code{tommh}, @code{tomml} and
2700 Because general MIDI does not contain rimshots the sidestick is used
2701 for this purpose instead.
2703 To typeset timbales on a two line staff.
2705 @lilypond[singleline]
2706 \include "drumpitch-init.ly"
2707 nam = \lyrics { timh ssh timl ssl cb }
2708 mus = \notes { timh ssh timl ssl cb s16 }
2711 \apply #(drums->paper 'timbales) \context Staff <
2715 \context Lyrics \nam
2720 \remove Bar_engraver
2721 \remove Time_signature_engraver
2722 StaffSymbol \override #'line-count = #2
2723 StaffSymbol \override #'staff-space = #2
2724 minimumVerticalExtent = #'(-3.0 . 4.0)
2728 \remove Stem_engraver
2735 To typeset congas on a two line staff.
2737 @lilypond[singleline]
2738 \include "drumpitch-init.ly"
2739 nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl }
2740 mus = \notes { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
2743 \apply #(drums->paper 'congas) \context Staff <
2747 \context Lyrics \nam
2752 \remove Bar_engraver
2753 \remove Time_signature_engraver
2754 StaffSymbol \override #'line-count = #2
2755 StaffSymbol \override #'staff-space = #2
2756 minimumVerticalExtent = #'(-3.0 . 4.0)
2760 \remove Stem_engraver
2766 To typeset bongos on a two line staff.
2768 @lilypond[singleline]
2769 \include "drumpitch-init.ly"
2770 nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl }
2771 mus = \notes { boh boho bohm ssh bol bolo bolm ssl s16 }
2774 \apply #(drums->paper 'bongos) \context Staff <
2778 \context Lyrics \nam
2783 \remove Bar_engraver
2784 \remove Time_signature_engraver
2785 StaffSymbol \override #'line-count = #2
2786 StaffSymbol \override #'staff-space = #2
2787 minimumVerticalExtent = #'(-3.0 . 4.0)
2791 \remove Stem_engraver
2797 To typeset all kinds of simple percussion on one line staves.
2798 @lilypond[singleline]
2799 \include "drumpitch-init.ly"
2800 nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc }
2801 mus = \notes { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
2804 \apply #(drums->paper 'percussion) \context Staff <
2808 \context Lyrics \nam
2813 \remove Bar_engraver
2814 \remove Time_signature_engraver
2815 StaffSymbol \override #'line-count = #1
2816 minimumVerticalExtent = #'(-2.0 . 3.0)
2820 \remove Stem_engraver
2827 If you do not like any of the predefined lists you can define your own
2828 list at the top of your file:
2830 @lilypond[singleline, verbatim]
2831 #(set-drum-kit 'mydrums `(
2832 (bassdrum default #f ,(ly:make-pitch -1 2 0))
2833 (snare default #f ,(ly:make-pitch 0 1 0))
2834 (hihat cross #f ,(ly:make-pitch 0 5 0))
2835 (pedalhihat xcircle "stopped" ,(ly:make-pitch 0 5 0))
2836 (lowtom diamond #f ,(ly:make-pitch -1 6 0))
2838 \include "drumpitch-init.ly"
2839 up = \notes { hh8 hh hh hh hhp4 hhp }
2840 down = \notes { bd4 sn bd toml8 toml }
2842 \apply #(drums->paper 'mydrums) \context Staff <
2844 \context Voice = up { \voiceOne \up }
2845 \context Voice = down { \voiceTwo \down }
2850 To use a modified existing list, one can prepend modifications to the
2854 #(set-drum-kit mydrums (append `(
2855 (bassdrum default #f ,(ly:make-pitch -1 2 0))
2856 (lowtom diamond #f ,(ly:make-pitch -1 6 0))
2857 ) (get-drum-kit 'drums)))
2860 The file @file{drumpitch-init.ly} replaces the normal pitch names, so
2861 you have to reinclude @file{nederlands.ly} after the
2862 drum-pattern-definitions to enter normal notes.
2864 @lilypond[singleline,verbatim]
2865 \include "drumpitch-init.ly"
2866 up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
2867 down = \notes { bassdrum4 snare8 bd r bd sn4 }
2868 \include "nederlands.ly"
2869 bass = \notes \transpose c c,, { a4. e8 r e g e }
2872 \apply #(drums->paper 'drums) \context Staff = drums <
2874 \context Voice = up { \voiceOne \up }
2875 \context Voice = down { \voiceTwo \down }
2877 \context Staff = bass { \clef "F_8" \bass }
2882 @node Percussion MIDI output
2883 @subsection Percussion MIDI output
2885 In order to produce correct MIDI output you need to produce two score
2886 blocks---one for the paper and one for the MIDI output. To use the
2887 percussion channel you set the property @code{instrument} to
2888 @code{'drums}. Because the drum-pitches themselves are similar to the
2889 general MIDI pitches all you have to do is to insert the voices with
2890 none of the scheme functions to get the correct MIDI output:
2894 \apply #(drums->paper 'mydrums) \context Staff <
2903 \property Staff.instrument = #'drums
2912 This scheme is a temporary implementation.
2916 @section Piano music
2918 Piano staves are two normal staves coupled with a brace. The staves
2919 are largely independent, but sometimes voices can cross between the
2920 two staves. The same notation is also used for harps and other key
2921 instruments. The @internalsref{PianoStaff} is especially built to
2922 handle this cross-staffing behavior. In this section we discuss the
2923 @internalsref{PianoStaff} and some other pianistic peculiarities.
2927 * Automatic staff changes::
2928 * Manual staff switches::
2931 * Staff switch lines::
2936 There is no support for putting chords across staves. You can get
2937 this result by increasing the length of the stem in the lower stave so
2938 it reaches the stem in the upper stave, or vice versa. An example is
2939 included with the distribution as @inputfileref{input/test,stem-cross-staff.ly}.
2941 Dynamics are not centered, but kludges do exist. See
2942 @inputfileref{input/templates,piano-dynamics.ly}.
2944 @cindex cross staff stem
2945 @cindex stem, cross staff
2948 @c fixme: should have hyperlinks as well.
2954 @node Automatic staff changes
2955 @subsection Automatic staff changes
2956 @cindex Automatic staff changes
2958 Voices can switch automatically between the top and the bottom
2959 staff. The syntax for this is
2961 \autochange Staff \context Voice @{ @dots{}@var{music}@dots{} @}
2963 The autochanger switches on basis of pitch (central C is the turning
2964 point), and it looks ahead skipping over rests to switch in
2965 advance. Here is a practical example:
2967 @lilypond[verbatim,singleline,quote]
2968 \score { \notes \context PianoStaff <
2969 \context Staff = "up" {
2970 \autochange Staff \context Voice = VA < \relative c' {
2971 g4 a b c d r4 a g } > }
2972 \context Staff = "down" {
2979 In this example, spacer rests are used to prevent the bottom staff from
2980 terminating too soon.
2985 The staff switches often do not end up in optimal places. For high
2986 quality output staff switches should be specified manually.
2990 @node Manual staff switches
2991 @subsection Manual staff switches
2993 @cindex manual staff switches
2994 @cindex staff switch, manual
2996 Voices can be switched between staves manually, using the following command:
2998 \translator Staff = @var{staffname} @var{music}
3002 The string @var{staffname} is the name of the staff. It switches the
3003 current voice from its current staff to the Staff called
3004 @var{staffname}. Typically @var{staffname} is @code{"up"} or
3012 Pianos have pedals that alter the way sound are produced. Generally, a
3013 piano has three pedals, sustain, una corda, and sostenuto.
3017 Piano pedal instruction can be expressed by attaching
3018 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
3019 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
3022 @lilypond[fragment,verbatim]
3023 c'4-\sustainDown c'4-\sustainUp
3026 What is printed can be modified by setting @code{pedal@var{X}Strings},
3027 where @var{X} is one of the pedal types: @code{Sustain},
3028 @code{Sostenuto} or @code{UnaCorda}. Refer to the generated
3029 documentation of @internalsref{SustainPedal} for more information.
3031 Pedals can also be indicated by a sequence of brackets, by setting the
3032 @code{pedal-type} property of @internalsref{SustainPedal} objects:
3034 @lilypond[fragment,verbatim]
3035 \property Staff.SustainPedal \override #'pedal-type = #'bracket
3036 c''4-\sustainDown d''4 e''4
3037 a'4-\sustainUp-\sustainDown
3038 f'4 g'4 a'4-\sustainUp
3041 A third style of pedal notation is a mixture of text and brackets,
3042 obtained by setting @code{pedal-type} to @code{mixed}:
3044 @lilypond[fragment,verbatim]
3045 \property Staff.SustainPedal \override #'pedal-type = #'mixed
3046 c''4-\sustainDown d''4 e''4
3047 c'4-\sustainUp-\sustainDown
3048 f'4 g'4 a'4-\sustainUp
3051 The default `*Ped' style for sustain and damper pedals corresponds to
3052 @code{\pedal-type = #'text}. However, @code{mixed} is the default style
3053 for a sostenuto pedal:
3055 @lilypond[fragment,verbatim]
3056 c''4-\sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4-\sostenutoUp
3059 For fine-tuning of the appearance of a pedal bracket, the properties
3060 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
3061 @code{PianoPedalBracket} objects (see the detailed documentation of
3062 @internalsref{PianoPedalBracket}) can be modified. For example, the bracket
3063 may be extended to the end of the note head.
3065 @lilypond[fragment,verbatim]
3066 \property Staff.PianoPedalBracket \override
3067 #'shorten-pair = #'(0 . -1.0)
3068 c''4-\sostenutoDown d''4 e''4 c'4
3069 f'4 g'4 a'4-\sostenutoUp
3073 @subsection Arpeggio
3076 @cindex broken arpeggio
3077 @cindex @code{\arpeggio}
3079 You can specify an arpeggio sign on a chord by attaching an
3080 @code{\arpeggio} to a chord.
3083 @lilypond[fragment,relative,verbatim]
3084 <<c e g c>>-\arpeggio
3087 When an arpeggio crosses staves in piano music, you attach an arpeggio
3088 to the chords in both staves, and set
3089 @internalsref{PianoStaff}.@code{connectArpeggios}.
3091 @lilypond[fragment,relative,verbatim]
3092 \context PianoStaff <
3093 \property PianoStaff.connectArpeggios = ##t
3094 \context Voice = one { <<c' e g c>>-\arpeggio }
3095 \context Voice = other { \clef bass <<c,, e g>>-\arpeggio }
3099 This command creates @internalsref{Arpeggio} objects. Cross staff
3100 arpeggios are @internalsref{PianoStaff}.@internalsref{Arpeggio}.
3102 The direction of the arpeggio is sometimes denoted by adding an
3103 arrowhead to the wiggly line. This can be typeset by setting
3104 @code{arpeggio-direction}.
3106 @lilypond[fragment,relative,verbatim]
3108 \property Voice.Arpeggio \set #'arpeggio-direction = #1
3109 <<c e g c>>-\arpeggio
3110 \property Voice.Arpeggio \set #'arpeggio-direction = #-1
3111 <<c e g c>>-\arpeggio
3115 A square bracket on the left indicates that the player should not
3116 arpeggiate the chord. To draw these brackets, set the
3117 @code{molecule-callback} property of @code{Arpeggio} or
3118 @code{PianoStaff.Arpeggio} objects to @code{\arpeggioBracket}, and use
3119 @code{\arpeggio} statements within the chords as before.
3121 @lilypond[fragment,relative,verbatim]
3122 \property PianoStaff.Arpeggio \override
3123 #'molecule-callback = \arpeggioBracket
3124 <<c' e g c>>-\arpeggio
3129 @cindex @code{\arpeggioBracket }
3130 @code{\arpeggioBracket},
3131 @cindex @code{\arpeggio}
3136 It is not possible to mix connected arpeggios and unconnected
3137 arpeggios in one @internalsref{PianoStaff} at the same time.
3139 @node Staff switch lines
3140 @subsection Staff switch lines
3143 @cindex follow voice
3144 @cindex staff switching
3147 @cindex @code{followVoice}
3149 Whenever a voice switches to another staff a line connecting the notes
3150 can be printed automatically. This is enabled if the property
3151 @code{PianoStaff.followVoice} is set to true:
3153 @lilypond[fragment,relative,verbatim]
3154 \context PianoStaff <
3155 \property PianoStaff.followVoice = ##t
3156 \context Staff \context Voice {
3158 \translator Staff=two
3161 \context Staff=two { \clef bass \skip 1*2 }
3165 The associated object is @internalsref{VoiceFollower}.
3169 @cindex @code{\showStaffSwitch }
3170 @code{\showStaffSwitch},
3171 @cindex @code{\hideStaffSwitch }
3172 @code{\hideStaffSwitch},
3176 @section Vocal music
3178 This section discusses how to enter, and print lyrics.
3182 * The Lyrics context::
3187 @node Entering lyrics
3188 @subsection Entering lyrics
3192 @cindex @code{\lyrics}
3195 Lyrics are entered in a special input mode. This mode is is introduced
3196 by the keyword @code{\lyrics}. In this mode you can enter lyrics, with
3197 punctuation and accents without any hassle. Syllables are entered like
3198 notes, but with pitches replaced by text. For example,
3200 \lyrics @{ Twin-4 kle4 twin- kle litt- le star2 @}
3203 A word in Lyrics mode begins with: an alphabetic character, @code{_},
3204 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
3205 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
3206 any 8-bit character with ASCII code over 127, or a two-character
3207 combination of a backslash followed by one of @code{`}, @code{'},
3208 @code{"}, or @code{^}.
3210 Subsequent characters of a word can be any character that is not a digit
3211 and not white space. One important consequence of this is that a word
3212 can end with @code{@}}. The following example is usually a bug. The
3213 syllable includes a @code{@}}, and hence the opening brace is not balanced.
3215 \lyrics @{ twinkle@}
3217 which may be confusing.
3219 @cindex @code{\property}, in @code{\lyrics}
3220 Similarly, a period following a alphabetic sequence, is included in the
3221 resulting string. As a consequence, spaces must be inserted around
3222 @code{\property} commands:
3224 \property Lyrics . LyricText \set #'font-shape = #'italic
3228 @cindex spaces, in lyrics
3229 @cindex quotes, in lyrics
3231 Any @code{_} character which appears in an unquoted word is converted
3232 to a space. This provides a mechanism for introducing spaces into words
3233 without using quotes. Quoted words can also be used in Lyrics mode to
3234 specify words that cannot be written with the above rules:
3237 \lyrics @{ He said: "\"Let" my peo ple "go\"" @}
3241 Hyphens can be entered as ordinary hyphens at the end of a syllable, i.e.
3246 These will be attached to the end of the first syllable.
3248 Centered hyphens are entered using the special `@code{-}@code{-}' lyric
3249 as a separate word between syllables. The hyphen will have variable
3250 length depending on the space between the syllables and it will be
3251 centered between the syllables.
3256 When a lyric is sung over many notes (this is called a melisma), this is
3257 indicated with a horizontal line centered between a syllable and the
3258 next one. Such a line is called an extender line, and it is entered as
3263 @internalsref{LyricEvent}, @internalsref{HyphenEvent},
3264 @internalsref{ExtenderEvent}.
3268 The definition of lyrics mode is too complex.
3270 @node The Lyrics context
3271 @subsection The Lyrics context
3273 Lyrics are printed by interpreting them in @internalsref{Lyrics}
3276 \context Lyrics \lyrics @dots{}
3279 @cindex automatic syllable durations
3280 @cindex @code{\addlyrics}
3281 @cindex lyrics and melodies
3283 This will place the lyrics according to the durations that were
3284 entered. The lyrics can also be aligned under a given melody
3285 automatically. In this case, it is no longer necessary to enter the
3286 correct duration for each syllable. This is achieved by combining the
3287 melody and the lyrics with the @code{\addlyrics} expression
3291 \context Lyrics @dots{}
3294 @cindex staff order, with @code{\addlyrics}
3296 Normally, this will put the lyrics below the staff. For different or
3297 more complex orderings, the best way is to setup the hierarchy of
3298 staffs and lyrics first, e.g.
3300 \context ChoirStaff \notes <
3301 \context Lyrics = LA @{ s1 @}
3302 \context Staff = SA @{ s1 @}
3303 \context Lyrics = LB @{ s1 @}
3304 \context Staff = SB @{ s1 @}
3307 and then combine the appropriate melodies and lyric lines:
3310 \context Staff = SA @emph{the music}
3311 \context Lyrics = LA @emph{the lyrics}
3314 putting both together, you would get
3316 \context ChoirStaff \notes <
3317 \context Lyrics = LA @dots{}
3318 \context Staff = SB @dots{}
3324 @cindex choral score
3326 An example of a SATB score setup is in the file
3327 @inputfileref{input/template,satb}.
3331 @internalsref{LyricCombineMusic}, @internalsref{Lyrics},
3332 @inputfileref{input/template,satb}.
3336 @code{\addlyrics} is not automatic enough: melismata are not detected
3337 automatically, and melismata are not stopped when they hit a rest. A
3338 melisma on the last note in a melody is not printed.
3342 @subsection More stanzas
3345 @cindex phrasing, in lyrics
3347 When multiple stanzas are printed underneath each other, the vertical
3348 groups of syllables should be aligned around punctuation. This can be
3349 done automatically when corresponding lyric lines and melodies are
3352 To this end, give the @internalsref{Voice} context an identity,
3354 \context Voice = duet @{
3359 Then set the @internalsref{LyricsVoice} contexts to names starting with
3360 that identity followed by a dash. In the preceding example, the
3361 @internalsref{Voice} identity is @code{duet}, so the identities of the
3362 @internalsref{LyricsVoices} are marked @code{duet-1} and @code{duet-2}.
3364 \context LyricsVoice = "duet-1" @{
3365 Hi, my name is bert. @}
3366 \context LyricsVoice = "duet-2" @{
3367 Ooooo, ch\'e -- ri, je t'aime. @}
3369 The convention for naming @internalsref{LyricsVoice} and
3370 @internalsref{Voice} must also be used to get melismata on rests
3373 The complete example is shown here.
3374 @lilypond[singleline,verbatim]
3377 \notes \relative c'' \context Voice = duet { \time 3/4
3379 \lyrics \context Lyrics <
3380 \context LyricsVoice = "duet-1" {
3381 \property LyricsVoice . stanza = "Bert"
3382 Hi, my name is bert. }
3383 \context LyricsVoice = "duet-2" {
3384 \property LyricsVoice . stanza = "Ernie"
3385 Ooooo, ch\'e -- ri, je t'aime. }
3390 Stanza numbers, or the names of the singers can be added by setting
3391 @code{LyricsVoice.Stanza} (for the first system) and
3392 @code{LyricsVoice.stz} for the following systems. Notice how dots are
3393 surrounded with spaces in @code{\lyrics} mode.
3396 \property LyricsVoice . stanza = "Bert"
3398 \property LyricsVoice . stanza = "Ernie"
3401 You can use empty syllables, e.g. @code{_4} or @code{" "4} to enter
3402 lyrics. This can confuse the LilyPond -- for example, this might put
3403 (empty) lyrics under rests. To remedy this, use @code{\skip} instead.
3411 Input for lyrics introduces a syntactical ambiguity:
3418 is interpreted as assigning a string identifier @code{\foo} such that
3419 it contains @code{"bar"}. However, it could also be interpreted as
3420 making or a music identifier @code{\foo} containing the syllable
3421 `bar'. The force the latter interpretation, use
3431 The term @emph{ambitus} denotes a range of pitches for a given voice in
3432 a part of music. It also may denote the pitch range that a musical
3433 instrument is capable of playing. Most musical instruments have their
3434 ambitus standardized (or at least there is agreement upon the minimal
3435 ambitus of a particular type of instrument), such that a composer or
3436 arranger of a piece of music can easily meet the ambitus constraints of
3437 the targeted instrument. However, the ambitus of the human voice
3438 depends on individual physiological state, including education and
3439 training of the voice. Therefore, a singer potentially has to check for
3440 each piece of music if the ambitus of that piece meets his individual
3441 capabilities. This is why the ambitus of a piece may be of particular
3442 value to vocal performers.
3444 The ambitus is typically notated on a per-voice basis at the very
3445 beginning of a piece, e.g. nearby the initial clef or time signature of
3446 each staff. The range is graphically specified by two noteheads, that
3447 represent the minimum and maximum pitch. Some publishers use a textual
3448 notation: they put the range in words in front of the corresponding
3449 staff. Lilypond currently only supports the graphical ambitus notation.
3451 To apply, add the @internalsref{Ambitus_engraver} to the
3452 @internalsref{Voice} context, i.e.
3455 \paper @{ \translator @{
3457 \consists Ambitus_engraver
3463 @lilypond[singleline]
3464 upper = \notes \relative c {
3467 as'' c e2 bes f cis d4 e f2 g
3469 lower = \notes \relative c {
3472 e'4 b g a c es fis a cis b a g f e d2
3475 \context ChoirStaff {
3477 \context Staff = one { \upper }
3478 \context Staff = three { \lower }
3484 \consists Ambitus_engraver
3493 @internalsref{Ambitus}, @inputfileref{input/regression,ambitus.ly}.
3498 Tablature notation is used for notating music for plucked string
3499 instruments. It notates pitches not by using note heads, but by
3500 indicating on which string and fret a note must be played. LilyPond
3501 offers limited support for tablature.
3504 * Tablatures basic::
3505 * Non-guitar tablatures::
3508 @node Tablatures basic
3509 @subsection Tablatures basic
3510 @cindex Tablatures basic
3512 The string number associated to a note is given as a backslash
3513 followed by a number, e.g. @code{c4\3} for a C quarter on the third
3514 string. By default, string 1 is the highest one, and the tuning
3515 defaults to the standard guitar tuning (with 6 strings). The notes
3516 are printed as tablature, by using @internalsref{TabStaff} and
3517 @internalsref{TabVoice} contexts.
3519 @lilypond[fragment,verbatim]
3520 \notes \context TabStaff {
3526 If you do not specify a string number then one is selected
3527 automatically: the first string that does not give a fret number less
3528 than @code{minimumFret} is selected. The default value for
3529 @code{minimumFret} is 0.
3533 e8 fis gis a b cis' dis' e'
3534 \property TabStaff.minimumFret = #8
3535 e8 fis gis a b cis' dis' e'
3540 e8 fis gis a b cis' dis' e'
3541 \property TabStaff.minimumFret = #8
3542 e8 fis gis a b cis' dis' e'
3545 \context StaffGroup <
3546 \context Staff { \clef "G_8" \frag }
3547 \context TabStaff { \frag }
3554 @internalsref{TabStaff}, @internalsref{TabVoice}, and
3555 @internalsref{StringNumberEvent}.
3559 Chords are not handled in a special way, and hence the automatic
3560 string selector may easily select the same string to two notes in a
3564 @node Non-guitar tablatures
3565 @subsection Non-guitar tablatures
3566 @cindex Non-guitar tablatures
3568 You can change the number of strings, by setting the number of lines
3569 in the @internalsref{TabStaff} (the @code{line-count} property of
3570 @internalsref{TabStaff} can only be changed using
3571 @code{\outputproperty}, for more information, see @ref{Tuning objects}.
3573 You can change the tuning of the strings. A string tuning is given as
3574 a Scheme list with one integer number for each string, the number
3575 being the pitch (measured in semitones relative to central C) of an
3576 open string. The numbers specified for @code{stringTuning} are the
3577 numbers of semitones to subtract or add, starting the specified pitch
3578 by default middle C, in string order: thus the notes are e, a, d, and
3581 @lilypond[fragment,verbatim]
3584 \outputproperty #(make-type-checker 'staff-symbol-interface)
3586 \property TabStaff.stringTunings = #'(-5 -10 -15 -20)
3589 a,4 c' a e' e c' a e'
3594 It is possible to change the Scheme function to format the tablature
3595 note text. The default is @code{fret-number-tablature-format}, which
3596 uses the fret number. For instruments that do not use this notation,
3597 you can create a special tablature formatting function. This function
3598 takes three argument: the string number, the string tuning and the
3603 As tablature is a recent feature, most of the guitar special effects
3604 such as bend are not yet supported.
3608 @section Chord names
3611 LilyPond has support for both entering and printing named chords.
3612 These chords are internally represented as a set of pitches. Therefore
3613 they can be entered by name and printed as notes, entered as notes and
3614 printed as chord names, or (the most common case) entered them by
3615 name, and print them as name. The following fragment shows these
3618 @lilypond[verbatim,singleline]
3619 twoWays = \notes \transpose c c' {
3629 < \context ChordNames \twoWays
3630 \context Voice \twoWays > }
3633 This example also shows that the chord printing routines do not try to
3634 be intelligent. The chord @code{f bes d}, is not interpreted as an
3640 * Printing chord names::
3645 @subsection Chords mode
3648 Chord mode is a mode where you can input sets of pitches using common
3649 names. It is introduced by the keyword @code{\chords}.
3650 In chords mode, a chord is entered by the root, which is entered
3651 like a common pitch, for example,
3652 @lilypond[fragment,verbatim,quote, relative=1]
3653 \chords { es4. d8 c2 }
3658 Other chords may be entered by suffixing a colon, and introducing a
3659 modifier, and optionally, a number, for example
3661 @lilypond[fragment,verbatim,quote]
3662 \chords { e1:m e1:7 e1:m7 }
3664 The first number following the root is taken to be the `type' of the
3665 chord, thirds are added to the root until it reaches the specified
3666 number, for example.
3667 @lilypond[fragment,verbatim]
3668 \chords { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 }
3671 @cindex root of chord
3672 @cindex additions, in chords
3673 @cindex removals, in chords
3675 More complex chords may also be constructed adding separate steps
3676 to a chord. Additions are added after the number following
3677 the colon, and are separated by dots. For example
3679 @lilypond[verbatim,fragment,quote]
3680 \chords { c:5.6 c:3.7.8 c:3.6.13 }
3682 Chord steps can be altered by suffixing a @code{-} or @code{+} sign
3683 to the number, for example:
3684 @lilypond[verbatim,fragment,quote]
3685 \chords { c:7+ c:5+.3- c:3-.5-.7- }
3687 Removals are specified similarly, and are introduced by a caret. They
3688 must come after the additions.
3689 @lilypond[verbatim,fragment]
3690 \chords { c^3 c:7^5 c:9^3.5 }
3693 Modifiers can be used to change pitches. The following modifiers are
3697 is the minor chord. This modifier lowers the 3rd and (if present) the 7th step.
3699 is the diminished chord. This modifier lowers the 3rd, 5th and (if present)
3702 is the augmented chord. This modifier raises the 5th step.
3704 is the major 7th chord. This modifier raises the 7th step if present.
3706 is the suspended 4th or 2nd. This modifier removes the 3rd
3707 step. Append either @code{2} or @code{4} to add the 2nd or 4th step to
3710 Modifiers can be mixed with additions.
3711 @lilypond[verbatim,fragment]
3712 \chords { c:sus4 c:7sus4 c:dim7 c:m6 }
3715 @cindex modifiers, in chords.
3722 Since the unaltered 11 does sound well when combined with the
3723 unaltered 3, the 11 is removed in this case, unless it is added
3724 explicitly). For example,
3725 @lilypond[fragment,verbatim]
3726 \chords { c:13 c:13.11 c:m13 }
3731 An inversion (putting one pitch of the chord on the bottom), as well
3732 as bass notes, can be specified by appending
3733 @code{/}@var{pitch} to the chord.
3734 @lilypond[fragment,verbatim,center]
3735 \chords { c1 c/g c/f }
3738 If you do not want to remove the bass note from the chord, but rather
3739 add the note, then you can use @code{/+}@var{pitch}.
3741 @lilypond[fragment,verbatim,center]
3742 \chords { c1 c/+g c/+f }
3745 Chords is a mode similar to @code{\lyrics}, @code{\notes} etc. Most
3746 of the commands continue to work, for example, @code{r} and
3747 @code{\skip} can be used to insert rests and spaces, and
3748 @code{\property} may be used to change various settings.
3754 Each step can only be present in a chord once. The following
3755 simply produces the augmented chord, since @code{5+} is interpreted
3758 @lilypond[verbatim,fragment]
3759 \chords { c:5.5-.5+ }
3762 In chord mode, dashes and carets are used to indicate chord additions
3763 and subtractions, so articulation scripts cannot be entered.
3766 @node Printing chord names
3767 @subsection Printing chord names
3769 @cindex printing chord names
3773 For displaying printed chord names, use the @internalsref{ChordNames}
3774 context. The chords may be entered either using the notation
3775 described above, or directly using @code{<<} and @code{>>}.
3777 @lilypond[verbatim,singleline]
3779 \chords {a1 b c} <<d' f' g'>> <<e' g' b'>>
3783 \context ChordNames \scheme
3784 \context Staff \scheme
3789 You can make the chord changes stand out by setting
3790 @internalsref{ChordNames}.@code{chordChanges} to true. This will only
3791 display chord names when there is a change in the chords scheme and at
3792 the start of a new line.
3796 c1:m c:m \break c:m c:m d
3800 \context ChordNames {
3801 \property ChordNames.chordChanges = ##t
3803 \context Staff \transpose c c' \scheme
3805 \paper{linewidth= 9.\cm}
3809 The default chord name layout is a system for Jazz music, proposed by
3810 Klaus Ignatzek (See @ref{Literature}).
3812 The Ignatzek chord name formatting can be tuned in a number of ways
3813 through the following properties:
3816 @cindex chordNameExceptions
3817 @item chordNameExceptions
3818 This is a list that contains the chords that have special formatting.
3820 @inputfileref{input/regression,chord-name-exceptions.ly}.
3821 @cindex exceptions, chord names.
3824 @cindex majorSevenSymbol
3825 @item majorSevenSymbol
3826 This property contains the markup object used for the 7th step, when
3827 it is major. Predefined options are @code{whiteTriangleMarkup} and
3828 @code{blackTriangleMarkup}. See
3829 @inputfileref{input/regression,chord-name-major7.ly} for an example.
3831 @cindex chordNameSeparator
3832 @item chordNameSeparator
3833 Different parts of a chord name are normally separated by a
3834 slash. By setting @code{chordNameSeparator}, you can specify other
3836 @lilypond[fragment,verbatim]
3837 \context ChordNames \chords {
3839 \property ChordNames.chordNameSeparator
3844 @cindex chordRootNamer
3845 @item chordRootNamer
3846 The root of a chord is usually printed as a letter with an optional
3847 alteration. The transformation from pitch to letter is done by this
3848 function. Special note names (for example, the German ``H'' for a
3849 B-chord) can be produced by storing a new function in this property.
3851 @cindex chordNoteNamer
3852 @item chordNoteNamer
3853 The default is to print single notes (as for instance the bass note)
3854 using the @code{chordRootNamer}. However, by setting this function to a non-null
3855 value you can specify a different function. I.e. you could use letters
3856 in lower case for the base note.
3861 There are also two other chord name schemes implemented: an alternate
3862 Jazz chord notation, and a systematic scheme called Banter chords. The
3863 alternate jazz notation is also shown on the chart in @ref{Chord name
3864 chart}. Turning on these styles is described in the input file
3865 @inputfileref{input/test/,chord-names-jazz.ly}.
3869 @cindex chords, jazz
3874 @cindex @code{\germanChords }
3875 @code{\germanChords},
3876 @cindex @code{\semiGermanChords }
3877 @code{\semiGermanChords},
3884 @inputfileref{input/regression,chord-name-major7.ly},
3885 @inputfileref{input/regression,chord-name-exceptions.ly},
3886 @inputfileref{input/test,chord-names-jazz.ly},
3887 @inputfileref{input/test,chord-names-german.ly},
3888 @file{scm/chords-ignatzek.scm}, @file{scm/chord-entry.scm}
3893 Chord names are determined solely from the list of pitches. Chord
3894 inversions are not identified, and neither are added bass notes. This
3895 may result in strange chord names when chords are entered with the
3896 @code{<< .. >>} syntax.
3901 @node Orchestral music
3902 @section Orchestral music
3904 @cindex Writing parts
3906 Orchestral music involves some special notation, both in the full
3907 score and the individual parts. This section explains how to tackle
3908 some common problems in orchestral music.
3913 * Multiple staff contexts::
3916 * Instrument names::
3918 * Multi measure rests::
3919 * Automatic part combining::
3921 * Sound output for transposing instruments::
3924 @node Multiple staff contexts
3925 @subsection Multiple staff contexts
3927 Polyphonic scores consist of many staffs. These staffs can be
3928 constructed in three different ways:
3930 @item The group is started with a brace at the left. This is done with the
3931 @internalsref{GrandStaff} context.
3932 @item The group is started with a bracket. This is done with the
3933 @internalsref{StaffGroup} context
3934 @item The group is started with a vertical line. This is the default
3938 @cindex Staff, multiple
3939 @cindex bracket, vertical
3940 @cindex brace, vertical
3947 @node Rehearsal marks
3948 @subsection Rehearsal marks
3949 @cindex Rehearsal marks
3951 @cindex @code{\mark}
3953 To print a rehearsal mark, use the @code{\mark} command.
3954 @lilypond[fragment,verbatim]
3964 The mark is incremented automatically if you use @code{\mark
3965 \default}. The value to use is stored in the property
3966 @code{rehearsalMark} is used and automatically incremented.
3968 The @code{\mark} command can also be used to put signs like coda,
3969 segno and fermatas on a barline. Use @code{\markup} to
3970 to access the appropriate symbol.
3972 @lilypond[fragment,verbatim,relative=1]
3973 c1 \mark \markup { \musicglyph #"scripts-ufermata" }
3977 In this case, during line breaks,
3978 marks must also be printed at the end of the line, and not at the
3979 beginning. Use the following to force that behavior
3981 \property Score.RehearsalMark \override
3982 #'break-visibility = #begin-of-line-invisible
3985 See @inputfileref{input/test,boxed-molecule.ly}. for putting boxes
3991 @cindex barlines, putting symbols on
3995 @internalsref{MarkEvent}, @internalsref{RehearsalMark},
3996 @inputfileref{input/test,boxed-molecule.ly}.
4000 @subsection Bar numbers
4004 @cindex measure numbers
4005 @cindex currentBarNumber
4007 Bar numbers are printed by default at the start of the line. The
4008 number itself is stored in the
4009 @code{currentBarNumber} property,
4010 which is normally updated automatically for every measure.
4012 Bar numbers can be typeset at regular intervals instead of at the
4013 beginning of each line. This is illustrated in the following example,
4014 whose source is available as
4015 @inputfileref{input/test,bar-number-every-fifth.ly}
4017 @lilypondfile[notexidoc]{bar-number-every-fifth.ly}
4019 The start of that numbering can also be reset, as demonstrated in
4020 @inputfileref{input/test,bar-number-every-five-reset.ly}.
4022 @lilypondfile[notexidoc]{bar-number-every-five-reset.ly}
4027 @internalsref{BarNumber}.
4028 @inputfileref{input/test,bar-number-every-five-reset.ly}.
4029 @inputfileref{input/test,bar-number-every-fifth.ly}
4033 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
4034 there is one at the top. To solve this, You have to twiddle with the
4035 @internalsref{padding} property of @internalsref{BarNumber} if your
4036 score starts with a @internalsref{StaffGroup}.
4038 @node Instrument names
4039 @subsection Instrument names
4041 In an orchestral score, instrument names are printed left of the
4044 This can be achieved by setting @internalsref{Staff}.@code{instrument}
4045 and @internalsref{Staff}.@code{instr}. This will print a string before
4046 the start of the staff. For the first start, @code{instrument} is
4047 used, for the next ones @code{instr} is used.
4049 @lilypond[verbatim,singleline]
4050 \property Staff.instrument = "ploink " { c''4 }
4053 You can also use markup texts to construct more complicated instrument
4056 @lilypond[fragment,verbatim,singleline]
4057 \notes \context Staff = treble {
4058 \property Staff.instrument = \markup {
4059 \column << "Clarinetti"
4061 \smaller \musicglyph #"accidentals--1"
4072 @internalsref{InstrumentName}
4076 When you put a name on a grand staff or piano staff the width of the
4077 brace is not taken into account. You must add extra spaces to the end of
4078 the name to avoid a collision.
4081 @subsection Transpose
4083 @cindex transposition of pitches
4084 @cindex @code{\transpose}
4086 A music expression can be transposed with @code{\transpose}. The syntax
4089 \transpose @var{from} @var{to} @var{musicexpr}
4092 This means that @var{musicexpr} is transposed by the interval
4093 between @var{from} and @var{to}.
4095 @code{\transpose} distinguishes between enharmonic pitches: both
4096 @code{\transpose c cis} or @code{\transpose c des} will transpose up
4097 half a tone. The first version will print sharps and the second
4098 version will print flats.
4100 @lilypond[singleline, verbatim]
4101 mus =\notes { \key d \major cis d fis g }
4102 \score { \notes \context Staff {
4105 \transpose c g' \mus
4106 \transpose c f' \mus
4112 @internalsref{TransposedMusic}, @internalsref{UntransposableMusic}.
4116 If you want to use both @code{\transpose} and @code{\relative}, then
4117 you must put @code{\transpose} outside of @code{\relative}, since
4118 @code{\relative} will have no effect music that appears inside a
4124 @node Multi measure rests
4125 @subsection Multi measure rests
4126 @cindex multi measure rests
4127 @cindex Rests, multi measure
4131 Multi measure rests are entered using `@code{R}'. It is specifically
4132 meant for full bar rests and for entering parts: the rest can expand to
4133 fill a score with rests, or it can be printed as a single multimeasure
4134 rest. This expansion is controlled by the property
4135 @code{Score.skipBars}. If this is set to true, Lily will not expand
4136 empty measures, and the appropriate number is added automatically.
4138 @lilypond[fragment,verbatim]
4139 \time 4/4 r1 | R1 | R1*2
4140 \property Score.skipBars = ##t R1*17 R1*4
4143 The @code{1} in @code{R1} is similar to the duration notation used for
4144 notes. Hence, for time signatures other than 4/4, you must enter other
4145 durations. This can be done with augmentation dots or fractions:
4147 @lilypond[fragment,verbatim]
4148 \property Score.skipBars = ##t
4156 A @code{R} spanning a single measure is printed as a whole rest
4157 centered in the measure (or a breve when the measure lasts longer than
4158 two whole notes), 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},
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 OK6, 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},
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}
4309 @node Frenched scores
4310 @subsection Frenched scores
4312 In orchestral scores, staff lines that only have rests are usually removed.
4313 This saves some space. This style is called `French Score'.
4317 This is supported through the @code{RemoveEmptyStaff}. This staff is
4318 removed when it turns out empty (or containing multimeasure rests)
4319 after the line-breaking process.
4321 For @internalsref{Lyrics}, @internalsref{LyricsVoice},
4322 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
4323 switched on by default. For normal staffs, it is available as a
4324 specialized @internalsref{Staff} context, with the name variable
4325 @code{\RemoveEmptyStaffContext}. Observe how the second staff in this
4326 example disappears in the second line.
4330 \notes \relative c' <
4331 \context Staff = SA { e4 f g a \break c1 }
4332 \context Staff = SB { c4 d e f \break R1 }
4336 \translator { \RemoveEmptyStaffContext }
4342 @node Sound output for transposing instruments
4343 @subsection Sound output for transposing instruments
4345 When you want to make a MIDI file from a score containing transposed
4346 and untransposed instruments, you have to instruct LilyPond the pitch
4347 offset (in semitones) for the transposed instruments. This is done
4348 using the @code{transposing} property. It does not affect printed
4351 @cindex @code{transposing}
4354 \property Staff.instrument = #"Cl. in B-flat"
4355 \property Staff.transposing = #-2
4359 @node Ancient notation
4360 @section Ancient notation
4362 @cindex Vaticana, Editio
4363 @cindex Medicaea, Editio
4368 @c [TODO: write introduction on ancient notation]
4371 * Ancient note heads::
4380 @node Ancient note heads
4381 @subsection Ancient note heads
4383 To get a longa note head, you have to use mensural note heads. This
4384 is accomplished by setting the @code{style} property of the
4385 NoteHead object to @code{mensural}. There is also a note head style
4386 @code{baroque} which gives mensural note heads for @code{\longa} and
4387 @code{\breve} but standard note heads for shorter notes.
4389 @lilypond[fragment,singleline,verbatim]
4390 \property Voice.NoteHead \set #'style = #'mensural
4395 @subsection Ancient clefs
4397 LilyPond supports a variety of clefs, many of them ancient.
4399 For modern clefs, see section @ref{Clef}. For the percussion clef, see
4400 section @ref{Percussion staves}. For the @code{TAB} clef, see section
4403 The following table shows all ancient clefs that are supported via the
4404 @code{\clef} command. Some of the clefs use the same glyph, but
4405 differ only with respect to the line they are printed on. In such
4406 cases, a trailing number in the name is used to enumerate these clefs.
4407 Still, you can manually force a clef glyph to be typeset on an
4408 arbitrary line, as described in section @ref{Clef}. The note printed
4409 to the right side of each clef in the example column denotes the
4410 @code{c'} with respect to that clef.
4412 @multitable @columnfractions .3 .3 .3 .1
4416 @b{Description} @tab
4417 @b{Supported Clefs} @tab
4421 @code{clefs-neo_mensural_c} @tab
4422 modern style mensural C clef @tab
4423 @code{neo_mensural_c1}, @code{neo_mensural_c2},
4424 @code{neo_mensural_c3}, @code{neo_mensural_c4} @tab
4425 @lilypond[relative 0, notime]
4426 \property Staff.TimeSignature \set #'transparent = ##t
4427 \clef "neo_mensural_c2" c
4431 @code{clefs-petrucci_c1}
4432 @code{clefs-petrucci_c2}
4433 @code{clefs-petrucci_c3}
4434 @code{clefs-petrucci_c4}
4435 @code{clefs-petrucci_c5}
4438 petrucci style mensural C clefs, for use on different stafflines
4439 (the examples shows the 2nd staffline C clef).
4449 @lilypond[relative 0, notime]
4450 \property Staff.TimeSignature \set #'transparent = ##t
4451 \clef "petrucci_c2" c
4455 @code{clefs-petrucci_f} @tab
4456 petrucci style mensural F clef @tab
4457 @code{petrucci_f} @tab
4458 @lilypond[relative 0, notime]
4459 \property Staff.TimeSignature \set #'transparent = ##t
4460 \clef "petrucci_f" c
4464 @code{clefs-petrucci_g} @tab
4465 petrucci style mensural G clef @tab
4466 @code{petrucci_g} @tab
4467 @lilypond[relative 0, notime]
4468 \property Staff.TimeSignature \set #'transparent = ##t
4469 \clef "petrucci_g" c
4473 @code{clefs-mensural_c'} @tab
4474 historic style mensural C clef @tab
4475 @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3},
4476 @code{mensural_c4} @tab
4477 @lilypond[relative 0, notime]
4478 \property Staff.TimeSignature \set #'transparent = ##t
4479 \clef "mensural_c2" c
4483 @code{clefs-mensural_f} @tab
4484 historic style mensural F clef @tab
4485 @code{mensural_f} @tab
4486 @lilypond[relative 0, notime]
4487 \property Staff.TimeSignature \set #'transparent = ##t
4488 \clef "mensural_f" c
4492 @code{clefs-mensural_g} @tab
4493 historic style mensural G clef @tab
4494 @code{mensural_g} @tab
4495 @lilypond[relative 0, notime]
4496 \property Staff.TimeSignature \set #'transparent = ##t
4497 \clef "mensural_g" c
4501 @code{clefs-vaticana_do} @tab
4502 Editio Vaticana style do clef @tab
4503 @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab
4504 @lilypond[relative 0, notime]
4506 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4507 \property Staff.TimeSignature \set #'transparent = ##t
4508 \clef "vaticana_do2" c
4512 @code{clefs-vaticana_fa} @tab
4513 Editio Vaticana style fa clef @tab
4514 @code{vaticana_fa1}, @code{vaticana_fa2} @tab
4515 @lilypond[relative 0, notime]
4517 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4518 \property Staff.TimeSignature \set #'transparent = ##t
4519 \clef "vaticana_fa2" c
4523 @code{clefs-medicaea_do} @tab
4524 Editio Medicaea style do clef @tab
4525 @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab
4526 @lilypond[relative 0, notime]
4528 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4529 \property Staff.TimeSignature \set #'transparent = ##t
4530 \clef "medicaea_do2" c
4534 @code{clefs-medicaea_fa} @tab
4535 Editio Medicaea style fa clef @tab
4536 @code{medicaea_fa1}, @code{medicaea_fa2} @tab
4537 @lilypond[relative 0, notime]
4539 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4540 \property Staff.TimeSignature \set #'transparent = ##t
4541 \clef "medicaea_fa2" c
4545 @code{clefs-hufnagel_do} @tab
4546 historic style hufnagel do clef @tab
4547 @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab
4548 @lilypond[relative 0, notime]
4550 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4551 \property Staff.TimeSignature \set #'transparent = ##t
4552 \clef "hufnagel_do2" c
4556 @code{clefs-hufnagel_fa} @tab
4557 historic style hufnagel fa clef @tab
4558 @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab
4559 @lilypond[relative 0, notime]
4561 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4562 \property Staff.TimeSignature \set #'transparent = ##t
4563 \clef "hufnagel_fa2" c
4567 @code{clefs-hufnagel_do_fa} @tab
4568 historic style hufnagel combined do/fa clef @tab
4569 @code{hufnagel_do_fa} @tab
4570 @lilypond[relative 0, notime]
4571 \property Staff.TimeSignature \set #'transparent = ##t
4572 \clef "hufnagel_do_fa" c
4577 @c --- This should go somewhere else: ---
4578 @c @item modern style percussion clef (glyph: @code{clefs-percussion})
4581 @c @code{percussion}
4583 @c @lilypond{\property Staff.TimeSignature \set #'transparent = ##t \clef "percussion" c'}
4585 @c @item modern style tab clef (glyph: @code{clefs-tab})
4590 @c @lilypond{\context Staff \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #6 \property Staff.TimeSignature \set #'transparent = ##t \clef "tab" c'}
4592 @emph{Modern style} means ``as is typeset in contemporary editions of
4593 transcribed mensural music''.
4595 @emph{Petrucci style} means ``inspired by printings published by the
4596 famous engraver Petrucci (1466-1539)''.
4598 @emph{Historic style} means ``as was typeset or written in historic
4599 editions (other than those of Petrucci)''.
4601 @emph{Editio XXX style} means ``as is/was printed in Editio XXX''.
4603 Petrucci used C clefs with differently balanced left-side vertical
4604 beams, depending on which staffline it is printed.
4608 @subsection Custodes
4613 A @emph{custos} (plural: @emph{custodes}; latin word for `guard') is a
4614 symbol that appears at the end of a staff. It anticipates the pitch
4615 of the first note(s) of the following line and thus helps the player
4616 or singer to manage line breaks during performance, thus enhancing
4617 readability of a score.
4619 Custodes were frequently used in music notation until the 17th
4620 century. Nowadays, they have survived only in a few particular forms
4621 of musical notation such as contemporary editions of Gregorian chant
4622 like the @emph{editio vaticana}. There are different custos glyphs
4623 used in different flavours of notational style.
4625 For typesetting custodes, just put a @internalsref{Custos_engraver} into the
4626 @internalsref{Staff} context when declaring the @code{\paper} block,
4627 as shown in the following example.
4633 \consists Custos_engraver
4634 Custos \override #'style = #'mensural
4639 The result looks like this:
4645 \property Staff.Custos \set #'style = #'mensural
4652 \consists Custos_engraver
4659 The custos glyph is selected by the @code{style} property. The styles
4660 supported are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
4661 @code{mensural}. They are demonstrated in the following fragment:
4671 { " " \musicglyph #"custodes-vaticana-u0" }
4675 { " " \musicglyph #"custodes-medicaea-u0" }
4679 { " " \musicglyph #"custodes-hufnagel-u0" }
4683 { " " \musicglyph #"custodes-mensural-u0" }
4692 \remove "Bar_number_engraver"
4696 \remove "Clef_engraver"
4697 \remove "Key_engraver"
4698 \remove "Time_signature_engraver"
4699 \remove "Staff_symbol_engraver"
4700 minimumVerticalExtent = ##f
4706 If the boolean property @code{adjust-if-on-staffline} is set to
4707 @code{#t} (which it is by default), lily typesets slightly different
4708 variants of the custos glyph, depending on whether the custos, is
4709 typeset on or between stafflines. The glyph will
4710 optically fit well into the staff, with the appendage on the right of
4711 the custos always ending at the same vertical position between two
4712 stafflines regardless of the pitch. If you set
4713 @code{adjust-if-on-staffline} to @code{#f}, then
4714 a compromise between both forms is used.
4716 Just like stems can be attached to noteheads in two directions
4717 @emph{up} and @emph{down}, each custos glyph is available with its
4718 appendage pointing either up or down. If the pitch of a custos is
4719 above a selectable position, the appendage will point downwards; if
4720 the pitch is below this position, the appendage will point upwards.
4721 Use property @code{neutral-position} to select this position. By
4722 default, it is set to @code{0}, such that the neutral position is the
4723 center of the staff. Use property @code{neutral-direction} to control
4724 what happens if a custos is typeset on the neutral position itself.
4725 By default, this property is set to @code{-1}, such that the appendage
4726 will point downwards. If set to @code{1}, the appendage will point
4727 upwards. Other values such as @code{0} are reserved for future
4728 extensions and should not be used.
4733 @internalsref{Custos}, @inputfileref{input/test,custos-style.ly} and
4734 @inputfileref{input/regression,custos.ly}.
4738 @subsection Divisiones
4744 A @emph{divisio} (plural: @emph{divisiones}; latin word for
4745 `division') is a staff context symbol that is used to structure
4746 Gregorian music into phrases and sections. The musical meaning of
4747 @emph{divisio minima}, @emph{divisio maior} and @emph{divisio maxima}
4748 can be characterized as short, medium and long pause, somewhat like
4749 @ref{Breath marks}. The @emph{finalis} sign not only marks the end of
4750 a chant, but is also frequently used within a single
4751 antiphonal/responsorial chant to mark the end of each section.
4755 To use divisiones, include the file @code{gregorian-init.ly}. It
4756 contains definitions that you can apply by just inserting
4757 @code{\divisioMinima}, @code{\divisioMaior}, @code{\divisioMaxima},
4758 and @code{\finalis} at proper places in the input. Some editions use
4759 @emph{virgula} or @emph{caesura} instead of divisio minima.
4760 Therefore, @code{gregorian-init.ly} also defines @code{\virgula} and
4764 @lilypondfile[notexidoc]{divisiones.ly}
4768 @internalsref{BreathingSign}, @internalsref{BreathingSignEvent},
4769 @inputfileref{input/test,divisiones.ly}, @ref{Breath marks}.
4772 @subsection Ligatures
4776 @c TODO: Should double check if I recalled things correctly when I wrote
4777 @c down the following paragraph by heart.
4779 In musical terminology, a ligature is a coherent graphical symbol that
4780 represents at least two different notes. Ligatures originally appeared
4781 in the manuscripts of Gregorian chant notation roughly since the 9th
4782 century as an allusion to the accent symbols of greek lyric poetry to
4783 denote ascending or descending sequences of notes. Both, the shape and
4784 the exact meaning of ligatures changed tremendously during the following
4785 centuries: In early notation, ligatures where used for monophonic tunes
4786 (Gregorian chant) and very soon denoted also the way of performance in
4787 the sense of articulation. With upcoming multiphony, the need for a
4788 metric system arised, since multiple voices of a piece have to be
4789 synchronized some way. New notation systems were invented that used
4790 the manifold shapes of ligatures to now denote rhythmical patterns
4791 (e.g. black mensural notation, mannered notation, ars nova). With the
4792 invention of the metric system of the white mensural notation, the need
4793 for ligatures to denote such patterns disappeared. Nevertheless,
4794 ligatures were still in use in the mensural system for a couple of
4795 decades until they finally disappeared during the late 16th / early 17th
4796 century. Still, ligatures have survived in contemporary editions of
4797 Gregorian chant such as the Editio Vaticana from 1905/08.
4801 Syntactically, ligatures are simply enclosed by @code{\[} and
4802 @code{\]}. Some ligature styles (such as Editio Vaticana) may need
4803 additional input syntax specific for this particular type of ligature.
4804 By default, the @internalsref{LigatureBracket} engraver just puts a
4805 square bracket above the ligature.
4807 @lilypond[singleline,verbatim]
4809 \notes \transpose c c' {
4817 To select a specific style of ligatures, a proper ligature engraver
4818 has to be added to the @internalsref{Voice} context, as explained in
4819 the following subsections. Currently, only white mensural ligatures
4820 are supported with certain limitations. Support for Editio Vaticana
4821 will be added in the future.
4824 * White mensural ligatures::
4825 * Gregorian square neumes ligatures::
4828 @node White mensural ligatures
4829 @subsubsection White mensural ligatures
4831 @cindex Mensural ligatures
4832 @cindex White mensural ligatures
4834 There is limited support for white mensural ligatures. The
4835 implementation is still experimental; it currently may output strange
4836 warnings or even crash in some cases or produce weird results on more
4837 complex ligatures. To engrave white mensural ligatures, in the paper
4838 block the @internalsref{Mensural_ligature_engraver} has to be put into
4839 the @internalsref{Voice} context, and remove the
4840 @internalsref{Ligature_bracket_engraver}:
4846 \remove Ligature_bracket_engraver
4847 \consists Mensural_ligature_engraver
4852 There is no additional input language to describe the shape of a
4853 white mensural ligature. The shape is rather determined solely from
4854 the pitch and duration of the enclosed notes. While this approach may
4855 take a new user a while to get accustomed, it has the great advantage
4856 that the full musical information of the ligature is known internally.
4857 This is not only required for correct MIDI output, but also allows for
4858 automatic transcription of the ligatures.
4863 \property Score.timing = ##f
4864 \property Score.defaultBarType = "empty"
4865 \property Voice.NoteHead \set #'style = #'neo_mensural
4866 \property Staff.TimeSignature \set #'style = #'neo_mensural
4868 \[ g\longa c\breve a\breve f\breve d'\longa \]
4870 \[ e1 f1 a\breve g\longa \]
4872 @lilypond[singleline]
4874 \notes \transpose c c' {
4875 \property Score.timing = ##f
4876 \property Score.defaultBarType = "empty"
4877 \property Voice.NoteHead \set #'style = #'neo_mensural
4878 \property Staff.TimeSignature \set #'style = #'neo_mensural
4880 \[ g\longa c\breve a\breve f\breve d'\longa \]
4882 \[ e1 f1 a\breve g\longa \]
4887 \remove Ligature_bracket_engraver
4888 \consists Mensural_ligature_engraver
4894 Without replacing @internalsref{Ligature_bracket_engraver} with
4895 @internalsref{Mensural_ligature_engraver}, the same music transcribes
4898 @lilypond[singleline]
4900 \notes \transpose c c' {
4901 \property Score.timing = ##f
4902 \property Score.defaultBarType = "empty"
4903 \property Voice.NoteHead \set #'style = #'neo_mensural
4904 \property Staff.TimeSignature \set #'style = #'neo_mensural
4906 \[ g\longa c\breve a\breve f\breve d'\longa \]
4908 \[ e1 f1 a\breve g\longa \]
4913 @node Gregorian square neumes ligatures
4914 @subsubsection Gregorian square neumes ligatures
4916 @cindex Square neumes ligatures
4917 @cindex Gregorian square neumes ligatures
4919 Gregorian square neumes notation (following the style of the Editio
4920 Vaticana) is under heavy development, but not yet really usable for
4921 production purposes. Core ligatures can already be typeset, but
4922 essential issues for serious typesetting are still under development,
4923 such as (among others) horizontal alignment of multiple ligatures,
4924 lyrics alignment and proper accidentals handling. Still, this section
4925 gives a sneak preview of what Gregorian chant may look like once it
4928 The following table contains the extended neumes table of the 2nd
4929 volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published
4930 1983 by the monks of Solesmes.
4932 @multitable @columnfractions .4 .2 .2 .2
4935 @b{Neuma aut@*Neumarum Elementa} @tab
4936 @b{Figurae@*Rectae} @tab
4937 @b{Figurae@*Liquescentes Auctae} @tab
4938 @b{Figurae@*Liquescentes Deminutae}
4940 @c TODO: \paper block is identical in all of the below examples.
4941 @c Therefore, it should somehow be included rather than duplicated all
4944 @c why not make identifiers in ly/engraver-init.ly? --hwn
4946 @c Because it's just used to typeset plain notes without
4947 @c a staff for demonstration purposes rather than something
4948 @c special of Gregorian chant notation. --jr
4953 @lilypond[noindent, 26pt, nofragment, linewidth=1.5cm]
4954 \include "gregorian-init.ly"
4956 \notes \transpose c c' {
4959 \noBreak s^\markup {"a"} \noBreak
4961 % Punctum Inclinatum
4963 \noBreak s^\markup {"b"}
4969 \remove "Bar_number_engraver"
4973 \remove "Clef_engraver"
4974 \remove "Key_engraver"
4975 StaffSymbol \set #'transparent = ##t
4976 \remove "Time_signature_engraver"
4977 \remove "Bar_engraver"
4978 minimumVerticalExtent = ##f
4982 \remove Ligature_bracket_engraver
4983 \consists Vaticana_ligature_engraver
4984 NoteHead \set #'style = #'vaticana_punctum
4985 Stem \set #'transparent = ##t
4991 @lilypond[noindent, 26pt, nofragment, linewidth=2.5cm]
4992 \include "gregorian-init.ly"
4994 \notes \transpose c c' {
4995 % Punctum Auctum Ascendens
4996 \[ \auctum \ascendens b \]
4997 \noBreak s^\markup {"c"} \noBreak
4999 % Punctum Auctum Descendens
5000 \[ \auctum \descendens b \]
5001 \noBreak s^\markup {"d"} \noBreak
5003 % Punctum Inclinatum Auctum
5004 \[ \inclinatum \auctum b \]
5005 \noBreak s^\markup {"e"}
5011 \remove "Bar_number_engraver"
5015 \remove "Clef_engraver"
5016 \remove "Key_engraver"
5017 StaffSymbol \set #'transparent = ##t
5018 \remove "Time_signature_engraver"
5019 \remove "Bar_engraver"
5020 minimumVerticalExtent = ##f
5024 \remove Ligature_bracket_engraver
5025 \consists Vaticana_ligature_engraver
5026 NoteHead \set #'style = #'vaticana_punctum
5027 Stem \set #'transparent = ##t
5033 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5034 \include "gregorian-init.ly"
5036 \notes \transpose c c' {
5037 % Punctum Inclinatum Parvum
5038 \[ \inclinatum \deminutum b \]
5039 \noBreak s^\markup {"f"}
5045 \remove "Bar_number_engraver"
5049 \remove "Clef_engraver"
5050 \remove "Key_engraver"
5051 StaffSymbol \set #'transparent = ##t
5052 \remove "Time_signature_engraver"
5053 \remove "Bar_engraver"
5054 minimumVerticalExtent = ##f
5058 \remove Ligature_bracket_engraver
5059 \consists Vaticana_ligature_engraver
5060 NoteHead \set #'style = #'vaticana_punctum
5061 Stem \set #'transparent = ##t
5070 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5071 \include "gregorian-init.ly"
5073 \notes \transpose c c' {
5076 \noBreak s^\markup {"g"}
5082 \remove "Bar_number_engraver"
5086 \remove "Clef_engraver"
5087 \remove "Key_engraver"
5088 StaffSymbol \set #'transparent = ##t
5089 \remove "Time_signature_engraver"
5090 \remove "Bar_engraver"
5091 minimumVerticalExtent = ##f
5095 \remove Ligature_bracket_engraver
5096 \consists Vaticana_ligature_engraver
5097 NoteHead \set #'style = #'vaticana_punctum
5098 Stem \set #'transparent = ##t
5107 @code{3. Apostropha vel Stropha}
5109 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5110 \include "gregorian-init.ly"
5112 \notes \transpose c c' {
5115 \noBreak s^\markup {"h"}
5121 \remove "Bar_number_engraver"
5125 \remove "Clef_engraver"
5126 \remove "Key_engraver"
5127 StaffSymbol \set #'transparent = ##t
5128 \remove "Time_signature_engraver"
5129 \remove "Bar_engraver"
5130 minimumVerticalExtent = ##f
5134 \remove Ligature_bracket_engraver
5135 \consists Vaticana_ligature_engraver
5136 NoteHead \set #'style = #'vaticana_punctum
5137 Stem \set #'transparent = ##t
5143 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5144 \include "gregorian-init.ly"
5146 \notes \transpose c c' {
5148 \[ \stropha \auctum b \]
5149 \noBreak s^\markup {"i"}
5155 \remove "Bar_number_engraver"
5159 \remove "Clef_engraver"
5160 \remove "Key_engraver"
5161 StaffSymbol \set #'transparent = ##t
5162 \remove "Time_signature_engraver"
5163 \remove "Bar_engraver"
5164 minimumVerticalExtent = ##f
5168 \remove Ligature_bracket_engraver
5169 \consists Vaticana_ligature_engraver
5170 NoteHead \set #'style = #'vaticana_punctum
5171 Stem \set #'transparent = ##t
5181 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5182 \include "gregorian-init.ly"
5184 \notes \transpose c c' {
5187 \noBreak s^\markup {"j"}
5193 \remove "Bar_number_engraver"
5197 \remove "Clef_engraver"
5198 \remove "Key_engraver"
5199 StaffSymbol \set #'transparent = ##t
5200 \remove "Time_signature_engraver"
5201 \remove "Bar_engraver"
5202 minimumVerticalExtent = ##f
5206 \remove Ligature_bracket_engraver
5207 \consists Vaticana_ligature_engraver
5208 NoteHead \set #'style = #'vaticana_punctum
5209 Stem \set #'transparent = ##t
5218 @code{5. Clivis vel Flexa}
5220 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5221 \include "gregorian-init.ly"
5223 \notes \transpose c c' {
5232 \remove "Bar_number_engraver"
5236 \remove "Clef_engraver"
5237 \remove "Key_engraver"
5238 StaffSymbol \set #'transparent = ##t
5239 \remove "Time_signature_engraver"
5240 \remove "Bar_engraver"
5241 minimumVerticalExtent = ##f
5245 \remove Ligature_bracket_engraver
5246 \consists Vaticana_ligature_engraver
5247 NoteHead \set #'style = #'vaticana_punctum
5248 Stem \set #'transparent = ##t
5254 @lilypond[noindent, 26pt, nofragment, linewidth=2.0cm]
5255 \include "gregorian-init.ly"
5257 \notes \transpose c c' {
5258 % Clivis Aucta Descendens
5259 \[ b \flexa \auctum \descendens g \]
5260 \noBreak s^\markup {"l"} \noBreak
5262 % Clivis Aucta Ascendens
5263 \[ b \flexa \auctum \ascendens g \]
5264 \noBreak s^\markup {"m"}
5270 \remove "Bar_number_engraver"
5274 \remove "Clef_engraver"
5275 \remove "Key_engraver"
5276 StaffSymbol \set #'transparent = ##t
5277 \remove "Time_signature_engraver"
5278 \remove "Bar_engraver"
5279 minimumVerticalExtent = ##f
5283 \remove Ligature_bracket_engraver
5284 \consists Vaticana_ligature_engraver
5285 NoteHead \set #'style = #'vaticana_punctum
5286 Stem \set #'transparent = ##t
5292 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5293 \include "gregorian-init.ly"
5295 \notes \transpose c c' {
5297 \[ b \flexa \deminutum g \]
5304 \remove "Bar_number_engraver"
5308 \remove "Clef_engraver"
5309 \remove "Key_engraver"
5310 StaffSymbol \set #'transparent = ##t
5311 \remove "Time_signature_engraver"
5312 \remove "Bar_engraver"
5313 minimumVerticalExtent = ##f
5317 \remove Ligature_bracket_engraver
5318 \consists Vaticana_ligature_engraver
5319 NoteHead \set #'style = #'vaticana_punctum
5320 Stem \set #'transparent = ##t
5327 @code{6. Podatus vel Pes}
5329 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5330 \include "gregorian-init.ly"
5332 \notes \transpose c c' {
5341 \remove "Bar_number_engraver"
5345 \remove "Clef_engraver"
5346 \remove "Key_engraver"
5347 StaffSymbol \set #'transparent = ##t
5348 \remove "Time_signature_engraver"
5349 \remove "Bar_engraver"
5350 minimumVerticalExtent = ##f
5354 \remove Ligature_bracket_engraver
5355 \consists Vaticana_ligature_engraver
5356 NoteHead \set #'style = #'vaticana_punctum
5357 Stem \set #'transparent = ##t
5363 @lilypond[noindent, 26pt, nofragment, linewidth=2.0cm]
5364 \include "gregorian-init.ly"
5366 \notes \transpose c c' {
5367 % Pes Auctus Descendens
5368 \[ g \pes \auctum \descendens b \]
5369 \noBreak s^\markup {"p"} \noBreak
5371 % Pes Auctus Ascendens
5372 \[ g \pes \auctum \ascendens b \]
5373 \noBreak s^\markup {"q"}
5379 \remove "Bar_number_engraver"
5383 \remove "Clef_engraver"
5384 \remove "Key_engraver"
5385 StaffSymbol \set #'transparent = ##t
5386 \remove "Time_signature_engraver"
5387 \remove "Bar_engraver"
5388 minimumVerticalExtent = ##f
5392 \remove Ligature_bracket_engraver
5393 \consists Vaticana_ligature_engraver
5394 NoteHead \set #'style = #'vaticana_punctum
5395 Stem \set #'transparent = ##t
5401 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5402 \include "gregorian-init.ly"
5404 \notes \transpose c c' {
5406 \[ g \pes \deminutum b \]
5413 \remove "Bar_number_engraver"
5417 \remove "Clef_engraver"
5418 \remove "Key_engraver"
5419 StaffSymbol \set #'transparent = ##t
5420 \remove "Time_signature_engraver"
5421 \remove "Bar_engraver"
5422 minimumVerticalExtent = ##f
5426 \remove Ligature_bracket_engraver
5427 \consists Vaticana_ligature_engraver
5428 NoteHead \set #'style = #'vaticana_punctum
5429 Stem \set #'transparent = ##t
5436 @code{7. Pes Quassus}
5438 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5439 \include "gregorian-init.ly"
5441 \notes \transpose c c' {
5443 \[ \oriscus g \pes \virga b \]
5450 \remove "Bar_number_engraver"
5454 \remove "Clef_engraver"
5455 \remove "Key_engraver"
5456 StaffSymbol \set #'transparent = ##t
5457 \remove "Time_signature_engraver"
5458 \remove "Bar_engraver"
5459 minimumVerticalExtent = ##f
5463 \remove Ligature_bracket_engraver
5464 \consists Vaticana_ligature_engraver
5465 NoteHead \set #'style = #'vaticana_punctum
5466 Stem \set #'transparent = ##t
5472 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5473 \include "gregorian-init.ly"
5475 \notes \transpose c c' {
5476 % Pes Quassus Auctus Descendens
5477 \[ \oriscus g \pes \auctum \descendens b \]
5484 \remove "Bar_number_engraver"
5488 \remove "Clef_engraver"
5489 \remove "Key_engraver"
5490 StaffSymbol \set #'transparent = ##t
5491 \remove "Time_signature_engraver"
5492 \remove "Bar_engraver"
5493 minimumVerticalExtent = ##f
5497 \remove Ligature_bracket_engraver
5498 \consists Vaticana_ligature_engraver
5499 NoteHead \set #'style = #'vaticana_punctum
5500 Stem \set #'transparent = ##t
5508 @code{8. Quilisma Pes}
5510 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5511 \include "gregorian-init.ly"
5513 \notes \transpose c c' {
5515 \[ \quilisma g \pes b \]
5522 \remove "Bar_number_engraver"
5526 \remove "Clef_engraver"
5527 \remove "Key_engraver"
5528 StaffSymbol \set #'transparent = ##t
5529 \remove "Time_signature_engraver"
5530 \remove "Bar_engraver"
5531 minimumVerticalExtent = ##f
5535 \remove Ligature_bracket_engraver
5536 \consists Vaticana_ligature_engraver
5537 NoteHead \set #'style = #'vaticana_punctum
5538 Stem \set #'transparent = ##t
5544 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5545 \include "gregorian-init.ly"
5547 \notes \transpose c c' {
5548 % Quilisma Pes Auctus Descendens
5549 \[ \quilisma g \pes \auctum \descendens b \]
5556 \remove "Bar_number_engraver"
5560 \remove "Clef_engraver"
5561 \remove "Key_engraver"
5562 StaffSymbol \set #'transparent = ##t
5563 \remove "Time_signature_engraver"
5564 \remove "Bar_engraver"
5565 minimumVerticalExtent = ##f
5569 \remove Ligature_bracket_engraver
5570 \consists Vaticana_ligature_engraver
5571 NoteHead \set #'style = #'vaticana_punctum
5572 Stem \set #'transparent = ##t
5580 @code{9. Podatus Initio Debilis}
5582 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5583 \include "gregorian-init.ly"
5585 \notes \transpose c c' {
5586 % Pes Initio Debilis
5587 \[ \deminutum g \pes b \]
5594 \remove "Bar_number_engraver"
5598 \remove "Clef_engraver"
5599 \remove "Key_engraver"
5600 StaffSymbol \set #'transparent = ##t
5601 \remove "Time_signature_engraver"
5602 \remove "Bar_engraver"
5603 minimumVerticalExtent = ##f
5607 \remove Ligature_bracket_engraver
5608 \consists Vaticana_ligature_engraver
5609 NoteHead \set #'style = #'vaticana_punctum
5610 Stem \set #'transparent = ##t
5616 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5617 \include "gregorian-init.ly"
5619 \notes \transpose c c' {
5620 % Pes Auctus Descendens Initio Debilis
5621 \[ \deminutum g \pes \auctum \descendens b \]
5628 \remove "Bar_number_engraver"
5632 \remove "Clef_engraver"
5633 \remove "Key_engraver"
5634 StaffSymbol \set #'transparent = ##t
5635 \remove "Time_signature_engraver"
5636 \remove "Bar_engraver"
5637 minimumVerticalExtent = ##f
5641 \remove Ligature_bracket_engraver
5642 \consists Vaticana_ligature_engraver
5643 NoteHead \set #'style = #'vaticana_punctum
5644 Stem \set #'transparent = ##t
5654 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5655 \include "gregorian-init.ly"
5657 \notes \transpose c c' {
5659 \[ a \pes b \flexa g \]
5666 \remove "Bar_number_engraver"
5670 \remove "Clef_engraver"
5671 \remove "Key_engraver"
5672 StaffSymbol \set #'transparent = ##t
5673 \remove "Time_signature_engraver"
5674 \remove "Bar_engraver"
5675 minimumVerticalExtent = ##f
5679 \remove Ligature_bracket_engraver
5680 \consists Vaticana_ligature_engraver
5681 NoteHead \set #'style = #'vaticana_punctum
5682 Stem \set #'transparent = ##t
5688 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5689 \include "gregorian-init.ly"
5691 \notes \transpose c c' {
5692 % Torculus Auctus Descendens
5693 \[ a \pes b \flexa \auctum \descendens g \]
5700 \remove "Bar_number_engraver"
5704 \remove "Clef_engraver"
5705 \remove "Key_engraver"
5706 StaffSymbol \set #'transparent = ##t
5707 \remove "Time_signature_engraver"
5708 \remove "Bar_engraver"
5709 minimumVerticalExtent = ##f
5713 \remove Ligature_bracket_engraver
5714 \consists Vaticana_ligature_engraver
5715 NoteHead \set #'style = #'vaticana_punctum
5716 Stem \set #'transparent = ##t
5722 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5723 \include "gregorian-init.ly"
5725 \notes \transpose c c' {
5726 % Torculus Deminutus
5727 \[ a \pes b \flexa \deminutum g \]
5734 \remove "Bar_number_engraver"
5738 \remove "Clef_engraver"
5739 \remove "Key_engraver"
5740 StaffSymbol \set #'transparent = ##t
5741 \remove "Time_signature_engraver"
5742 \remove "Bar_engraver"
5743 minimumVerticalExtent = ##f
5747 \remove Ligature_bracket_engraver
5748 \consists Vaticana_ligature_engraver
5749 NoteHead \set #'style = #'vaticana_punctum
5750 Stem \set #'transparent = ##t
5757 @code{11. Torculus Initio Debilis}
5759 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5760 \include "gregorian-init.ly"
5762 \notes \transpose c c' {
5763 % Torculus Initio Debilis
5764 \[ \deminutum a \pes b \flexa g \]
5771 \remove "Bar_number_engraver"
5775 \remove "Clef_engraver"
5776 \remove "Key_engraver"
5777 StaffSymbol \set #'transparent = ##t
5778 \remove "Time_signature_engraver"
5779 \remove "Bar_engraver"
5780 minimumVerticalExtent = ##f
5784 \remove Ligature_bracket_engraver
5785 \consists Vaticana_ligature_engraver
5786 NoteHead \set #'style = #'vaticana_punctum
5787 Stem \set #'transparent = ##t
5793 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5794 \include "gregorian-init.ly"
5796 \notes \transpose c c' {
5797 % Torculus Auctus Descendens Initio Debilis
5798 \[ \deminutum a \pes b \flexa \auctum \descendens g \]
5805 \remove "Bar_number_engraver"
5809 \remove "Clef_engraver"
5810 \remove "Key_engraver"
5811 StaffSymbol \set #'transparent = ##t
5812 \remove "Time_signature_engraver"
5813 \remove "Bar_engraver"
5814 minimumVerticalExtent = ##f
5818 \remove Ligature_bracket_engraver
5819 \consists Vaticana_ligature_engraver
5820 NoteHead \set #'style = #'vaticana_punctum
5821 Stem \set #'transparent = ##t
5827 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5828 \include "gregorian-init.ly"
5830 \notes \transpose c c' {
5831 % Torculus Deminutus Initio Debilis
5832 \[ \deminutum a \pes b \flexa \deminutum 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
5862 @code{12. Porrectus}
5864 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5865 \include "gregorian-init.ly"
5867 \notes \transpose c c' {
5869 \[ a \flexa g \pes b \]
5876 \remove "Bar_number_engraver"
5880 \remove "Clef_engraver"
5881 \remove "Key_engraver"
5882 StaffSymbol \set #'transparent = ##t
5883 \remove "Time_signature_engraver"
5884 \remove "Bar_engraver"
5885 minimumVerticalExtent = ##f
5889 \remove Ligature_bracket_engraver
5890 \consists Vaticana_ligature_engraver
5891 NoteHead \set #'style = #'vaticana_punctum
5892 Stem \set #'transparent = ##t
5898 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5899 \include "gregorian-init.ly"
5901 \notes \transpose c c' {
5902 % Porrectus Auctus Descendens
5903 \[ a \flexa g \pes \auctum \descendens b \]
5910 \remove "Bar_number_engraver"
5914 \remove "Clef_engraver"
5915 \remove "Key_engraver"
5916 StaffSymbol \set #'transparent = ##t
5917 \remove "Time_signature_engraver"
5918 \remove "Bar_engraver"
5919 minimumVerticalExtent = ##f
5923 \remove Ligature_bracket_engraver
5924 \consists Vaticana_ligature_engraver
5925 NoteHead \set #'style = #'vaticana_punctum
5926 Stem \set #'transparent = ##t
5932 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5933 \include "gregorian-init.ly"
5935 \notes \transpose c c' {
5936 % Porrectus Deminutus
5937 \[ a \flexa g \pes \deminutum b \]
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
5969 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5970 \include "gregorian-init.ly"
5972 \notes \transpose c c' {
5974 \[ \virga b \inclinatum a \inclinatum g \]
5981 \remove "Bar_number_engraver"
5985 \remove "Clef_engraver"
5986 \remove "Key_engraver"
5987 StaffSymbol \set #'transparent = ##t
5988 \remove "Time_signature_engraver"
5989 \remove "Bar_engraver"
5990 minimumVerticalExtent = ##f
5994 \remove Ligature_bracket_engraver
5995 \consists Vaticana_ligature_engraver
5996 NoteHead \set #'style = #'vaticana_punctum
5997 Stem \set #'transparent = ##t
6003 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6004 \include "gregorian-init.ly"
6006 \notes \transpose c c' {
6008 \[ \virga b \inclinatum a \inclinatum \auctum g \]
6015 \remove "Bar_number_engraver"
6019 \remove "Clef_engraver"
6020 \remove "Key_engraver"
6021 StaffSymbol \set #'transparent = ##t
6022 \remove "Time_signature_engraver"
6023 \remove "Bar_engraver"
6024 minimumVerticalExtent = ##f
6028 \remove Ligature_bracket_engraver
6029 \consists Vaticana_ligature_engraver
6030 NoteHead \set #'style = #'vaticana_punctum
6031 Stem \set #'transparent = ##t
6037 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6038 \include "gregorian-init.ly"
6040 \notes \transpose c c' {
6041 % Climacus Deminutus
6042 \[ \virga b \inclinatum a \inclinatum \deminutum g \]
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
6072 @code{14. Scandicus}
6074 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6075 \include "gregorian-init.ly"
6077 \notes \transpose c c' {
6079 \[ g \pes a \virga b \]
6086 \remove "Bar_number_engraver"
6090 \remove "Clef_engraver"
6091 \remove "Key_engraver"
6092 StaffSymbol \set #'transparent = ##t
6093 \remove "Time_signature_engraver"
6094 \remove "Bar_engraver"
6095 minimumVerticalExtent = ##f
6099 \remove Ligature_bracket_engraver
6100 \consists Vaticana_ligature_engraver
6101 NoteHead \set #'style = #'vaticana_punctum
6102 Stem \set #'transparent = ##t
6108 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6109 \include "gregorian-init.ly"
6111 \notes \transpose c c' {
6112 % Scandicus Auctus Descendens
6113 \[ g \pes a \pes \auctum \descendens b \]
6120 \remove "Bar_number_engraver"
6124 \remove "Clef_engraver"
6125 \remove "Key_engraver"
6126 StaffSymbol \set #'transparent = ##t
6127 \remove "Time_signature_engraver"
6128 \remove "Bar_engraver"
6129 minimumVerticalExtent = ##f
6133 \remove Ligature_bracket_engraver
6134 \consists Vaticana_ligature_engraver
6135 NoteHead \set #'style = #'vaticana_punctum
6136 Stem \set #'transparent = ##t
6142 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6143 \include "gregorian-init.ly"
6145 \notes \transpose c c' {
6146 % Scandicus Deminutus
6147 \[ g \pes a \pes \deminutum b \]
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
6179 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6180 \include "gregorian-init.ly"
6182 \notes \transpose c c' {
6184 \[ g \oriscus a \pes \virga b \]
6191 \remove "Bar_number_engraver"
6195 \remove "Clef_engraver"
6196 \remove "Key_engraver"
6197 StaffSymbol \set #'transparent = ##t
6198 \remove "Time_signature_engraver"
6199 \remove "Bar_engraver"
6200 minimumVerticalExtent = ##f
6204 \remove Ligature_bracket_engraver
6205 \consists Vaticana_ligature_engraver
6206 NoteHead \set #'style = #'vaticana_punctum
6207 Stem \set #'transparent = ##t
6213 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6214 \include "gregorian-init.ly"
6216 \notes \transpose c c' {
6217 % Salicus Auctus Descendens
6218 \[ g \oriscus a \pes \auctum \descendens b \]
6225 \remove "Bar_number_engraver"
6229 \remove "Clef_engraver"
6230 \remove "Key_engraver"
6231 StaffSymbol \set #'transparent = ##t
6232 \remove "Time_signature_engraver"
6233 \remove "Bar_engraver"
6234 minimumVerticalExtent = ##f
6238 \remove Ligature_bracket_engraver
6239 \consists Vaticana_ligature_engraver
6240 NoteHead \set #'style = #'vaticana_punctum
6241 Stem \set #'transparent = ##t
6251 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6252 \include "gregorian-init.ly"
6254 \notes \transpose c c' {
6256 \[ \stropha b \stropha b \stropha a \]
6263 \remove "Bar_number_engraver"
6267 \remove "Clef_engraver"
6268 \remove "Key_engraver"
6269 StaffSymbol \set #'transparent = ##t
6270 \remove "Time_signature_engraver"
6271 \remove "Bar_engraver"
6272 minimumVerticalExtent = ##f
6276 \remove Ligature_bracket_engraver
6277 \consists Vaticana_ligature_engraver
6278 NoteHead \set #'style = #'vaticana_punctum
6279 Stem \set #'transparent = ##t
6290 Unlike most other neumes notation systems, the input language for
6291 neumes does not necessarily reflect directly the typographical
6292 appearance, but is designed to solely focuse on musical meaning. For
6293 example, @code{\[ a \pes b \flexa g \]} produces a Torculus consisting
6294 of three Punctum heads, while @code{\[ a \flexa g \pes b \]} produces
6295 a torculus with a curved flexa shape and only a single Punctum head.
6296 There is no command to explicitly typeset the curved flexa shape; the
6297 decision of when to typeset a curved flexa shape is purely taken from
6298 the musical input. The idea of this approach is to separate the
6299 musical aspects of the input from the notation style of the output.
6300 This way, the same input can be reused to typeset the same music in a
6301 different style of Gregorian chant notation such as Hufnagel (also
6302 known as German gothic neumes) or Medicaea (kind of a very simple
6303 forerunner of the Editio Vaticana). As soon as Hufnagel ligature
6304 engraver and Medicaea ligature engraver will have been implemented, it
6305 will be as simple as replacing the ligature engraver in the
6306 VoiceContext to get the desired notation style from the same input.
6308 The following table shows the code fragments that produce the
6309 ligatures in the above neumes table. The letter in the first column
6310 in each line of the below table indicates to which ligature in the
6311 above table it refers. The second column gives the name of the
6312 ligature. The third column shows the code fragment that produces this
6313 ligature, using @code{g}, @code{a} and @code{b} as example pitches.
6315 @multitable @columnfractions .1 .4 .5
6329 Punctum Inclinatum @tab
6330 @code{\[ \inclinatum b \]}
6334 Punctum Auctum Ascendens @tab
6335 @code{\[ \auctum \ascendens b \]}
6339 Punctum Auctum Descendens @tab
6340 @code{\[ \auctum \descendens b \]}
6344 Punctum Inclinatum Auctum @tab
6345 @code{\[ \inclinatum \auctum b \]}
6349 Punctum Inclinatum Parvum @tab
6350 @code{\[ \inclinatum \deminutum b \]}
6355 @code{\[ \virga b \]}
6360 @code{\[ \stropha b \]}
6365 @code{\[ \stropha \auctum b \]}
6370 @code{\[ \oriscus b \]}
6374 Clivis vel Flexa @tab
6375 @code{\[ b \flexa g \]}
6379 Clivis Aucta Descendens @tab
6380 @code{\[ b \flexa \auctum \descendens g \]}
6384 Clivis Aucta Ascendens @tab
6385 @code{\[ b \flexa \auctum \ascendens g \]}
6390 @code{\[ b \flexa \deminutum g \]}
6394 Podatus vel Pes @tab
6395 @code{\[ g \pes b \]}
6399 Pes Auctus Descendens @tab
6400 @code{\[ g \pes \auctum \descendens b \]}
6404 Pes Auctus Ascendens @tab
6405 @code{\[ g \pes \auctum \ascendens b \]}
6410 @code{\[ g \pes \deminutum b \]}
6415 @code{\[ \oriscus g \pes \virga b \]}
6419 Pes Quassus Auctus Descendens @tab
6420 @code{\[ \oriscus g \pes \auctum \descendens b \]}
6425 @code{\[ \quilisma g \pes b \]}
6429 Quilisma Pes Auctus Descendens @tab
6430 @code{\[ \quilisma g \pes \auctum \descendens b \]}
6434 Pes Initio Debilis @tab
6435 @code{\[ \deminutum g \pes b \]}
6439 Pes Auctus Descendens Initio Debilis @tab
6440 @code{\[ \deminutum g \pes \auctum \descendens b \]}
6445 @code{\[ a \pes b \flexa g \]}
6449 Torculus Auctus Descendens @tab
6450 @code{\[ a \pes b \flexa \auctum \descendens g \]}
6454 Torculus Deminutus @tab
6455 @code{\[ a \pes b \flexa \deminutum g \]}
6459 Torculus Initio Debilis @tab
6460 @code{\[ \deminutum a \pes b \flexa g \]}
6464 Torculus Auctus Descendens Initio Debilis @tab
6465 @code{\[ \deminutum a \pes b \flexa \auctum \descendens g \]}
6469 Torculus Deminutus Initio Debilis @tab
6470 @code{\[ \deminutum a \pes b \flexa \deminutum g \]}
6475 @code{\[ a \flexa g \pes b \]}
6479 Porrectus Auctus Descendens @tab
6480 @code{\[ a \flexa g \pes \auctum \descendens b \]}
6484 Porrectus Deminutus @tab
6485 @code{\[ a \flexa g \pes \deminutum b \]}
6490 @code{\[ \virga b \inclinatum a \inclinatum g \]}
6494 Climacus Auctus @tab
6495 @code{\[ \virga b \inclinatum a \inclinatum \auctum g \]}
6499 Climacus Deminutus @tab
6500 @code{\[ \virga b \inclinatum a \inclinatum \deminutum g \]}
6505 @code{\[ g \pes a \virga b \]}
6509 Scandicus Auctus Descendens @tab
6510 @code{\[ g \pes a \pes \auctum \descendens b \]}
6514 Scandicus Deminutus @tab
6515 @code{\[ g \pes a \pes \deminutum b \]}
6520 @code{\[ g \oriscus a \pes \virga b \]}
6524 Salicus Auctus Descendens @tab
6525 @code{\[ g \oriscus a \pes \auctum \descendens b \]}
6530 @code{\[ \stropha b \stropha b \stropha a \]}
6536 Scandicus Deminutus: Punctum Auctum Ascendens overlaps with
6537 Semivocalis head; this looks awful.
6539 Trigonus: apply equal spacing, regardless of pitch.
6542 @subsection Figured bass
6544 @cindex Basso continuo
6546 @c TODO: musicological blurb about FB
6550 LilyPond has limited support for figured bass:
6552 @lilypond[verbatim,fragment]
6554 \context Voice \notes { \clef bass dis4 c d ais}
6555 \context FiguredBass
6557 < 6 >4 < 7 >8 < 6+ [_!] >
6563 The support for figured bass consists of two parts: there is an input
6564 mode, introduced by @code{\figures}, where you can enter bass figures
6565 as numbers, and there is a context called @internalsref{FiguredBass}
6566 that takes care of making @internalsref{BassFigure} objects.
6568 In figures input mode, a group of bass figures is delimited by
6569 @code{<} and @code{>}. The duration is entered after the @code{>}.
6574 \context FiguredBass
6578 Accidentals are added when you append @code{-}, @code{!} and @code{+}
6585 \context FiguredBass
6586 \figures { <4- 6+ 7!> }
6589 Spaces or dashes may be inserted by using @code{_}. Brackets are
6590 introduced with @code{[} and @code{]}.
6596 \context FiguredBass
6597 \figures { < [4 6] 8 [_ 12]> }
6600 Although the support for figured bass may superficially resemble chord
6601 support, it works much simpler. The @code{\figures} mode simply
6602 stores the numbers , and @internalsref{FiguredBass} context prints
6603 them as entered. There is no conversion to pitches, and no
6604 realizations of the bass are played in the MIDI file.
6606 Internally, the code produces markup texts. You can use any of the
6607 markup text properties to override formatting. For example, the
6608 vertical spacing of the figures may be set with @code{baseline-skip}.
6612 @internalsref{BassFigureEvent} music, @internalsref{BassFigure} object,
6613 @internalsref{FiguredBass} context
6617 Slash notation for alterations is not supported.
6620 @node Contemporary notation
6621 @section Contemporary notation
6623 In the 20th century, composers have greatly expanded the musical
6624 vocabulary. With this expansion, many innovations in musical notation
6625 have been tried. For a comprehensive overview, refer to @cite{Stone
6626 1980} (see @ref{Literature}). In general, the use of new, innovative
6627 notation makes a piece harder to understand and perform and its use
6628 should therefore be avoided if possible. For this reason, support for
6629 contemporary notation in LilyPond is limited.
6638 @subsection Clusters
6642 In musical terminology, a @emph{cluster} denotes a range of
6643 simultaneously sounding pitches that may change over time. The set of
6644 available pitches to apply usually depends on the accoustic source.
6645 Thus, in piano music, a cluster typically consists of a continous range
6646 of the semitones as provided by the piano's fixed set of a chromatic
6647 scale. In choral music, each singer of the choir typically may sing an
6648 arbitrary pitch within the cluster's range that is not bound to any
6649 diatonic, chromatic or other scale. In electronic music, a cluster
6650 (theoretically) may even cover a continuous range of pitches, thus
6651 resulting in coloured noise, such as pink noise.
6653 Clusters can be denoted in the context of ordinary staff notation by
6654 engraving simple geometrical shapes that replace ordinary notation of
6655 notes. Ordinary notes as musical events specify starting time and
6656 duration of pitches; however, the duration of a note is expressed by the
6657 shape of the note head rather than by the horizontal graphical extent of
6658 the note symbol. In contrast, the shape of a cluster geometrically
6659 describes the development of a range of pitches (vertical extent) over
6660 time (horizontal extent). Still, the geometrical shape of a cluster
6661 covers the area in wich any single pitch contained in the cluster would
6662 be notated as an ordinary note. From this point of view, it is
6663 reasonable to specify a cluster as the envelope of a set of notes.
6667 A cluster is engraved as the envelope of a set of
6668 cluster-notes. Cluster notes are created by applying the function
6669 @code{notes-to-clusters} to a sequence of chords, eg.
6671 @lilypond[relative 2]
6672 \apply #notes-to-clusters { << c e >> <<b f'>> }
6675 The following example (from
6676 @inputfileref{input/regression,cluster.ly}) shows what the result
6679 @lilypondfile[notexidoc]{cluster.ly}
6681 By default, @internalsref{Cluster_engraver} is in the
6682 @internalsref{Voice} context. This allows putting ordinary notes and
6683 clusters together in the same staff, even simultaneously. In such a
6684 case no attempt is made to automatically avoid collisions between
6685 ordinary notes and clusters.
6689 @internalsref{ClusterSpanner}, @internalsref{ClusterSpannerBeacon},
6690 @inputfileref{input/regression,cluster.ly},
6691 @internalsref{Cluster_engraver}, @internalsref{ClusterNoteEvent}.
6695 Music expressions like @code{< @{ g8 e8 @} a4 >} are not printed
6696 accurately. Use @code{<<g a>>8 <<e a>>8} instead.
6701 @subsection Fermatas
6707 Contemporary music notation frequently uses special fermata symbols to
6708 indicate fermatas of differing lengths.
6712 The following are supported
6714 @lilypond[singleline]
6737 \context Lyrics \lyrics {
6738 "shortfermata" "fermata" "longfermata" "verylongfermata"
6743 See @ref{Articulations} for general instructions how to apply scripts
6744 such as fermatas to a @code{\notes@{@}} block.
6747 @section Tuning output
6749 There are situations where default layout decisions are not
6750 sufficient. In this section we discuss ways to override these
6753 Formatting is internally done by manipulating so called objects (graphic
6754 objects). Each object carries with it a set of properties (object
6755 properties) specific to that object. For example, a stem object has
6756 properties that specify its direction, length and thickness.
6758 The most direct way of tuning the output is by altering the values of
6759 these properties. There are two ways of doing that: first, you can
6760 temporarily change the definition of one type of object, thus
6761 affecting a whole set of objects. Second, you can select one specific
6762 object, and set a object property in that object.
6766 * Constructing a tweak::
6775 @node Tuning objects
6776 @subsection Tuning objects
6778 @cindex object description
6780 The definition of an object is actually a list of default object
6781 properties. For example, the definition of the Stem object (available
6782 in @file{scm/define-grobs.scm}), includes the following definitions for
6787 (beamed-lengths . (0.0 2.5 2.0 1.5))
6788 (Y-extent-callback . ,Stem::height)
6793 By adding variables on top of these existing definitions, the system
6794 default is overridden, and the appearance of a layout objects is
6800 Changing a variable for only one object is commonly achieved with
6804 \once \property @var{context}.@var{objectname}
6805 \override @var{symbol} = @var{value}
6807 Here @var{symbol} is a Scheme expression of symbol type, @var{context}
6808 and @var{objectname} is a string and @var{value} is a Scheme expression.
6809 This command applies a setting only during one moment in the score.
6811 In the following example, only one @internalsref{Stem} object is
6812 changed from its original setting:
6814 @lilypond[verbatim, fragment, relative=1]
6816 \once \property Voice.Stem \set #'thickness = #4
6820 @cindex @code{\once}
6822 For changing more objects, the same command, without @code{\once} can
6825 \property @var{context}.@var{objectname} \override @var{symbol} = @var{value}
6827 This command adds @code{@var{symbol} = @var{value}} to the definition
6828 of @var{objectname} in the context @var{context}, and this definition
6829 stays in place until it is removed.
6831 An existing definition may be removed by the following command
6834 \property @var{context}.@var{objectname} \revert @var{symbol}
6837 All @code{\override} and @code{\revert} commands should be balanced.
6838 The @code{\set} shorthand, performs a revert followed by an override,
6839 and is often more convenient to use
6842 \property @var{context}.@var{objectname} \set @var{symbol} = @var{value}
6846 @lilypond[verbatim,quote]
6847 c'4 \property Voice.Stem \override #'thickness = #4.0
6849 c'4 \property Voice.Stem \revert #'thickness
6853 The following example gives exactly the same result as the previous
6854 one (assuming the system default for stem thickness is 1.3).
6856 @lilypond[verbatim,quote]
6857 c'4 \property Voice.Stem \set #'thickness = #4.0
6859 c'4 \property Voice.Stem \set #'thickness = #1.3
6863 Reverting a setting which was not set in the first place has no
6864 effect. However, if the setting was set as a system default, this may
6865 remove the default value, and this may give surprising results,
6866 including crashes. In other words, @code{\override} and
6867 @code{\revert} must be carefully balanced.
6869 These are examples of correct nesting of @code{\override}, @code{\set},
6872 A clumsy but correct form:
6874 \override \revert \override \revert \override \revert
6877 Shorter version of the same:
6879 \override \set \set \revert
6882 A short form, using only @code{\set}. This requires you to know the
6885 \set \set \set \set @var{to default value}
6888 If there is no default (i.e. by default, the object property is unset),
6891 \set \set \set \revert
6894 For the digirati, the object description is an Scheme association
6895 list. Since a Scheme list is a singly linked list, we can treat it as
6896 a stack, and @code{\override} and @code{\revert} are push and pop
6897 operations. The association list is stored in a normal context
6900 \property Voice.NoteHead = #'()
6902 will effectively erase @internalsref{NoteHead}s from the current
6903 @internalsref{Voice}. However, this mechanism is not guaranteed to
6904 work, and may cause crashes or other anomalous behavior.
6908 @internalsref{OverrideProperty}, @internalsref{RevertProperty},
6909 @internalsref{PropertySet}, @internalsref{backend properties},
6910 @internalsref{All layout objects}.
6915 The backend is not very strict in type-checking object properties.
6916 Cyclic references in @var{value} cause hangs and/or crashes.
6917 Similarly, reverting properties that are system defaults may also lead
6920 @node Constructing a tweak
6921 @subsection Constructing a tweak
6924 @cindex internal documentation
6925 @cindex finding graphical objects
6926 @cindex graphical object descriptions
6928 @cindex @code{\override}
6930 @cindex internal documentation
6934 Using @code{\override} and @code{\set}, requires three pieces of
6935 information: the name of the layout object, the context and the name
6936 of the property. We demonstrate how to glean this information from
6937 the notation manual and the generated documentation.
6939 The generated documentation is a set of HTML pages which should be
6940 included if you installed a binary distribution, typically in
6941 @file{/usr/share/doc/lilypond}. They are also available on the web:
6942 go to the @uref{LilyPond website,http://lilypond.org}, click
6943 ``Documentation: Index'' on the side bar, look in the ``Information
6944 for users'' section, and click on ``Documentation of internals.'' It
6945 is advisable to bookmark either the local HTML files if possilbe. They
6946 will load faster than the ones on the web. If you use the version
6947 from the web, you must check whether the documentation matches the
6948 program version: the documentation is generated from the definitions
6949 that the program uses, and therefore it is strongly tied to the
6953 @c [TODO: revise for new site.]
6955 Suppose we want to move the fingering indication in the fragment below
6957 @lilypond[relative=2]
6963 If you visit the documentation of @code{Fingering} (in @ref{Fingering
6964 instructions}), you will notice that it says
6969 @internalsref{FingerEvent} and @internalsref{Fingering}.
6972 This implies that the fingerings, once entered, are internally stored
6973 as @code{FingerEvent} music objects. When printed, a @code{Fingering}
6974 layout object is created for every @code{FingerEvent}.
6977 When we follow the link of @internalsref{Fingering},
6980 When we look up @internalsref{Fingering} in the generated
6983 we see a list of interfaces. The Fingering object has a number of
6984 different functions, and each of those is captured in an interface.
6986 The @code{Fingering} object has a fixed size
6987 (@internalsref{item-interface}), the symbol is a piece of text
6988 (@internalsref{text-interface}), whose font can be set
6989 (@internalsref{font-interface}). It is centered horizontally
6990 (@internalsref{self-alignment-interface}), it is placed next to other
6991 objects (@internalsref{side-position-interface}) vertically, and its
6992 placement is coordinated with other scripts
6993 (@internalsref{text-script-interface}). It also has the standard
6994 @internalsref{grob-interface} (grob stands for Graphical object)
6996 @cindex graphical object
6997 @cindex layout object
6998 @cindex object, layout
6999 with all the variables that come with
7000 it. Finally, it denotes a fingering instruction, so it has
7001 @internalsref{finger-interface}.
7003 For the vertical placement, we have to look under
7004 @code{side-position-interface}.
7006 side-position-interface
7008 Position a victim object (this one) next to other objects (the
7009 support). In this case, the direction signifies where to put the
7010 victim object relative to the support (left or right, up or down?)
7012 below this description, the variable @code{padding} is described as
7016 (dimension, in staff space)
7018 add this much extra space between objects that are next to each
7019 other. Default value: @code{0.6}
7023 By increasing the value of @code{padding}, we can move away the
7024 fingering. The following command inserts 3 staff spaces of white
7025 between the note and the fingering
7027 \once \property Voice.Fingering \set #'padding = #3
7030 Before the object is created, we get
7031 @lilypond[relative=2,fragment]
7032 \once \property Voice.Fingering
7039 The context name @code{Voice} in the example above can be determined
7040 as follows. In the documentation for @internalsref{Fingering}, it says
7042 Fingering grobs are created by: @internalsref{Fingering_engraver}
7045 Clicking @code{Fingering_engraver} shows the documentation of
7046 the module responsible for interpreting the fingering instructions and
7047 translating them to a @code{Fingering} object. Such a module is called
7048 an @emph{engraver}. The documentation of the @code{Fingering_engraver}
7051 Fingering_engraver is part of contexts: Voice and TabVoice
7053 so tuning the settings for Fingering should be done using either
7055 \property Voice.Fingering \set @dots{}
7059 \property TabVoice.Fingering \set @dots{}
7062 Since the @code{TabVoice} is only used for tab notation, we see that
7063 the first guess @code{Voice} was indeed correct.
7065 Of course, the tweak may also done in a larger context than
7066 @code{Voice}, for example, @internalsref{Staff} or
7067 @internalsref{Score}.
7069 The internals document also contains alphabetical lists of
7070 @internalsref{All contexts}, @internalsref{All layout objects} and
7071 @internalsref{All music types}, so you can also find which objects to
7072 tweak by browsing the internals document.
7076 @subsection Applyoutput
7078 The most versatile way of tuning object is @code{\applyoutput}. Its
7081 \applyoutput @var{proc}
7083 where @var{proc} is a Scheme function, taking four arguments.
7085 When interpreted, the function @var{proc} is called for every layout object found
7086 in the context, with the following arguments:
7088 @item the layout object itself
7089 @item the context where the layout object was created
7090 @item the context where @code{\applyoutput} is processed.
7093 In addition, the cause of the layout object, i.e. the music
7094 expression or object that was responsible for creating it, is in the
7095 object property @code{cause}. For example, for a note head, this is a
7096 @internalsref{NoteHead} event, and for a @internalsref{Stem} object,
7097 this is a @internalsref{NoteHead} object.
7100 @node Outputproperty
7101 @subsection Outputproperty
7103 @cindex @code{\outputproperty}
7105 Another way of tuning objects is the more arcane @code{\outputproperty}
7106 feature. The syntax is as follows:
7108 \outputproperty @var{predicate} @var{symbol} = @var{value}
7110 Here @code{predicate} is a Scheme function taking an object argument, and
7111 returning a boolean. This statement is processed by the
7112 @code{Output_property_engraver}. It instructs the engraver to feed all
7113 objects that it sees to @var{predicate}. Whenever the predicate returns
7114 true, the object property @var{symbol} will be set to @var{value}.
7116 You will need to combine this statement with @code{\context} to select
7117 the appropriate context to apply this to.
7118 @inputfileref{input/regression,output-property.ly} shows an example of
7119 the use of @code{\outputproperty}.
7123 If possible, avoid this feature: the semantics are not very clean, and
7124 the syntax and semantics are up for rewrite.
7127 @node Font selection
7128 @subsection Font selection
7130 The most common thing to change about the appearance of fonts is
7131 their size. The font size of any context can be easily
7132 changed by setting the @code{fontSize} property for that context:
7134 @lilypond[fragment,relative=1,verbatim,quote]
7135 c4 c4 \property Voice.fontSize = #-1
7138 This command will set @code{font-relative-size} (see below),
7139 and does not change the size of variable symbols, such as
7140 beams or slurs. You can use this command to get smaller symbol for
7141 cue notes, but that involves some more subtleties. An elaborate
7142 example of those is in @inputfileref{input/test,cue-notes.ly}.
7144 @cindex magnification
7146 The size of the font may be scaled with the object property
7147 @code{font-magnification}. For example, @code{2.0} blows up all
7148 letters by a factor 2 in both directions.
7157 The font used for printing a object can be selected by setting
7158 @code{font-name}, e.g.
7160 \property Staff.TimeSignature
7161 \set #'font-name = #"cmr17"
7163 You may use any font which is available to @TeX{}, such as foreign
7164 fonts or fonts that do not belong to the Computer Modern font family.
7166 Font selection for the standard fonts, @TeX{}'s Computer Modern fonts,
7167 can also be adjusted with a more fine-grained mechanism. By setting
7168 the object properties described below, you can select a different font.
7169 All three mechanisms work for every object that supports
7170 @code{font-interface}.
7174 A symbol indicating the general class of the typeface. Supported are
7175 @code{roman} (Computer Modern), @code{braces} (for piano staff
7176 braces), @code{music} (the standard music font, including ancient
7177 glyphs), @code{dynamic} (for dynamic signs) and @code{typewriter}.
7180 A symbol indicating the shape of the font, there are typically several
7181 font shapes available for each font family. Choices are @code{italic},
7182 @code{caps} and @code{upright}
7185 A symbol indicating the series of the font. There are typically several
7186 font series for each font family and shape. Choices are @code{medium}
7189 @item font-relative-size
7190 A number indicating the size relative the standard size. For example,
7191 with 20pt staff height, relative size -1 corresponds to 16pt staff
7192 height, and relative size +1 corresponds to 23 pt staff height.
7194 There are small differences in design between fonts designed for
7195 different sizes, hence @code{font-relative-size} is preferred over
7196 @code{font-magnification} for changing font sizes.
7199 @item font-design-size
7200 A number indicating the design size of the font.
7202 This is a feature of the Computer Modern Font: each point size has a
7203 slightly different design. Smaller design sizes are relatively wider,
7204 which enhances readability.
7207 For any of these properties, the value @code{*} (i.e. the symbol
7208 @code{*}, entered as @code{#'*}), acts as a wildcard. This can be used
7209 to override default setting, which are always present. For example:
7211 \property Lyrics.LyricText \override #'font-series = #'bold
7212 \property Lyrics.LyricText \override #'font-family = #'typewriter
7213 \property Lyrics.LyricText \override #'font-shape = #'*
7216 @cindex @code{font-style}
7220 The following commands set @code{fontSize} for the current voice.
7222 @cindex @code{\tiny}
7224 @cindex @code{\small}
7226 @cindex @code{\normalsize}
7231 Relative size is not linked to any real size.
7233 There is no style sheet provided for other fonts besides the @TeX{}
7234 family, and the style sheet cannot be modified easily.
7236 @cindex font selection
7237 @cindex font magnification
7238 @cindex @code{font-interface}
7242 @subsection Text markup
7247 @cindex typeset text
7249 LilyPond has an internal mechanism to typeset texts. You can access it
7250 with the keyword @code{\markup}. Within markup mode, you can enter texts
7251 similar to lyrics: simply enter them, surrounded by spaces.
7254 @lilypond[verbatim,fragment,relative=1]
7255 c1^\markup { hello }
7256 c1_\markup { hi there }
7257 c1^\markup { hi \bold there, is \italic anyone home? }
7260 @cindex font switching
7262 The line of the example demonstrates font switching commands. The
7263 command only apply to the first following word; enclose a set of texts
7264 with braces to apply a command to more words.
7266 \markup @{ \bold @{ hi there @} @}
7268 For clarity, you can also do this for single arguments, e.g.
7270 \markup @{ is \italic @{ anyone @} home @}
7273 @cindex font size, texts
7275 The following size commands set abolute sizes
7277 @cindex @code{\teeny}
7278 @cindex @code{\tiny}
7279 @cindex @code{\small}
7280 @cindex @code{\large}
7281 @cindex @code{\huge}
7291 You can also make letter larger or smaller relative to their neighbors,
7292 with the commands @code{\larger} and @code{\smaller}.
7296 @cindex font style, for texts
7297 @cindex @code{\bold}
7298 @cindex @code{\dynamic}
7299 @cindex @code{\number}
7300 @cindex @code{\italic}
7302 The following font change commands are defined:
7305 This changes to the font used for dynamic signs. This font does not
7306 contain all characters of the alphabet, so when producing ``piu f'',
7307 the ``piu'' should be done in a different font.
7311 This changes to the font used for time signatures. It only contains
7312 numbers and a few punctuation marks.
7314 Changes @code{font-shape} to @code{italic}
7316 Changes @code{font-series} to @code{bold}
7319 @cindex raising text
7320 @cindex lowering text
7322 @cindex translating text
7325 @cindex @code{\super}
7327 Raising and lowering texts can be done with @code{\super} and
7330 @lilypond[verbatim,fragment,relative=1]
7331 c1^\markup { E "=" mc \super "2" }
7334 @cindex @code{\raise}
7336 If you want to give an explicit amount for lowering or raising, use
7337 @code{\raise}. This command takes a Scheme valued first argument, and
7338 a markup object as second argument
7340 @lilypond[verbatim,fragment,relative=1,quote]
7341 c1^\markup { C \small \raise #1.0 \bold { "9/7+" }}
7343 The argument to @code{\raise} is the vertical displacement amount,
7344 measured in (global) staff spaces.
7346 Other commands taking single arguments include
7349 @item \bracket, \hbracket
7350 Bracket the argument markup with normal and horizontal brackets
7354 @cindex @code{\musicglyph}
7355 This is converted to a musical symbol, e.g. @code{\musicglyph
7356 #"accidentals-0"} will select the natural sign from the music font.
7357 See @ref{The Feta font} for a complete listing of the possible glyphs.
7359 This produces a single character, e.g. @code{\char #65} produces the
7363 @cindex @code{\note @var{log} @var{dots} @var{dir}}
7365 This produces a note with a stem pointing in @var{dir} direction, with
7366 duration log @var{log} and @var{dots} augmentation dots.
7368 @item \hspace #@var{amount}
7369 @cindex @code{\hspace}
7370 This produces a invisible object taking horizontal space.
7372 \markup @{ A \hspace #2.0 B @}
7374 will put extra space between A and B, on top of the space that is
7375 normally inserted before elements on a line.
7377 @item \fontsize #@var{size}
7378 @cindex @code{\fontsize}
7379 This sets the relative font size, eg.
7381 A \fontsize #2 @{ B C @} D
7385 This will enlarge the B and the C by two steps.
7386 @item \translate #(cons @var{x} @var{y})
7388 This translates an object. Its first argument is a cons of numbers
7390 A \translate #(cons 2 -3) @{ B C @} D
7392 This moves `B C' 2 spaces to the right, and 3 down.
7394 @item \magnify #@var{mag}
7395 @cindex @code{\magnify}
7396 This sets the font magnification for the its argument. In the following
7397 example, the middle A will be 10% larger.
7399 A \magnify #1.1 @{ A @} A
7403 @item \override #(@var{key} . @var{value})
7404 @cindex @code{\override}
7405 This overrides a formatting property for its argument. The argument
7406 should be a key/value pair, e.g.
7408 m \override #'(font-family . math) m m
7412 In markup mode you can compose expressions, similar to mathematical
7413 expressions, XML documents and music expressions. The braces group
7414 notes into horizontal lines. Other types of lists also exist: you can
7415 stack expressions grouped with @code{<<}, and @code{>>} vertically with
7416 the command @code{\column}. Similarly, @code{\center} aligns texts by
7419 @lilypond[verbatim,fragment,relative=1]
7420 c1^\markup { \column << a bbbb c >> }
7421 c1^\markup { \center << a bbbb c >> }
7422 c1^\markup { \line << a b c >> }
7425 The markup mechanism is extensible. Refer to
7426 @file{scm/new-markup.scm} for more information on extending the markup
7433 @internalsref{Markup functions}, @file{scm/new-markup.scm}
7440 Text layout is ultimately done by @TeX{}, which does kerning of
7441 letters. LilyPond does not account for kerning, so texts will be
7442 spaced slightly too wide.
7444 Syntax errors for markup mode are confusing.
7448 @section Global layout
7450 The global layout determined by three factors: the page layout, the
7451 line breaks and the spacing. These all influence each other. The
7452 choice of spacing determines how densely each system of music is set,
7453 which influences where line breaks breaks are chosen, and thus
7454 ultimately how many pages a piece of music takes. In this section, the
7455 algorithm for spacing music is explained, and how spacing can be
7458 Globally spoken, this procedure happens in three steps: first,
7459 flexible distances (``springs'') are chosen, based on durations. All
7460 possible line breaking combination are tried, and the one with the
7461 best results---a layout that has uniform density and requires as
7462 little stretching or cramping as possible---is chosen. When the score
7463 is processed by @TeX{}, each page is filled with systems, and page breaks
7464 are chosen whenever the page gets full.
7469 * Vertical spacing::
7470 * Horizontal spacing::
7477 @node Vertical spacing
7478 @subsection Vertical spacing
7480 @cindex vertical spacing
7481 @cindex distance between staves
7482 @cindex staff distance
7483 @cindex between staves, distance
7484 @cindex staffs per page
7487 The height of each system is determined automatically by lilypond, to
7488 keep systems from bumping into each other, some minimum distances are
7489 set. By changing these, you can put staves closer together, and thus
7490 put more systems onto one page.
7492 Normally staves are stacked vertically. To make
7493 staves maintain a distance, their vertical size is padded. This is
7494 done with the property @code{minimumVerticalExtent}. It takes a pair
7495 of numbers, so if you want to make it smaller from its, then you could
7498 \property Staff.minimumVerticalExtent = #'(-4 . 4)
7500 This sets the vertical size of the current staff to 4 staff-space on
7501 either side of the center staff line. The argument of
7502 @code{minimumVerticalExtent} is interpreted as an interval, where the
7503 center line is the 0, so the first number is generally negative. The
7504 staff can be made larger at the bottom by setting it to @code{(-6
7507 The piano staves are handled a little differently: to make cross-staff
7508 beaming work correctly, it necessary that the distance between staves
7509 is fixed beforehand. This is also done with a
7510 @internalsref{VerticalAlignment} object, created in
7511 @internalsref{PianoStaff}. In this object the distance between the
7512 staves is fixed by setting @code{forced-distance}. If you want to
7513 override this, use a @code{\translator} block as follows:
7517 VerticalAlignment \override #'forced-distance = #9
7520 This would bring the staves together at a distance of 9 staff spaces,
7521 measured from the center line of each staff.
7525 Vertical aligment of staves is handled by the
7526 @internalsref{VerticalAlignment} object.
7530 @node Horizontal spacing
7531 @subsection Horizontal Spacing
7533 The spacing engine translates differences in durations into
7534 stretchable distances (``springs'') of differing lengths. Longer
7535 durations get more space, shorter durations get less. The shortest
7536 durations get a fixed amount of space (which is controlled by
7537 @code{shortest-duration-space} in the @internalsref{SpacingSpanner}
7538 object). The longer the duration, the more space it gets: doubling a
7539 duration adds a fixed amount (this amount is controlled by
7540 @code{spacing-increment}) of space to the note.
7542 For example, the following piece contains lots of half, quarter and
7543 8th notes, the eighth note is followed by 1 note head width (NHW).
7544 The quarter note is followed by 2 NHW, the half by 3 NHW, etc.
7545 @lilypond[fragment, verbatim, relative=1] c2 c4. c8 c4. c8 c4. c8 c8
7549 Normally, @code{shortest-duration-space} is set to 1.2, which is the
7550 width of a note head, and @code{shortest-duration-space} is set to
7551 2.0, meaning that the shortest note gets 2 NHW (2 times
7552 @code{shortest-duration-space}) of space. For normal notes, this space
7553 is always counted from the left edge of the symbol, so the shortest
7554 notes are generally followed by one NHW of space.
7556 If one would follow the above procedure exactly, then adding a single
7557 32th note to a score that uses 8th and 16th notes, would widen up the
7558 entire score a lot. The shortest note is no longer a 16th, but a 32nd,
7559 thus adding 2 noteheads of space to every note. To prevent this, the
7560 shortest duration for spacing is not the shortest note in the score,
7561 but the most commonly found shortest note. Notes that are even
7562 shorter this are followed by a space that is proportonial to their
7563 duration relative to the common shortest note. So if we were to add
7564 only a few 16th notes to the example above, they would be followed by
7567 @lilypond[fragment, verbatim, relative=2]
7568 c2 c4. c8 c4. c16-[ c-] c4. c8 c8 c8 c4 c4 c4
7571 The most common shortest duration is determined as follows: in every
7572 measure, the shortest duration is determined. The most common short
7573 duration, is taken as the basis for the spacing, with the stipulation
7574 that this shortest duration should always be equal to or shorter than
7575 1/8th note. The shortest duration is printed when you run lilypond
7576 with @code{--verbose}. These durations may also be customized. If you
7577 set the @code{common-shortest-duration} in
7578 @internalsref{SpacingSpanner}, then this sets the base duration for
7579 spacing. The maximum duration for this base (normally 1/8th), is set
7580 through @code{base-shortest-duration}.
7582 @cindex @code{common-shortest-duration}
7583 @cindex @code{base-shortest-duration}
7584 @cindex @code{stem-spacing-correction}
7585 @cindex @code{spacing}
7587 In the introduction it was explained that stem directions influence
7588 spacing. This is controlled with @code{stem-spacing-correction}
7589 property in @internalsref{NoteSpacing}, which are generated for every
7590 @internalsref{Voice} context. The @code{StaffSpacing} object
7591 (generated at @internalsref{Staff} context) contains the same property
7592 for controlling the stem/barline spacing. The following example
7593 shows these corrections, once with default settings, and once with
7594 exaggerated corrections.
7600 \property Staff.NoteSpacing \override #'stem-spacing-correction
7602 \property Staff.StaffSpacing \override #'stem-spacing-correction
7607 \paper { raggedright = ##t } }
7610 @cindex SpacingSpanner, overriding properties
7612 Properties of the @internalsref{SpacingSpanner} must be overridden
7613 from the @code{\paper} block, since the @internalsref{SpacingSpanner}
7614 is created before any @code{\property} statements are interpreted.
7616 \paper @{ \translator @{
7618 SpacingSpanner \override #'spacing-increment = #3.0
7625 @internalsref{SpacingSpanner}, @internalsref{NoteSpacing},
7626 @internalsref{StaffSpacing}, @internalsref{SeparationItem},
7627 @internalsref{SeparatingGroupSpanner}.
7631 Spacing is determined on a score wide basis. If you have a score that
7632 changes its character (measured in durations) halfway during the
7633 score, the part containing the longer durations will be spaced too
7636 There is no convenient mechanism to manually override spacing.
7641 @subsection Font size
7642 @cindex font size, setting
7643 @cindex staff size, setting
7644 @cindex @code{paper} file
7646 The Feta font provides musical symbols at seven different sizes.
7647 These fonts are 11 point, 13 point, 16 point, 20 point, 23 point, and
7648 26 point. The point size of a font is the height of the corresponding
7649 staff (excluding line thicknesses).
7651 Definitions for these sizes are the files @file{paperSZ.ly}, where
7652 @code{SZ} is one of 11, 13, 16, 20, 23 and 26. If you include any
7653 of these files, the variables @code{paperEleven},
7654 @code{paperThirteen}, @code{paperSixteen},
7655 @code{paperTwenty}, @code{paperTwentythree}, and @code{paperTwentysix}
7656 are defined respectively. The default @code{\paper} block is also
7657 set. These files should be imported at toplevel, i.e.
7659 \include "paper26.ly"
7663 The font definitions are generated using a Scheme function. For more
7664 details, see the file @file{scm/font.scm}.
7669 @subsection Line breaking
7672 @cindex breaking lines
7674 Line breaks are normally computed automatically. They are chosen such
7675 that lines look neither cramped nor loose, and that consecutive lines
7676 have similar density.
7678 Occasionally you might want to override the automatic breaks; you can
7679 do this by specifying @code{\break}. This will force a line break at
7680 this point. Line breaks can only occur at places where there are bar
7681 lines. If you want to have a line break where there is no bar line,
7682 you can force an invisible bar line by entering @code{\bar
7683 ""}. Similarly, @code{\noBreak} forbids a line break at a
7687 @cindex regular line breaks
7688 @cindex four bar music.
7690 If you want linebreaks at regular intervals, you can use the following:
7692 < \repeat unfold 7 @{ s1 * 4 \break @}
7693 @emph{the real music}
7696 This makes the following 28 measures (assuming 4/4 time) be broken every
7701 @internalsref{BreakEvent}
7705 @subsection Page layout
7708 @cindex breaking pages
7710 @cindex @code{indent}
7711 @cindex @code{linewidth}
7713 The most basic settings influencing the spacing are @code{indent} and
7714 @code{linewidth}. They are set in the @code{\paper} block. They
7715 control the indentation of the first line of music, and the lengths of
7718 If @code{raggedright} is set to true in the @code{\paper}
7719 block, then the lines are justified at their natural length. This
7720 useful for short fragments, and for checking how tight the natural
7724 @cindex vertical spacing
7726 The page layout process happens outside the LilyPond formatting
7727 engine: variables controlling page layout are passed to the output,
7728 and are further interpreted by @code{ly2dvi}. @code{ly2dvi} responds
7729 to the following variables in the @code{\paper} block. The variable
7730 @code{textheight} sets the total height of the music on each page.
7731 The spacing between systems is controlled with @code{interscoreline},
7732 its default is 16pt. The distance between the score lines will
7733 stretch in order to fill the full page @code{interscorelinefill} is
7734 set to a positive number. In that case @code{interscoreline}
7735 specifies the minimum spacing.
7737 @cindex @code{textheight}
7738 @cindex @code{interscoreline}
7739 @cindex @code{interscorelinefill}
7741 If the variable @code{lastpagefill} is defined,
7742 @c fixme: this should only be done if lastpagefill == #t
7743 systems are evenly distributed vertically on the last page. This
7744 might produce ugly results in case there are not enough systems on the
7745 last page. The @command{lilypond-book} command ignores
7746 @code{lastpagefill}. See @ref{lilypond-book manual} for more
7749 @cindex @code{lastpagefill}
7751 Page breaks are normally computed by @TeX{}, so they are not under
7752 direct control of LilyPond. However, you can insert a commands into
7753 the @file{.tex} output to instruct @TeX{} where to break pages. This
7754 is done by setting the @code{between-systems-strings} on the
7755 @internalsref{NonMusicalPaperColumn} where the system is broken.
7756 An example is shown in @inputfileref{input/regression,between-systems.ly}.
7757 The predefined command @code{\newpage} also does this.
7761 @cindex @code{papersize}
7763 To change the paper size, you must first set the
7764 @code{papersize} paper variable variable. Set it to
7765 the strings @code{a4}, @code{letter}, or @code{legal}. After this
7766 specification, you must set the font as described above. If you want
7767 the default font, then use the 20 point font.
7770 \paper@{ papersize = "a4" @}
7771 \include "paper16.ly"
7774 The file @code{paper16.ly} will now include a file named @file{a4.ly}, which
7775 will set the paper variables @code{hsize} and @code{vsize} (used by
7776 Lilypond and @code{ly2dvi})
7781 @cindex @code{\newpage}
7787 @ref{Invoking ly2dvi},
7788 @inputfileref{input/regression,between-systems.ly},
7789 @internalsref{NonMusicalPaperColumn}.
7793 There is no concept of page breaking, which makes it difficult to
7794 choose sensible page breaks in multi-page pieces.
7803 Entered music can also be converted to MIDI output. The performance
7804 is good enough for proof-hearing the music for errors.
7806 Ties, dynamics and tempo changes are interpreted. Dynamic marks,
7807 crescendi and decrescendi translate into MIDI volume levels. Dynamic
7808 marks translate to a fixed fraction of the available MIDI volume
7809 range, crescendi and decrescendi make the volume vary linearly between
7810 their two extremities. The fractions be adjusted by
7811 @code{dynamicAbsoluteVolumeFunction} in @internalsref{Voice} context.
7812 For each type of MIDI instrument, a volume range can be defined. This
7813 gives you basic equalizer control, which can enhance the quality of
7814 the MIDI output remarkably. The equalizer can be controlled by
7815 setting @code{instrumentEqualizer}.
7819 Many musically interesting effects, such as swing, articulation,
7820 slurring, etc., are not translated to MIDI.
7825 * MIDI instrument names::
7830 @subsection MIDI block
7834 The MIDI block is analogous to the paper block, but it is somewhat
7835 simpler. The @code{\midi} block can contain:
7839 @item a @code{\tempo} definition
7840 @item context definitions
7843 Assignments in the @code{\midi} block are not allowed.
7847 @cindex context definition
7849 Context definitions follow precisely the same syntax as within the
7850 \paper block. Translation modules for sound are called performers.
7851 The contexts for MIDI output are defined in @file{ly/performer-init.ly}.
7854 @node MIDI instrument names
7855 @subsection MIDI instrument names
7857 @cindex instrument names
7858 @cindex @code{Staff.midiInstrument}
7859 @cindex @code{Staff.instrument}
7861 The MIDI instrument name is set by the @code{Staff.midiInstrument}
7862 property or, if that property is not set, the @code{Staff.instrument}
7863 property. The instrument name should be chosen from the list in
7864 @ref{MIDI instruments}.
7868 If the selected string does not exactly match, then LilyPond uses the
7869 default (Grand Piano). It is not possible to select an instrument by