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.
53 * Chromatic alterations::
61 * Easy Notation note heads ::
69 A note is printed by specifying its pitch and then its duration.
70 @footnote{Notes constitute the most basic elements of LilyPond input,
71 but they do not form valid input on their own without a @code{\score}
72 block. However, for the sake of brevity and simplicity we will
73 generally omit @code{\score} blocks and @code{\paper} declarations in
76 @lilypond[fragment,verbatim]
85 @cindex Note specification
87 @cindex entering notes
89 The most common syntax for pitch entry is used in @code{\chords} and
90 @code{\notes} mode. In Note and Chord mode, pitches may be designated
91 by names. The notes are specified by the letters @code{a} through
92 @code{g}, while the octave is formed with notes ranging from @code{c}
93 to @code{b}. The pitch @code{c} is an octave below middle C and the
94 letters span the octave above that C.
96 @lilypond[fragment,verbatim]
98 a,4 b, c d e f g a b c' d' e' \clef treble f' g' a' b' c''
101 @cindex note names, Dutch
103 A sharp is formed by adding @code{-is} to the end of a pitch
104 name and a flat is formed by adding @code{-es}. Double sharps and
105 double flats are obtained by adding @code{-isis} or @code{-eses}.
107 These default names are the Dutch note names. In Dutch, @code{aes} is
108 contracted to @code{as} in Dutch, but both forms are
109 accepted. Similarly, both @code{es} and @code{ees} are accepted.
111 There are predefined sets of note names for various other languages.
112 To use them, include the language specific init file. For
113 example: @code{\include "english.ly"}. The available language files
114 and the note names they define are:
119 Note Names sharp flat
120 nederlands.ly c d e f g a bes b -is -es
121 english.ly c d e f g a bf b -s/-sharp -f/-flat
122 deutsch.ly c d e f g a b h -is -es
123 norsk.ly c d e f g a b h -iss/-is -ess/-es
124 svenska.ly c d e f g a b h -iss -ess
125 italiano.ly do re mi fa sol la sib si -d -b
126 catalan.ly do re mi fa sol la sib si -d/-s -b
127 espanol.ly do re mi fa sol la sib si -s -b
136 The optional octave specification takes the form of a series of
137 single quote (`@code{'}') characters or a series of comma
138 (`@code{,}') characters. Each @code{'} raises the pitch by one
139 octave; each @code{,} lowers the pitch by an octave.
141 @lilypond[fragment,verbatim,center]
142 c' c'' es' g' as' gisis' ais'
146 The verbose syntax for pitch specification is
148 @cindex @code{\pitch}
150 \pitch @var{scmpitch}
154 where @var{scmpitch} is a Scheme object of the @code{Pitch} type.
158 Dots are normally moved up to avoid staff lines, except in polyphonic
159 situations. The following commands may be used to force a particular
162 @cindex @code{\dotsUp }
164 @cindex @code{\dotsDown }
166 @cindex @code{\dotsBoth}
169 Notes can be hidden and unhidden with the following commands.
171 @cindex @code{\hideNotes }
173 @cindex @code{\unHideNotes }
179 @internalsref{NoteEvent}, @internalsref{NoteHead}
181 @node Chromatic alterations
182 @subsection Chromatic alterations
184 Normally accidentals are printed automatically, but you may also
185 print them manually. A reminder accidental
186 @cindex reminder accidental
188 can be forced by adding an exclamation mark @code{!}
189 after the pitch. A cautionary accidental
190 @cindex cautionary accidental
191 @cindex parenthesized accidental
192 (an accidental within parentheses) can be obtained by adding the
193 question mark `@code{?}' after the pitch.
195 @lilypond[fragment,verbatim]
196 cis' cis' cis'! cis'?
200 The automatic production of accidentals can be tuned in many
201 ways. For more information, refer to @ref{Accidentals}.
206 A chord is formed by a enclosing a set of pitches in @code{<<} and
207 @code{>>}. A chord may be followed by a duration, and a set of
208 articulations, just like simple notes.
210 Additionally, fingerings and articulations may be attached to
211 individual pitches of the chord:
213 @lilypond[singleline,verbatim,relative 1]
226 Rests are entered like notes, with the note name @code{r}.
228 @lilypond[singleline,verbatim]
232 Whole bar rests, centered in middle of the bar, are specified using
233 @code{R} (capital R); see @ref{Multi measure rests}. See also
236 For some music, you may wish to explicitly specify the rest's vertical
237 position. This can be achieved by entering a note with the @code{\rest}
238 keyword appended. Rest collision testing will leave these rests alone.
240 @lilypond[singleline,verbatim]
246 @internalsref{RestEvent}, @internalsref{Rest}
253 @cindex Invisible rest
256 An invisible rest (also called a `skip') can be entered like a note
257 with note name `@code{s}' or with @code{\skip @var{duration}}:
259 @lilypond[singleline,verbatim]
263 The @code{s} syntax is only available in Note mode and Chord
264 mode. In other situations, you should use the @code{\skip} command,
265 which will work outside of those two modes:
267 @lilypond[singleline,verbatim]
270 { \time 4/8 \skip 2 \time 4/4 }
271 \notes\relative c'' { a2 a1 }
276 The skip command is merely an empty musical placeholder. It does not
277 produce any output, not even transparent output.
281 @internalsref{SkipEvent}
286 @subsection Durations
290 @cindex @code{\duration}
293 In Note, Chord, and Lyrics mode, durations are designated by numbers
294 and dots: durations are entered as their reciprocal values. For example,
295 a quarter note is entered using a @code{4} (since it is a 1/4 note), while
296 a half note is entered using a @code{2} (since it is a 1/2 note). For notes
297 longer than a whole you must use variables.
299 @c FIXME: what is an identifier? I do not think it's been introduced yet.
300 @c and if it has, I obviously skipped that part. - Graham
304 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64
306 r1 r2 r4 r8 r16 r32 r64 r64
311 \notes \relative c'' {
313 a1 a2 a4 a8 a16 a32 a64 a64
315 r1 r2 r4 r8 r16 r32 r64 r64
320 \remove "Clef_engraver"
321 \remove "Staff_symbol_engraver"
322 \remove "Time_signature_engraver"
323 \consists "Pitch_squash_engraver"
330 If the duration is omitted then it is set to the previously entered
331 duration. Default for the first note is a quarter note. The duration
332 can be followed by dots (`@code{.}') in order to obtain dotted note
336 @lilypond[fragment,verbatim,center]
337 a' b' c''8 b' a'4 a'4. b'4.. c'8.
342 You can alter the length of duration by a fraction @var{N/M}
343 appending `@code{*}@var{N/M}' (or `@code{*}@var{N}' if @var{M=1}). This
344 will not affect the appearance of the notes or rests produced.
346 @lilypond[fragment,verbatim]
347 a'2*2 b'4*2 a'8*4 a'4*3/2 gis'4*3/2 a'4*3/2 a'4
350 Durations can also be produced through GUILE extension mechanism.
351 @lilypond[verbatim,fragment]
352 c'\duration #(ly:make-duration 2 1)
358 Dot placement for chords is not perfect. In some cases, dots overlap:
366 Whenever a note is found, a
367 @internalsref{Stem} object is created automatically. For whole notes
368 and rests, stem objects are also created, but in those cases, the stem
373 @cindex @code{\stemUp}
375 @cindex @code{\stemDown}
377 @cindex @code{\stemBoth}
388 A tie connects two adjacent note heads of the same pitch. The tie in
389 effect extends the length of a note. Ties should not be confused with
390 slurs, which indicate articulation, or phrasing slurs, which indicate
391 musical phrasing. A tie is entered using the tilde symbol `@code{~}'.
393 @lilypond[fragment,verbatim,center]
394 e' ~ e' <<c' e' g'>> ~ <<c' e' g'>>
397 When a tie is applied to a chord, all note heads whose pitches match
398 are connected. When no note heads match, no ties will be created.
400 In its meaning a tie is just a way of extending a note duration, similar
401 to the augmentation dot: the following example are two ways of notating
402 exactly the same concept.
404 @lilypond[fragment, singleline,quote]
405 \time 3/4 c'2. c'2 ~ c'4
407 If you need to tie notes over bars, it may be easier to use automatic
408 note splitting (See @ref{Automatic note splitting}).
413 @cindex @code{\tieUp }
415 @cindex @code{\tieDown }
417 @cindex @code{\tieBoth }
419 @cindex @code{\tieDotted }
421 @cindex @code{\tieSolid}
426 @internalsref{TieEvent}, @internalsref{NewTieEvent},
427 @internalsref{Tie}, @ref{Automatic note splitting}.
430 ties created for a chord, see @inputfileref{input/test,tie-sparse.ly}.
434 Tieing only a subset of the note heads of a pair of chords is not
435 supported in a simple way. It can be achieved by moving the
436 tie-engraver into the @internalsref{Thread} context and turning on and
437 off ties per @internalsref{Thread}.
439 Switching staves when a tie is active, will produce a horizontal tie
442 Formatting of ties is a difficult subject. The results are often not
452 @cindex @code{\times}
454 Tuplets are made out of a music expression by multiplying all durations
457 @cindex @code{\times}
459 \times @var{fraction} @var{musicexpr}
462 The duration of @var{musicexpr} will be multiplied by the fraction.
463 In the sheet music, the fraction's denominator will be printed over
464 the notes, optionally with a bracket. The most common tuplet is the
465 triplet in which 3 notes have the length of 2, so the notes are 2/3
466 of their written length:
468 @lilypond[fragment,verbatim,center]
469 g'4 \times 2/3 {c'4 c' c'} d'4 d'4
472 The property @code{tupletSpannerDuration} specifies how long each bracket
473 should last. With this, you can make lots of tuplets while typing
474 @code{\times} only once, saving lots of typing.
476 @lilypond[fragment, relative, singleline, verbatim]
477 \property Voice.tupletSpannerDuration = #(ly:make-moment 1 4)
478 \times 2/3 { c'8 c c c c c }
481 The format of the number is determined by the property
482 @code{tupletNumberFormatFunction}. The default prints only the
483 denominator, but if it is set to the Scheme function
484 @code{fraction-tuplet-formatter}, @var{num}:@var{den} will be printed
488 @cindex @code{tupletNumberFormatFunction}
489 @cindex tuplet formatting
494 @cindex @code{\tupletUp }
496 @cindex @code{\tupletDown }
498 @cindex @code{\tupletBoth}
503 @seeinternals{TupletBracket}, @seeinternals{TimeScaledMusic}.
507 Nested tuplets are not formatted automatically. In this case, outer
508 tuplet brackets should be moved manually.
510 @node Easy Notation note heads
511 @subsection Easy Notation note heads
513 @cindex easy notation
516 The `easyplay' note head includes a note name inside the head. It is
517 used in music aimed at beginners.
519 @lilypond[singleline,verbatim,26pt]
521 \notes { c'2 e'4 f' | g'1 }
522 \paper { \translator { \EasyNotation } }
526 The @code{EasyNotation} variable overrides a @internalsref{Score}
527 context. You probably will want to print it with magnification or a
528 large font size to make it more readable. To print with
529 magnification, you must create a DVI file (with @file{ly2dvi}) and
530 then enlarge it with something like @file{dvips -x 2000 file.dvi}.
531 See @file{man dvips} for details. To print with a larger font, see
538 If you view the result with Xdvi, then staff lines will show through
539 the letters. Printing the PostScript file obtained with ly2dvi does
540 produce the correct result.
543 @node Easier music entry
544 @section Easier music entry
547 When entering music it is easy to introduce errors. This section deals
548 with tricks and features of the input language that help when entering
549 music, and find and correct mistakes.
551 Some features of the input language ease entering music, for example
552 the use of variables (for splitting up large pieces of music), and
553 unfolded repeats for writing repetitive parts. They are described in
554 other sections (see @ref{Repeats} and @ref{Assignments}), since they
555 are not especially aimed at easing entry
557 It is also possible to use external programs, for example GUI
558 interfaces, or MIDI transcription programs, to enter or edit
559 music. Refer to the website for more information. Finally, there are
560 tools make debugging easier, by linking the input file and the output
561 shown on screen. See @ref{Point and click} for more information.
567 * Skipping corrected music::
568 * Automatic note splitting ::
574 @node Relative octaves
575 @subsection Relative octaves
577 @cindex relative octave specification
579 Octaves are specified by adding @code{'} and @code{,} to pitch names.
580 When you copy existing music, it is easy to accidentally put a pitch
581 in the wrong octave and hard to find such an error. The relative
582 octave mode prevents these errors
584 @cindex @code{\relative}
586 \relative @var{startpitch} @var{musicexpr}
589 The octave of notes that appear in @var{musicexpr} are calculated as
590 follows: If no octave changing marks are used, the basic interval
591 between this and the last note is always taken to be a fourth or less
592 (This distance is determined without regarding alterations; a
593 @code{fisis} following a @code{ceses} will be put above the
596 The octave changing marks @code{'} and @code{,} can be added to raise or
597 lower the pitch by an extra octave. Upon entering relative mode, an
598 absolute starting pitch must be specified that will act as the
599 predecessor of the first note of @var{musicexpr}.
601 Entering music that changes octave frequently is easy in relative mode.
602 @lilypond[fragment,singleline,verbatim,center]
608 And octave changing marks are used for intervals greater than a fourth.
609 @lilypond[fragment,verbatim,center]
614 If the preceding item is a chord, the first note of the chord is used
615 to determine the first note of the next chord. However, other notes
616 within the second chord are determined by looking at the immediately
619 @lilypond[fragment,verbatim,center]
626 @cindex @code{\notes}
628 The pitch after the @code{\relative} contains a note name. To parse
629 the pitch as a note name, you have to be in note mode, so there must
630 be a surrounding @code{\notes} keyword (which is not
633 The relative conversion will not affect @code{\transpose},
634 @code{\chords} or @code{\relative} sections in its argument. If you
635 want to use relative within transposed music, you must place an
636 additional @code{\relative} inside the @code{\transpose}.
640 @subsection Bar check
644 @cindex @code{barCheckSynchronize}
648 Whenever a bar check is encountered during interpretation, a warning
649 message is issued if it does not fall at a measure boundary. This can
650 help find errors in the input. Depending on the value of
651 @code{barCheckSynchronize}, the beginning of the measure will be
652 relocated. A bar check is entered using the bar symbol, `@code{|}'.
655 \time 3/4 c2 e4 | g2.
660 @cindex skipTypesetting
662 Failed bar checks are caused by entering incorrect
663 durations. Incorrect durations often completely garble up the score,
664 especially if it is polyphonic, so you should start correcting the
665 score by scanning for failed bar checks and incorrect durations. To
666 speed up this process, you can use @code{skipTypesetting}, described
669 @node Skipping corrected music
670 @subsection Skipping corrected music
672 The property @code{Score.skipTypesetting} can be used to switch on and
673 off typesetting completely during the interpretation phase. When
674 typesetting is switched off, the music is processed much more quickly.
675 This can be used to skip over the parts of a score that have already
676 been checked for errors.
678 @lilypond[fragment,singleline,verbatim]
680 \property Score.skipTypesetting = ##t
682 \property Score.skipTypesetting = ##f
686 @node Automatic note splitting
687 @subsection Automatic note splitting
689 Long notes can be converted automatically to tied notes. This is done
690 by replacing the @internalsref{Note_heads_engraver} by the
691 @internalsref{Completion_heads_engraver}.
694 \paper @{ \translator @{
696 \remove "Note_heads_engraver"
697 \consists "Completion_heads_engraver"
704 c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2
711 c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2
713 \paper { \translator {
715 \remove "Note_heads_engraver"
716 \consists "Completion_heads_engraver"
721 This engraver splits all running notes at the bar line, and inserts
722 ties. One of its uses is to debug complex scores: if the measures are
723 not entirely filled, then the ties exactly show how much each measure
728 Not all durations (especially those containing tuplets) can be
729 represented exactly; the engraver will not insert tuplets.
735 @section Staff notation
737 This section describes with music notation that occurs on staff level,
738 such as keys, clefs and time signatures.
740 @cindex Staff notation
753 @subsection Staff symbol
755 @cindex adjusting staff symbol
756 @cindex StaffSymbol, using \property
757 @cindex staff lines, setting number of
759 Notes, dynamic signs, etc. are grouped
760 with a set of horizontal lines, into a staff (plural `staves'). In our
761 system, these lines are drawn using a separate layout object called
764 This object is created whenever a @internalsref{Staff} context is
765 created. The appearance of the staff symbol cannot be changed by
766 using @code{\override} or @code{\set}. At the moment that
767 @code{\property Staff} is interpreted, a @internalsref{Staff} context
768 is made, and the @internalsref{StaffSymbol} is created before any
769 @code{\override} is effective. Properties can be changed in a
770 @code{\translator} definition, or by using @code{\outputproperty}.
774 If a staff is ended halfway a piece, the staff symbol may not end
775 exactly on the barline.
779 @subsection Key signature
780 @cindex Key signature
784 The key signature indicates the scale in which a piece is played. It
785 is denoted by a set of alterations (flats or sharps) at the start of
790 Setting or changing the key signature is done with the @code{\key}
793 @code{\key} @var{pitch} @var{type}
796 @cindex @code{\minor}
797 @cindex @code{\major}
798 @cindex @code{\minor}
799 @cindex @code{\ionian}
800 @cindex @code{\locrian}
801 @cindex @code{\aeolian}
802 @cindex @code{\mixolydian}
803 @cindex @code{\lydian}
804 @cindex @code{\phrygian}
805 @cindex @code{\dorian}
807 Here, @var{type} should be @code{\major} or @code{\minor} to get
808 @var{pitch}-major or @var{pitch}-minor, respectively.
809 The standard mode names @code{\ionian},
810 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
811 @code{\phrygian}, and @code{\dorian} are also defined.
813 This command sets the context property
814 @internalsref{Staff}.@code{keySignature}. Non-standard key signatures
815 can be specified by setting this property directly.
819 The ordering of a key restoration (alterations that change back to
820 natural) is wrong when combined with a repeat barline.
824 @internalsref{KeyChangeEvent}, @internalsref{KeySignature}.
826 @cindex @code{keySignature}
833 The clef indicates which lines of the staff correspond to which
838 The clef can be set or changed with the @code{\clef} command:
839 @lilypond[fragment,verbatim]
840 \key f\major c''2 \clef alto g'2
843 Supported clef-names include
844 @c Moved standard clefs to the top /MB
846 @item treble, violin, G, G2
855 G clef on 1st line, so-called French violin clef
870 By adding @code{_8} or @code{^8} to the clef name, the clef is
871 transposed one octave down or up, respectively. @var{clefname} must
872 be enclosed in quotes when it contains underscores or digits. For
878 This command is equivalent to setting @code{clefGlyph},
879 @code{clefPosition} (which controls the Y position of the clef),
880 @code{centralCPosition} and @code{clefOctavation}. A clef is printed
881 when any of these properties are changed.
885 The object for this symbol is @internalsref{Clef}.
889 @node Ottava brackets
890 @subsection Ottava brackets
892 ``Ottava'' brackets introduce an extra transposition of an octave for
893 the staff. They are created by invoking the function
894 @code{set-octavation}
900 @lilypond[verbatim,fragment]
909 Internally the @code{set-octavation} sets @code{ottavation} (eg. to
910 @code{"8va"}) and @code{centralCPosition} properties.
914 @internalsref{OttavaBracket}
918 @code{set-octavation} will get confused when clef changes happen
919 during an octavation bracket.
922 @subsection Time signature
923 @cindex Time signature
927 Time signature indicates the metrum of a piece: a regular pattern of
928 strong and weak beats. It is denoted by a fraction at the start of the
933 The time signature is set or changed by the @code{\time}
935 @lilypond[fragment,verbatim]
936 \time 2/4 c'2 \time 3/4 c'2.
939 The actual symbol that is printed can be customized with the
940 @code{style} property. Setting it to @code{#'()} uses fraction style
941 for 4/4 and 2/2 time. There are many more options for its layout.
942 See @inputfileref{input/test,time.ly} for more examples.
945 This command sets the property @code{timeSignatureFraction},
946 @code{beatLength} and @code{measureLength} in the @code{Timing}
947 context, which is normally aliased to @internalsref{Score}. The
948 property @code{timeSignatureFraction} determines where bar lines
949 should be inserted, and how automatic beams should be generated.
950 Changing the value of @code{timeSignatureFraction} also causes the
951 symbol to be printed.
953 More options are available through the Scheme function
954 @code{set-time-signature}. In combination with the
955 @internalsref{Measure_grouping_engraver}, it will create
956 @internalsref{MeasureGrouping} signs. Such signs ease reading
957 rhythmically complex modern music. In the following example, the 9/8
958 measure is subdivided in 2, 2, 2 and 3. This is passed to
959 @code{set-time-signature} as the third argument @code{(2 2 2 3)}.
962 \score { \notes \relative c'' {
963 #(set-time-signature 9 8 '(2 2 2 3))
964 g8-[ g-] d-[ d-] g-[ g-] a8-[-( bes g-]-) |
965 #(set-time-signature 5 8 '(3 2))
970 \translator { \StaffContext
971 \consists "Measure_grouping_engraver"
977 @internalsref{TimeSignature}, @internalsref{Timing_engraver}.
982 Automatic beaming does not use measure grouping specified with
983 @code{set-time-signature}.
990 @cindex partial measure
991 @cindex measure, partial
992 @cindex shorten measures
993 @cindex @code{\partial}
995 Partial measures, for example in upbeats, are entered using the
996 @code{\partial} command:
997 @lilypond[fragment,verbatim]
998 \partial 16*5 c'16 c4 f16 a'2. ~ a'8. a'16 | g'1
1001 The syntax for this command is
1003 \partial @var{duration}
1005 This is internally translated into
1007 \property Timing.measurePosition = -@var{length of duration}
1010 The property @code{measurePosition} contains a rational number
1011 indicating how much of the measure has passed at this point.
1013 @node Unmetered music
1014 @subsection Unmetered music
1016 Bar lines and bar numbers are calculated automatically. For unmetered
1017 music (e.g. cadenzas), this is not desirable. By setting
1018 @code{Score.timing} to false, this automatic timing can be switched
1024 @cindex @code{\cadenzaOn }
1026 @cindex @code{\cadenzaOff }
1030 @subsection Bar lines
1034 @cindex measure lines
1038 Bar lines delimit measures, but are also used to indicate
1039 repeats. Line breaks may only happen on barlines.
1043 Bar lines are inserted automatically. Special types
1044 of barlines can be forced with the @code{\bar} command:
1045 @lilypond[relative=1,fragment,verbatim]
1049 The following bar types are available
1050 @lilypond[fragment, relative, singleline, verbatim]
1062 In scores with many staves, the barlines are automatically placed at
1063 top level, and they are connected between different staves of a
1064 @internalsref{StaffGroup}:
1065 @lilypond[fragment, verbatim]
1066 < \context StaffGroup <
1067 \context Staff = up { e'4 d'
1070 \context Staff = down { \clef bass c4 g e g } >
1071 \context Staff = pedal { \clef bass c2 c2 } >
1075 The command @code{\bar @var{bartype}} is a short cut for
1076 doing @code{\property Score.whichBar = @var{bartype}}
1077 Whenever @code{whichBar} is set to a string, a bar line of that type is
1078 created. @code{whichBar} is usually set automatically: at the start of
1079 a measure it is set to @code{defaultBarType}. The contents of
1080 @code{repeatCommands} is used to override default measure bars.
1082 @code{whichBar} can also be set directly, using @code{\property} or
1083 @code{\bar}. These settings take precedence over the automatic
1084 @code{whichBar} settings.
1087 @cindex repeatCommands
1088 @cindex defaultBarType
1090 You are encouraged to use @code{\repeat} for repetitions. See
1100 The bar line objects that are created at @internalsref{Staff} level
1101 are called @internalsref{BarLine}, the bar lines that span staffs are
1102 @internalsref{SpanBar}s.
1109 The easiest way to enter fragments with more than one voice on a staff
1110 is to split chords using the separator @code{\\}. You can use it for
1111 small, short-lived voices or for single chords:
1113 @lilypond[verbatim,fragment]
1114 \context Voice = VA \relative c'' {
1115 c4 < { f d e } \\ { b c2 } > c4 < g' \\ b, \\ f' \\ d' >
1119 The separator causes @internalsref{Voice} contexts to be instantiated,
1120 bearing the names @code{"1"}, @code{"2"}, etc. In each of these
1121 contexts, vertical direction of slurs, stems, etc. are set
1124 This can also be done by instantiating @internalsref{Voice} contexts
1125 by hand, and using @code{\voiceOne}, up to @code{\voiceFour} to assign
1126 a stem directions and horizontal shift for each part.
1129 @lilypond[singleline, verbatim]
1131 \context Staff < \context Voice = VA { \voiceOne cis2 b }
1132 \context Voice = VB { \voiceThree b4 ais ~ ais4 gis4 }
1133 \context Voice = VC { \voiceTwo fis4~ fis4 f ~ f } >
1136 Normally, note heads with a different number of dots are not merged, but
1137 when the object property @code{merge-differently-dotted} is set in
1138 the @internalsref{NoteCollision} object, they are:
1139 @lilypond[verbatim,fragment,singleline]
1140 \relative c'' \context Voice < {
1142 \property Staff.NoteCollision \override
1143 #'merge-differently-dotted = ##t
1145 } \\ { g8.-[ f16-] g8.-[ f16-] }
1149 Similarly, you can merge half note heads with eighth notes, by setting
1150 @code{merge-differently-headed}:
1151 @lilypond[fragment, relative=2,verbatim]
1154 \property Staff.NoteCollision
1155 \override #'merge-differently-headed = ##t
1156 c8 c4. } \\ { c2 c2 } >
1159 LilyPond also vertically shifts rests that are opposite of a stem.
1162 @lilypond[singleline,fragment,verbatim]
1163 \context Voice < c''4 \\ r4 >
1171 @cindex @code{\oneVoice }
1173 @cindex @code{\voiceOne }
1175 @cindex @code{\voiceTwo }
1177 @cindex @code{\voiceThree }
1179 @cindex @code{\voiceFour }
1182 The following commands specify in what chords of the current voice
1183 should be shifted: the outer voice has @code{\shiftOff}, and the inner
1184 voices have @code{\shiftOn}, @code{\shiftOnn}, etc.
1187 @cindex @code{\shiftOn}
1189 @cindex @code{\shiftOnn }
1191 @cindex @code{\shiftOnnn }
1193 @cindex @code{\shiftOff }
1200 The objects responsible for resolving collisions are
1201 @internalsref{NoteCollision} and @internalsref{RestCollision}. See
1202 also example files @inputfileref{input/regression,collision-dots.ly},
1203 @inputfileref{input/regression,collision-head-chords.ly},
1204 @inputfileref{input/regression,collision-heads.ly},
1205 @inputfileref{input/regression,collision-mesh.ly}, and
1206 @inputfileref{input/regression,collisions.ly}.
1211 Resolving collisions is a intricate subject, and only a few situations
1212 are handled. When LilyPond cannot cope, the @code{force-hshift}
1213 property of the @internalsref{NoteColumn} object and pitched rests can
1214 be used to override typesetting decisions.
1220 Beams are used to group short notes into chunks that are aligned with
1221 the metrum. They are inserted automatically in most cases.
1223 @lilypond[fragment,verbatim, relative=2]
1224 \time 2/4 c8 c c c \time 6/8 c c c c8. c16 c8
1227 When these automatic decisions are not good enough, beaming can be
1228 entered explicitly. It is also possible to define beaming patterns
1229 that differ from the defaults.
1233 @internalsref{Beam}.
1236 @cindex Automatic beams
1237 @subsection Manual beams
1238 @cindex beams, manual
1242 In some cases it may be necessary to override the automatic beaming
1243 algorithm. For example, the auto beamer will not beam over rests or
1244 bar lines, If you want that, specify the begin and end point manually
1245 using @code{[} and @code{]}.
1247 @lilypond[fragment,relative,verbatim]
1249 r4 r8-[ g' a r8-] r8 g-[ | a-] r8
1253 @cindex @code{stemLeftBeamCount}
1255 Normally, beaming patterns within a beam are determined automatically.
1256 When this mechanism fouls up, the properties
1257 @code{Voice.stemLeftBeamCount} and @code{Voice.stemRightBeamCount} can
1258 be used to control the beam subdivision on a stem. If either property
1259 is set, its value will be used only once, and then it is erased.
1261 @lilypond[fragment,relative,verbatim]
1264 f8-[ r16 \property Voice.stemLeftBeamCount = #1 f g a-]
1267 @cindex @code{stemRightBeamCount}
1270 The property @code{subdivideBeams} can be set in order to subdivide
1271 all 16th or shorter beams at beat positions. This accomplishes the
1272 same effect as twiddling with @code{stemLeftBeamCount} and
1273 @code{stemRightBeamCount}, but it take less typing.
1276 @lilypond[relative=1,verbatim,noindent]
1277 c16-[ c c c c c c c-]
1278 \property Voice.subdivideBeams = ##t
1279 c16-[ c c c c c c c-]
1280 \property Score.beatLength = #(ly:make-moment 1 8)
1281 c16-[ c c c c c c c-]
1283 @cindex subdivideBeams
1285 Kneed beams are inserted automatically, when a large gap is detected
1286 between the note heads. This behavior can be tuned through the object
1287 property @code{auto-knee-gap}.
1289 @cindex beams, kneed
1291 @cindex auto-knee-gap
1299 Automatically kneed beams cannot be used together with Hara Kiri
1304 * Setting automatic beam behavior ::
1308 @no de Beam typography
1309 @sub section Beam typography
1311 One of the strong points of LilyPond is how beams are formatted. Beams
1312 are quantized, meaning that the left and right endpoints beams start
1313 exactly on staff lines. Without quantization, small wedges of white
1314 space appear between the beam and staff line, and this looks untidy.
1316 Beams are also slope-damped: melodies that go up or down should also
1317 have beams that go up or down, but the slope of the beams should be
1318 less than the slope of the notes themselves.
1320 Some beams should be horizontal. These are so-called concave beams.
1322 [TODO: some pictures.]
1326 @node Setting automatic beam behavior
1327 @subsection Setting automatic beam behavior
1329 @cindex @code{autoBeamSettings}
1330 @cindex @code{(end * * * *)}
1331 @cindex @code{(begin * * * *)}
1332 @cindex automatic beams, tuning
1333 @cindex tuning automatic beaming
1335 @c [TODO: use \applycontext]
1337 In normal time signatures, automatic beams can start on any note but can
1338 only end in a few positions within the measure: beams can end on a beat,
1339 or at durations specified by the properties in
1340 @code{Voice.autoBeamSettings}. The defaults for @code{autoBeamSettings}
1341 are defined in @file{scm/auto-beam.scm}.
1343 The value of @code{autoBeamSettings} is changed using
1344 @code{\override} and unset using @code{\revert}:
1346 \property Voice.autoBeamSettings \override #'(@var{BE} @var{P} @var{Q} @var{N} @var{M}) = @var{dur}
1347 \property Voice.autoBeamSettings \revert #'(@var{BE} @var{P} @var{Q} @var{N} @var{M})
1349 Here, @var{BE} is the symbol @code{begin} or @code{end}. It determines
1350 whether the rule applies to begin or end-points. The quantity
1351 @var{P}/@var{Q} refers to the length of the beamed notes (and `@code{*
1352 *}' designates notes of any length), @var{N}/@var{M} refers to a time
1353 signature (wildcards, `@code{* *}' may be entered to designate all time
1356 For example, if automatic beams should end on every quarter note, use
1359 \property Voice.autoBeamSettings \override
1360 #'(end * * * *) = #(ly:make-moment 1 4)
1362 Since the duration of a quarter note is 1/4 of a whole note, it is
1363 entered as @code{(ly:make-moment 1 4)}.
1365 The same syntax can be used to specify beam starting points. In this
1366 example, automatic beams can only end on a dotted quarter note.
1368 \property Voice.autoBeamSettings \override
1369 #'(end * * * *) = #(ly:make-moment 3 8)
1371 In 4/4 time signature, this means that automatic beams could end only on
1372 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
1373 3/8 has passed within the measure).
1375 Rules can also be restricted to specific time signatures. A rule that
1376 should only be applied in @var{N}/@var{M} time signature is formed by
1377 replacing the second asterisks by @var{N} and @var{M}. For example, a
1378 rule for 6/8 time exclusively looks like
1380 \property Voice.autoBeamSettings \override
1381 #'(begin * * 6 8) = ...
1384 If a rule should be to applied only to certain types of beams, use the
1385 first pair of asterisks. Beams are classified according to the
1386 shortest note they contain. For a beam ending rule that only applies
1387 to beams with 32nd notes (and no shorter notes), use @code{(end 1 32 *
1390 If a score ends while an automatic beam has not been ended and is still
1391 accepting notes, this last beam will not be typeset at all.
1393 @cindex automatic beam generation
1395 @cindex @code{Voice.autoBeaming}
1398 For melodies that have lyrics, you may want to switch off
1399 automatic beaming. This is done by setting @code{Voice.autoBeaming} to
1404 @cindex @code{\autoBeamOff }
1405 @code{\autoBeamOff},
1406 @cindex @code{\autoBeamOn }
1412 It is not possible to specify beaming parameters for beams with mixed
1413 durations, that differ from the beaming parameters of all separate
1414 durations, i.e., you will have to specify manual beams to get:
1416 @lilypond[singleline,fragment,relative,noverbatim,quote]
1417 \property Voice.autoBeamSettings
1418 \override #'(end * * * *) = #(ly:make-moment 3 8)
1419 \time 12/8 c'8 c c c16 c c c c c c-[ c c c-] c8 c c4
1421 It is not possible to specify beaming parameters that act differently in
1422 different parts of a measure. This means that it is not possible to use
1423 automatic beaming in irregular meters such as @code{5/8}.
1426 @section Accidentals
1429 This section describes how to change the way that LilyPond automatically
1430 inserts accidentals before the running notes.
1434 * Using the predefined accidental variables::
1435 * Customized accidental rules::
1438 @node Using the predefined accidental variables
1439 @subsection Using the predefined accidental variables
1441 The constructs for describing the accidental typesetting rules are
1442 quite hairy, so non-experts should stick to the variables
1443 defined in @file{ly/property-init.ly}.
1444 @cindex @file{property-init.ly}
1446 The variables set properties in the ``Current'' context (see
1447 @ref{Context properties}). This means that the variables should
1448 normally be added right after the creation of the context in which the
1449 accidental typesetting described by the variable is to take
1450 effect. For example, if you want to use piano-accidentals in a piano
1451 staff then issue @code{\pianoAccidentals} first thing after the
1452 creation of the piano staff:
1455 \notes \relative c'' <
1456 \context Staff = sa @{ cis4 d e2 @}
1457 \context GrandStaff <
1459 \context Staff = sb @{ cis4 d e2 @}
1460 \context Staff = sc @{ es2 c @}
1462 \context Staff = sd @{ es2 c @}
1466 @lilypond[singleline]
1468 \notes \relative c'' <
1469 \context Staff = sa { cis4 d e2 }
1470 \context GrandStaff <
1472 \context Staff = sb { cis4 d e2 }
1473 \context Staff = sc { es2 c }
1475 \context Staff = sd { es2 c }
1480 minimumVerticalExtent = #'(-4.0 . 4.0)
1488 @item \defaultAccidentals
1489 @cindex @code{\defaultAccidentals}
1490 This is the default typesetting behaviour. It should correspond
1491 to 18th century common practice: Accidentals are
1492 remembered to the end of the measure in which they occur and
1493 only on their own octave.
1495 @item \voiceAccidentals
1496 @cindex @code{\voiceAccidentals}
1498 The normal behaviour is to
1499 remember the accidentals on Staff-level. This variable, however,
1500 typesets accidentals individually for each voice. Apart from that the
1501 rule is similar to @code{\defaultAccidentals}.
1503 This leads to some weird and often unwanted results
1504 because accidentals from one voice do not get cancelled in other
1506 @lilypond[singleline,relative,fragment,verbatim,quote]
1514 Hence you should only use @code{\voiceAccidentals} if the voices
1515 are to be read solely by individual musicians. If the staff is to be
1516 used by one musician (e.g., a conductor) then you use
1517 @code{\modernVoiceAccidentals} or @code{\modernVoiceCautionaries}
1520 @item \modernAccidentals
1521 @cindex @code{\modernAccidentals}
1522 This rule corresponds to the common practice in the 20th
1524 The rule is more complex than @code{\defaultAccidentals}.
1525 You get all the same accidentals, but temporary
1526 accidentals also get cancelled in other octaves. Further more,
1527 in the same octave, they also get cancelled in the following measure:
1528 @lilypond[singleline,fragment,verbatim]
1530 cis' c'' cis'2 | c'' c'
1533 @item \modernCautionaries
1534 @cindex @code{\modernCautionaries}
1535 This rule is similar to @code{\modernAccidentals}, but the
1536 ``extra'' accidentals (the ones not typeset by
1537 @code{\defaultAccidentals}) are typeset as cautionary accidentals
1538 (i.e. in reduced size):
1539 @lilypond[singleline,fragment,verbatim]
1541 cis' c'' cis'2 | c'' c'
1544 @cindex @code{\modernVoiceAccidentals}
1545 @item \modernVoiceAccidentals
1546 is used for multivoice accidentals to be read both by musicians
1547 playing one voice and musicians playing all voices. Accidentals are
1548 typeset for each voice, but they @emph{are} cancelled across voices in
1549 the same @internalsref{Staff}.
1551 @cindex @code{\modernVoiceCautionaries}
1552 @item \modernVoiceCautionaries
1553 is the same as @code{\modernVoiceAccidentals}, but with the extra
1554 accidentals (the ones not typeset by @code{\voiceAccidentals}) typeset
1555 as cautionaries. Even though all accidentals typeset by
1556 @code{\defaultAccidentals} @emph{are} typeset by this variable then
1557 some of them are typeset as cautionaries.
1559 @item \pianoAccidentals
1560 @cindex @code{\pianoAccidentals}
1561 20th century practice for piano notation. Very similar to
1562 @code{\modernAccidentals} but accidentals also get cancelled
1563 across the staves in the same @internalsref{GrandStaff} or
1564 @internalsref{PianoStaff}.
1566 @item \pianoCautionaries
1567 @cindex @code{\pianoCautionaries}
1568 As @code{\pianoAccidentals} but with the extra accidentals
1569 typeset as cautionaries.
1572 @cindex @code{\noResetKey}
1573 Same as @code{\defaultAccidentals} but with accidentals lasting
1574 ``forever'' and not only until the next measure:
1575 @lilypond[singleline,fragment,verbatim,relative]
1580 @item \forgetAccidentals
1581 @cindex @code{\forgetAccidentals}
1582 This is sort of the opposite of @code{\noResetKey}: Accidentals
1583 are not remembered at all - and hence all accidentals are
1584 typeset relative to the key signature, regardless of what was
1585 before in the music:
1586 @lilypond[singleline,fragment,verbatim,relative]
1588 \key d\major c4 c cis cis d d dis dis
1592 @node Customized accidental rules
1593 @subsection Customized accidental rules
1595 This section must be considered gurus-only, and hence it must be
1596 sufficient with a short description of the system and a reference to
1597 the internal documentation.
1599 The algorithm tries several different rules, and uses the rule
1600 that gives the highest number of accidentals. Each rule consists of
1603 In which context is the rule applied. For example, if
1604 @var{context} is @internalsref{Score} then all staves share
1605 accidentals, and if @var{context} is @internalsref{Staff} then all
1606 voices in the same staff share accidentals, but staves do not.
1608 Whether the accidental changes all octaves or only the current
1611 Over how many barlines the accidental lasts.
1612 If @var{lazyness} is @code{-1} then the accidental is forget
1613 immediately, and if @var{lazyness} is @code{#t} then the accidental
1616 @c [TODO: should use +infinity for this case?]
1622 @cindex @code{\defaultAccidentals }
1623 @code{\defaultAccidentals},
1624 @cindex @code{\voiceAccidentals }
1625 @code{\voiceAccidentals},
1626 @cindex @code{\modernAccidentals }
1627 @code{\modernAccidentals},
1628 @cindex @code{\modernCautionaries }
1629 @code{\modernCautionaries},
1630 @cindex @code{\modernVoiceAccidentals }
1631 @code{\modernVoiceAccidentals},
1632 @cindex @code{\modernVoiceCautionaries }
1633 @code{\modernVoiceCautionaries},
1634 @cindex @code{\pianoAccidentals }
1635 @code{\pianoAccidentals},
1636 @cindex @code{\pianoCautionaries }
1637 @code{\pianoCautionaries},
1638 @cindex @code{\noResetKey }
1640 @cindex @code{\forgetAccidentals }
1641 @code{\forgetAccidentals},
1645 @internalsref{Accidental_engraver}, @internalsref{Accidental},
1646 @internalsref{AccidentalPlacement}.
1651 Currently the simultaneous notes are considered to be entered in
1652 sequential mode. This means that in a chord the accidentals are
1653 typeset as if the notes in the chord happened one at a time - in the
1654 order in which they appear in the input file.
1656 This is only a problem when there are simultaneous notes whose
1657 accidentals depend on each other. The problem only occurs when using
1658 non-default accidentals. In the default scheme, accidentals only
1659 depend on other accidentals with the same pitch on the same staff, so
1660 no conflicts possible.
1662 This example shows two examples of the same music giving different
1663 accidentals depending on the order in which the notes occur in the
1666 @lilypond[singleline,fragment,verbatim]
1667 \property Staff.autoAccidentals = #'( Staff (any-octave . 0) )
1668 cis'4 <<c'' c'>> r2 | cis'4 <<c' c''>> r2
1669 | <<cis' c''>> r | <<c'' cis'>> r |
1672 This problem can be solved by manually inserting @code{!} and @code{?}
1673 for the problematic notes.
1675 @node Expressive marks
1676 @section Expressive marks
1684 * Analysis brackets::
1691 A slur indicates that notes are to be played bound or @emph{legato}.
1695 They are entered using parentheses:
1696 @lilypond[fragment,verbatim,center]
1697 f'-( g'-)-( a'-) a'8-[ b'-(-] a'4 g'2 f'4-)
1698 <<c' e'>>2-( <<b d'>>2-)
1702 @c TODO: should explain that ^( and _( set directions
1703 @c should set attachments with ^ and _ ?
1705 Slurs avoid crossing stems, and are generally attached to note heads.
1706 However, in some situations with beams, slurs may be attached to stem
1707 ends. If you want to override this layout you can do this through the
1708 object property @code{attachment} of @internalsref{Slur} in
1709 @internalsref{Voice} context. Its value is a pair of symbols, specifying
1710 the attachment type of the left and right end points.
1712 @lilypond[fragment,relative,verbatim]
1714 \property Voice.Stem \set #'length = #5.5
1716 \property Voice.Slur \set #'attachment = #'(stem . stem)
1720 If a slur would strike through a stem or beam, the slur will be moved
1721 away upward or downward. If this happens, attaching the slur to the
1722 stems might look better:
1724 @lilypond[fragment,relative,verbatim]
1727 \property Voice.Slur \set #'attachment = #'(stem . stem)
1734 @cindex @code{\slurUp }
1736 @cindex @code{\slurDown }
1738 @cindex @code{\slurBoth }
1740 @cindex @code{\slurDotted }
1742 @cindex @code{\slurSolid }
1747 @seeinternals{Slur}, @internalsref{SlurEvent}.
1752 Producing nice slurs is a difficult problem, and LilyPond currently
1753 uses a simple, empiric method to produce slurs. In some cases, the
1754 results of this method are ugly.
1757 @cindex Adjusting slurs
1759 @node Phrasing slurs
1760 @subsection Phrasing slurs
1762 @cindex phrasing slurs
1763 @cindex phrasing marks
1765 A phrasing slur (or phrasing mark) connects chords and is used to
1766 indicate a musical sentence. It is started using @code{\(} and @code{\)}
1769 @lilypond[fragment,verbatim,center,relative]
1770 \time 6/4 c'-\( d-( e-) f-( e-) d-\)
1773 Typographically, the phrasing slur behaves almost exactly like a
1774 normal slur. However, they are treated as different objects. A
1775 @code{\slurUp} will have no effect on a phrasing slur; instead, you
1776 should use @code{\phrasingSlurUp}, @code{\phrasingSlurDown}, and
1777 @code{\phrasingSlurBoth}.
1779 The commands @code{\slurUp}, @code{\slurDown}, and @code{\slurBoth}
1780 will only affect normal slurs and not phrasing slurs.
1784 @cindex @code{\phrasingSlurUp }
1785 @code{\phrasingSlurUp},
1786 @cindex @code{\phrasingSlurDown }
1787 @code{\phrasingSlurDown},
1788 @cindex @code{\phrasingSlurBoth }
1789 @code{\phrasingSlurBoth},
1793 See also @internalsref{PhrasingSlur},
1794 @internalsref{PhrasingSlurEvent}.
1798 Phrasing slurs have the same limitations in their formatting as normal
1799 slurs. Putting phrasing slurs over rests leads to spurious warnings.
1802 @subsection Breath marks
1804 Breath marks are entered using @code{\breathe}.
1807 @lilypond[fragment,relative]
1811 The glyph of the breath mark can be tweaked by overriding the
1812 @code{text} property of the @code{BreathingSign} layout object with the name of
1813 any glyph of @ref{The Feta font}. For example,
1814 @lilypond[fragment,verbatim,relative]
1816 \property Voice.BreathingSign \override #'text = #"scripts-rvarcomma"
1823 @internalsref{BreathingSign}, @internalsref{BreathingSignEvent},
1824 @inputfileref{input/regression,breathing-sign.ly}.
1827 @node Metronome marks
1828 @subsection Metronome marks
1831 @cindex beats per minute
1832 @cindex metronome marking
1834 Metronome settings can be entered as follows:
1836 \tempo @var{duration} = @var{perminute}
1839 In the MIDI output, they are interpreted as a tempo change, and in the
1840 paper output, a metronome marking is printed
1841 @cindex @code{\tempo}
1842 @lilypond[fragment,verbatim]
1848 @internalsref{TempoEvent}
1853 @subsection Text spanners
1854 @cindex Text spanners
1856 Some performance indications, e.g. @i{rallentando} or @i{accelerando},
1857 are written as texts, and extended over many measures with dotted
1858 lines. You can create such texts using text spanners: attach
1859 @code{\startTextSpan} and @code{\stopTextSpan} to the
1860 start and ending note of the spanner.
1862 The string to be printed, as well as the style, is set through object
1865 @lilypond[fragment,relative,verbatim]
1867 \property Voice.TextSpanner \set #'direction = #-1
1868 \property Voice.TextSpanner \set #'edge-text = #'("rall " . "")
1869 c2-\startTextSpan b c-\stopTextSpan a }
1875 @internalsref{TextSpanEvent},
1876 @internalsref{TextSpanner}, @inputfileref{input/regression,text-spanner.ly}.
1879 @node Analysis brackets
1880 @subsection Analysis brackets
1882 @cindex phrasing brackets
1883 @cindex musicological analysis
1884 @cindex note grouping bracket
1886 Brackets are used in musical analysis to indicate structure in musical
1887 pieces. LilyPond supports a simple form of nested horizontal brackets.
1888 To use this, add the @internalsref{Horizontal_bracket_engraver} to
1889 @internalsref{Staff} context. A bracket is started with
1890 @code{\startGroup} and closed with @code{\stopGroup}.
1892 @lilypond[singleline,verbatim]
1893 \score { \notes \relative c'' {
1894 c4-\startGroup-\startGroup
1897 c4-\stopGroup-\stopGroup
1899 \paper { \translator {
1900 \StaffContext \consists "Horizontal_bracket_engraver"
1906 @internalsref{HorizontalBracket}, @internalsref{NoteGroupingEvent},
1907 @inputfileref{input/regression,note-group-bracket.ly}.
1911 Bracket endings should be angled/slanted. (TODO)
1918 @section Articulations
1919 @cindex Articulations
1921 @cindex articulations
1925 A variety of symbols can appear above and below notes to indicate
1926 different characteristics of the performance. They are added to a note
1927 by adding a dash and the character signifying the
1928 articulation. They are demonstrated here.
1930 @lilypondfile[notexidoc]{script-abbreviations.ly}
1932 The script is automatically placed, but if you need to force
1933 directions, you can use @code{_} to force them down, or @code{^} to
1935 @lilypond[fragment, verbatim]
1942 Other symbols can be added using the syntax
1943 @var{note}@code{-\}@var{name}. Again, they can be forced up or down
1944 using @code{^} and @code{_}.
1948 @cindex staccatissimo
1957 @cindex organ pedal marks
1966 @cindex prallmordent
1970 @cindex thumb marking
1975 @lilypondfile[notexidoc]{script-chart.ly}
1980 @cindex @code{\scriptUp }
1982 @cindex @code{\scriptDown }
1984 @cindex @code{\scriptBoth}
1989 @internalsref{ScriptEvent}, @internalsref{Script}.
1993 All of these note ornaments appear in the printed output but have no
1994 effect on the MIDI rendering of the music.
1997 @node Fingering instructions
1998 @section Fingering instructions
2002 Fingering instructions can be entered using
2004 @var{note}-@var{digit}
2006 For finger changes, use markup texts:
2008 @lilypond[verbatim, singleline, fragment]
2009 c'4-1 c'4-2 c'4-3 c'4-4
2010 c'^\markup { \fontsize #-3 \number "2-3" }
2013 @cindex finger change
2018 You can use the thumb-script to indicate that a note should be
2019 played with your thumb (used in cello music):
2021 @lilypond[verbatim, singleline, fragmnt]
2022 <<a' a''-3>>8-(_\thumb-[ <<b' b''-3>>-)_\thumb
2023 <<c'' c'''-3>>-(_\thumb <<d'' d'''-3>>-)_\thumb-]
2026 Fingering for chords can be notated like this:
2028 @lilypond[verbatim,singleline,fragment,relative=1]
2029 << c-1 e-2 g-3 b-5 >> 4
2030 \property Voice.fingerHorizontalDirection = #LEFT
2031 << c-1 es-3 g-5 >> 4
2032 \property Voice.fingerHorizontalDirection = #RIGHT
2033 << c-1 e-2 g-3 b-5 >>4
2034 \property Voice.fingerHorizontalDirection = #LEFT
2035 << c_1 e-2 g-3 b^5 >>4
2040 @internalsref{FingerEvent} and @internalsref{Fingering}.
2051 @subsection Text scripts
2052 @cindex Text scripts
2054 It is possible to place arbitrary strings of text or markup text (see
2055 @ref{Text markup}) above or below notes by using a string:
2056 @code{c^"text"}. By default, these indications do not influence the
2057 note spacing, but by using the command @code{\fatText}, the widths
2058 will be taken into account.
2060 @lilypond[fragment,singleline,verbatim] \relative c' {
2061 c4^"longtext" \fatText c4_"longlongtext" c4 }
2064 It is possible to use @TeX{} commands in the strings, but this should be
2065 avoided because it makes it impossible for LilyPond to compute the
2066 exact length of the string, which may lead to collisions. Also, @TeX{}
2067 commands will not work with direct PostScript output.
2072 @internalsref{TextScriptEvent}, @internalsref{TextScript},
2078 @subsection Grace notes
2080 @cindex @code{\grace}
2084 Grace notes are ornaments that are written out
2086 @lilypond[relative=2,verbatim,fragment] c4 \grace c16 c4 \grace {
2090 In normal notation, grace notes take up no logical
2091 time in a measure. Such an idea is practical for normal notation, but
2092 is not strict enough to put it into a program. The model that LilyPond
2093 uses for grace notes internally is that all timing is done in two
2096 Every point in musical time consists of two rational numbers: one
2097 denotes the logical time, one denotes the grace timing. The above
2098 example is shown here with timing tuples.
2101 \score { \notes \relative c''{
2102 c4^"(0,0)" \grace c16_" "_"(1/4,-1/16)" c4^"(1/4,0)" \grace {
2103 c16_"(2/4,-1/8)"-[ d16^"(2/4,-1/16)" ] } c4_" "_"(2/4,0)"
2105 \paper { linewidth = 8.\cm }
2110 The placement of these grace notes is synchronized between different
2113 @lilypond[relative=2,verbatim,fragment]
2114 < \context Staff = SA { e4 \grace { c16-[ d e f-] } e4 }
2115 \context Staff = SB { c'4 \grace { g8 b } c4 } >
2119 Unbeamed eighth notes and shorter by default have a slash through the
2120 stem. This can be controlled with object property @code{stroke-style} of
2121 @internalsref{Stem}. For proper matching of override and reverts of
2122 such properties, it is necessary to use a Scheme function.
2124 The following fragment overrides the default formatting Grace style stems.
2126 #(add-to-grace-init "Voice" 'Stem 'stroke-style '())
2129 The @code{\override} is carefully matched with a @code{\revert}.
2134 @lilypond[fragment,verbatim]
2135 \relative c'' \context Voice {
2136 \grace c8 c4 \grace { c16-[ c16-] } c4
2138 \property Voice.Stem \override #'stroke-style = #'()
2140 \property Voice.Stem \revert #'stroke-style
2145 If you want to end a note with a grace note, then the standard trick
2146 is to put the grace notes before a phantom ``space note'', e.g.
2147 @lilypond[fragment,verbatim, relative=2]
2150 { s2 \grace { c16-[ d-] } } >
2154 By adjusting the duration of the skip note (here it is a half-note),
2155 the space between the main-note and the grace is adjusted.
2157 A @code{\grace} section has some default values, and LilyPond will
2158 use those default values unless you specify otherwise inside the
2159 @code{\grace} section. For example, if you specify \slurUp
2160 @emph{before} your @code{\grace} section, a slur which starts inside
2161 the @code{\grace} will not be forced up, even if the slur ends outside
2162 of the @code{\grace}. Note the difference between the first and
2163 second bars in this example:
2165 @lilypond[fragment,verbatim]
2166 \relative c'' \context Voice {
2184 @internalsref{GraceMusic}.
2188 Grace notes cannot be used in the smallest size (@file{paper11.ly}).
2190 A score that starts with an @code{\grace} section needs an explicit
2191 @code{\context Voice} declaration, otherwise the main note and grace
2192 note end up on different staffs.
2194 Grace note synchronization can also lead to surprises. Staff notation,
2195 such as key signatures, barlines, etc. are also synchronized. Take
2196 care when you mix staves with grace notes and staves without.
2198 @lilypond[relative=2,verbatim,fragment]
2199 < \context Staff = SA { e4 \bar "|:" \grace c16 d4 }
2200 \context Staff = SB { c4 \bar "|:" d4 } >
2203 Grace sections should only be used within sequential music
2204 expressions. Nesting, juxtaposing, or ending sequential music with a
2205 grace section is not supported, and might produce crashes or other
2208 Overriding settings for grace music using @code{add-to-grace-init}
2209 cannot be done in a modular way.
2213 @subsection Glissando
2216 @cindex @code{\glissando}
2218 A glissando is a smooth change in pitch. It is denoted by a line or a
2219 wavy line between two notes.
2223 A glissando line can be requested by attaching a @code{\glissando} to
2226 @lilypond[fragment,relative,verbatim]
2232 @internalsref{Glissando}, @internalsref{GlissandoEvent}.
2237 Printing of an additional text (such as @emph{gliss.}) must be done
2242 @subsection Dynamics
2255 @cindex @code{\ffff}
2265 Absolute dynamic marks are specified using an variable after a
2266 note: @code{c4-\ff}. The available dynamic marks are: @code{\ppp},
2267 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
2268 @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
2269 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}.
2271 @lilypond[verbatim,singleline,fragment,relative]
2272 c'-\ppp c-\pp c -\p c-\mp c-\mf c-\f c-\ff c-\fff
2278 @cindex @code{\decr}
2279 @cindex @code{\rced}
2286 A crescendo mark is started with @code{\cr} and terminated with
2287 @code{\endcr}, and decrescendi similarly with @code{\decr} and
2288 @code{\enddecr}. There are also shorthands for these marks. A
2289 crescendo can be started with @code{\<} and a decrescendo can be
2290 started with @code{\>}. Either one can be terminated with @code{\!}.
2291 Because these marks are bound to notes, if you must use spacer notes
2292 if multiple marks during one note are needed.
2294 @lilypond[fragment,verbatim,center,quote]
2295 c''-\< c''-\! d''-\decr e''-\rced
2296 < f''1 { s4 s4-\< s4-\! \> s4-\! } >
2298 This may give rise to very short hairpins. Use @code{minimum-length}
2299 in @internalsref{Voice}.@internalsref{HairPin} to lengthen them, for
2303 \property Staff.Hairpin \override #'minimum-length = #5
2306 You can also use a text saying @emph{cresc.} instead of hairpins. Here
2307 is an example how to do it:
2309 @lilypond[fragment,relative=2,verbatim]
2310 c4 \cresc c4 \endcresc c4
2317 You can also supply your own texts:
2318 @lilypond[fragment,relative,verbatim]
2320 \property Voice.crescendoText = "cresc. poco"
2321 \property Voice.crescendoSpanner = #'dashed-line
2331 @cindex @code{\dynamicUp }
2333 @cindex @code{\dynamicDown }
2334 @code{\dynamicDown},
2335 @cindex @code{\dynamicBoth }
2336 @code{\dynamicBoth},
2338 @cindex direction, of dynamics
2342 @internalsref{CrescendoEvent}, @internalsref{DecrescendoEvent},
2343 @internalsref{AbsoluteDynamicEvent}.
2345 Dynamics are objects of @internalsref{DynamicText} and
2346 @internalsref{Hairpin}. Vertical positioning of these symbols is
2347 handled by the @internalsref{DynamicLineSpanner} object.
2349 If you want to adjust padding or vertical direction of the dynamics,
2350 you must set properties for the @internalsref{DynamicLineSpanner}
2359 @cindex @code{\repeat}
2362 Repetition is a central concept in music, and multiple notations exist
2363 for repetitions. In LilyPond, most of these notations can be captured
2364 in a uniform syntax. One of the advantages is, all these repetitions
2365 can be rendered in MIDI accurately.
2367 The following types of repetition are supported:
2371 Repeated music is fully written (played) out. Useful for MIDI
2372 output, and entering repetitive music.
2375 This is the normal notation: Repeats are not written out, but
2376 alternative endings (voltas) are printed, left to right.
2380 Alternative endings are written stacked. This has limited use but may be
2381 used to typeset two lines of lyrics in songs with repeats, see
2382 @inputfileref{input,star-spangled-banner.ly}.
2389 Make beat or measure repeats. These look like percent signs.
2395 * Repeats and MIDI::
2396 * Manual repeat commands::
2398 * Tremolo subdivisions::
2403 @subsection Repeat syntax
2407 LilyPond has one syntactic construct for specifying different types of
2408 repeats. The syntax is
2411 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
2414 If you have alternative endings, you may add
2415 @cindex @code{\alternative}
2417 \alternative @code{@{} @var{alternative1}
2419 @var{alternative3} @dots{} @code{@}}
2421 where each @var{alternative} is a music expression. If you do not
2422 give enough alternatives for all of the repeats, then the first
2423 alternative is assumed to be played more than once.
2425 Normal notation repeats are used like this:
2426 @lilypond[fragment,verbatim]
2428 \repeat volta 2 { c'4 d' e' f' }
2429 \repeat volta 2 { f' e' d' c' }
2432 With alternative endings:
2433 @lilypond[fragment,verbatim]
2435 \repeat volta 2 {c'4 d' e' f'}
2436 \alternative { {d'2 d'} {f' f} }
2440 @lilypond[fragment,verbatim]
2444 \repeat volta 4 { e | c2 d2 | e2 f2 | }
2445 \alternative { { g4 g g } { a | a a a a | b2. } }
2452 If you do a nested repeat like
2461 then it is ambiguous to which @code{\repeat} the @code{\alternative}
2462 belongs. This ambiguity is resolved by always having the
2463 @code{\alternative} belong to the inner @code{\repeat}. For clarity,
2464 it is advisable to use braces in such situations.
2467 @node Repeats and MIDI
2468 @subsection Repeats and MIDI
2470 @cindex expanding repeats
2472 For instructions on how to unfold repeats for MIDI output, see the
2473 example file @inputfileref{input/test,unfold-all-repeats.ly}.
2478 Timing information is not remembered at the start of an alternative,
2479 so you have to reset timing information after a repeat, e.g. using a
2480 bar-check (See @ref{Bar check}), setting @code{Score.measurePosition}
2481 or entering @code{\partial}. Similarly, slurs or ties are also not
2485 @node Manual repeat commands
2486 @subsection Manual repeat commands
2488 @cindex @code{repeatCommands}
2490 The property @code{repeatCommands} can be used to control the layout of
2491 repeats. Its value is a Scheme list of repeat commands, where each repeat
2499 @item (volta . @var{text})
2500 Print a volta bracket saying @var{text}. The text can be specified as
2501 a text string or as a markup text, see @ref{Text markup}. Do not
2502 forget to change the font, as the default number font does not contain
2503 alphabetic characters.
2505 Stop a running volta bracket
2508 @lilypond[verbatim, fragment]
2510 \property Score.repeatCommands = #'((volta "93") end-repeat)
2512 \property Score.repeatCommands = #'((volta #f))
2519 @internalsref{VoltaBracket}, @internalsref{RepeatedMusic},
2520 @internalsref{VoltaRepeatedMusic},
2521 @internalsref{UnfoldedRepeatedMusic}
2522 @internalsref{FoldedRepeatedMusic}.
2524 @node Tremolo repeats
2525 @subsection Tremolo repeats
2526 @cindex tremolo beams
2528 To place tremolo marks between notes, use @code{\repeat} with tremolo
2530 @lilypond[verbatim,center,singleline]
2532 \context Voice \notes\relative c' {
2533 \repeat "tremolo" 8 { c16 d16 }
2534 \repeat "tremolo" 4 { c16 d16 }
2535 \repeat "tremolo" 2 { c16 d16 }
2536 \repeat "tremolo" 4 c16
2543 Tremolo beams are @internalsref{Beam} objects. Single stem tremolos are
2544 @internalsref{StemTremolo}. @internalsref{TremoloEvent}.
2549 The single stem tremolo @emph{must} be entered without @code{@{} and
2552 @node Tremolo subdivisions
2553 @subsection Tremolo subdivisions
2554 @cindex tremolo marks
2555 @cindex @code{tremoloFlags}
2557 Tremolo marks can be printed on a single note by adding
2558 `@code{:}[@var{length}]' after the note. The length must be at least 8.
2559 A @var{length} value of 8 gives one line across the note stem. If the
2560 length is omitted, then then the last value (stored in
2561 @code{Voice.tremoloFlags}) is used.
2563 @lilypond[verbatim,fragment,center]
2564 c'2:8 c':32 | c': c': |
2567 @c [TODO : stok is te kort bij 32en]
2571 Tremolos in this style do not carry over into the MIDI output.
2574 @node Measure repeats
2575 @subsection Measure repeats
2577 @cindex percent repeats
2578 @cindex measure repeats
2580 In the @code{percent} style, a note pattern can be repeated. It is
2581 printed once, and then the pattern is replaced with a special sign.
2582 Patterns of a one and two measures are replaced by percent-like signs,
2583 patterns that divide the measure length are replaced by slashes.
2585 @lilypond[verbatim,singleline]
2586 \context Voice { \repeat "percent" 4 { c'4 }
2587 \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
2593 @internalsref{RepeatSlash}, @internalsref{PercentRepeat},
2594 @internalsref{PercentRepeatedMusic}, and
2595 @internalsref{DoublePercentRepeat}.
2600 Single measure and double measure percent-repeats cannot be nested.
2602 @node Rhythmic music
2603 @section Rhythmic music
2605 Sometimes you might want to show only the rhythm of a melody. This
2606 can be done with the rhythmic staff. All pitches of notes on such a
2607 staff are squashed, and the staff itself has a single line:
2609 @lilypond[fragment,relative,verbatim]
2610 \context RhythmicStaff {
2612 c4 e8 f g2 | r4 g r2 | g1:32 | r1 |
2617 * Percussion staves::
2618 * Percussion midi output::
2621 @node Percussion staves
2622 @subsection Percussion staves
2626 To typeset more than one piece of percussion to be played by the same
2627 musician one typically uses a multiline staff where each staff
2628 position refers to a specific piece of percussion.
2632 Percussion staves are typeset with help of a set of Scheme
2633 functions. The system is based on the general MIDI drum-pitches.
2634 Include @file{ly/drumpitch-init.ly} to use drum pitches. This file
2635 defines the pitches from the Scheme variable @code{drum-pitch-names},
2636 the definition of which can be read in @file{scm/drums.scm}. Each
2637 piece of percussion has a full name and an abbreviated name, and both
2638 the full name or the abbreviation may be used in input files.
2640 To typeset the music on a staff apply the function @code{drums->paper}
2641 to the percussion music. This function takes a list of percussion
2642 instrument names, notehead scripts and staff positions (that is:
2643 pitches relative to the C-clef) and transforms the input
2644 music by moving the pitch, changing the notehead and (optionally)
2647 @lilypond[singleline,verbatim,quote]
2648 \include "drumpitch-init.ly"
2649 up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
2650 down = \notes { bassdrum4 snare8 bd r bd sn4 }
2652 \apply #(drums->paper 'drums) \context Staff <
2654 \context Voice = up { \voiceOne \up }
2655 \context Voice = down { \voiceTwo \down }
2660 In the above example the music was transformed using the list @code{'drums}.
2661 Currently the following lists are defined in @file{scm/drums.scm}:
2664 To typeset a typical drum kit on a five-line staff.
2667 \include "drumpitch-init.ly"
2668 nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc
2669 bd sn ss tomh tommh tomml toml tomfh tomfl }
2670 mus = \notes { cymc cyms cymr hh hhc hho hhho hhp cb hc
2671 bd sn ss tomh tommh tomml toml tomfh tomfl s16 }
2674 \apply #(drums->paper 'drums) \context Staff <
2678 \context Lyrics \nam
2681 linewidth = 100.0\mm
2684 \remove Bar_engraver
2685 \remove Time_signature_engraver
2686 minimumVerticalExtent = #'(-4.0 . 5.0)
2690 \remove Stem_engraver
2696 The drum scheme supports six different toms. When there fewer toms, simply
2697 select the toms that produce the desired result, i.e., to get toms on
2698 the three middle lines you use @code{tommh}, @code{tomml} and
2701 Because general MIDI does not contain rimshots the sidestick is used
2702 for this purpose instead.
2704 To typeset timbales on a two line staff.
2706 @lilypond[singleline]
2707 \include "drumpitch-init.ly"
2708 nam = \lyrics { timh ssh timl ssl cb }
2709 mus = \notes { timh ssh timl ssl cb s16 }
2712 \apply #(drums->paper 'timbales) \context Staff <
2716 \context Lyrics \nam
2721 \remove Bar_engraver
2722 \remove Time_signature_engraver
2723 StaffSymbol \override #'line-count = #2
2724 StaffSymbol \override #'staff-space = #2
2725 minimumVerticalExtent = #'(-3.0 . 4.0)
2729 \remove Stem_engraver
2736 To typeset congas on a two line staff.
2738 @lilypond[singleline]
2739 \include "drumpitch-init.ly"
2740 nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl }
2741 mus = \notes { cgh cgho cghm ssh cgl cglo cglm ssl s16 }
2744 \apply #(drums->paper 'congas) \context Staff <
2748 \context Lyrics \nam
2753 \remove Bar_engraver
2754 \remove Time_signature_engraver
2755 StaffSymbol \override #'line-count = #2
2756 StaffSymbol \override #'staff-space = #2
2757 minimumVerticalExtent = #'(-3.0 . 4.0)
2761 \remove Stem_engraver
2767 To typeset bongos on a two line staff.
2769 @lilypond[singleline]
2770 \include "drumpitch-init.ly"
2771 nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl }
2772 mus = \notes { boh boho bohm ssh bol bolo bolm ssl s16 }
2775 \apply #(drums->paper 'bongos) \context Staff <
2779 \context Lyrics \nam
2784 \remove Bar_engraver
2785 \remove Time_signature_engraver
2786 StaffSymbol \override #'line-count = #2
2787 StaffSymbol \override #'staff-space = #2
2788 minimumVerticalExtent = #'(-3.0 . 4.0)
2792 \remove Stem_engraver
2798 To typeset all kinds of simple percussion on one line staves.
2799 @lilypond[singleline]
2800 \include "drumpitch-init.ly"
2801 nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc }
2802 mus = \notes { tri trio trim gui guis guil cb cl tamb cab mar hc s16 }
2805 \apply #(drums->paper 'percussion) \context Staff <
2809 \context Lyrics \nam
2814 \remove Bar_engraver
2815 \remove Time_signature_engraver
2816 StaffSymbol \override #'line-count = #1
2817 minimumVerticalExtent = #'(-2.0 . 3.0)
2821 \remove Stem_engraver
2828 If you do not like any of the predefined lists you can define your own
2829 list at the top of your file:
2831 @lilypond[singleline, verbatim]
2832 #(set-drum-kit 'mydrums `(
2833 (bassdrum default #f ,(ly:make-pitch -1 2 0))
2834 (snare default #f ,(ly:make-pitch 0 1 0))
2835 (hihat cross #f ,(ly:make-pitch 0 5 0))
2836 (pedalhihat xcircle "stopped" ,(ly:make-pitch 0 5 0))
2837 (lowtom diamond #f ,(ly:make-pitch -1 6 0))
2839 \include "drumpitch-init.ly"
2840 up = \notes { hh8 hh hh hh hhp4 hhp }
2841 down = \notes { bd4 sn bd toml8 toml }
2843 \apply #(drums->paper 'mydrums) \context Staff <
2845 \context Voice = up { \voiceOne \up }
2846 \context Voice = down { \voiceTwo \down }
2851 To use a modified existing list, one can prepend modifications to the
2855 #(define mydrums (append `(
2856 (bassdrum default #f ,(ly:make-pitch -1 2 0))
2857 (lowtom diamond #f ,(ly:make-pitch -1 6 0))
2861 The file @file{drumpitch-init.ly} replaces the normal pitch names, so
2862 you have to reinclude @file{nederlands.ly} after the
2863 drum-pattern-definitions to enter normal notes.
2865 @lilypond[singleline,verbatim]
2866 \include "drumpitch-init.ly"
2867 up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat }
2868 down = \notes { bassdrum4 snare8 bd r bd sn4 }
2869 \include "nederlands.ly"
2870 bass = \notes \transpose c c,, { a4. e8 r e g e }
2873 \apply #(drums->paper 'drums) \context Staff = drums <
2875 \context Voice = up { \voiceOne \up }
2876 \context Voice = down { \voiceTwo \down }
2878 \context Staff = bass { \clef "F_8" \bass }
2883 @node Percussion midi output
2884 @subsection Percussion midi output
2886 In order to produce correct midi output you need to produce two score
2887 blocks---one for the paper and one for the midi output. To use the
2888 percussion channel you set the property @code{instrument} to
2889 @code{'drums}. Because the drum-pitches themself are similar to the
2890 general midi pitches all you have to do is to insert the voices with
2891 none of the scheme functions to get the correct midi output:
2895 \apply #(drums->paper 'mydrums) \context Staff <
2904 \property Staff.instrument = #'drums
2913 This scheme is to be considered a temporary implementation.
2917 @section Piano music
2919 Piano staves are two normal staves coupled with a brace. The staves
2920 are largely independent, but sometimes voices can cross between the
2921 two staves. The same notation is also used for harps and other key
2922 instruments. The @internalsref{PianoStaff} is especially built to
2923 handle this cross-staffing behavior. In this section we discuss the
2924 @internalsref{PianoStaff} and some other pianistic peculiarities.
2928 * Automatic staff changes::
2929 * Manual staff switches::
2932 * Staff switch lines::
2937 There is no support for putting chords across staves. You can get
2938 this result by increasing the length of the stem in the lower stave so
2939 it reaches the stem in the upper stave, or vice versa. An example is
2940 included with the distribution as @inputfileref{input/test,stem-cross-staff.ly}.
2942 Dynamics are not centered, but kludges do exist. See
2943 @inputfileref{input/templates,piano-dynamics.ly}.
2945 @cindex cross staff stem
2946 @cindex stem, cross staff
2949 @c fixme: should have hyperlinks as well.
2955 @node Automatic staff changes
2956 @subsection Automatic staff changes
2957 @cindex Automatic staff changes
2959 Voices can switch automatically between the top and the bottom
2960 staff. The syntax for this is
2962 \autochange Staff \context Voice @{ @dots{}@var{music}@dots{} @}
2964 The autochanger switches on basis of pitch (central C is the turning
2965 point), and it looks ahead skipping over rests to switch rests in
2966 advance. Here is a practical example:
2968 @lilypond[verbatim,singleline,quote]
2969 \score { \notes \context PianoStaff <
2970 \context Staff = "up" {
2971 \autochange Staff \context Voice = VA < \relative c' {
2972 g4 a b c d r4 a g } > }
2973 \context Staff = "down" {
2978 Spacer rests are used to prevent the bottom staff from
2979 terminating too soon.
2984 The staff switches often do not end up in optimal places. For high
2985 quality output staff switches should be specified manually.
2989 @node Manual staff switches
2990 @subsection Manual staff switches
2992 @cindex manual staff switches
2993 @cindex staff switch, manual
2995 Voices can be switched between staves manually, using the following command:
2997 \translator Staff = @var{staffname} @var{music}
2999 The string @var{staffname} is the name of the staff. It switches the
3000 current voice from its current staff to the Staff called
3001 @var{staffname}. Typically @var{staffname} is @code{"up"} or
3009 Pianos have pedals that alter the way sound are produced. Generally, a
3010 piano has three pedals, sustain, una corda, and sostenuto.
3014 Piano pedal instruction can be expressed by attaching
3015 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
3016 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp} to a
3019 The symbols that are printed can be modified by setting
3020 @code{pedal@var{X}Strings}, where @var{X} is one of the pedal types:
3021 Sustain, Sostenuto or UnaCorda. Refer to the generated documentation
3022 of @internalsref{SustainPedal} for more information.
3024 Pedals can also be indicated by a sequence of brackets, by setting the
3025 @code{pedal-type} property of @internalsref{SustainPedal} objects:
3027 @lilypond[fragment,verbatim]
3028 \property Staff.SustainPedal \override #'pedal-type = #'bracket
3029 c''4-\sustainDown d''4 e''4
3030 a'4-\sustainUp-\sustainDown
3031 f'4 g'4 a'4-\sustainUp
3034 A third style of pedal notation is a mixture of text and brackets,
3035 obtained by setting @code{pedal-type} to @code{mixed}:
3037 @lilypond[fragment,verbatim]
3038 \property Staff.SustainPedal \override #'pedal-type = #'mixed
3039 c''4-\sustainDown d''4 e''4
3040 c'4-\sustainUp-\sustainDown
3041 f'4 g'4 a'4-\sustainUp
3044 The default `*Ped' style for sustain and damper pedals corresponds to
3045 @code{\pedal-type = #'text}. However, @code{mixed} is the default style
3046 for a sostenuto pedal:
3048 @lilypond[fragment,verbatim]
3049 c''4-\sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4-\sostenutoUp
3052 For fine-tuning of the appearance of a pedal bracket, the properties
3053 @code{edge-width}, @code{edge-height}, and @code{shorten-pair} of
3054 @code{PianoPedalBracket} objects (see the detailed documentation of
3055 @internalsref{PianoPedalBracket}) can be modified. For example, the bracket
3056 may be extended to the end of the note head.
3058 @lilypond[fragment,verbatim]
3059 \property Staff.PianoPedalBracket \override
3060 #'shorten-pair = #'(0 . -1.0)
3061 c''4-\sostenutoDown d''4 e''4 c'4
3062 f'4 g'4 a'4-\sostenutoUp
3066 @subsection Arpeggio
3069 @cindex broken arpeggio
3070 @cindex @code{\arpeggio}
3072 You can specify an arpeggio sign on a chord by attaching an
3073 @code{\arpeggio} to a chord.
3076 @lilypond[fragment,relative,verbatim]
3077 <<c e g c>>-\arpeggio
3080 When an arpeggio crosses staves in piano music, you attach an arpeggio
3081 to the chords in both staves, and set
3082 @internalsref{PianoStaff}.@code{connectArpeggios}.
3084 @lilypond[fragment,relative,verbatim]
3085 \context PianoStaff <
3086 \property PianoStaff.connectArpeggios = ##t
3087 \context Voice = one { <<c' e g c>>-\arpeggio }
3088 \context Voice = other { \clef bass <<c,, e g>>-\arpeggio }
3092 This command creates @internalsref{Arpeggio} objects. Cross staff
3093 arpeggios are @internalsref{PianoStaff}.@internalsref{Arpeggio}.
3095 The direction of the arpeggio is sometimes denoted by adding an
3096 arrowhead to the wiggly line. This can be typeset by setting
3097 @code{arpeggio-direction}.
3099 @lilypond[fragment,relative,verbatim]
3101 \property Voice.Arpeggio \set #'arpeggio-direction = #1
3102 <<c e g c>>-\arpeggio
3103 \property Voice.Arpeggio \set #'arpeggio-direction = #-1
3104 <<c e g c>>-\arpeggio
3108 A square bracket on the left indicates that the player should not
3109 arpeggiate the chord. To draw these brackets, set the
3110 @code{molecule-callback} property of @code{Arpeggio} or
3111 @code{PianoStaff.Arpeggio} objects to @code{\arpeggioBracket}, and use
3112 @code{\arpeggio} statements within the chords as before.
3114 @lilypond[fragment,relative,verbatim]
3115 \property PianoStaff.Arpeggio \override
3116 #'molecule-callback = \arpeggioBracket
3117 <<c' e g c>>-\arpeggio
3122 @cindex @code{\arpeggioBracket }
3123 @code{\arpeggioBracket},
3124 @cindex @code{\arpeggio}
3129 It is not possible to mix connected arpeggios and unconnected
3130 arpeggios in one @internalsref{PianoStaff} at the same time.
3132 @node Staff switch lines
3133 @subsection Staff switch lines
3136 @cindex follow voice
3137 @cindex staff switching
3140 @cindex @code{followVoice}
3142 Whenever a voice switches to another staff a line connecting the notes
3143 can be printed automatically. This is enabled if the property
3144 @code{PianoStaff.followVoice} is set to true:
3146 @lilypond[fragment,relative,verbatim]
3147 \context PianoStaff <
3148 \property PianoStaff.followVoice = ##t
3149 \context Staff \context Voice {
3151 \translator Staff=two
3154 \context Staff=two { \clef bass \skip 1*2 }
3158 The associated object is @internalsref{VoiceFollower}.
3162 @cindex @code{\showStaffSwitch }
3163 @code{\showStaffSwitch},
3164 @cindex @code{\hideStaffSwitch }
3165 @code{\hideStaffSwitch},
3169 @section Vocal music
3171 This section discusses how to enter, and print lyrics.
3175 * The Lyrics context::
3180 @node Entering lyrics
3181 @subsection Entering lyrics
3185 @cindex @code{\lyrics}
3188 Lyrics are entered in a special input mode. This mode is is introduced
3189 by the keyword @code{\lyrics}. In this mode you can enter lyrics, with
3190 punctuation and accents without any hassle. Syllables are entered like
3191 notes, but with pitches replaced by text. For example,
3193 \lyrics @{ Twin-4 kle4 twin- kle litt- le star2 @}
3196 A word in Lyrics mode begins with: an alphabetic character, @code{_},
3197 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
3198 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
3199 any 8-bit character with ASCII code over 127, or a two-character
3200 combination of a backslash followed by one of @code{`}, @code{'},
3201 @code{"}, or @code{^}.
3203 Subsequent characters of a word can be any character that is not a digit
3204 and not white space. One important consequence of this is that a word
3205 can end with @code{@}}. The following example is usually a bug. The
3206 syllable includes a @code{@}}, and hence the opening brace is not balanced.
3208 \lyrics @{ twinkle@}
3210 which may be confusing.
3212 @cindex @code{\property}, in @code{\lyrics}
3213 Similarly, a period following a alphabetic sequence, is included in the
3214 resulting string. As a consequence, spaces must be inserted around
3215 @code{\property} commands:
3217 \property Lyrics . LyricText \set #'font-shape = #'italic
3221 @cindex spaces, in lyrics
3222 @cindex quotes, in lyrics
3224 Any @code{_} character which appears in an unquoted word is converted
3225 to a space. This provides a mechanism for introducing spaces into words
3226 without using quotes. Quoted words can also be used in Lyrics mode to
3227 specify words that cannot be written with the above rules:
3230 \lyrics @{ He said: "\"Let" my peo ple "go\"" @}
3234 Hyphens can be entered as ordinary hyphens at the end of a syllable, i.e.
3239 These will be attached to the end of the first syllable.
3241 Centered hyphens are entered using the special `@code{-}@code{-}' lyric
3242 as a separate word between syllables. The hyphen will have variable
3243 length depending on the space between the syllables and it will be
3244 centered between the syllables.
3249 When a lyric is sung over many notes (this is called a melisma), this is
3250 indicated with a horizontal line centered between a syllable and the
3251 next one. Such a line is called an extender line, and it is entered as
3256 @internalsref{LyricEvent}, @internalsref{HyphenEvent},
3257 @internalsref{ExtenderEvent}.
3261 The definition of lyrics mode is too complex.
3263 @node The Lyrics context
3264 @subsection The Lyrics context
3266 Lyrics are printed by interpreting them in @internalsref{Lyrics}
3269 \context Lyrics \lyrics @dots{}
3272 @cindex automatic syllable durations
3273 @cindex @code{\addlyrics}
3274 @cindex lyrics and melodies
3276 This will place the lyrics according to the durations that were
3277 entered. The lyrics can also be aligned under a given melody
3278 automatically. In this case, it is no longer necessary to enter the
3279 correct duration for each syllable. This is achieved by combining the
3280 melody and the lyrics with the @code{\addlyrics} expression
3284 \context Lyrics @dots{}
3287 @cindex staff order, with @code{\addlyrics}
3289 Normally, this will put the lyrics below the staff. For different or
3290 more complex orderings, the best way is to setup the hierarchy of
3291 staffs and lyrics first, e.g.
3293 \context ChoirStaff \notes <
3294 \context Lyrics = LA @{ s1 @}
3295 \context Staff = SA @{ s1 @}
3296 \context Lyrics = LB @{ s1 @}
3297 \context Staff = SB @{ s1 @}
3300 and then combine the appropriate melodies and lyric lines:
3303 \context Staff = SA @emph{the music}
3304 \context Lyrics = LA @emph{the lyrics}
3307 putting both together, you would get
3309 \context ChoirStaff \notes <
3310 \context Lyrics = LA @dots{}
3311 \context Staff = SB @dots{}
3317 @cindex choral score
3319 An example of a SATB score setup is in the file
3320 @inputfileref{input/template,satb}.
3324 @internalsref{LyricCombineMusic}, @internalsref{Lyrics},
3325 @inputfileref{input/template,satb}.
3329 @code{\addlyrics} is not automatic enough: melismata are not detected
3330 automatically, and melismata are not stopped when they hit a rest. A
3331 melisma on the last note in a melody is not printed.
3335 @subsection More stanzas
3338 @cindex phrasing, in lyrics
3340 When multiple stanzas are printed underneath each other, the vertical
3341 groups of syllables should be aligned around punctuation. This can be
3342 done automatically when corresponding lyric lines and melodies are
3345 To this end, give the @internalsref{Voice} context an identity,
3347 \context Voice = duet @{
3352 Then set the @internalsref{LyricsVoice} contexts to names starting with
3353 that identity followed by a dash. In the preceding example, the
3354 @internalsref{Voice} identity is @code{duet}, so the identities of the
3355 @internalsref{LyricsVoices} are marked @code{duet-1} and @code{duet-2}.
3357 \context LyricsVoice = "duet-1" @{
3358 Hi, my name is bert. @}
3359 \context LyricsVoice = "duet-2" @{
3360 Ooooo, ch\'e -- ri, je t'aime. @}
3362 The convention for naming @internalsref{LyricsVoice} and
3363 @internalsref{Voice} must also be used to get melismata on rests
3366 The complete example is shown here.
3367 @lilypond[singleline,verbatim]
3370 \notes \relative c'' \context Voice = duet { \time 3/4
3372 \lyrics \context Lyrics <
3373 \context LyricsVoice = "duet-1" {
3374 \property LyricsVoice . stanza = "Bert"
3375 Hi, my name is bert. }
3376 \context LyricsVoice = "duet-2" {
3377 \property LyricsVoice . stanza = "Ernie"
3378 Ooooo, ch\'e -- ri, je t'aime. }
3383 Stanza numbers, or the names of the singers can be added by setting
3384 @code{LyricsVoice.Stanza} (for the first system) and
3385 @code{LyricsVoice.stz} for the following systems. Notice how dots are
3386 surrounded with spaces in @code{\lyrics} mode.
3389 \property LyricsVoice . stanza = "Bert"
3391 \property LyricsVoice . stanza = "Ernie"
3394 You can use empty syllables, e.g. @code{_4} or @code{" "4} to enter
3395 lyrics. This can confuse the LilyPond -- for example, this might put
3396 (empty) lyrics under rests. To remedy this, use @code{\skip} instead.
3404 Input for lyrics introduces a syntactical ambiguity:
3411 is interpreted as assigning a string identifier @code{\foo} such that
3412 it contains @code{"bar"}. However, it could also be interpreted as
3413 making or a music identifier @code{\foo} containing the syllable
3414 `bar'. The force the latter interpretation, use
3424 The term @emph{ambitus} denotes a range of pitches for a given voice in
3425 a part of music. It also may denote the pitch range that a musical
3426 instrument is capable of playing. Most musical instruments have their
3427 ambitus standardized (or at least there is agreement upon the minimal
3428 ambitus of a particular type of instrument), such that a composer or
3429 arranger of a piece of music can easily meet the ambitus constraints of
3430 the targeted instrument. However, the ambitus of the human voice
3431 depends on individual physiological state, including education and
3432 training of the voice. Therefore, a singer potentially has to check for
3433 each piece of music if the ambitus of that piece meets his individual
3434 capabilities. This is why the ambitus of a piece may be of particular
3435 value to vocal performers.
3437 The ambitus is typically notated on a per-voice basis at the very
3438 beginning of a piece, e.g. nearby the initial clef or time signature of
3439 each staff. The range is graphically specified by two noteheads, that
3440 represent the minimum and maximum pitch. Some publishers use a textual
3441 notation: they put the range in words in front of the corresponding
3442 staff. Lilypond currently only supports the graphical ambitus notation.
3444 To apply, add the @internalsref{Ambitus_engraver} to the
3445 @internalsref{Voice} context, i.e.
3448 \paper @{ \translator @{
3450 \consists Ambitus_engraver
3456 @lilypond[singleline]
3457 upper = \notes \relative c {
3460 as'' c e2 bes f cis d4 e f2 g
3462 lower = \notes \relative c {
3465 e'4 b g a c es fis a cis b a g f e d2
3468 \context ChoirStaff {
3470 \context Staff = one { \upper }
3471 \context Staff = three { \lower }
3477 \consists Ambitus_engraver
3486 @internalsref{Ambitus}, @inputfileref{input/regression,ambitus.ly}.
3491 Tablature notation is used for notating music for plucked string
3492 instruments. It notates pitches not by using note heads, but by
3493 indicating on which string and fret a note must be played. LilyPond
3494 offers limited support for tablature.
3497 * Tablatures basic::
3498 * Non-guitar tablatures::
3501 @node Tablatures basic
3502 @subsection Tablatures basic
3503 @cindex Tablatures basic
3505 The string number associated to a note is given as a backslash
3506 followed by a number, e.g. @code{c4\3} for a C quarter on the third
3507 string. By default, string 1 is the highest one, and the tuning
3508 defaults to the standard guitar tuning (with 6 strings). The notes
3509 are printed as tablature, by using @internalsref{TabStaff} and
3510 @internalsref{TabVoice} contexts.
3512 @lilypond[fragment,verbatim]
3513 \notes \context TabStaff {
3519 If you do not specify a string number then one is selected
3520 automatically: the first string that does not give a fret number less
3521 than @code{minimumFret} is selected. The default value for
3522 @code{minimumFret} is 0.
3526 e8 fis gis a b cis' dis' e'
3527 \property TabStaff.minimumFret = #8
3528 e8 fis gis a b cis' dis' e'
3533 e8 fis gis a b cis' dis' e'
3534 \property TabStaff.minimumFret = #8
3535 e8 fis gis a b cis' dis' e'
3538 \context StaffGroup <
3539 \context Staff { \clef "G_8" \frag }
3540 \context TabStaff { \frag }
3547 @internalsref{TabStaff}, @internalsref{TabVoice}, and
3548 @internalsref{StringNumberEvent}.
3552 Chords are not handled in a special way, and hence the automatic
3553 string selector may easily select the same string to two notes in a
3557 @node Non-guitar tablatures
3558 @subsection Non-guitar tablatures
3559 @cindex Non-guitar tablatures
3561 You can change the number of strings, by setting the number of lines
3562 in the @internalsref{TabStaff} (the @code{line-count} property of
3563 @internalsref{TabStaff} can only be changed using
3564 @code{\outputproperty}, for more information, see @ref{Tuning objects}.
3566 You can change the tuning of the strings. A string tuning is given as
3567 a Scheme list with one integer number for each string, the number
3568 being the pitch (measured in semitones relative to central C) of an
3569 open string. The numbers specified for @code{stringTuning} are the
3570 numbers of semitones to subtract or add, starting the specified pitch
3571 by default middle C, in string order: thus the notes are e, a, d, and
3574 @lilypond[fragment,verbatim]
3577 \outputproperty #(make-type-checker 'staff-symbol-interface)
3579 \property TabStaff.stringTunings = #'(-5 -10 -15 -20)
3582 a,4 c' a e' e c' a e'
3587 It is possible to change the Scheme function to format the tablature
3588 note text. The default is @code{fret-number-tablature-format}, which
3589 uses the fret number. For instruments that do not use this notation,
3590 you can create a special tablature formatting function. This function
3591 takes three argument: the string number, the string tuning and the
3596 As tablature is a recent feature, most of the guitar special effects
3597 such as bend are not yet supported.
3601 @section Chord names
3604 LilyPond has support for both entering and printing named chords.
3605 These chords are internally represented as a set of pitches. Therefore
3606 they can be entered by name and printed as notes, entered as notes and
3607 printed as chord names, or (the most common case) entered them by
3608 name, and print them as name. The following fragment shows these
3611 @lilypond[verbatim,singleline]
3612 twoWays = \notes \transpose c c' {
3622 < \context ChordNames \twoWays
3623 \context Voice \twoWays > }
3626 This example also shows that the chord printing routines do not try to
3627 be intelligent. The chord @code{f bes d}, is not interpreted as an
3633 * Printing chord names::
3638 @subsection Chords mode
3641 Chord mode is a mode where you can input sets of pitches using common
3642 names. It is introduced by the keyword @code{\chords}.
3643 In chords mode, a chord is entered by the root, which is entered
3644 like a common pitch, for example,
3645 @lilypond[fragment,verbatim,quote, relative=1]
3646 \chords { es4. d8 c2 }
3651 Other chords may be entered by suffixing a colon, and introducing a
3652 modifier, and optionally, a number, for example
3654 @lilypond[fragment,verbatim,quote]
3655 \chords { e1:m e1:7 e1:m7 }
3657 The first number following the root is taken to be the `type' of the
3658 chord, thirds are added to the root until it reaches the specified
3659 number, for example.
3660 @lilypond[fragment,verbatim]
3661 \chords { c:3 c:5 c:6 c:7 c:8 c:9 c:10 c:11 }
3664 @cindex root of chord
3665 @cindex additions, in chords
3666 @cindex removals, in chords
3668 More complex chords may also be constructed adding separate steps
3669 to a chord. Additions are added after the number following
3670 the colon, and are separated by dots. For example
3672 @lilypond[verbatim,fragment,quote]
3673 \chords { c:5.6 c:3.7.8 c:3.6.13 }
3675 Chord steps can be altered by suffixing a @code{-} or @code{+} sign
3676 to the number, for example:
3677 @lilypond[verbatim,fragment,quote]
3678 \chords { c:7+ c:5+.3- c:3-.5-.7- }
3680 Removals are specified similarly, and are introduced by a caret. They
3681 must come after the additions.
3682 @lilypond[verbatim,fragment]
3683 \chords { c^3 c:7^5 c:9^3.5 }
3686 Modifiers can be used to change pitches. The following modifiers are
3690 is the minor chord. This modifier lowers the 3rd and (if present) the 7th step.
3692 is the diminished chord. This modifier lowers the 3rd, 5th and (if present)
3695 is the augmented chord. This modifier raises the 5th step.
3697 is the major 7th chord. This modifier raises the 7th step if present.
3699 is the suspended 4th or 2nd. This modifier removes the 3rd
3700 step. Append either @code{2} or @code{4} to add the 2nd or 4th step to
3703 Modifiers can be mixed with additions.
3704 @lilypond[verbatim,fragment]
3705 \chords { c:sus4 c:7sus4 c:dim7 c:m6 }
3708 @cindex modifiers, in chords.
3715 Since the unaltered 11 does sound well when combined with the
3716 unaltered 3, the 11 is removed in this case, unless it is added
3717 explicitly). For example,
3718 @lilypond[fragment,verbatim]
3719 \chords { c:13 c:13.11 c:m13 }
3724 An inversion (putting one pitch of the chord on the bottom), as well
3725 as bass notes, can be specified by appending
3726 @code{/}@var{pitch} to the chord.
3727 @lilypond[fragment,verbatim,center]
3728 \chords { c1 c/g c/f }
3731 If you do not want to remove the bass note from the chord, but rather
3732 add the note, then you can use @code{/+}@var{pitch}.
3734 @lilypond[fragment,verbatim,center]
3735 \chords { c1 c/+g c/+f }
3738 Chords is a mode similar to @code{\lyrics}, @code{\notes} etc. Most
3739 of the commands continue to work, for example, @code{r} and
3740 @code{\skip} can be used to insert rests and spaces, and
3741 @code{\property} may be used to change various settings.
3747 Each step can only be present in a chord once. The following
3748 simply produces the augmented chord, since @code{5+} is interpreted
3751 @lilypond[verbatim,fragment]
3752 \chords { c:5.5-.5+ }
3755 In chord mode, dashes and carets are used to indicate chord additions
3756 and subtractions, so articulation scripts cannot be entered.
3759 @node Printing chord names
3760 @subsection Printing chord names
3762 @cindex printing chord names
3766 For displaying printed chord names, use the @internalsref{ChordNames}
3767 context. The chords may be entered either using the notation
3768 described above, or directly using @code{<<} and @code{>>}.
3770 @lilypond[verbatim,singleline]
3772 \chords {a1 b c} <<d' f' g'>> <<e' g' b'>>
3776 \context ChordNames \scheme
3777 \context Staff \scheme
3782 You can make the chord changes stand out by setting
3783 @internalsref{ChordNames}.@code{chordChanges} to true. This will only
3784 display chord names when there is a change in the chords scheme and at
3785 the start of a new line.
3789 c1:m c:m \break c:m c:m d
3793 \context ChordNames {
3794 \property ChordNames.chordChanges = ##t
3796 \context Staff \transpose c c' \scheme
3798 \paper{linewidth= 9.\cm}
3802 The default chord name layout is a system for Jazz music, proposed by
3803 Klaus Ignatzek (See @ref{Literature}).
3805 The Ignatzek chord name formatting can be tuned in a number of ways
3806 through the following properties:
3809 @cindex chordNameExceptions
3810 @item chordNameExceptions
3811 This is a list that contains the chords that have special formatting.
3813 @inputfileref{input/regression,chord-name-exceptions.ly}.
3814 @cindex exceptions, chord names.
3817 @cindex majorSevenSymbol
3818 @item majorSevenSymbol
3819 This property contains the markup object used for the 7th step, when
3820 it is major. Predefined options are @code{whiteTriangleMarkup} and
3821 @code{blackTriangleMarkup}. See
3822 @inputfileref{input/regression,chord-name-major7.ly} for an example.
3824 @cindex chordNameSeparator
3825 @item chordNameSeparator
3826 Different parts of a chord name are normally separated by a
3827 slash. By setting @code{chordNameSeparator}, you can specify other
3829 @lilypond[fragment,verbatim]
3830 \context ChordNames \chords {
3832 \property ChordNames.chordNameSeparator
3837 @cindex chordRootNamer
3838 @item chordRootNamer
3839 The root of a chord is usually printed as a letter with an optional
3840 alteration. The transformation from pitch to letter is done by this
3841 function. Special note names (for example, the German ``H'' for a
3842 B-chord) can be produced by storing a new function in this property.
3844 @cindex chordNoteNamer
3845 @item chordNoteNamer
3846 The default is to print single notes (as for instance the bass note)
3847 using the @code{chordRootNamer}. However, by setting this function to a non-null
3848 value you can specify a different function. I.e. you could use letters
3849 in lower case for the base note.
3854 There are also two other chord name schemes implemented: an alternate
3855 Jazz chord notation, and a systematic scheme called Banter chords. The
3856 alternate jazz notation is also shown on the chart in @ref{Chord name
3857 chart}. Turning on these styles is described in the input file
3858 @inputfileref{input/test/,chord-names-jazz.ly}.
3862 @cindex chords, jazz
3867 @cindex @code{\germanChords }
3868 @code{\germanChords},
3869 @cindex @code{\semiGermanChords }
3870 @code{\semiGermanChords},
3877 @inputfileref{input/regression,chord-name-major7.ly},
3878 @inputfileref{input/regression,chord-name-exceptions.ly},
3879 @inputfileref{input/test,chord-names-jazz.ly},
3880 @inputfileref{input/test,chord-names-german.ly},
3881 @file{scm/chords-ignatzek.scm}, @file{scm/chord-entry.scm}
3886 Chord names are determined solely from the list of pitches. Chord
3887 inversions are not identified, and neither are added bass notes. This
3888 may result in strange chord names when chords are entered with the
3889 @code{<< .. >>} syntax.
3894 @node Orchestral music
3895 @section Orchestral music
3897 @cindex Writing parts
3899 Orchestral music involves some special notation, both in the full
3900 score and the individual parts. This section explains how to tackle
3901 some common problems in orchestral music.
3906 * Multiple staff contexts::
3909 * Instrument names::
3911 * Multi measure rests::
3912 * Automatic part combining::
3914 * Sound output for transposing instruments::
3917 @node Multiple staff contexts
3918 @subsection Multiple staff contexts
3920 Polyphonic scores consist of many staffs. These staffs can be
3921 constructed in three different ways:
3923 @item The group is started with a brace at the left. This is done with the
3924 @internalsref{GrandStaff} context.
3925 @item The group is started with a bracket. This is done with the
3926 @internalsref{StaffGroup} context
3927 @item The group is started with a vertical line. This is the default
3931 @cindex Staff, multiple
3932 @cindex bracket, vertical
3933 @cindex brace, vertical
3940 @node Rehearsal marks
3941 @subsection Rehearsal marks
3942 @cindex Rehearsal marks
3944 @cindex @code{\mark}
3946 To print a rehearsal mark, use the @code{\mark} command.
3947 @lilypond[fragment,verbatim]
3957 The mark is incremented automatically if you use @code{\mark
3958 \default}. The value to use is stored in the property
3959 @code{rehearsalMark} is used and automatically incremented.
3961 The @code{\mark} command can also be used to put signs like coda,
3962 segno and fermatas on a barline. Use @code{\markup} to
3963 to access the appropriate symbol.
3965 @lilypond[fragment,verbatim,relative=1]
3966 c1 \mark \markup { \musicglyph #"scripts-ufermata" }
3970 In this case, during line breaks,
3971 marks must also be printed at the end of the line, and not at the
3972 beginning. Use the following to force that behavior
3974 \property Score.RehearsalMark \override
3975 #'break-visibility = #begin-of-line-invisible
3978 See @inputfileref{input/test,boxed-molecule.ly}. for putting boxes
3984 @cindex barlines, putting symbols on
3988 @internalsref{MarkEvent}, @internalsref{RehearsalMark},
3989 @inputfileref{input/test,boxed-molecule.ly}.
3993 @subsection Bar numbers
3997 @cindex measure numbers
3998 @cindex currentBarNumber
4000 Bar numbers are printed by default at the start of the line. The
4001 number itself is stored in the
4002 @code{currentBarNumber} property,
4003 which is normally updated automatically for every measure.
4005 Bar numbers can be typeset at regular intervals instead of at the
4006 beginning of each line. This is illustrated in the following example,
4007 whose source is available as
4008 @inputfileref{input/test,bar-number-every-fifth.ly}
4010 @lilypondfile[notexidoc]{bar-number-every-fifth.ly}
4012 The start of that numbering can also be reset, as demonstrated in
4013 @inputfileref{input/test,bar-number-every-five-reset.ly}.
4015 @lilypondfile[notexidoc]{bar-number-every-five-reset.ly}
4020 @internalsref{BarNumber}.
4021 @inputfileref{input/test,bar-number-every-five-reset.ly}.
4022 @inputfileref{input/test,bar-number-every-fifth.ly}
4026 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
4027 there is one at the top. To solve this, You have to twiddle with the
4028 @internalsref{padding} property of @internalsref{BarNumber} if your
4029 score starts with a @internalsref{StaffGroup}.
4031 @node Instrument names
4032 @subsection Instrument names
4034 In an orchestral score, instrument names are printed left of the
4037 This can be achieved by setting @internalsref{Staff}.@code{instrument}
4038 and @internalsref{Staff}.@code{instr}. This will print a string before
4039 the start of the staff. For the first start, @code{instrument} is
4040 used, for the next ones @code{instr} is used.
4042 @lilypond[verbatim,singleline]
4043 \property Staff.instrument = "ploink " { c''4 }
4046 You can also use markup texts to construct more complicated instrument
4049 @lilypond[fragment,verbatim,singleline]
4050 \notes \context Staff = treble {
4051 \property Staff.instrument = \markup {
4052 \column << "Clarinetti"
4054 \smaller \musicglyph #"accidentals--1"
4065 @internalsref{InstrumentName}
4069 When you put a name on a grand staff or piano staff the width of the
4070 brace is not taken into account. You must add extra spaces to the end of
4071 the name to avoid a collision.
4074 @subsection Transpose
4076 @cindex transposition of pitches
4077 @cindex @code{\transpose}
4079 A music expression can be transposed with @code{\transpose}. The syntax
4082 \transpose @var{from} @var{to} @var{musicexpr}
4085 This means that @var{musicexpr} is transposed by the interval
4086 between @var{from} and @var{to}.
4088 @code{\transpose} distinguishes between enharmonic pitches: both
4089 @code{\transpose c cis} or @code{\transpose c des} will transpose up
4090 half a tone. The first version will print sharps and the second
4091 version will print flats.
4093 @lilypond[singleline, verbatim]
4094 mus =\notes { \key d \major cis d fis g }
4095 \score { \notes \context Staff {
4098 \transpose c g' \mus
4099 \transpose c f' \mus
4105 @internalsref{TransposedMusic}, @internalsref{UntransposableMusic}.
4109 If you want to use both @code{\transpose} and @code{\relative}, then
4110 you must put @code{\transpose} outside of @code{\relative}, since
4111 @code{\relative} will have no effect music that appears inside a
4117 @node Multi measure rests
4118 @subsection Multi measure rests
4119 @cindex multi measure rests
4120 @cindex Rests, multi measure
4124 Multi measure rests are entered using `@code{R}'. It is specifically
4125 meant for full bar rests and for entering parts: the rest can expand to
4126 fill a score with rests, or it can be printed as a single multimeasure
4127 rest. This expansion is controlled by the property
4128 @code{Score.skipBars}. If this is set to true, Lily will not expand
4129 empty measures, and the appropriate number is added automatically.
4131 @lilypond[fragment,verbatim]
4132 \time 4/4 r1 | R1 | R1*2
4133 \property Score.skipBars = ##t R1*17 R1*4
4136 The @code{1} in @code{R1} is similar to the duration notation used for
4137 notes. Hence, for time signatures other than 4/4, you must enter other
4138 durations. This can be done with augmentation dots or fractions:
4140 @lilypond[fragment,verbatim]
4141 \property Score.skipBars = ##t
4149 A @code{R} spanning a single measure is printed as a whole rest
4150 centered in the measure (or a breve when the measure lasts longer than
4151 two whole notes), regardless of the time signature.
4155 @cindex text on multi-measure rest
4156 @cindex script on multi-measure rest
4157 @cindex fermata on multi-measure rest
4159 Texts can be added to multi-measure rests by using the
4160 @var{note}-@code{markup} syntax (see @ref{Text markup}). In this case, the number is
4161 replaced. If you need both texts and the number, you must add the
4162 number by hand. A variable (@code{\fermataMarkup}) is provided for
4166 @lilypond[verbatim,fragment]
4168 R2._\markup { "Ad lib" }
4173 @cindex whole rests for a full measure
4177 @internalsref{MultiMeasureRestEvent},
4178 @internalsref{MultiMeasureTextEvent},
4179 @internalsref{MultiMeasureRestMusicGroup},
4180 @internalsref{MultiMeasureRest},
4182 The layout object @internalsref{MultiMeasureRestNumber} is for the
4183 default number, and @internalsref{MultiMeasureRestText} for user
4188 It is not possible to use fingerings (e.g. @code{R1-4}) to put numbers
4189 over multi-measure rests.
4191 @cindex condensing rests
4193 There is no way to automatically condense multiple rests into a single
4194 multimeasure rest. Multi measure rests do not take part in rest
4197 Be careful when entering multimeasure rests followed by whole notes,
4201 will enter two notes lasting four measures each. When @code{skipBars}
4202 is set, then the result will look OK6, but the bar numbering will be
4205 @node Automatic part combining
4206 @subsection Automatic part combining
4207 @cindex automatic part combining
4208 @cindex part combiner
4211 Automatic part combining is used to merge two parts of music onto a
4212 staff. It is aimed at typesetting orchestral scores. When the two
4213 parts are identical for a period of time, only one is shown. In
4214 places where the two parts differ, they are typeset as separate
4215 voices, and stem directions are set automatically. Also, solo and
4216 @emph{a due} parts are identified and can be marked.
4220 The syntax for part combining is
4223 \partcombine @var{context} @var{musicexpr1} @var{musicexpr2}
4225 where the pieces of music @var{musicexpr1} and @var{musicexpr2} will be
4226 combined into one context of type @var{context}. The music expressions
4227 must be interpreted by contexts whose names should start with @code{one}
4230 The following example demonstrates the basic functionality of the part
4231 combiner: putting parts on one staff, and setting stem directions and
4234 @lilypond[verbatim,singleline,fragment]
4236 \context Voice=one \partcombine Voice
4237 \context Thread=one \relative c'' {
4240 \context Thread=two \relative c'' {
4246 The first @code{g} appears only once, although it was
4247 specified twice (once in each part). Stem, slur and tie directions are
4248 set automatically, depending whether there is a solo or unisono. The
4249 first part (with context called @code{one}) always gets up stems, and
4250 `solo', while the second (called @code{two}) always gets down stems and
4253 If you just want the merging parts, and not the textual markings, you
4254 may set the property @var{soloADue} to false.
4256 @lilypond[verbatim,singleline,fragment]
4258 \property Staff.soloADue = ##f
4259 \context Voice=one \partcombine Voice
4260 \context Thread=one \relative c'' {
4263 \context Thread=two \relative c'' {
4271 @internalsref{PartCombineMusic},
4272 @internalsref{Thread_devnull_engraver},
4273 @internalsref{Voice_devnull_engraver} and @internalsref{A2_engraver}.
4277 The syntax for naming contexts in inconsistent with the syntax for
4280 In @code{soloADue} mode, when the two voices play the same notes on and
4281 off, the part combiner may typeset @code{a2} more than once in a
4284 @lilypond[fragment,singleline]
4286 \context Voice=one \partcombine Voice
4287 \context Thread=one \relative c'' {
4290 \context Thread=two \relative c'' {
4296 The part combiner is slated to be rewritten [TODO: explain why].
4298 @cindex @code{Thread_devnull_engraver}
4299 @cindex @code{Voice_engraver}
4300 @cindex @code{A2_engraver}
4302 @node Frenched scores
4303 @subsection Frenched scores
4305 In orchestral scores, staff lines that only have rests are usually removed.
4306 This saves some space. This style is called `French Score'.
4310 This is supported through the @code{RemoveEmptyStaff}. This staff is
4311 removed when it turns out empty (or containing multimeasure rests)
4312 after the line-breaking process.
4314 For @internalsref{Lyrics}, @internalsref{LyricsVoice},
4315 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
4316 switched on by default. For normal staffs, it is available as a
4317 specialized @internalsref{Staff} context, with the name variable
4318 @code{\RemoveEmptyStaffContext}. Observe how the second staff in this
4319 example disappears in the second line.
4323 \notes \relative c' <
4324 \context Staff = SA { e4 f g a \break c1 }
4325 \context Staff = SB { c4 d e f \break R1 }
4329 \translator { \RemoveEmptyStaffContext }
4335 @node Sound output for transposing instruments
4336 @subsection Sound output for transposing instruments
4338 When you want to make a MIDI file from a score containing transposed
4339 and untransposed instruments, you have to instruct LilyPond the pitch
4340 offset (in semitones) for the transposed instruments. This is done
4341 using the @code{transposing} property. It does not affect printed
4344 @cindex @code{transposing}
4347 \property Staff.instrument = #"Cl. in B-flat"
4348 \property Staff.transposing = #-2
4352 @node Ancient notation
4353 @section Ancient notation
4355 @cindex Vaticana, Editio
4356 @cindex Medicaea, Editio
4361 @c [TODO: write introduction on ancient notation]
4364 * Ancient note heads::
4373 @node Ancient note heads
4374 @subsection Ancient note heads
4376 To get a longa note head, you have to use mensural note heads. This
4377 is accomplished by setting the @code{style} property of the
4378 NoteHead object to @code{mensural}. There is also a note head style
4379 @code{baroque} which gives mensural note heads for @code{\longa} and
4380 @code{\breve} but standard note heads for shorter notes.
4382 @lilypond[fragment,singleline,verbatim]
4383 \property Voice.NoteHead \set #'style = #'mensural
4388 @subsection Ancient clefs
4390 LilyPond supports a variety of clefs, many of them ancient.
4392 For modern clefs, see section @ref{Clef}. For the percussion clef, see
4393 section @ref{Percussion staves}. For the @code{TAB} clef, see section
4396 The following table shows all ancient clefs that are supported via the
4397 @code{\clef} command. Some of the clefs use the same glyph, but
4398 differ only with respect to the line they are printed on. In such
4399 cases, a trailing number in the name is used to enumerate these clefs.
4400 Still, you can manually force a clef glyph to be typeset on an
4401 arbitrary line, as described in section @ref{Clef}. The note printed
4402 to the right side of each clef in the example column denotes the
4403 @code{c'} with respect to that clef.
4405 @multitable @columnfractions .3 .3 .3 .1
4409 @b{Description} @tab
4410 @b{Supported Clefs} @tab
4414 @code{clefs-neo_mensural_c} @tab
4415 modern style mensural C clef @tab
4416 @code{neo_mensural_c1}, @code{neo_mensural_c2},
4417 @code{neo_mensural_c3}, @code{neo_mensural_c4} @tab
4418 @lilypond[relative 0, notime]
4419 \property Staff.TimeSignature \set #'transparent = ##t
4420 \clef "neo_mensural_c2" c
4424 @code{clefs-petrucci_c1}
4425 @code{clefs-petrucci_c2}
4426 @code{clefs-petrucci_c3}
4427 @code{clefs-petrucci_c4}
4428 @code{clefs-petrucci_c5}
4431 petrucci style mensural C clefs, for use on different stafflines
4432 (the examples shows the 2nd staffline C clef).
4442 @lilypond[relative 0, notime]
4443 \property Staff.TimeSignature \set #'transparent = ##t
4444 \clef "petrucci_c2" c
4448 @code{clefs-petrucci_f} @tab
4449 petrucci style mensural F clef @tab
4450 @code{petrucci_f} @tab
4451 @lilypond[relative 0, notime]
4452 \property Staff.TimeSignature \set #'transparent = ##t
4453 \clef "petrucci_f" c
4457 @code{clefs-petrucci_g} @tab
4458 petrucci style mensural G clef @tab
4459 @code{petrucci_g} @tab
4460 @lilypond[relative 0, notime]
4461 \property Staff.TimeSignature \set #'transparent = ##t
4462 \clef "petrucci_g" c
4466 @code{clefs-mensural_c'} @tab
4467 historic style mensural C clef @tab
4468 @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3},
4469 @code{mensural_c4} @tab
4470 @lilypond[relative 0, notime]
4471 \property Staff.TimeSignature \set #'transparent = ##t
4472 \clef "mensural_c2" c
4476 @code{clefs-mensural_f} @tab
4477 historic style mensural F clef @tab
4478 @code{mensural_f} @tab
4479 @lilypond[relative 0, notime]
4480 \property Staff.TimeSignature \set #'transparent = ##t
4481 \clef "mensural_f" c
4485 @code{clefs-mensural_g} @tab
4486 historic style mensural G clef @tab
4487 @code{mensural_g} @tab
4488 @lilypond[relative 0, notime]
4489 \property Staff.TimeSignature \set #'transparent = ##t
4490 \clef "mensural_g" c
4494 @code{clefs-vaticana_do} @tab
4495 Editio Vaticana style do clef @tab
4496 @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab
4497 @lilypond[relative 0, notime]
4499 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4500 \property Staff.TimeSignature \set #'transparent = ##t
4501 \clef "vaticana_do2" c
4505 @code{clefs-vaticana_fa} @tab
4506 Editio Vaticana style fa clef @tab
4507 @code{vaticana_fa1}, @code{vaticana_fa2} @tab
4508 @lilypond[relative 0, notime]
4510 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4511 \property Staff.TimeSignature \set #'transparent = ##t
4512 \clef "vaticana_fa2" c
4516 @code{clefs-medicaea_do} @tab
4517 Editio Medicaea style do clef @tab
4518 @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab
4519 @lilypond[relative 0, notime]
4521 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4522 \property Staff.TimeSignature \set #'transparent = ##t
4523 \clef "medicaea_do2" c
4527 @code{clefs-medicaea_fa} @tab
4528 Editio Medicaea style fa clef @tab
4529 @code{medicaea_fa1}, @code{medicaea_fa2} @tab
4530 @lilypond[relative 0, notime]
4532 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4533 \property Staff.TimeSignature \set #'transparent = ##t
4534 \clef "medicaea_fa2" c
4538 @code{clefs-hufnagel_do} @tab
4539 historic style hufnagel do clef @tab
4540 @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab
4541 @lilypond[relative 0, notime]
4543 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4544 \property Staff.TimeSignature \set #'transparent = ##t
4545 \clef "hufnagel_do2" c
4549 @code{clefs-hufnagel_fa} @tab
4550 historic style hufnagel fa clef @tab
4551 @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab
4552 @lilypond[relative 0, notime]
4554 \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #4
4555 \property Staff.TimeSignature \set #'transparent = ##t
4556 \clef "hufnagel_fa2" c
4560 @code{clefs-hufnagel_do_fa} @tab
4561 historic style hufnagel combined do/fa clef @tab
4562 @code{hufnagel_do_fa} @tab
4563 @lilypond[relative 0, notime]
4564 \property Staff.TimeSignature \set #'transparent = ##t
4565 \clef "hufnagel_do_fa" c
4570 @c --- This should go somewhere else: ---
4571 @c @item modern style percussion clef (glyph: @code{clefs-percussion})
4574 @c @code{percussion}
4576 @c @lilypond{\property Staff.TimeSignature \set #'transparent = ##t \clef "percussion" c'}
4578 @c @item modern style tab clef (glyph: @code{clefs-tab})
4583 @c @lilypond{\context Staff \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #6 \property Staff.TimeSignature \set #'transparent = ##t \clef "tab" c'}
4585 @emph{Modern style} means ``as is typeset in contemporary editions of
4586 transcribed mensural music''.
4588 @emph{Petrucci style} means ``inspired by printings published by the
4589 famous engraver Petrucci (1466-1539)''.
4591 @emph{Historic style} means ``as was typeset or written in historic
4592 editions (other than those of Petrucci)''.
4594 @emph{Editio XXX style} means ``as is/was printed in Editio XXX''.
4596 Petrucci used C clefs with differently balanced left-side vertical
4597 beams, depending on which staffline it is printed.
4601 @subsection Custodes
4606 A @emph{custos} (plural: @emph{custodes}; latin word for `guard') is a
4607 symbol that appears at the end of a staff. It anticipates the pitch
4608 of the first note(s) of the following line and thus helps the player
4609 or singer to manage line breaks during performance, thus enhancing
4610 readability of a score.
4612 Custodes were frequently used in music notation until the 17th
4613 century. Nowadays, they have survived only in a few particular forms
4614 of musical notation such as contemporary editions of Gregorian chant
4615 like the @emph{editio vaticana}. There are different custos glyphs
4616 used in different flavours of notational style.
4618 For typesetting custodes, just put a @internalsref{Custos_engraver} into the
4619 @internalsref{Staff} context when declaring the @code{\paper} block,
4620 as shown in the following example.
4626 \consists Custos_engraver
4627 Custos \override #'style = #'mensural
4632 The result looks like this:
4638 \property Staff.Custos \set #'style = #'mensural
4645 \consists Custos_engraver
4652 The custos glyph is selected by the @code{style} property. The styles
4653 supported are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
4654 @code{mensural}. They are demonstrated in the following fragment:
4664 { " " \musicglyph #"custodes-vaticana-u0" }
4668 { " " \musicglyph #"custodes-medicaea-u0" }
4672 { " " \musicglyph #"custodes-hufnagel-u0" }
4676 { " " \musicglyph #"custodes-mensural-u0" }
4685 \remove "Bar_number_engraver"
4689 \remove "Clef_engraver"
4690 \remove "Key_engraver"
4691 \remove "Time_signature_engraver"
4692 \remove "Staff_symbol_engraver"
4693 minimumVerticalExtent = ##f
4699 If the boolean property @code{adjust-if-on-staffline} is set to
4700 @code{#t} (which it is by default), lily typesets slightly different
4701 variants of the custos glyph, depending on whether the custos, is
4702 typeset on or between stafflines. The glyph will
4703 optically fit well into the staff, with the appendage on the right of
4704 the custos always ending at the same vertical position between two
4705 stafflines regardless of the pitch. If you set
4706 @code{adjust-if-on-staffline} to @code{#f}, then
4707 a compromise between both forms is used.
4709 Just like stems can be attached to noteheads in two directions
4710 @emph{up} and @emph{down}, each custos glyph is available with its
4711 appendage pointing either up or down. If the pitch of a custos is
4712 above a selectable position, the appendage will point downwards; if
4713 the pitch is below this position, the appendage will point upwards.
4714 Use property @code{neutral-position} to select this position. By
4715 default, it is set to @code{0}, such that the neutral position is the
4716 center of the staff. Use property @code{neutral-direction} to control
4717 what happens if a custos is typeset on the neutral position itself.
4718 By default, this property is set to @code{-1}, such that the appendage
4719 will point downwards. If set to @code{1}, the appendage will point
4720 upwards. Other values such as @code{0} are reserved for future
4721 extensions and should not be used.
4726 @internalsref{Custos}, @inputfileref{input/test,custos-style.ly} and
4727 @inputfileref{input/regression,custos.ly}.
4731 @subsection Divisiones
4737 A @emph{divisio} (plural: @emph{divisiones}; latin word for
4738 `division') is a staff context symbol that is used to structure
4739 Gregorian music into phrases and sections. The musical meaning of
4740 @emph{divisio minima}, @emph{divisio maior} and @emph{divisio maxima}
4741 can be characterized as short, medium and long pause, somewhat like
4742 @ref{Breath marks}. The @emph{finalis} sign not only marks the end of
4743 a chant, but is also frequently used within a single
4744 antiphonal/responsorial chant to mark the end of each section.
4748 To use divisiones, include the file @code{gregorian-init.ly}. It
4749 contains definitions that you can apply by just inserting
4750 @code{\divisioMinima}, @code{\divisioMaior}, @code{\divisioMaxima},
4751 and @code{\finalis} at proper places in the input. Some editions use
4752 @emph{virgula} or @emph{caesura} instead of divisio minima.
4753 Therefore, @code{gregorian-init.ly} also defines @code{\virgula} and
4757 @lilypondfile[notexidoc]{divisiones.ly}
4761 @internalsref{BreathingSign}, @internalsref{BreathingSignEvent},
4762 @inputfileref{input/test,divisiones.ly}, @ref{Breath marks}.
4765 @subsection Ligatures
4769 @c TODO: Should double check if I recalled things correctly when I wrote
4770 @c down the following paragraph by heart.
4772 In musical terminology, a ligature is a coherent graphical symbol that
4773 represents at least two different notes. Ligatures originally appeared
4774 in the manuscripts of Gregorian chant notation roughly since the 9th
4775 century as an allusion to the accent symbols of greek lyric poetry to
4776 denote ascending or descending sequences of notes. Both, the shape and
4777 the exact meaning of ligatures changed tremendously during the following
4778 centuries: In early notation, ligatures where used for monophonic tunes
4779 (Gregorian chant) and very soon denoted also the way of performance in
4780 the sense of articulation. With upcoming multiphony, the need for a
4781 metric system arised, since multiple voices of a piece have to be
4782 synchronized some way. New notation systems were invented that used
4783 the manifold shapes of ligatures to now denote rhythmical patterns
4784 (e.g. black mensural notation, mannered notation, ars nova). With the
4785 invention of the metric system of the white mensural notation, the need
4786 for ligatures to denote such patterns disappeared. Nevertheless,
4787 ligatures were still in use in the mensural system for a couple of
4788 decades until they finally disappeared during the late 16th / early 17th
4789 century. Still, ligatures have survived in contemporary editions of
4790 Gregorian chant such as the Editio Vaticana from 1905/08.
4794 Syntactically, ligatures are simply enclosed by @code{\[} and
4795 @code{\]}. Some ligature styles (such as Editio Vaticana) may need
4796 additional input syntax specific for this particular type of ligature.
4797 By default, the @internalsref{LigatureBracket} engraver just puts a
4798 square bracket above the ligature.
4800 @lilypond[singleline,verbatim]
4802 \notes \transpose c c' {
4810 To select a specific style of ligatures, a proper ligature engraver
4811 has to be added to the @internalsref{Voice} context, as explained in
4812 the following subsections. Currently, only white mensural ligatures
4813 are supported with certain limitations. Support for Editio Vaticana
4814 will be added in the future.
4817 * White mensural ligatures::
4818 * Gregorian square neumes ligatures::
4821 @node White mensural ligatures
4822 @subsubsection White mensural ligatures
4824 @cindex Mensural ligatures
4825 @cindex White mensural ligatures
4827 There is limited support for white mensural ligatures. The
4828 implementation is still experimental; it currently may output strange
4829 warnings or even crash in some cases or produce weird results on more
4830 complex ligatures. To engrave white mensural ligatures, in the paper
4831 block the @internalsref{Mensural_ligature_engraver} has to be put into
4832 the @internalsref{Voice} context, and remove the
4833 @internalsref{Ligature_bracket_engraver}:
4839 \remove Ligature_bracket_engraver
4840 \consists Mensural_ligature_engraver
4845 There is no additional input language to describe the shape of a
4846 white mensural ligature. The shape is rather determined solely from
4847 the pitch and duration of the enclosed notes. While this approach may
4848 take a new user a while to get accustomed, it has the great advantage
4849 that the full musical information of the ligature is known internally.
4850 This is not only required for correct MIDI output, but also allows for
4851 automatic transcription of the ligatures.
4856 \property Score.timing = ##f
4857 \property Score.defaultBarType = "empty"
4858 \property Voice.NoteHead \set #'style = #'neo_mensural
4859 \property Staff.TimeSignature \set #'style = #'neo_mensural
4861 \[ g\longa c\breve a\breve f\breve d'\longa \]
4863 \[ e1 f1 a\breve g\longa \]
4865 @lilypond[singleline]
4867 \notes \transpose c c' {
4868 \property Score.timing = ##f
4869 \property Score.defaultBarType = "empty"
4870 \property Voice.NoteHead \set #'style = #'neo_mensural
4871 \property Staff.TimeSignature \set #'style = #'neo_mensural
4873 \[ g\longa c\breve a\breve f\breve d'\longa \]
4875 \[ e1 f1 a\breve g\longa \]
4880 \remove Ligature_bracket_engraver
4881 \consists Mensural_ligature_engraver
4887 Without replacing @internalsref{Ligature_bracket_engraver} with
4888 @internalsref{Mensural_ligature_engraver}, the same music transcribes
4891 @lilypond[singleline]
4893 \notes \transpose c c' {
4894 \property Score.timing = ##f
4895 \property Score.defaultBarType = "empty"
4896 \property Voice.NoteHead \set #'style = #'neo_mensural
4897 \property Staff.TimeSignature \set #'style = #'neo_mensural
4899 \[ g\longa c\breve a\breve f\breve d'\longa \]
4901 \[ e1 f1 a\breve g\longa \]
4906 @node Gregorian square neumes ligatures
4907 @subsubsection Gregorian square neumes ligatures
4909 @cindex Square neumes ligatures
4910 @cindex Gregorian square neumes ligatures
4912 Gregorian square neumes notation (following the style of the Editio
4913 Vaticana) is under heavy development, but not yet really usable for
4914 production purposes. Core ligatures can already be typeset, but
4915 essential issues for serious typesetting are still under development,
4916 such as (among others) horizontal alignment of multiple ligatures,
4917 lyrics alignment and proper accidentals handling. Still, this section
4918 gives a sneak preview of what Gregorian chant may look like once it
4921 The following table contains the extended neumes table of the 2nd
4922 volume of the Antiphonale Romanum (@emph{Liber Hymnarius}), published
4923 1983 by the monks of Solesmes.
4925 @multitable @columnfractions .4 .2 .2 .2
4928 @b{Neuma aut@*Neumarum Elementa} @tab
4929 @b{Figurae@*Rectae} @tab
4930 @b{Figurae@*Liquescentes Auctae} @tab
4931 @b{Figurae@*Liquescentes Deminutae}
4933 @c TODO: \paper block is identical in all of the below examples.
4934 @c Therefore, it should somehow be included rather than duplicated all
4937 @c why not make identifiers in ly/engraver-init.ly? --hwn
4939 @c Because it's just used to typeset plain notes without
4940 @c a staff for demonstration purposes rather than something
4941 @c special of Gregorian chant notation. --jr
4946 @lilypond[noindent, 26pt, nofragment, linewidth=1.5cm]
4947 \include "gregorian-init.ly"
4949 \notes \transpose c c' {
4952 \noBreak s^\markup {"a"} \noBreak
4954 % Punctum Inclinatum
4956 \noBreak s^\markup {"b"}
4962 \remove "Bar_number_engraver"
4966 \remove "Clef_engraver"
4967 \remove "Key_engraver"
4968 StaffSymbol \set #'transparent = ##t
4969 \remove "Time_signature_engraver"
4970 \remove "Bar_engraver"
4971 minimumVerticalExtent = ##f
4975 \remove Ligature_bracket_engraver
4976 \consists Vaticana_ligature_engraver
4977 NoteHead \set #'style = #'vaticana_punctum
4978 Stem \set #'transparent = ##t
4984 @lilypond[noindent, 26pt, nofragment, linewidth=2.5cm]
4985 \include "gregorian-init.ly"
4987 \notes \transpose c c' {
4988 % Punctum Auctum Ascendens
4989 \[ \auctum \ascendens b \]
4990 \noBreak s^\markup {"c"} \noBreak
4992 % Punctum Auctum Descendens
4993 \[ \auctum \descendens b \]
4994 \noBreak s^\markup {"d"} \noBreak
4996 % Punctum Inclinatum Auctum
4997 \[ \inclinatum \auctum b \]
4998 \noBreak s^\markup {"e"}
5004 \remove "Bar_number_engraver"
5008 \remove "Clef_engraver"
5009 \remove "Key_engraver"
5010 StaffSymbol \set #'transparent = ##t
5011 \remove "Time_signature_engraver"
5012 \remove "Bar_engraver"
5013 minimumVerticalExtent = ##f
5017 \remove Ligature_bracket_engraver
5018 \consists Vaticana_ligature_engraver
5019 NoteHead \set #'style = #'vaticana_punctum
5020 Stem \set #'transparent = ##t
5026 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5027 \include "gregorian-init.ly"
5029 \notes \transpose c c' {
5030 % Punctum Inclinatum Parvum
5031 \[ \inclinatum \deminutum b \]
5032 \noBreak s^\markup {"f"}
5038 \remove "Bar_number_engraver"
5042 \remove "Clef_engraver"
5043 \remove "Key_engraver"
5044 StaffSymbol \set #'transparent = ##t
5045 \remove "Time_signature_engraver"
5046 \remove "Bar_engraver"
5047 minimumVerticalExtent = ##f
5051 \remove Ligature_bracket_engraver
5052 \consists Vaticana_ligature_engraver
5053 NoteHead \set #'style = #'vaticana_punctum
5054 Stem \set #'transparent = ##t
5063 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5064 \include "gregorian-init.ly"
5066 \notes \transpose c c' {
5069 \noBreak s^\markup {"g"}
5075 \remove "Bar_number_engraver"
5079 \remove "Clef_engraver"
5080 \remove "Key_engraver"
5081 StaffSymbol \set #'transparent = ##t
5082 \remove "Time_signature_engraver"
5083 \remove "Bar_engraver"
5084 minimumVerticalExtent = ##f
5088 \remove Ligature_bracket_engraver
5089 \consists Vaticana_ligature_engraver
5090 NoteHead \set #'style = #'vaticana_punctum
5091 Stem \set #'transparent = ##t
5100 @code{3. Apostropha vel Stropha}
5102 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5103 \include "gregorian-init.ly"
5105 \notes \transpose c c' {
5108 \noBreak s^\markup {"h"}
5114 \remove "Bar_number_engraver"
5118 \remove "Clef_engraver"
5119 \remove "Key_engraver"
5120 StaffSymbol \set #'transparent = ##t
5121 \remove "Time_signature_engraver"
5122 \remove "Bar_engraver"
5123 minimumVerticalExtent = ##f
5127 \remove Ligature_bracket_engraver
5128 \consists Vaticana_ligature_engraver
5129 NoteHead \set #'style = #'vaticana_punctum
5130 Stem \set #'transparent = ##t
5136 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5137 \include "gregorian-init.ly"
5139 \notes \transpose c c' {
5141 \[ \stropha \auctum b \]
5142 \noBreak s^\markup {"i"}
5148 \remove "Bar_number_engraver"
5152 \remove "Clef_engraver"
5153 \remove "Key_engraver"
5154 StaffSymbol \set #'transparent = ##t
5155 \remove "Time_signature_engraver"
5156 \remove "Bar_engraver"
5157 minimumVerticalExtent = ##f
5161 \remove Ligature_bracket_engraver
5162 \consists Vaticana_ligature_engraver
5163 NoteHead \set #'style = #'vaticana_punctum
5164 Stem \set #'transparent = ##t
5174 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5175 \include "gregorian-init.ly"
5177 \notes \transpose c c' {
5180 \noBreak s^\markup {"j"}
5186 \remove "Bar_number_engraver"
5190 \remove "Clef_engraver"
5191 \remove "Key_engraver"
5192 StaffSymbol \set #'transparent = ##t
5193 \remove "Time_signature_engraver"
5194 \remove "Bar_engraver"
5195 minimumVerticalExtent = ##f
5199 \remove Ligature_bracket_engraver
5200 \consists Vaticana_ligature_engraver
5201 NoteHead \set #'style = #'vaticana_punctum
5202 Stem \set #'transparent = ##t
5211 @code{5. Clivis vel Flexa}
5213 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5214 \include "gregorian-init.ly"
5216 \notes \transpose c c' {
5225 \remove "Bar_number_engraver"
5229 \remove "Clef_engraver"
5230 \remove "Key_engraver"
5231 StaffSymbol \set #'transparent = ##t
5232 \remove "Time_signature_engraver"
5233 \remove "Bar_engraver"
5234 minimumVerticalExtent = ##f
5238 \remove Ligature_bracket_engraver
5239 \consists Vaticana_ligature_engraver
5240 NoteHead \set #'style = #'vaticana_punctum
5241 Stem \set #'transparent = ##t
5247 @lilypond[noindent, 26pt, nofragment, linewidth=2.0cm]
5248 \include "gregorian-init.ly"
5250 \notes \transpose c c' {
5251 % Clivis Aucta Descendens
5252 \[ b \flexa \auctum \descendens g \]
5253 \noBreak s^\markup {"l"} \noBreak
5255 % Clivis Aucta Ascendens
5256 \[ b \flexa \auctum \ascendens g \]
5257 \noBreak s^\markup {"m"}
5263 \remove "Bar_number_engraver"
5267 \remove "Clef_engraver"
5268 \remove "Key_engraver"
5269 StaffSymbol \set #'transparent = ##t
5270 \remove "Time_signature_engraver"
5271 \remove "Bar_engraver"
5272 minimumVerticalExtent = ##f
5276 \remove Ligature_bracket_engraver
5277 \consists Vaticana_ligature_engraver
5278 NoteHead \set #'style = #'vaticana_punctum
5279 Stem \set #'transparent = ##t
5285 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5286 \include "gregorian-init.ly"
5288 \notes \transpose c c' {
5290 \[ b \flexa \deminutum g \]
5297 \remove "Bar_number_engraver"
5301 \remove "Clef_engraver"
5302 \remove "Key_engraver"
5303 StaffSymbol \set #'transparent = ##t
5304 \remove "Time_signature_engraver"
5305 \remove "Bar_engraver"
5306 minimumVerticalExtent = ##f
5310 \remove Ligature_bracket_engraver
5311 \consists Vaticana_ligature_engraver
5312 NoteHead \set #'style = #'vaticana_punctum
5313 Stem \set #'transparent = ##t
5320 @code{6. Podatus vel Pes}
5322 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5323 \include "gregorian-init.ly"
5325 \notes \transpose c c' {
5334 \remove "Bar_number_engraver"
5338 \remove "Clef_engraver"
5339 \remove "Key_engraver"
5340 StaffSymbol \set #'transparent = ##t
5341 \remove "Time_signature_engraver"
5342 \remove "Bar_engraver"
5343 minimumVerticalExtent = ##f
5347 \remove Ligature_bracket_engraver
5348 \consists Vaticana_ligature_engraver
5349 NoteHead \set #'style = #'vaticana_punctum
5350 Stem \set #'transparent = ##t
5356 @lilypond[noindent, 26pt, nofragment, linewidth=2.0cm]
5357 \include "gregorian-init.ly"
5359 \notes \transpose c c' {
5360 % Pes Auctus Descendens
5361 \[ g \pes \auctum \descendens b \]
5362 \noBreak s^\markup {"p"} \noBreak
5364 % Pes Auctus Ascendens
5365 \[ g \pes \auctum \ascendens b \]
5366 \noBreak s^\markup {"q"}
5372 \remove "Bar_number_engraver"
5376 \remove "Clef_engraver"
5377 \remove "Key_engraver"
5378 StaffSymbol \set #'transparent = ##t
5379 \remove "Time_signature_engraver"
5380 \remove "Bar_engraver"
5381 minimumVerticalExtent = ##f
5385 \remove Ligature_bracket_engraver
5386 \consists Vaticana_ligature_engraver
5387 NoteHead \set #'style = #'vaticana_punctum
5388 Stem \set #'transparent = ##t
5394 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5395 \include "gregorian-init.ly"
5397 \notes \transpose c c' {
5399 \[ g \pes \deminutum b \]
5406 \remove "Bar_number_engraver"
5410 \remove "Clef_engraver"
5411 \remove "Key_engraver"
5412 StaffSymbol \set #'transparent = ##t
5413 \remove "Time_signature_engraver"
5414 \remove "Bar_engraver"
5415 minimumVerticalExtent = ##f
5419 \remove Ligature_bracket_engraver
5420 \consists Vaticana_ligature_engraver
5421 NoteHead \set #'style = #'vaticana_punctum
5422 Stem \set #'transparent = ##t
5429 @code{7. Pes Quassus}
5431 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5432 \include "gregorian-init.ly"
5434 \notes \transpose c c' {
5436 \[ \oriscus g \pes \virga b \]
5443 \remove "Bar_number_engraver"
5447 \remove "Clef_engraver"
5448 \remove "Key_engraver"
5449 StaffSymbol \set #'transparent = ##t
5450 \remove "Time_signature_engraver"
5451 \remove "Bar_engraver"
5452 minimumVerticalExtent = ##f
5456 \remove Ligature_bracket_engraver
5457 \consists Vaticana_ligature_engraver
5458 NoteHead \set #'style = #'vaticana_punctum
5459 Stem \set #'transparent = ##t
5465 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5466 \include "gregorian-init.ly"
5468 \notes \transpose c c' {
5469 % Pes Quassus Auctus Descendens
5470 \[ \oriscus g \pes \auctum \descendens b \]
5477 \remove "Bar_number_engraver"
5481 \remove "Clef_engraver"
5482 \remove "Key_engraver"
5483 StaffSymbol \set #'transparent = ##t
5484 \remove "Time_signature_engraver"
5485 \remove "Bar_engraver"
5486 minimumVerticalExtent = ##f
5490 \remove Ligature_bracket_engraver
5491 \consists Vaticana_ligature_engraver
5492 NoteHead \set #'style = #'vaticana_punctum
5493 Stem \set #'transparent = ##t
5501 @code{8. Quilisma Pes}
5503 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5504 \include "gregorian-init.ly"
5506 \notes \transpose c c' {
5508 \[ \quilisma g \pes b \]
5515 \remove "Bar_number_engraver"
5519 \remove "Clef_engraver"
5520 \remove "Key_engraver"
5521 StaffSymbol \set #'transparent = ##t
5522 \remove "Time_signature_engraver"
5523 \remove "Bar_engraver"
5524 minimumVerticalExtent = ##f
5528 \remove Ligature_bracket_engraver
5529 \consists Vaticana_ligature_engraver
5530 NoteHead \set #'style = #'vaticana_punctum
5531 Stem \set #'transparent = ##t
5537 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5538 \include "gregorian-init.ly"
5540 \notes \transpose c c' {
5541 % Quilisma Pes Auctus Descendens
5542 \[ \quilisma g \pes \auctum \descendens b \]
5549 \remove "Bar_number_engraver"
5553 \remove "Clef_engraver"
5554 \remove "Key_engraver"
5555 StaffSymbol \set #'transparent = ##t
5556 \remove "Time_signature_engraver"
5557 \remove "Bar_engraver"
5558 minimumVerticalExtent = ##f
5562 \remove Ligature_bracket_engraver
5563 \consists Vaticana_ligature_engraver
5564 NoteHead \set #'style = #'vaticana_punctum
5565 Stem \set #'transparent = ##t
5573 @code{9. Podatus Initio Debilis}
5575 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5576 \include "gregorian-init.ly"
5578 \notes \transpose c c' {
5579 % Pes Initio Debilis
5580 \[ \deminutum g \pes b \]
5587 \remove "Bar_number_engraver"
5591 \remove "Clef_engraver"
5592 \remove "Key_engraver"
5593 StaffSymbol \set #'transparent = ##t
5594 \remove "Time_signature_engraver"
5595 \remove "Bar_engraver"
5596 minimumVerticalExtent = ##f
5600 \remove Ligature_bracket_engraver
5601 \consists Vaticana_ligature_engraver
5602 NoteHead \set #'style = #'vaticana_punctum
5603 Stem \set #'transparent = ##t
5609 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5610 \include "gregorian-init.ly"
5612 \notes \transpose c c' {
5613 % Pes Auctus Descendens Initio Debilis
5614 \[ \deminutum g \pes \auctum \descendens b \]
5621 \remove "Bar_number_engraver"
5625 \remove "Clef_engraver"
5626 \remove "Key_engraver"
5627 StaffSymbol \set #'transparent = ##t
5628 \remove "Time_signature_engraver"
5629 \remove "Bar_engraver"
5630 minimumVerticalExtent = ##f
5634 \remove Ligature_bracket_engraver
5635 \consists Vaticana_ligature_engraver
5636 NoteHead \set #'style = #'vaticana_punctum
5637 Stem \set #'transparent = ##t
5647 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5648 \include "gregorian-init.ly"
5650 \notes \transpose c c' {
5652 \[ a \pes b \flexa g \]
5659 \remove "Bar_number_engraver"
5663 \remove "Clef_engraver"
5664 \remove "Key_engraver"
5665 StaffSymbol \set #'transparent = ##t
5666 \remove "Time_signature_engraver"
5667 \remove "Bar_engraver"
5668 minimumVerticalExtent = ##f
5672 \remove Ligature_bracket_engraver
5673 \consists Vaticana_ligature_engraver
5674 NoteHead \set #'style = #'vaticana_punctum
5675 Stem \set #'transparent = ##t
5681 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5682 \include "gregorian-init.ly"
5684 \notes \transpose c c' {
5685 % Torculus Auctus Descendens
5686 \[ a \pes b \flexa \auctum \descendens g \]
5693 \remove "Bar_number_engraver"
5697 \remove "Clef_engraver"
5698 \remove "Key_engraver"
5699 StaffSymbol \set #'transparent = ##t
5700 \remove "Time_signature_engraver"
5701 \remove "Bar_engraver"
5702 minimumVerticalExtent = ##f
5706 \remove Ligature_bracket_engraver
5707 \consists Vaticana_ligature_engraver
5708 NoteHead \set #'style = #'vaticana_punctum
5709 Stem \set #'transparent = ##t
5715 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5716 \include "gregorian-init.ly"
5718 \notes \transpose c c' {
5719 % Torculus Deminutus
5720 \[ a \pes b \flexa \deminutum g \]
5727 \remove "Bar_number_engraver"
5731 \remove "Clef_engraver"
5732 \remove "Key_engraver"
5733 StaffSymbol \set #'transparent = ##t
5734 \remove "Time_signature_engraver"
5735 \remove "Bar_engraver"
5736 minimumVerticalExtent = ##f
5740 \remove Ligature_bracket_engraver
5741 \consists Vaticana_ligature_engraver
5742 NoteHead \set #'style = #'vaticana_punctum
5743 Stem \set #'transparent = ##t
5750 @code{11. Torculus Initio Debilis}
5752 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5753 \include "gregorian-init.ly"
5755 \notes \transpose c c' {
5756 % Torculus Initio Debilis
5757 \[ \deminutum a \pes b \flexa g \]
5764 \remove "Bar_number_engraver"
5768 \remove "Clef_engraver"
5769 \remove "Key_engraver"
5770 StaffSymbol \set #'transparent = ##t
5771 \remove "Time_signature_engraver"
5772 \remove "Bar_engraver"
5773 minimumVerticalExtent = ##f
5777 \remove Ligature_bracket_engraver
5778 \consists Vaticana_ligature_engraver
5779 NoteHead \set #'style = #'vaticana_punctum
5780 Stem \set #'transparent = ##t
5786 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5787 \include "gregorian-init.ly"
5789 \notes \transpose c c' {
5790 % Torculus Auctus Descendens Initio Debilis
5791 \[ \deminutum a \pes b \flexa \auctum \descendens g \]
5798 \remove "Bar_number_engraver"
5802 \remove "Clef_engraver"
5803 \remove "Key_engraver"
5804 StaffSymbol \set #'transparent = ##t
5805 \remove "Time_signature_engraver"
5806 \remove "Bar_engraver"
5807 minimumVerticalExtent = ##f
5811 \remove Ligature_bracket_engraver
5812 \consists Vaticana_ligature_engraver
5813 NoteHead \set #'style = #'vaticana_punctum
5814 Stem \set #'transparent = ##t
5820 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5821 \include "gregorian-init.ly"
5823 \notes \transpose c c' {
5824 % Torculus Deminutus Initio Debilis
5825 \[ \deminutum a \pes b \flexa \deminutum g \]
5832 \remove "Bar_number_engraver"
5836 \remove "Clef_engraver"
5837 \remove "Key_engraver"
5838 StaffSymbol \set #'transparent = ##t
5839 \remove "Time_signature_engraver"
5840 \remove "Bar_engraver"
5841 minimumVerticalExtent = ##f
5845 \remove Ligature_bracket_engraver
5846 \consists Vaticana_ligature_engraver
5847 NoteHead \set #'style = #'vaticana_punctum
5848 Stem \set #'transparent = ##t
5855 @code{12. Porrectus}
5857 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5858 \include "gregorian-init.ly"
5860 \notes \transpose c c' {
5862 \[ a \flexa g \pes b \]
5869 \remove "Bar_number_engraver"
5873 \remove "Clef_engraver"
5874 \remove "Key_engraver"
5875 StaffSymbol \set #'transparent = ##t
5876 \remove "Time_signature_engraver"
5877 \remove "Bar_engraver"
5878 minimumVerticalExtent = ##f
5882 \remove Ligature_bracket_engraver
5883 \consists Vaticana_ligature_engraver
5884 NoteHead \set #'style = #'vaticana_punctum
5885 Stem \set #'transparent = ##t
5891 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5892 \include "gregorian-init.ly"
5894 \notes \transpose c c' {
5895 % Porrectus Auctus Descendens
5896 \[ a \flexa g \pes \auctum \descendens b \]
5903 \remove "Bar_number_engraver"
5907 \remove "Clef_engraver"
5908 \remove "Key_engraver"
5909 StaffSymbol \set #'transparent = ##t
5910 \remove "Time_signature_engraver"
5911 \remove "Bar_engraver"
5912 minimumVerticalExtent = ##f
5916 \remove Ligature_bracket_engraver
5917 \consists Vaticana_ligature_engraver
5918 NoteHead \set #'style = #'vaticana_punctum
5919 Stem \set #'transparent = ##t
5925 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5926 \include "gregorian-init.ly"
5928 \notes \transpose c c' {
5929 % Porrectus Deminutus
5930 \[ a \flexa g \pes \deminutum b \]
5937 \remove "Bar_number_engraver"
5941 \remove "Clef_engraver"
5942 \remove "Key_engraver"
5943 StaffSymbol \set #'transparent = ##t
5944 \remove "Time_signature_engraver"
5945 \remove "Bar_engraver"
5946 minimumVerticalExtent = ##f
5950 \remove Ligature_bracket_engraver
5951 \consists Vaticana_ligature_engraver
5952 NoteHead \set #'style = #'vaticana_punctum
5953 Stem \set #'transparent = ##t
5962 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5963 \include "gregorian-init.ly"
5965 \notes \transpose c c' {
5967 \[ \virga b \inclinatum a \inclinatum g \]
5974 \remove "Bar_number_engraver"
5978 \remove "Clef_engraver"
5979 \remove "Key_engraver"
5980 StaffSymbol \set #'transparent = ##t
5981 \remove "Time_signature_engraver"
5982 \remove "Bar_engraver"
5983 minimumVerticalExtent = ##f
5987 \remove Ligature_bracket_engraver
5988 \consists Vaticana_ligature_engraver
5989 NoteHead \set #'style = #'vaticana_punctum
5990 Stem \set #'transparent = ##t
5996 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
5997 \include "gregorian-init.ly"
5999 \notes \transpose c c' {
6001 \[ \virga b \inclinatum a \inclinatum \auctum g \]
6008 \remove "Bar_number_engraver"
6012 \remove "Clef_engraver"
6013 \remove "Key_engraver"
6014 StaffSymbol \set #'transparent = ##t
6015 \remove "Time_signature_engraver"
6016 \remove "Bar_engraver"
6017 minimumVerticalExtent = ##f
6021 \remove Ligature_bracket_engraver
6022 \consists Vaticana_ligature_engraver
6023 NoteHead \set #'style = #'vaticana_punctum
6024 Stem \set #'transparent = ##t
6030 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6031 \include "gregorian-init.ly"
6033 \notes \transpose c c' {
6034 % Climacus Deminutus
6035 \[ \virga b \inclinatum a \inclinatum \deminutum g \]
6042 \remove "Bar_number_engraver"
6046 \remove "Clef_engraver"
6047 \remove "Key_engraver"
6048 StaffSymbol \set #'transparent = ##t
6049 \remove "Time_signature_engraver"
6050 \remove "Bar_engraver"
6051 minimumVerticalExtent = ##f
6055 \remove Ligature_bracket_engraver
6056 \consists Vaticana_ligature_engraver
6057 NoteHead \set #'style = #'vaticana_punctum
6058 Stem \set #'transparent = ##t
6065 @code{14. Scandicus}
6067 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6068 \include "gregorian-init.ly"
6070 \notes \transpose c c' {
6072 \[ g \pes a \virga b \]
6079 \remove "Bar_number_engraver"
6083 \remove "Clef_engraver"
6084 \remove "Key_engraver"
6085 StaffSymbol \set #'transparent = ##t
6086 \remove "Time_signature_engraver"
6087 \remove "Bar_engraver"
6088 minimumVerticalExtent = ##f
6092 \remove Ligature_bracket_engraver
6093 \consists Vaticana_ligature_engraver
6094 NoteHead \set #'style = #'vaticana_punctum
6095 Stem \set #'transparent = ##t
6101 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6102 \include "gregorian-init.ly"
6104 \notes \transpose c c' {
6105 % Scandicus Auctus Descendens
6106 \[ g \pes a \pes \auctum \descendens b \]
6113 \remove "Bar_number_engraver"
6117 \remove "Clef_engraver"
6118 \remove "Key_engraver"
6119 StaffSymbol \set #'transparent = ##t
6120 \remove "Time_signature_engraver"
6121 \remove "Bar_engraver"
6122 minimumVerticalExtent = ##f
6126 \remove Ligature_bracket_engraver
6127 \consists Vaticana_ligature_engraver
6128 NoteHead \set #'style = #'vaticana_punctum
6129 Stem \set #'transparent = ##t
6135 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6136 \include "gregorian-init.ly"
6138 \notes \transpose c c' {
6139 % Scandicus Deminutus
6140 \[ g \pes a \pes \deminutum b \]
6147 \remove "Bar_number_engraver"
6151 \remove "Clef_engraver"
6152 \remove "Key_engraver"
6153 StaffSymbol \set #'transparent = ##t
6154 \remove "Time_signature_engraver"
6155 \remove "Bar_engraver"
6156 minimumVerticalExtent = ##f
6160 \remove Ligature_bracket_engraver
6161 \consists Vaticana_ligature_engraver
6162 NoteHead \set #'style = #'vaticana_punctum
6163 Stem \set #'transparent = ##t
6172 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6173 \include "gregorian-init.ly"
6175 \notes \transpose c c' {
6177 \[ g \oriscus a \pes \virga b \]
6184 \remove "Bar_number_engraver"
6188 \remove "Clef_engraver"
6189 \remove "Key_engraver"
6190 StaffSymbol \set #'transparent = ##t
6191 \remove "Time_signature_engraver"
6192 \remove "Bar_engraver"
6193 minimumVerticalExtent = ##f
6197 \remove Ligature_bracket_engraver
6198 \consists Vaticana_ligature_engraver
6199 NoteHead \set #'style = #'vaticana_punctum
6200 Stem \set #'transparent = ##t
6206 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6207 \include "gregorian-init.ly"
6209 \notes \transpose c c' {
6210 % Salicus Auctus Descendens
6211 \[ g \oriscus a \pes \auctum \descendens b \]
6218 \remove "Bar_number_engraver"
6222 \remove "Clef_engraver"
6223 \remove "Key_engraver"
6224 StaffSymbol \set #'transparent = ##t
6225 \remove "Time_signature_engraver"
6226 \remove "Bar_engraver"
6227 minimumVerticalExtent = ##f
6231 \remove Ligature_bracket_engraver
6232 \consists Vaticana_ligature_engraver
6233 NoteHead \set #'style = #'vaticana_punctum
6234 Stem \set #'transparent = ##t
6244 @lilypond[noindent, 26pt, nofragment, linewidth=1.0cm]
6245 \include "gregorian-init.ly"
6247 \notes \transpose c c' {
6249 \[ \stropha b \stropha b \stropha a \]
6256 \remove "Bar_number_engraver"
6260 \remove "Clef_engraver"
6261 \remove "Key_engraver"
6262 StaffSymbol \set #'transparent = ##t
6263 \remove "Time_signature_engraver"
6264 \remove "Bar_engraver"
6265 minimumVerticalExtent = ##f
6269 \remove Ligature_bracket_engraver
6270 \consists Vaticana_ligature_engraver
6271 NoteHead \set #'style = #'vaticana_punctum
6272 Stem \set #'transparent = ##t
6283 Unlike most other neumes notation systems, the input language for
6284 neumes does not necessarily reflect directly the typographical
6285 appearance, but is designed to solely focuse on musical meaning. For
6286 example, @code{\[ a \pes b \flexa g \]} produces a Torculus consisting
6287 of three Punctum heads, while @code{\[ a \flexa g \pes b \]} produces
6288 a torculus with a curved flexa shape and only a single Punctum head.
6289 There is no command to explicitly typeset the curved flexa shape; the
6290 decision of when to typeset a curved flexa shape is purely taken from
6291 the musical input. The idea of this approach is to separate the
6292 musical aspects of the input from the notation style of the output.
6293 This way, the same input can be reused to typeset the same music in a
6294 different style of Gregorian chant notation such as Hufnagel (also
6295 known as German gothic neumes) or Medicaea (kind of a very simple
6296 forerunner of the Editio Vaticana). As soon as Hufnagel ligature
6297 engraver and Medicaea ligature engraver will have been implemented, it
6298 will be as simple as replacing the ligature engraver in the
6299 VoiceContext to get the desired notation style from the same input.
6301 The following table shows the code fragments that produce the
6302 ligatures in the above neumes table. The letter in the first column
6303 in each line of the below table indicates to which ligature in the
6304 above table it refers. The second column gives the name of the
6305 ligature. The third column shows the code fragment that produces this
6306 ligature, using @code{g}, @code{a} and @code{b} as example pitches.
6308 @multitable @columnfractions .1 .4 .5
6322 Punctum Inclinatum @tab
6323 @code{\[ \inclinatum b \]}
6327 Punctum Auctum Ascendens @tab
6328 @code{\[ \auctum \ascendens b \]}
6332 Punctum Auctum Descendens @tab
6333 @code{\[ \auctum \descendens b \]}
6337 Punctum Inclinatum Auctum @tab
6338 @code{\[ \inclinatum \auctum b \]}
6342 Punctum Inclinatum Parvum @tab
6343 @code{\[ \inclinatum \deminutum b \]}
6348 @code{\[ \virga b \]}
6353 @code{\[ \stropha b \]}
6358 @code{\[ \stropha \auctum b \]}
6363 @code{\[ \oriscus b \]}
6367 Clivis vel Flexa @tab
6368 @code{\[ b \flexa g \]}
6372 Clivis Aucta Descendens @tab
6373 @code{\[ b \flexa \auctum \descendens g \]}
6377 Clivis Aucta Ascendens @tab
6378 @code{\[ b \flexa \auctum \ascendens g \]}
6383 @code{\[ b \flexa \deminutum g \]}
6387 Podatus vel Pes @tab
6388 @code{\[ g \pes b \]}
6392 Pes Auctus Descendens @tab
6393 @code{\[ g \pes \auctum \descendens b \]}
6397 Pes Auctus Ascendens @tab
6398 @code{\[ g \pes \auctum \ascendens b \]}
6403 @code{\[ g \pes \deminutum b \]}
6408 @code{\[ \oriscus g \pes \virga b \]}
6412 Pes Quassus Auctus Descendens @tab
6413 @code{\[ \oriscus g \pes \auctum \descendens b \]}
6418 @code{\[ \quilisma g \pes b \]}
6422 Quilisma Pes Auctus Descendens @tab
6423 @code{\[ \quilisma g \pes \auctum \descendens b \]}
6427 Pes Initio Debilis @tab
6428 @code{\[ \deminutum g \pes b \]}
6432 Pes Auctus Descendens Initio Debilis @tab
6433 @code{\[ \deminutum g \pes \auctum \descendens b \]}
6438 @code{\[ a \pes b \flexa g \]}
6442 Torculus Auctus Descendens @tab
6443 @code{\[ a \pes b \flexa \auctum \descendens g \]}
6447 Torculus Deminutus @tab
6448 @code{\[ a \pes b \flexa \deminutum g \]}
6452 Torculus Initio Debilis @tab
6453 @code{\[ \deminutum a \pes b \flexa g \]}
6457 Torculus Auctus Descendens Initio Debilis @tab
6458 @code{\[ \deminutum a \pes b \flexa \auctum \descendens g \]}
6462 Torculus Deminutus Initio Debilis @tab
6463 @code{\[ \deminutum a \pes b \flexa \deminutum g \]}
6468 @code{\[ a \flexa g \pes b \]}
6472 Porrectus Auctus Descendens @tab
6473 @code{\[ a \flexa g \pes \auctum \descendens b \]}
6477 Porrectus Deminutus @tab
6478 @code{\[ a \flexa g \pes \deminutum b \]}
6483 @code{\[ \virga b \inclinatum a \inclinatum g \]}
6487 Climacus Auctus @tab
6488 @code{\[ \virga b \inclinatum a \inclinatum \auctum g \]}
6492 Climacus Deminutus @tab
6493 @code{\[ \virga b \inclinatum a \inclinatum \deminutum g \]}
6498 @code{\[ g \pes a \virga b \]}
6502 Scandicus Auctus Descendens @tab
6503 @code{\[ g \pes a \pes \auctum \descendens b \]}
6507 Scandicus Deminutus @tab
6508 @code{\[ g \pes a \pes \deminutum b \]}
6513 @code{\[ g \oriscus a \pes \virga b \]}
6517 Salicus Auctus Descendens @tab
6518 @code{\[ g \oriscus a \pes \auctum \descendens b \]}
6523 @code{\[ \stropha b \stropha b \stropha a \]}
6529 Scandicus Deminutus: Punctum Auctum Ascendens overlaps with
6530 Semivocalis head; this looks awful.
6532 Trigonus: apply equal spacing, regardless of pitch.
6535 @subsection Figured bass
6537 @cindex Basso continuo
6539 @c TODO: musicological blurb about FB
6543 LilyPond has limited support for figured bass:
6545 @lilypond[verbatim,fragment]
6547 \context Voice \notes { \clef bass dis4 c d ais}
6548 \context FiguredBass
6550 < 6 >4 < 7 >8 < 6+ [_!] >
6556 The support for figured bass consists of two parts: there is an input
6557 mode, introduced by @code{\figures}, where you can enter bass figures
6558 as numbers, and there is a context called @internalsref{FiguredBass}
6559 that takes care of making @internalsref{BassFigure} objects.
6561 In figures input mode, a group of bass figures is delimited by
6562 @code{<} and @code{>}. The duration is entered after the @code{>}.
6567 \context FiguredBass
6571 Accidentals are added when you append @code{-}, @code{!} and @code{+}
6578 \context FiguredBass
6579 \figures { <4- 6+ 7!> }
6582 Spaces or dashes may be inserted by using @code{_}. Brackets are
6583 introduced with @code{[} and @code{]}.
6589 \context FiguredBass
6590 \figures { < [4 6] 8 [_ 12]> }
6593 Although the support for figured bass may superficially resemble chord
6594 support, it works much simpler. The @code{\figures} mode simply
6595 stores the numbers , and @internalsref{FiguredBass} context prints
6596 them as entered. There is no conversion to pitches, and no
6597 realizations of the bass are played in the MIDI file.
6599 Internally, the code produces markup texts. You can use any of the
6600 markup text properties to override formatting. For example, the
6601 vertical spacing of the figures may be set with @code{baseline-skip}.
6605 @internalsref{BassFigureEvent} music, @internalsref{BassFigure} object,
6606 @internalsref{FiguredBass} context
6610 Slash notation for alterations is not supported.
6613 @node Contemporary notation
6614 @section Contemporary notation
6616 In the 20th century, composers have greatly expanded the musical
6617 vocabulary. With this expansion, many innovations in musical notation
6618 have been tried. For a comprehensive overview, refer to @cite{Stone
6619 1980} (see @ref{Literature}). In general, the use of new, innovative
6620 notation makes a piece harder to understand and perform and its use
6621 should therefore be avoided if possible. For this reason, support for
6622 contemporary notation in LilyPond is limited.
6631 @subsection Clusters
6635 In musical terminology, a @emph{cluster} denotes a range of
6636 simultaneously sounding pitches that may change over time. The set of
6637 available pitches to apply usually depends on the accoustic source.
6638 Thus, in piano music, a cluster typically consists of a continous range
6639 of the semitones as provided by the piano's fixed set of a chromatic
6640 scale. In choral music, each singer of the choir typically may sing an
6641 arbitrary pitch within the cluster's range that is not bound to any
6642 diatonic, chromatic or other scale. In electronic music, a cluster
6643 (theoretically) may even cover a continuous range of pitches, thus
6644 resulting in coloured noise, such as pink noise.
6646 Clusters can be denoted in the context of ordinary staff notation by
6647 engraving simple geometrical shapes that replace ordinary notation of
6648 notes. Ordinary notes as musical events specify starting time and
6649 duration of pitches; however, the duration of a note is expressed by the
6650 shape of the note head rather than by the horizontal graphical extent of
6651 the note symbol. In contrast, the shape of a cluster geometrically
6652 describes the development of a range of pitches (vertical extent) over
6653 time (horizontal extent). Still, the geometrical shape of a cluster
6654 covers the area in wich any single pitch contained in the cluster would
6655 be notated as an ordinary note. From this point of view, it is
6656 reasonable to specify a cluster as the envelope of a set of notes.
6660 A cluster is engraved as the envelope of a set of
6661 cluster-notes. Cluster notes are created by applying the function
6662 @code{notes-to-clusters} to a sequence of chords, eg.
6664 @lilypond[relative 2]
6665 \apply #notes-to-clusters { << c e >> <<b f'>> }
6668 The following example (from
6669 @inputfileref{input/regression,cluster.ly}) shows what the result
6672 @lilypondfile[notexidoc]{cluster.ly}
6674 By default, @internalsref{Cluster_engraver} is in the
6675 @internalsref{Voice} context. This allows putting ordinary notes and
6676 clusters together in the same staff, even simultaneously. In such a
6677 case no attempt is made to automatically avoid collisions between
6678 ordinary notes and clusters.
6682 @internalsref{ClusterSpanner}, @internalsref{ClusterSpannerBeacon},
6683 @inputfileref{input/regression,cluster.ly},
6684 @internalsref{Cluster_engraver}, @internalsref{ClusterNoteEvent}.
6688 Music expressions like @code{< @{ g8 e8 @} a4 >} are not printed
6689 accurately. Use @code{<<g a>>8 <<e a>>8} instead.
6694 @subsection Fermatas
6700 Contemporary music notation frequently uses special fermata symbols to
6701 indicate fermatas of differing lengths.
6705 The following are supported
6707 @lilypond[singleline]
6730 \context Lyrics \lyrics {
6731 "shortfermata" "fermata" "longfermata" "verylongfermata"
6736 See @ref{Articulations} for general instructions how to apply scripts
6737 such as fermatas to a @code{\notes@{@}} block.
6740 @section Tuning output
6742 There are situations where default layout decisions are not
6743 sufficient. In this section we discuss ways to override these
6746 Formatting is internally done by manipulating so called objects (graphic
6747 objects). Each object carries with it a set of properties (object
6748 properties) specific to that object. For example, a stem object has
6749 properties that specify its direction, length and thickness.
6751 The most direct way of tuning the output is by altering the values of
6752 these properties. There are two ways of doing that: first, you can
6753 temporarily change the definition of one type of object, thus
6754 affecting a whole set of objects. Second, you can select one specific
6755 object, and set a object property in that object.
6759 * Constructing a tweak::
6768 @node Tuning objects
6769 @subsection Tuning objects
6771 @cindex object description
6773 The definition of an object is actually a list of default object
6774 properties. For example, the definition of the Stem object (available
6775 in @file{scm/define-grobs.scm}), includes the following definitions for
6780 (beamed-lengths . (0.0 2.5 2.0 1.5))
6781 (Y-extent-callback . ,Stem::height)
6786 By adding variables on top of these existing definitions, the system
6787 default is overridden, and the appearance of a layout objects is
6793 Changing a variable for only one object is commonly achieved with
6797 \once \property @var{context}.@var{objectname}
6798 \override @var{symbol} = @var{value}
6800 Here @var{symbol} is a Scheme expression of symbol type, @var{context}
6801 and @var{objectname} is a string and @var{value} is a Scheme expression.
6802 This command applies a setting only during one moment in the score.
6804 In the following example, only one @internalsref{Stem} object is
6805 changed from its original setting:
6807 @lilypond[verbatim, fragment, relative=1]
6809 \once \property Voice.Stem \set #'thickness = #4
6813 @cindex @code{\once}
6815 For changing more objects, the same command, without @code{\once} can
6818 \property @var{context}.@var{objectname} \override @var{symbol} = @var{value}
6820 This command adds @code{@var{symbol} = @var{value}} to the definition
6821 of @var{objectname} in the context @var{context}, and this definition
6822 stays in place until it is removed.
6824 An existing definition may be removed by the following command
6827 \property @var{context}.@var{objectname} \revert @var{symbol}
6830 All @code{\override} and @code{\revert} commands should be balanced.
6831 The @code{\set} shorthand, performs a revert followed by an override,
6832 and is often more convenient to use
6835 \property @var{context}.@var{objectname} \set @var{symbol} = @var{value}
6839 @lilypond[verbatim,quote]
6840 c'4 \property Voice.Stem \override #'thickness = #4.0
6842 c'4 \property Voice.Stem \revert #'thickness
6846 The following example gives exactly the same result as the previous
6847 one (assuming the system default for stem thickness is 1.3).
6849 @lilypond[verbatim,quote]
6850 c'4 \property Voice.Stem \set #'thickness = #4.0
6852 c'4 \property Voice.Stem \set #'thickness = #1.3
6856 Reverting a setting which was not set in the first place has no
6857 effect. However, if the setting was set as a system default, this may
6858 remove the default value, and this may give surprising results,
6859 including crashes. In other words, @code{\override} and
6860 @code{\revert} must be carefully balanced.
6862 These are examples of correct nesting of @code{\override}, @code{\set},
6865 A clumsy but correct form:
6867 \override \revert \override \revert \override \revert
6870 Shorter version of the same:
6872 \override \set \set \revert
6875 A short form, using only @code{\set}. This requires you to know the
6878 \set \set \set \set @var{to default value}
6881 If there is no default (i.e. by default, the object property is unset),
6884 \set \set \set \revert
6887 For the digirati, the object description is an Scheme association
6888 list. Since a Scheme list is a singly linked list, we can treat it as
6889 a stack, and @code{\override} and @code{\revert} are push and pop
6890 operations. The association list is stored in a normal context
6893 \property Voice.NoteHead = #'()
6895 will effectively erase @internalsref{NoteHead}s from the current
6896 @internalsref{Voice}. However, this mechanism is not guaranteed to
6897 work, and may cause crashes or other anomalous behavior.
6901 @internalsref{OverrideProperty}, @internalsref{RevertProperty},
6902 @internalsref{PropertySet}, @internalsref{backend properties},
6903 @internalsref{All layout objects}.
6908 The backend is not very strict in type-checking object properties.
6909 Cyclic references in @var{value} cause hangs and/or crashes.
6910 Similarly, reverting properties that are system defaults may also lead
6913 @node Constructing a tweak
6914 @subsection Constructing a tweak
6917 @cindex internal documentation
6918 @cindex finding graphical objects
6919 @cindex graphical object descriptions
6921 @cindex @code{\override}
6923 @cindex internal documentation
6927 Using @code{\override} and @code{\set}, requires three pieces of
6928 information: the name of the layout object, the context and the name
6929 of the property. We demonstrate how to glean this information from
6930 the notation manual and the generated documentation.
6932 The generated documentation is a set of HTML pages which should be
6933 included if you installed a binary distribution, typically in
6934 @file{/usr/share/doc/lilypond}. They are also available on the web:
6935 go to the @uref{LilyPond website,http://lilypond.org}, click
6936 ``Documentation: Index'' on the side bar, look in the ``Information
6937 for users'' section, and click on ``Documentation of internals.'' It
6938 is advisable to bookmark either the local HTML files if possilbe. They
6939 will load faster than the ones on the web. If you use the version
6940 from the web, you must check whether the documentation matches the
6941 program version: the documentation is generated from the definitions
6942 that the program uses, and therefore it is strongly tied to the
6946 @c [TODO: revise for new site.]
6948 Suppose we want to move the fingering indication in the fragment below
6950 @lilypond[relative=2]
6956 If you visit the documentation of @code{Fingering} (in @ref{Fingering
6957 instructions}), you will notice that it says
6962 @internalsref{FingerEvent} and @internalsref{Fingering}.
6965 This implies that the fingerings, once entered, are internally stored
6966 as @code{FingerEvent} music objects. When printed, a @code{Fingering}
6967 layout object is created for every @code{FingerEvent}.
6970 When we follow the link of @internalsref{Fingering},
6973 When we look up @internalsref{Fingering} in the generated
6976 we see a list of interfaces. The Fingering object has a number of
6977 different functions, and each of those is captured in an interface.
6979 The @code{Fingering} object has a fixed size
6980 (@internalsref{item-interface}), the symbol is a piece of text
6981 (@internalsref{text-interface}), whose font can be set
6982 (@internalsref{font-interface}). It is centered horizontally
6983 (@internalsref{self-alignment-interface}), it is placed next to other
6984 objects (@internalsref{side-position-interface}) vertically, and its
6985 placement is coordinated with other scripts
6986 (@internalsref{text-script-interface}). It also has the standard
6987 @internalsref{grob-interface} (grob stands for Graphical object)
6989 @cindex graphical object
6990 @cindex layout object
6991 @cindex object, layout
6992 with all the variables that come with
6993 it. Finally, it denotes a fingering instruction, so it has
6994 @internalsref{finger-interface}.
6996 For the vertical placement, we have to look under
6997 @code{side-position-interface}.
6999 side-position-interface
7001 Position a victim object (this one) next to other objects (the
7002 support). In this case, the direction signifies where to put the
7003 victim object relative to the support (left or right, up or down?)
7005 below this description, the variable @code{padding} is described as
7009 (dimension, in staff space)
7011 add this much extra space between objects that are next to each
7012 other. Default value: @code{0.6}
7016 By increasing the value of @code{padding}, we can move away the
7017 fingering. The following command inserts 3 staff spaces of white
7018 between the note and the fingering
7020 \once \property Voice.Fingering \set #'padding = #3
7023 Before the object is created, we get
7024 @lilypond[relative=2,fragment]
7025 \once \property Voice.Fingering
7032 The context name @code{Voice} in the example above can be determined
7033 as follows. In the documentation for @internalsref{Fingering}, it says
7035 Fingering grobs are created by: @internalsref{Fingering_engraver}
7038 Clicking @code{Fingering_engraver} shows the documentation of
7039 the module responsible for interpreting the fingering instructions and
7040 translating them to a @code{Fingering} object. Such a module is called
7041 an @emph{engraver}. The documentation of the @code{Fingering_engraver}
7044 Fingering_engraver is part of contexts: Voice and TabVoice
7046 so tuning the settings for Fingering should be done using either
7048 \property Voice.Fingering \set @dots{}
7052 \property TabVoice.Fingering \set @dots{}
7055 Since the @code{TabVoice} is only used for tab notation, we see that
7056 the first guess @code{Voice} was indeed correct.
7058 Of course, the tweak may also done in a larger context than
7059 @code{Voice}, for example, @internalsref{Staff} or
7060 @internalsref{Score}.
7062 The internals document also contains alphabetical lists of
7063 @internalsref{All contexts}, @internalsref{All layout objects} and
7064 @internalsref{All music types}, so you can also find which objects to
7065 tweak by browsing the internals document.
7069 @subsection Applyoutput
7071 The most versatile way of tuning object is @code{\applyoutput}. Its
7074 \applyoutput @var{proc}
7076 where @var{proc} is a Scheme function, taking four arguments.
7078 When interpreted, the function @var{proc} is called for every layout object found
7079 in the context, with the following arguments:
7081 @item the layout object itself
7082 @item the context where the layout object was created
7083 @item the context where @code{\applyoutput} is processed.
7086 In addition, the cause of the layout object, i.e. the music
7087 expression or object that was responsible for creating it, is in the
7088 object property @code{cause}. For example, for a note head, this is a
7089 @internalsref{NoteHead} event, and for a @internalsref{Stem} object,
7090 this is a @internalsref{NoteHead} object.
7093 @node Outputproperty
7094 @subsection Outputproperty
7096 @cindex @code{\outputproperty}
7098 Another way of tuning objects is the more arcane @code{\outputproperty}
7099 feature. The syntax is as follows:
7101 \outputproperty @var{predicate} @var{symbol} = @var{value}
7103 Here @code{predicate} is a Scheme function taking an object argument, and
7104 returning a boolean. This statement is processed by the
7105 @code{Output_property_engraver}. It instructs the engraver to feed all
7106 objects that it sees to @var{predicate}. Whenever the predicate returns
7107 true, the object property @var{symbol} will be set to @var{value}.
7109 You will need to combine this statement with @code{\context} to select
7110 the appropriate context to apply this to.
7111 @inputfileref{input/regression,output-property.ly} shows an example of
7112 the use of @code{\outputproperty}.
7116 If possible, avoid this feature: the semantics are not very clean, and
7117 the syntax and semantics are up for rewrite.
7120 @node Font selection
7121 @subsection Font selection
7123 The most common thing to change about the appearance of fonts is
7124 their size. The font size of any context can be easily
7125 changed by setting the @code{fontSize} property for that context:
7127 @lilypond[fragment,relative=1,verbatim,quote]
7128 c4 c4 \property Voice.fontSize = #-1
7131 This command will set @code{font-relative-size} (see below),
7132 and does not change the size of variable symbols, such as
7133 beams or slurs. You can use this command to get smaller symbol for
7134 cue notes, but that involves some more subtleties. An elaborate
7135 example of those is in @inputfileref{input/test,cue-notes.ly}.
7137 @cindex magnification
7139 The size of the font may be scaled with the object property
7140 @code{font-magnification}. For example, @code{2.0} blows up all
7141 letters by a factor 2 in both directions.
7150 The font used for printing a object can be selected by setting
7151 @code{font-name}, e.g.
7153 \property Staff.TimeSignature
7154 \set #'font-name = #"cmr17"
7156 You may use any font which is available to @TeX{}, such as foreign
7157 fonts or fonts that do not belong to the Computer Modern font family.
7159 Font selection for the standard fonts, @TeX{}'s Computer Modern fonts,
7160 can also be adjusted with a more fine-grained mechanism. By setting
7161 the object properties described below, you can select a different font.
7162 All three mechanisms work for every object that supports
7163 @code{font-interface}.
7167 A symbol indicating the general class of the typeface. Supported are
7168 @code{roman} (Computer Modern), @code{braces} (for piano staff
7169 braces), @code{music} (the standard music font, including ancient
7170 glyphs), @code{dynamic} (for dynamic signs) and @code{typewriter}.
7173 A symbol indicating the shape of the font, there are typically several
7174 font shapes available for each font family. Choices are @code{italic},
7175 @code{caps} and @code{upright}
7178 A symbol indicating the series of the font. There are typically several
7179 font series for each font family and shape. Choices are @code{medium}
7182 @item font-relative-size
7183 A number indicating the size relative the standard size. For example,
7184 with 20pt staff height, relative size -1 corresponds to 16pt staff
7185 height, and relative size +1 corresponds to 23 pt staff height.
7187 There are small differences in design between fonts designed for
7188 different sizes, hence @code{font-relative-size} is preferred over
7189 @code{font-magnification} for changing font sizes.
7192 @item font-design-size
7193 A number indicating the design size of the font.
7195 This is a feature of the Computer Modern Font: each point size has a
7196 slightly different design. Smaller design sizes are relatively wider,
7197 which enhances readability.
7200 For any of these properties, the value @code{*} (i.e. the symbol
7201 @code{*}, entered as @code{#'*}), acts as a wildcard. This can be used
7202 to override default setting, which are always present. For example:
7204 \property Lyrics.LyricText \override #'font-series = #'bold
7205 \property Lyrics.LyricText \override #'font-family = #'typewriter
7206 \property Lyrics.LyricText \override #'font-shape = #'*
7209 @cindex @code{font-style}
7213 The following commands set @code{fontSize} for the current voice.
7215 @cindex @code{\tiny}
7217 @cindex @code{\small}
7219 @cindex @code{\normalsize}
7224 Relative size is not linked to any real size.
7226 There is no style sheet provided for other fonts besides the @TeX{}
7227 family, and the style sheet cannot be modified easily.
7229 @cindex font selection
7230 @cindex font magnification
7231 @cindex @code{font-interface}
7235 @subsection Text markup
7240 @cindex typeset text
7242 LilyPond has an internal mechanism to typeset texts. You can access it
7243 with the keyword @code{\markup}. Within markup mode, you can enter texts
7244 similar to lyrics: simply enter them, surrounded by spaces.
7247 @lilypond[verbatim,fragment,relative=1]
7248 c1^\markup { hello }
7249 c1_\markup { hi there }
7250 c1^\markup { hi \bold there, is \italic anyone home? }
7253 @cindex font switching
7255 The line of the example demonstrates font switching commands. The
7256 command only apply to the first following word; enclose a set of texts
7257 with braces to apply a command to more words.
7259 \markup @{ \bold @{ hi there @} @}
7261 For clarity, you can also do this for single arguments, e.g.
7263 \markup @{ is \italic @{ anyone @} home @}
7266 @cindex font size, texts
7268 The following size commands set abolute sizes
7270 @cindex @code{\teeny}
7271 @cindex @code{\tiny}
7272 @cindex @code{\small}
7273 @cindex @code{\large}
7274 @cindex @code{\huge}
7284 You can also make letter larger or smaller relative to their neighbors,
7285 with the commands @code{\larger} and @code{\smaller}.
7289 @cindex font style, for texts
7290 @cindex @code{\bold}
7291 @cindex @code{\dynamic}
7292 @cindex @code{\number}
7293 @cindex @code{\italic}
7295 The following font change commands are defined:
7298 This changes to the font used for dynamic signs. This font does not
7299 contain all characters of the alphabet, so when producing ``piu f'',
7300 the ``piu'' should be done in a different font.
7304 This changes to the font used for time signatures. It only contains
7305 numbers and a few punctuation marks.
7307 Changes @code{font-shape} to @code{italic}
7309 Changes @code{font-series} to @code{bold}
7312 @cindex raising text
7313 @cindex lowering text
7315 @cindex translating text
7318 @cindex @code{\super}
7320 Raising and lowering texts can be done with @code{\super} and
7323 @lilypond[verbatim,fragment,relative=1]
7324 c1^\markup { E "=" mc \super "2" }
7327 @cindex @code{\raise}
7329 If you want to give an explicit amount for lowering or raising, use
7330 @code{\raise}. This command takes a Scheme valued first argument, and
7331 a markup object as second argument
7333 @lilypond[verbatim,fragment,relative=1,quote]
7334 c1^\markup { C \small \raise #1.0 \bold { "9/7+" }}
7336 The argument to @code{\raise} is the vertical displacement amount,
7337 measured in (global) staff spaces.
7339 Other commands taking single arguments include
7342 @item \bracket, \hbracket
7343 Bracket the argument markup with normal and horizontal brackets
7347 @cindex @code{\musicglyph}
7348 This is converted to a musical symbol, e.g. @code{\musicglyph
7349 #"accidentals-0"} will select the natural sign from the music font.
7350 See @ref{The Feta font} for a complete listing of the possible glyphs.
7352 This produces a single character, e.g. @code{\char #65} produces the
7356 @cindex @code{\note @var{log} @var{dots} @var{dir}}
7358 This produces a note with a stem pointing in @var{dir} direction, with
7359 duration log @var{log} and @var{dots} augmentation dots.
7361 @item \hspace #@var{amount}
7362 @cindex @code{\hspace}
7363 This produces a invisible object taking horizontal space.
7365 \markup @{ A \hspace #2.0 B @}
7367 will put extra space between A and B, on top of the space that is
7368 normally inserted before elements on a line.
7370 @item \fontsize #@var{size}
7371 @cindex @code{\fontsize}
7372 This sets the relative font size, eg.
7374 A \fontsize #2 @{ B C @} D
7378 This will enlarge the B and the C by two steps.
7379 @item \translate #(cons @var{x} @var{y})
7381 This translates an object. Its first argument is a cons of numbers
7383 A \translate #(cons 2 -3) @{ B C @} D
7385 This moves `B C' 2 spaces to the right, and 3 down.
7387 @item \magnify #@var{mag}
7388 @cindex @code{\magnify}
7389 This sets the font magnification for the its argument. In the following
7390 example, the middle A will be 10% larger.
7392 A \magnify #1.1 @{ A @} A
7396 @item \override #(@var{key} . @var{value})
7397 @cindex @code{\override}
7398 This overrides a formatting property for its argument. The argument
7399 should be a key/value pair, e.g.
7401 m \override #'(font-family . math) m m
7405 In markup mode you can compose expressions, similar to mathematical
7406 expressions, XML documents and music expressions. The braces group
7407 notes into horizontal lines. Other types of lists also exist: you can
7408 stack expressions grouped with @code{<<}, and @code{>>} vertically with
7409 the command @code{\column}. Similarly, @code{\center} aligns texts by
7412 @lilypond[verbatim,fragment,relative=1]
7413 c1^\markup { \column << a bbbb c >> }
7414 c1^\markup { \center << a bbbb c >> }
7415 c1^\markup { \line << a b c >> }
7418 The markup mechanism is extensible. Refer to
7419 @file{scm/new-markup.scm} for more information on extending the markup
7426 @internalsref{Markup functions}, @file{scm/new-markup.scm}
7433 Text layout is ultimately done by @TeX{}, which does kerning of
7434 letters. LilyPond does not account for kerning, so texts will be
7435 spaced slightly too wide.
7437 Syntax errors for markup mode are confusing.
7441 @section Global layout
7443 The global layout determined by three factors: the page layout, the
7444 line breaks and the spacing. These all influence each other. The
7445 choice of spacing determines how densely each system of music is set,
7446 which influences where line breaks breaks are chosen, and thus
7447 ultimately how many pages a piece of music takes. In this section, the
7448 algorithm for spacing music is explained, and how spacing can be
7451 Globally spoken, this procedure happens in three steps: first,
7452 flexible distances (``springs'') are chosen, based on durations. All
7453 possible line breaking combination are tried, and the one with the
7454 best results---a layout that has uniform density and requires as
7455 little stretching or cramping as possible---is chosen. When the score
7456 is processed by @TeX{}, each page is filled with systems, and page breaks
7457 are chosen whenever the page gets full.
7462 * Vertical spacing::
7463 * Horizontal spacing::
7470 @node Vertical spacing
7471 @subsection Vertical spacing
7473 @cindex vertical spacing
7474 @cindex distance between staves
7475 @cindex staff distance
7476 @cindex between staves, distance
7477 @cindex staffs per page
7480 The height of each system is determined automatically by lilypond, to
7481 keep systems from bumping into each other, some minimum distances are
7482 set. By changing these, you can put staves closer together, and thus
7483 put more systems onto one page.
7485 Normally staves are stacked vertically. To make
7486 staves maintain a distance, their vertical size is padded. This is
7487 done with the property @code{minimumVerticalExtent}. It takes a pair
7488 of numbers, so if you want to make it smaller from its, then you could
7491 \property Staff.minimumVerticalExtent = #'(-4 . 4)
7493 This sets the vertical size of the current staff to 4 staff-space on
7494 either side of the center staff line. The argument of
7495 @code{minimumVerticalExtent} is interpreted as an interval, where the
7496 center line is the 0, so the first number is generally negative. The
7497 staff can be made larger at the bottom by setting it to @code{(-6
7500 The piano staves are handled a little differently: to make cross-staff
7501 beaming work correctly, it necessary that the distance between staves
7502 is fixed beforehand. This is also done with a
7503 @internalsref{VerticalAlignment} object, created in
7504 @internalsref{PianoStaff}. In this object the distance between the
7505 staves is fixed by setting @code{forced-distance}. If you want to
7506 override this, use a @code{\translator} block as follows:
7510 VerticalAlignment \override #'forced-distance = #9
7513 This would bring the staves together at a distance of 9 staff spaces,
7514 measured from the center line of each staff.
7518 Vertical aligment of staves is handled by the
7519 @internalsref{VerticalAlignment} object.
7523 @node Horizontal spacing
7524 @subsection Horizontal Spacing
7526 The spacing engine translates differences in durations into
7527 stretchable distances (``springs'') of differing lengths. Longer
7528 durations get more space, shorter durations get less. The shortest
7529 durations get a fixed amount of space (which is controlled by
7530 @code{shortest-duration-space} in the @internalsref{SpacingSpanner}
7531 object). The longer the duration, the more space it gets: doubling a
7532 duration adds a fixed amount (this amount is controlled by
7533 @code{spacing-increment}) of space to the note.
7535 For example, the following piece contains lots of half, quarter and
7536 8th notes, the eighth note is followed by 1 note head width (NHW).
7537 The quarter note is followed by 2 NHW, the half by 3 NHW, etc.
7538 @lilypond[fragment, verbatim, relative=1] c2 c4. c8 c4. c8 c4. c8 c8
7542 Normally, @code{shortest-duration-space} is set to 1.2, which is the
7543 width of a note head, and @code{shortest-duration-space} is set to
7544 2.0, meaning that the shortest note gets 2 NHW (2 times
7545 @code{shortest-duration-space}) of space. For normal notes, this space
7546 is always counted from the left edge of the symbol, so the shortest
7547 notes are generally followed by one NHW of space.
7549 If one would follow the above procedure exactly, then adding a single
7550 32th note to a score that uses 8th and 16th notes, would widen up the
7551 entire score a lot. The shortest note is no longer a 16th, but a 32nd,
7552 thus adding 2 noteheads of space to every note. To prevent this, the
7553 shortest duration for spacing is not the shortest note in the score,
7554 but the most commonly found shortest note. Notes that are even
7555 shorter this are followed by a space that is proportonial to their
7556 duration relative to the common shortest note. So if we were to add
7557 only a few 16th notes to the example above, they would be followed by
7560 @lilypond[fragment, verbatim, relative=2]
7561 c2 c4. c8 c4. c16-[ c-] c4. c8 c8 c8 c4 c4 c4
7564 The most common shortest duration is determined as follows: in every
7565 measure, the shortest duration is determined. The most common short
7566 duration, is taken as the basis for the spacing, with the stipulation
7567 that this shortest duration should always be equal to or shorter than
7568 1/8th note. The shortest duration is printed when you run lilypond
7569 with @code{--verbose}. These durations may also be customized. If you
7570 set the @code{common-shortest-duration} in
7571 @internalsref{SpacingSpanner}, then this sets the base duration for
7572 spacing. The maximum duration for this base (normally 1/8th), is set
7573 through @code{base-shortest-duration}.
7575 @cindex @code{common-shortest-duration}
7576 @cindex @code{base-shortest-duration}
7577 @cindex @code{stem-spacing-correction}
7578 @cindex @code{spacing}
7580 In the introduction it was explained that stem directions influence
7581 spacing. This is controlled with @code{stem-spacing-correction}
7582 property in @internalsref{NoteSpacing}, which are generated for every
7583 @internalsref{Voice} context. The @code{StaffSpacing} object
7584 (generated at @internalsref{Staff} context) contains the same property
7585 for controlling the stem/barline spacing. The following example
7586 shows these corrections, once with default settings, and once with
7587 exaggerated corrections.
7593 \property Staff.NoteSpacing \override #'stem-spacing-correction
7595 \property Staff.StaffSpacing \override #'stem-spacing-correction
7600 \paper { raggedright = ##t } }
7603 @cindex SpacingSpanner, overriding properties
7605 Properties of the @internalsref{SpacingSpanner} must be overridden
7606 from the @code{\paper} block, since the @internalsref{SpacingSpanner}
7607 is created before any @code{\property} statements are interpreted.
7609 \paper @{ \translator @{
7611 SpacingSpanner \override #'spacing-increment = #3.0
7618 @internalsref{SpacingSpanner}, @internalsref{NoteSpacing},
7619 @internalsref{StaffSpacing}, @internalsref{SeparationItem},
7620 @internalsref{SeparatingGroupSpanner}.
7624 Spacing is determined on a score wide basis. If you have a score that
7625 changes its character (measured in durations) halfway during the
7626 score, the part containing the longer durations will be spaced too
7629 There is no convenient mechanism to manually override spacing.
7634 @subsection Font size
7635 @cindex font size, setting
7636 @cindex staff size, setting
7637 @cindex @code{paper} file
7639 The Feta font provides musical symbols at seven different sizes.
7640 These fonts are 11 point, 13 point, 16 point, 20 point, 23 point, and
7641 26 point. The point size of a font is the height of the corresponding
7642 staff (excluding line thicknesses).
7644 Definitions for these sizes are the files @file{paperSZ.ly}, where
7645 @code{SZ} is one of 11, 13, 16, 20, 23 and 26. If you include any
7646 of these files, the variables @code{paperEleven},
7647 @code{paperThirteen}, @code{paperSixteen},
7648 @code{paperTwenty}, @code{paperTwentythree}, and @code{paperTwentysix}
7649 are defined respectively. The default @code{\paper} block is also
7650 set. These files should be imported at toplevel, i.e.
7652 \include "paper26.ly"
7656 The font definitions are generated using a Scheme function. For more
7657 details, see the file @file{scm/font.scm}.
7662 @subsection Line breaking
7665 @cindex breaking lines
7667 Line breaks are normally computed automatically. They are chosen such
7668 that lines look neither cramped nor loose, and that consecutive lines
7669 have similar density.
7671 Occasionally you might want to override the automatic breaks; you can
7672 do this by specifying @code{\break}. This will force a line break at
7673 this point. Line breaks can only occur at places where there are bar
7674 lines. If you want to have a line break where there is no bar line,
7675 you can force an invisible bar line by entering @code{\bar
7676 ""}. Similarly, @code{\noBreak} forbids a line break at a
7680 @cindex regular line breaks
7681 @cindex four bar music.
7683 If you want linebreaks at regular intervals, you can use the following:
7685 < \repeat unfold 7 @{ s1 * 4 \break @}
7686 @emph{the real music}
7689 This makes the following 28 measures (assuming 4/4 time) be broken every
7694 @internalsref{BreakEvent}
7698 @subsection Page layout
7701 @cindex breaking pages
7703 @cindex @code{indent}
7704 @cindex @code{linewidth}
7706 The most basic settings influencing the spacing are @code{indent} and
7707 @code{linewidth}. They are set in the @code{\paper} block. They
7708 control the indentation of the first line of music, and the lengths of
7711 If @code{raggedright} is set to true in the @code{\paper}
7712 block, then the lines are justified at their natural length. This
7713 useful for short fragments, and for checking how tight the natural
7717 @cindex vertical spacing
7719 The page layout process happens outside the LilyPond formatting
7720 engine: variables controlling page layout are passed to the output,
7721 and are further interpreted by @code{ly2dvi}. @code{ly2dvi} responds
7722 to the following variables in the @code{\paper} block. The variable
7723 @code{textheight} sets the total height of the music on each page.
7724 The spacing between systems is controlled with @code{interscoreline},
7725 its default is 16pt. The distance between the score lines will
7726 stretch in order to fill the full page @code{interscorelinefill} is
7727 set to a positive number. In that case @code{interscoreline}
7728 specifies the minimum spacing.
7730 @cindex @code{textheight}
7731 @cindex @code{interscoreline}
7732 @cindex @code{interscorelinefill}
7734 If the variable @code{lastpagefill} is defined,
7735 @c fixme: this should only be done if lastpagefill == #t
7736 systems are evenly distributed vertically on the last page. This
7737 might produce ugly results in case there are not enough systems on the
7738 last page. The @command{lilypond-book} command ignores
7739 @code{lastpagefill}. See @ref{lilypond-book manual} for more
7742 @cindex @code{lastpagefill}
7744 Page breaks are normally computed by @TeX{}, so they are not under
7745 direct control of LilyPond. However, you can insert a commands into
7746 the @file{.tex} output to instruct @TeX{} where to break pages. This
7747 is done by setting the @code{between-systems-strings} on the
7748 @internalsref{NonMusicalPaperColumn} where the system is broken.
7749 An example is shown in @inputfileref{input/regression,between-systems.ly}.
7750 The predefined command @code{\newpage} also does this.
7754 @cindex @code{papersize}
7756 To change the paper size, you must first set the
7757 @code{papersize} paper variable variable. Set it to
7758 the strings @code{a4}, @code{letter}, or @code{legal}. After this
7759 specification, you must set the font as described above. If you want
7760 the default font, then use the 20 point font.
7763 \paper@{ papersize = "a4" @}
7764 \include "paper16.ly"
7767 The file @code{paper16.ly} will now include a file named @file{a4.ly}, which
7768 will set the paper variables @code{hsize} and @code{vsize} (used by
7769 Lilypond and @code{ly2dvi})
7774 @cindex @code{\newpage}
7780 @ref{Invoking ly2dvi},
7781 @inputfileref{input/regression,between-systems.ly},
7782 @internalsref{NonMusicalPaperColumn}.
7786 There is no concept of page breaking, which makes it difficult to
7787 choose sensible page breaks in multi-page pieces.
7796 Entered music can also be converted to MIDI output. The performance
7797 is good enough for proof-hearing the music for errors.
7799 Ties, dynamics and tempo changes are interpreted. Dynamic marks,
7800 crescendi and decrescendi translate into MIDI volume levels. Dynamic
7801 marks translate to a fixed fraction of the available MIDI volume
7802 range, crescendi and decrescendi make the volume vary linearly between
7803 their two extremities. The fractions be adjusted by
7804 @code{dynamicAbsoluteVolumeFunction} in @internalsref{Voice} context.
7805 For each type of MIDI instrument, a volume range can be defined. This
7806 gives you basic equalizer control, which can enhance the quality of
7807 the MIDI output remarkably. The equalizer can be controlled by
7808 setting @code{instrumentEqualizer}.
7812 Many musically interesting effects, such as swing, articulation,
7813 slurring, etc., are not translated to MIDI.
7818 * MIDI instrument names::
7823 @subsection MIDI block
7827 The MIDI block is analogous to the paper block, but it is somewhat
7828 simpler. The @code{\midi} block can contain:
7832 @item a @code{\tempo} definition
7833 @item context definitions
7836 Assignments in the @code{\midi} block are not allowed.
7840 @cindex context definition
7842 Context definitions follow precisely the same syntax as within the
7843 \paper block. Translation modules for sound are called performers.
7844 The contexts for MIDI output are defined in @file{ly/performer-init.ly}.
7847 @node MIDI instrument names
7848 @subsection MIDI instrument names
7850 @cindex instrument names
7851 @cindex @code{Staff.midiInstrument}
7852 @cindex @code{Staff.instrument}
7854 The MIDI instrument name is set by the @code{Staff.midiInstrument}
7855 property or, if that property is not set, the @code{Staff.instrument}
7856 property. The instrument name should be chosen from the list in
7857 @ref{MIDI instruments}.
7861 If the selected string does not exactly match, then LilyPond uses the
7862 default (Grand Piano). It is not possible to select an instrument by