4 @c A menu is needed before every deeper *section nesting of @nodes
5 @c Run M-x texinfo-all-menus-update
6 @c to automagically fill in these menus
7 @c before saving changes
18 @c .{Reference Manual}
20 @node Reference Manual
21 @chapter Reference Manual
23 This document describes GNU LilyPond and its input format. The last
24 revision of this document was made for LilyPond 1.4.1. It supposes a
25 passing familiarity with how LilyPond input works. New users are
26 encouraged to study the tutorial first.
28 The reference manual is ordered according to different tasks.
29 More details on the property setting mechanisms and context handling is
30 provided in @ref{Tuning output} and @ref{Interpretation context}. The
31 syntactical details are described at the end of the manual.
53 * Skipping corrected music::
54 * Interpretation context::
64 The purpose of LilyPond is explained informally by the term `music
65 typesetter'. This is not a fully correct name: not only does the
66 program print musical symbols, it also makes aesthetic decisions.
67 Symbols and their placements are @emph{generated} from a high-level
68 musical description. In other words, LilyPond would be best described
69 by `music compiler' or `music to notation compiler'.
71 LilyPond is linked to GUILE, GNU's Scheme library for extension
72 programming. The Scheme library provides the glue that holds together
73 the low-level routines and separate modules which are written in C++.
75 When lilypond is run to typeset sheet music, the following happens:
77 @item GUILE Initialization: various scheme files are read
78 @item parsing: first standard @code{ly} initialization files are read, and
79 then the user @file{ly} file is read.
80 @item interpretation: the music in the file is processed ``in playing
81 order'', i.e. the order that you use to read sheet music, or the
82 order in which notes are played. The result of this step is a typesetting
86 The typesetting specification is solved: positions and formatting is
89 @item the visible results ("virtual ink") are written to the output file.
92 During these stages different types of data play the the main role:
93 during parsing, @strong{Music} objects are created. During the
94 interpretation, @strong{contexts} are constructed, and with these contexts
95 a network of @strong{graphical objects} (``grobs'') is created. These
96 grobs contain unknown variables, and the network forms a set of
97 equations. After solving the equations and filling in these variables,
98 the printed output (in the form of @strong{molecules}) is written to an
101 These threemanship of tasks (parsing, translating, typesetting) and
102 data-structures (music, context, graphical objects) permeates the entire
103 design of the program.
110 The most basic forms of music are notes. We discuss how you enter them
111 here. Notes on their own don't form valid input, but for the sake of
112 brevity we omit obligatory lint such as @code{\score} blocks and
113 @code{\paper} declarations.
124 * Defining pitch names::
125 * Easy Notation note heads ::
132 A note specification has the form
135 @var{pitch}[!][?][@var{duration}]
138 The alteration refers to what note is heard, not to whether an
139 accidental is printed. This is done depending on the key and context.
140 A reminder accidental
141 @cindex reminder accidental
143 can be forced by adding an exclamation mark @code{!} after the pitch. A
144 cautionary accidental,
145 @cindex cautionary accidental
146 @cindex parenthesized accidental
147 i.e., an accidental within parentheses can be obtained by adding the
148 question mark `@code{?}' after the pitch.
150 @lilypond[fragment,verbatim,center]
151 cis' d' e' cis' c'? d' e' c'!
160 @cindex Note specification
162 @cindex entering notes
164 The verbose syntax for pitch specification is
166 @cindex @code{\pitch}
168 \pitch @var{scmpitch}
171 @var{scmpitch} is a pitch scheme object, see @ref{Pitch data type}.
173 In Note and Chord mode, pitches may be designated by names. The default
174 names are the Dutch note names. The notes are specified by the letters
175 @code{a} through @code{g} (where the octave is formed by notes ranging
176 from @code{c} to @code{b}). The pitch @code{c} is an octave below
177 middle C and the letters span the octave above that C.
179 @cindex note names, Dutch
181 In Dutch, a sharp is formed by adding @code{-is} to the end of a pitch
182 name and a flat is formed by adding @code{-es}. Double sharps and double
183 flats are obtained by adding @code{-isis} or @code{-eses}. @code{aes}
184 and @code{ees} are contracted to @code{as} and @code{es} in Dutch, but
185 both forms are accepted.
187 LilyPond has predefined sets of note names for various other languages.
188 To use them, simply include the language specific init file. For
189 example: @code{\include "english.ly"}. The available language files and
190 the names they define are:
193 Note Names sharp flat
194 nederlands.ly c d e f g a bes b -is -es
195 english.ly c d e f g a bf b -s/-sharp -f/-flat
196 deutsch.ly c d e f g a b h -is -es
197 norsk.ly c d e f g a b h -iss/-is -ess/-es
198 svenska.ly c d e f g a b h -iss -ess
199 italiano.ly do re mi fa sol la sib si -d -b
200 catalan.ly do re mi fa sol la sib si -d/-s -b
208 The optional octave specification takes the form of a series of
209 single quote (`@code{'}') characters or a series of comma
210 (`@code{,}') characters. Each @code{'} raises the pitch by one
211 octave; each @code{,} lowers the pitch by an octave.
213 @lilypond[fragment,verbatim,center]
214 c' c'' es' g' as' gisis' ais'
222 Rests are entered like notes, with note name `@code{r}'. The grob is
223 @code{Rest}. Whole bar rests centered in the bar are specified using
224 @code{R}, see @ref{Multi measure rests}.
239 Skips the amount of time specified by @var{duration}. If no other music
240 is played, a gap will be left for the skipped time without any notes
241 printed. The shorthand is only available in Note and Chord mode.
245 @subsection Durations
249 @cindex @code{\duration}
251 The syntax for a verbose duration specification is
253 \duration @var{scmduration}
255 Here, @var{scmduration} is a Scheme object of type @code{Duration}. See
256 @ref{Duration} for more information.
259 In Note, Chord, and Lyrics mode, durations may be designated by numbers
260 and dots: durations are entered as their reciprocal values. For notes
261 longer than a whole you must use identifiers.
265 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64
267 r1 r2 r4 r8 r16 r32 r64 r64
273 \notes \relative c'' {
275 a1 a2 a4 a8 a16 a32 a64 a64
277 r1 r2 r4 r8 r16 r32 r64 r64
282 \remove "Clef_engraver"
283 \remove "Staff_symbol_engraver"
284 \remove "Time_signature_engraver"
285 \consists "Pitch_squash_engraver"
291 To get a longa note head, you have to use mensural note heads. This
292 is accomplished by setting the @code{style} property of the
293 NoteHead grob to @code{mensural}. There is also a note head style
294 @code{baroque} which gives mensural note heads for @code{\longa} and
295 @code{\breve} but standard note heads for shorter notes.
297 @lilypond[fragment,singleline,verbatim]
298 \property Voice.NoteHead \set #'style = #'mensural
302 If the duration is omitted then it is set to the previous duration
303 entered. At the start of parsing a quarter note is assumed. The
304 duration can be followed by dots (`@code{.}') to obtain dotted note
308 @lilypond[fragment,verbatim,center]
314 You can alter the length of duration by a fraction @var{N/M} by
315 appending `@code{*}@var{N/M}' (or `@code{*}@var{N}' if @var{M=1}). This
316 will not affect the appearance of the notes or rests produced.
328 A tie connects two adjacent note heads of the same pitch. When used
329 with chords, it connects all the note heads whose pitches match.
330 Ties are indicated using the tilde symbol `@code{~}'. If you try to tie
331 together chords which have no common pitches then no ties will be
334 @lilypond[fragment,verbatim,center]
335 e' ~ e' <c' e' g'> ~ <c' e' g'>
338 If you dislike the amount of ties created for a chord, you set
339 @code{Voice.sparseTies} to true, resulting in a smaller number of
341 @lilypond[fragment,verbatim,center]
342 \property Voice.sparseTies = ##t
343 <c' e' g'> ~ <c' e' g'>
346 In its meaning a tie is just a way of extending a note duration, similar
347 to the augmentation dot: the following example are two ways of notating
348 exactly the same concept.
350 @lilypond[fragment, singleline]
351 \time 3/4 c'2. c'2 ~ c'4
354 The name of the tie grob is @code{Voice.Tie}.
358 At present, the tie is implemented as a separate thing, temporally
359 located in between the notes. There is also no way to convert
360 between tied notes, dotted notes and plain notes.
362 Tieing only a subset of the note heads of a chord is not supported in a
363 simple way. It can be achieved by moving the tie-engraver into the Thread
364 context and turning on and off ties per Thread.
372 @cindex @code{\times}
374 Tuplets are made out of a music expression by multiplying all duration
377 @cindex @code{\times}
379 \times @var{fraction} @var{musicexpr}
382 The duration of @var{musicexpr} will be multiplied by the fraction.
383 In print, the fraction's denominator will be printed over the notes,
384 optionally with a bracket. The most common tuplet is the triplet in
385 which 3 notes have the length of 2, so the notes are 2/3 of
386 their written length:
388 @lilypond[fragment,verbatim,center]
389 g'4 \times 2/3 {c'4 c' c'} d'4 d'4
392 The property @code{tupletSpannerDuration} specifies how long each bracket
393 should last. With this, you can make lots of tuplets while typing
394 @code{\times} only once, thus saving typing work.
396 @lilypond[fragment, relative, singleline, verbatim]
397 \property Voice.tupletSpannerDuration = #(make-moment 1 4)
398 \times 2/3 { c'8 c c c c c }
401 The format of the number is determined by the property
402 @code{tupletNumberFormatFunction}. The default prints only the
403 denominator, but if you set it to the Scheme function
404 @code{fraction-tuplet-formatter}, Lilypond will print @var{num}:@var{den}
407 The typesetting of brackets and numbers is controlled by the properties
408 @code{tuplet-bracket-visibility} and @code{tuplet-number-visibility}.
410 @lilypond[fragment, relative, singleline, verbatim]
411 \property Voice.TupletBracket \set #'tuplet-bracket-visibility = ##t
412 \times 2/3{c'8 d e} \times 2/3{d4 e8}
413 \property Voice.TupletBracket \set #'tuplet-bracket-visibility = #'if-no-beam
414 \times 2/3{c d e} \times 2/3{d4 e8}
415 \property Voice.TupletBracket \set #'tuplet-bracket-visibility = ##f
416 \times 2/3{c d e} \times 2/3{d4 e8}
417 \property Voice.TupletBracket \set #'tuplet-number-visibility = ##f
418 \times 2/3{c d e} \times 2/3{d4 e8}
419 \property Voice.TupletBracket \set #'tuplet-number-visibility = #'if-no-beam
420 \times 2/3{c d e} \times 2/3{d4 e8}
423 @cindex @code{tupletNumberFormatFunction}
424 @cindex tuplet formatting
426 Tuplet brackets are printed as @code{TupletBracket} grobs
428 @c . {Defining pitch names}
429 @node Defining pitch names
430 @subsection Defining pitch names
432 @cindex defining pitch names
433 @cindex pitch names, defining
435 Note names and chord modifiers can be customized for nationalities. The
436 syntax is as follows.
438 @cindex @code{\pitchnames}
439 @cindex @code{\chordmodifiers}
441 \pitchnames @var{scheme-alist}
442 \chordmodifiers @var{scheme-alist}
445 See @file{ly/nederlands.ly} and @file{ly/chord-modifiers.ly} for
446 specific examples on how to do this.
449 @node Easy Notation note heads
450 @subsection Easy Notation note heads
452 @cindex easy notation
455 A entirely different type of note head is the "easyplay" note head: a
456 note head that includes a note name. It is used in some publications by
457 Hal-Leonard Inc. music publishers.
459 @lilypond[singleline,verbatim]
460 \include "paper23.ly"
462 \notes { c'2 e'4 f' | g'1 }
463 \paper { \translator { \EasyNotation } }
467 Note that @code{EasyNotation} overrides a @code{Score} context. You
468 probably will want to print it with magnification to make it more
469 readable, see @ref{Output scaling}.
475 If you view the result with Xdvi, then staff lines will show through the
476 letters. Printing the postscript file obtained either by using dvips or
477 the @code{-f ps} option of lilypond produces the correct result.
482 @section Staff notation
484 @cindex Staff notation
496 @subsection Key signature
501 Setting or changing the key signature is done with the @code{\key}
504 @code{\key} @var{pitch} @var{type}
507 @cindex @code{\minor}
508 @cindex @code{\major}
509 @cindex @code{\minor}
510 @cindex @code{\ionian}
511 @cindex @code{\locrian}
512 @cindex @code{\aeolian}
513 @cindex @code{\mixolydian}
514 @cindex @code{\lydian}
515 @cindex @code{\phrygian}
516 @cindex @code{\dorian}
518 Here, @var{type} should be @code{\major} or @code{\minor} to get
519 @var{pitch}-major or @var{pitch}-minor, respectively.
520 The standard mode names @code{\ionian},
521 @code{\locrian}, @code{\aeolian}, @code{\mixolydian}, @code{\lydian},
522 @code{\phrygian}, and @code{\dorian} are also defined.
524 This command sets the context property @code{Staff.keySignature}.
525 Non-standard key signatures can be specified by setting this property
526 directly, see the generated documentation for @rgrob{KeySignature}.
528 The printed signature is a @code{KeySignature} grob.
530 @cindex @code{keySignature}
537 The clef can be set or changed with the @code{\clef} command.
545 \property Staff.clefGlyph = @var{glyph associated with clefname}
546 \property Staff.clefPosition = @var{clef Y-position for clefname}
547 \property Staff.centralCPosition = @var{position for central C}
548 \property Staff.clefOctavation = @var{extra transposition of clefname}
551 Any change in these properties creates a clef (a @code{Clef} grob).
553 Supported clef-names include
555 @c Moved standard clefs to the top /MB
557 @item treble, violin, G, G2
566 G clef on 1st line, so-called French violin clef
581 By adding @code{_8} or @code{^8} to the clef name, the clef is
582 transposed one octave down or up, respectively.
584 Supported associated glyphs (for @code{Staff.clefGlyph}) are:
593 @item clefs-vaticana_do
594 Editio Vaticana style do clef
595 @item clefs-vaticana_fa
596 Editio Vaticana style fa clef
597 @item clefs-medicaea_do
598 Editio Medicaea style do clef
599 @item clefs-medicaea_fa
600 Editio Medicaea style fa clef
601 @item clefs-mensural1_c
602 modern style mensural C clef
603 @item clefs-mensural2_c
604 historic style small mensural C clef
605 @item clefs-mensural3_c
606 historic style big mensural C clef
607 @item clefs-mensural1_f
608 historic style traditional mensural F clef
609 @item clefs-mensural2_f
610 historic style new mensural F clef
611 @item clefs-mensural_g
612 historic style mensural G clef
613 @item clefs-hufnagel_do
614 historic style hufnagel do clef
615 @item clefs-hufnagel_fa
616 historic style hufnagel fa clef
617 @item clefs-hufnagel_do_fa
618 historic style hufnagel combined do/fa clef
619 @item clefs-percussion
620 modern style percussion clef
623 @emph{Modern style} means ``as is typeset in current editions.''
624 @emph{Historic style} means ``as was typeset or written in contemporary
625 historic editions''. @emph{Editio XXX style} means ``as is/was printed in
628 @cindex Vaticana, Editio
629 @cindex Medicaea, Editio
630 @cindex hufnagel clefs
633 @c . {Time signature}
635 @subsection Time signature
636 @cindex Time signature
640 The time signature is set or changed by the @code{\time}
643 \time @var{n}@code{/}@var{d}
645 Internally, this is a shortcut for doing
647 \property Score.timeSignatureFraction = #'(@var{n} . @var{d})
648 \property Score.beatLength = #(make-moment 1 @var{d})
649 \property Score.measureLength = #(make-moment @var{n} @var{d})
652 These properties @code{timeSignatureFraction} determine where bar lines
653 should be inserted, and how automatic beams should be
656 Changing the value of @code{timeSignatureFraction} also causes a
657 fraction to be printed. This grob is @code{TimeSignature}.
659 The actual symbol that's printed can be customized with the style
661 @lilypond[fragment, verbatim, singleline]
663 \property Staff.TimeSignature \override #'style = #'C
665 \property Staff.TimeSignature \override #'style = #'()
667 \property Staff.TimeSignature \override #'style = #'C
671 There are many more options for the layout of this grob. They are
672 selected through the @code{style} grob property.
674 @c FIXME: this isn't documented except in example?
676 @file{input/test/time.ly} for examples.
683 @cindex partial measure
684 @cindex measure, partial
685 @cindex shorten measures
686 @cindex @code{\partial}
688 Partial measures, for example in upbeats, are entered using the
689 @code{\partial} command:
691 \partial @var{duration}
694 Internally, this is a shortcut for
697 \property Score.measurePosition = -@var{length of duration}
701 The property @code{measurePosition} contains a rational number
702 indicating how much of the measure has passed at this point.
705 @node Unmetered music
706 @subsection Unmetered music
708 Bar lines and bar numbers are calculated automatically. For unmetered
709 music (e.g. cadenzas), this is not desirable. The property
710 @code{Score.timing} can be used to switch off this automatic timing
712 @lilypond[fragment,relative,singleline,verbatim]
714 \property Score.timing = ##f
716 \property Score.timing = ##t
720 The identifiers @code{\cadenzaOn} and @code{\cadenzaOff} can be used as
727 @subsection Bar lines
731 @cindex measure lines
738 This is a shortcut for doing
740 \property Score.whichBar = @var{bartype}
742 The following bar types are available
744 @lilypond[fragment, relative, singleline, verbatim]
757 You are encouraged to use @code{\repeat} for repetitions. See
761 @cindex Bar_line_engraver
763 @cindex repeatCommands
764 @cindex defaultBarType
766 Whenever @code{whichBar} is set to a string, a bar line of that type is
767 created. @code{whichBar} is usually set automatically: at the start of
768 a measure it is set to @code{defaultBarType}. The contents of
769 @code{repeatCommands} is used to override default measure bars.
771 @code{whichBar} can also be set directly, using @code{\property} or
772 @code{\bar }. These settings take precedence over the automatic
773 @code{whichBar} settings.
775 @code{BarLine} grobs are created by the @code{Bar_engraver}.
782 Polyphonic parts, i.e. parts with more than one voice on a staff can be
783 typeset with LilyPond. To use this, instantiate a separate Voice
784 context for each part, and assign a stem direction to each part.
785 @lilypond[fragment,verbatim]
787 < \context Voice = VA { \stemUp b'4 a' g' f' e' }
788 \context Voice = VB { \stemDown g'4 g' g' g' g' } >
791 When there are more than two voices on a staff, you must also indicate
792 which voice should moved horizontally in case of a collision. This can
793 be done with the identifiers @code{\shiftOff}, @code{\shiftOn},
794 @code{\shiftOnn}, etc. (which sets the grob property @code{horizontal-shift}
795 in @code{NoteColumn}).
797 @lilypond[fragment, verbatim]
798 \context Staff \notes\relative c''<
805 \context Voice=three {
806 \shiftOnn \stemUp ais
808 \context Voice=four {
809 \shiftOnnn \stemUp fis
814 The most convenient way is to use the identifiers @code{\voiceOne}
815 through @code{\voiceFour}, which also set slur and tie directions in the
818 @lilypond[singleline, verbatim]
820 \context Staff < \context Voice = VA { \voiceOne cis2 b }
821 \context Voice = VB { \voiceThree b4 ais ~ ais4 gis4 }
822 \context Voice = VC { \voiceTwo fis4~ fis4 f ~ f } >
825 Normally, note heads with a different number of dots are not merged, but
826 if you set the grob property @code{merge-differently-dotted}, they are:
828 @lilypond[verbatim,fragment,singleline]
830 \context Voice = VA { \voiceOne
832 \property Staff.NoteCollision \override #'merge-differently-dotted = ##t
835 \context Voice = VB { \voiceTwo [g'8. f16] [g'8. f'16] }
839 LilyPond also vertically shifts rests that are opposite of a stem.
841 @lilypond[singleline,verbatim]
843 \context Voice { \stemUp c''4 }
844 \context Voice =VB { r4 }
848 Note head collisions (horizontal shifting of note heads) are handled by
849 the @code{NoteCollision} grob. @code{RestCollision} handles vertical
852 @cindex @code{NoteCollision}
853 @cindex @code{RestCollision}
858 Resolving collisions is a very intricate subject, and LilyPond only
859 handles a few situations. When it can not cope, you are advised to use
860 @code{force-hshift} of the NoteColumn grob and @code{staff-position} of
861 the Rest grob to override typesetting decisions.
866 Beams are used to group short notes into chunks that are aligned with
867 the metrum. LilyPond guesses where beams should be inserted. If you're
868 not satisfied with the automatic beaming, you can specify which patterns
869 to beam automatically. In specific cases, you can also enter the beams
873 @c . {Automatic beams}
874 @subsection Automatic beams
876 @cindex @code{Voice.autoBeamSettings}
877 @cindex @code{(end * * * *)}
878 @cindex @code{(begin * * * *)}
881 In normal time signatures, automatic beams can start on any note but can
882 only end in a few positions within the measure: beams can end on a beat,
883 or at durations specified by the properties in
884 @code{Voice.autoBeamSettings}. The defaults for @code{autoBeamSettings}
885 are defined in @file{scm/auto-beam.scm}.
887 The value of @code{autoBeamSettings} is changed using
888 @code{\override} and unset using @code{\revert}:
890 \property Voice.autoBeamSettings \override #'(@var{BE} @var{P} @var{Q} @var{N} @var{M}) = @var{dur}
891 \property Voice.autoBeamSettings \revert #'(@var{BE} @var{P} @var{Q} @var{N} @var{M})
893 Here, @var{BE} is the symbol @code{begin} or @code{end}. It determines
894 whether the rule applies to begin or end-points. The quantity
895 @var{P}/@var{Q} refers to the length of the beamed notes (and `@code{*
896 *}' designates notes of any length), @var{N}/@var{M} refers to a time
897 signature (wildcards, `@code{* *}' may be entered to designate all time
900 For example, if you want automatic beams to end on every quarter note,
901 you can use the following:
903 \property Voice.autoBeamSettings \override
904 #'(end * * * *) = #(make-moment 1 4)
906 Since the duration of a quarter note is 1/4 of a whole note, it is
907 entered as @code{(make-moment 1 4)}.
909 The same syntax can be used to specify beam starting points. In this
910 example, automatic beams can only end on a dotted quarter note.
912 \property Voice.autoBeamSettings \override
913 #'(end * * * *) = #(make-moment 3 8)
915 In 4/4 time signature, this means that automatic beams could end only on
916 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
917 3/8 has passed within the measure).
919 You can also restrict rules to specific time signatures. A rule that
920 should only be applied in @var{N}/@var{M} time signature is formed by
921 replacing the second asterisks by @var{N} and @var{M}. For example, a
922 rule for 6/8 time exclusively looks like
924 \property Voice.autoBeamSettings \override
925 #'(begin * * 6 8) = ...
928 If you want a rule to apply to certain types of beams, you can use the
929 first pair of asterisks. Beams are classified according to the shortest
930 note they contain. For a beam ending rule that only applies to beams
931 with 32nd notes (and no shorter notes), you would use @code{(end 1
935 @c Automatic beams can not be put on the last note in a score.
937 If a score ends while an automatic beam has not been ended and is still
938 accepting notes, this last beam will not be typeset at all.
940 @cindex automatic beam generation
942 @cindex @code{Voice.noAutoBeaming}
944 Automatic beaming is on by default, but can be switched off by setting
945 @code{Voice.noAutoBeaming} to true. You you may find this necessary for
946 a melody that goes with lyrics.
950 It is not possible to specify beaming parameters for beams with mixed
951 durations, that differ from the beaming parameters of all separate
952 durations, i.e., you'll have to specify manual beams to get:
953 @lilypond[fragment,singleline,relative]
954 \property Voice.autoBeamSettings
955 \override #'(end * * * *) = #(make-moment 3 8)
956 \time 12/8 c'8 c c c16 c c c c c [c c c c] c8 c c4
959 It is not possible to specify beaming parameters that act differently in
960 different parts of a measure. This means that it is not possible to use
961 automatic beaming in irregular meters such as @code{5/8}.
964 @cindex Automatic beams
965 @subsection Manual beams
966 @cindex beams, manual
970 In some cases it may be necessary to override LilyPond's automatic
971 beaming algorithm. For example, the auto beamer will not beam over
972 rests or bar lines, If you want that, specify the begin and end point
973 manually using a @code{[} before the first beamed note and a @code{]}
976 @lilypond[fragment,relative,verbatim]
978 r4 [r8 g' a r8] r8 [g | a] r8
981 Whenever an manual beam is busy, the automatic beamer will not produce
984 @cindex @code{stemLeftBeamCount}
986 Normally, beaming patterns within a beam are determined automatically.
987 When this mechanism fouls up, the properties
988 @code{Voice.stemLeftBeamCount} and @code{Voice.stemRightBeamCount}. can
989 be used to control the beam subdivision on a stem. If you set either
990 property, it's value will be used only once, and then it is erased.
992 @lilypond[fragment,relative,verbatim]
995 [f8 r16 \property Voice.stemLeftBeamCount = #1 f g a]
998 @cindex @code{stemRightBeamCount}
1000 The beam symbol (grob @code{Voice.Beam}, both for automatic and manual
1001 beams) can be tweaked through grob-properties @code{height} and
1002 @code{staff-position}. These specify vertical location and vertical
1003 span. Both are measured in half staff-spaces, @code{staff-position=0}
1004 corresponds to the middle staff line.
1007 Set @code{height} to zero, to get horizontal beams:
1009 @lilypond[fragment,relative,verbatim]
1010 \property Voice.Beam \set #'direction = #1
1011 \property Voice.Beam \set #'height = #0
1015 Here's how you'd specify a weird looking beam that instead of being
1016 horizontal, falls two staff spaces:
1018 @lilypond[fragment,relative,verbatim]
1019 \property Voice.Beam \set #'staff-position = #4
1020 \property Voice.Beam \set #'height = #-4
1023 @cindex @code{default-neutral-direction}
1025 @node Expressive marks
1026 @section Expressive marks
1041 A slur indicates that notes are to be played bound or @emph{legato}.
1042 They are entered using parentheses:
1044 @lilypond[fragment,verbatim,center]
1045 f'()g'()a' [a'8 b'(] a'4 g'2 )f'4
1049 Slurs avoid crossing stems, and are generally attached to note heads.
1050 However, in some situations with beams, slurs may be attached to stem
1051 ends. If you want to override this layout you can do this through the
1052 @code{Voice.Slur}'s grob-property @code{attachment}. It's value is a
1053 pair of symbols, specifying the attachment type of the left and right end points.
1055 @lilypond[fragment,relative,verbatim]
1056 \property Voice.Slur \set #'direction = #1
1057 \property Voice.Stem \set #'length = #5.5
1059 \property Voice.Slur \set #'attachment = #'(stem . stem)
1063 If a slur would strike through a stem or beam, the slur will be moved
1064 away upward or downward. If this happens, attaching the slur to the
1065 stems might look better:
1067 @lilypond[fragment,relative,verbatim]
1068 \property Voice.Stem \set #'direction = #1
1069 \property Voice.Slur \set #'direction = #1
1071 \property Voice.Slur \set #'attachment = #'(stem . stem)
1076 Similarly, the curvature of a slur is adjusted to stay clear of note
1077 heads and stems. When that would increase the curvature too much, the
1078 slur is reverted to its default shape. The threshold for this decision
1079 is in @code{Voice.Slur}'s grob-property @code{beautiful}. It is loosely
1080 related to the enclosed area between the slur and the notes. Usually,
1081 the default setting works well, but in some cases you may prefer a
1082 curved slur when LilyPond decides for a vertically moved one. You can
1083 indicate this preference by increasing the @code{beautiful} value:
1085 @lilypond[verbatim,singleline,relative]
1086 \property Voice.Beam \override #'direction = #-1
1087 \property Voice.Slur \override #'direction = #1
1088 c16( a' f' a a f a, )c,
1089 c( a' f' a a f d, )c
1090 \property Voice.Slur \override #'beautiful = #5.0
1091 c( a' f' a a f d, )c
1096 @code{beautiful} is an arbitrary parameter in the slur formatter.
1097 Useful values can only be determined by trial and error.
1099 @cindex Adjusting slurs
1101 @node Phrasing slurs
1102 @subsection Phrasing slurs
1104 @cindex phrasing slurs
1105 @cindex phrasing marks
1107 A phrasing slur (or phrasing mark) connects chords and is used to
1108 indicate a musical sentence. It is started using @code{\(} and @code{\)}
1111 @lilypond[fragment,verbatim,center,relative]
1112 \time 6/4 c' \( ( d ) e f ( e ) \) d
1115 Typographically, the phrasing slur behaves almost exactly like a normal
1116 slur. The grob associated with it is @code{Voice.PhrasingSlur}.
1119 @subsection Breath marks
1121 Breath marks are entered using @code{\breathe}. The result is a
1122 @code{Voice.BreathingSign} grob.
1124 @lilypond[fragment,relative]
1133 Currently, only tick marks are supported, not comma style breath marks.
1140 @cindex beats per minute
1141 @cindex metronome marking
1143 Metronome settings can be entered as follows:
1145 @cindex @code{\tempo}
1147 \tempo @var{duration} = @var{perminute}
1150 For example, @code{\tempo 4 = 76} requests output with 76 quarter notes
1155 The tempo setting is not printed, but is only used in the MIDI
1156 output. You can trick lily into producing a metronome mark,
1157 though. Details are in @ref{Text markup}.
1162 @subsection Text spanners
1163 @cindex Text spanners
1165 Some textual indications, e.g. rallentando or accelerando, often extend
1166 over many measures. This is indicated by following the text with a
1167 dotted line. You can create such texts using text spanners. The syntax
1170 \spanrequest \start "text"
1171 \spanrequest \stop "text"
1173 LilyPond will respond by creating a @code{Voice.TextSpanner} grob. The
1174 string to be printed, as well as the style is set through grob
1177 An application---or rather, a hack---is to fake octavation indications.
1178 @lilypond[fragment,relative,verbatim]
1179 \relative c' { a''' b c a
1180 \property Voice.TextSpanner \set #'type = #'dotted-line
1181 \property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5)
1182 \property Voice.TextSpanner \set #'edge-text = #'("8va " . "")
1183 \property Staff.centralCPosition = #-13
1184 a\spanrequest \start "text" b c a \spanrequest \stop "text" }
1202 @subsection Articulations
1203 @cindex Articulations
1205 @cindex articulations
1209 A variety of symbols can appear above and below notes to indicate
1210 different characteristics of the performance. These symbols can be
1211 added to a note with `@var{note}@code{-\}@var{name}'. Numerous symbols
1212 are defined in @file{script.ly}. Symbols can be forced to appear above
1213 or below the note by writing `@var{note}@code{^\}@var{name}' and
1214 `@var{note}@code{_\}@var{name}' respectively. Here is a chart showing
1215 symbols on notes, with the name of the corresponding symbol appearing
1221 \property Score.LyricSyllable \override #'font-family =#'typewriter
1222 \property Score.LyricSyllable \override #'font-shape = #'upright
1223 \context Staff \notes {
1224 c''-\accent c''-\marcato c''-\staccatissimo c''^\fermata
1225 c''-\stopped c''-\staccato c''-\tenuto c''-\upbow
1226 c''-\downbow c''^\lheel c''-\rheel c''^\ltoe
1227 c''-\rtoe c''-\turn c''-\open c''-\flageolet
1228 c''-\reverseturn c''-\trill c''-\prall c''-\mordent
1229 c''-\prallprall c''-\prallmordent c''-\upprall c''-\downprall
1230 c''-\thumb c''-\segno c''-\coda
1232 \context Lyrics \lyrics {
1233 accent__ marcato__ staccatissimo__ fermata
1234 stopped__ staccato__ tenuto__ upbow
1235 downbow__ lheel__ rheel__ ltoe
1236 rtoe__ turn__ open__ flageolet
1237 reverseturn__ trill__ prall__ mordent
1238 prallprall__ prallmordent__ uprall__ downprall
1239 thumb__ segno__ coda
1243 linewidth = 5.875\in
1249 To save typing work, some shorthands are available:
1250 @lilypond[singleline]
1252 \notes \context Voice {
1253 \property Voice.TextScript \set #'font-family = #'typewriter
1254 \property Voice.TextScript \set #'font-shape = #'upright
1260 c''4-^_"c-\\^{ }" s4
1267 Fingering instructions can also be entered in this shorthand.
1268 @lilypond[verbatim, singleline, fragment]
1269 c'4-1 c'4-2 c'4-3 c'4-4
1273 @cindex @code{\script}
1278 You can add scripts by editing @file{scm/script.scm}. This file contains
1279 a table, listing script definitions and aliases. The following syntax
1280 accesses a script definition from the table:
1286 Usually the @code{\script} keyword is not used directly. Various
1287 helpful identifier definitions appear in @file{script.ly}.
1289 Grobs for these objects are @code{Script} and @code{Fingering}.
1293 All of these note ornaments appear in the printed output but have no
1294 effect on the MIDI rendering of the music.
1296 Unfortunately, there is no support for adding fingering instructions or
1297 ornaments to individual note heads. Some hacks exist, though. See
1298 @file{input/test/script-horizontal.ly}.
1303 @subsection Text scripts
1304 @cindex Text scripts
1306 In addition, it is possible to place arbitrary strings of text or markup
1307 text (see @ref{Text markup}) above or below notes by using a string:
1310 By default, these indications do not influence the note spacing, but
1311 if @code{Voice.textNonEmpty} is set to true the widths will be taken
1312 into account. The identifier @code{\fatText} is defined in the standard
1314 @lilypond[fragment,singleline,verbatim]
1315 \relative c' { c4^"longtext" \fatText c4_"longlongtext" c4 }
1318 Text scripts are created in form of @code{Voice.TextScript} grobs.
1320 @ref{Text markup} describes how to change the font or access
1321 special symbols in text scripts.
1325 @subsection Grace notes
1334 @cindex @code{\grace}
1337 @cindex @code{graceAlignPosition}
1339 Grace notes are ornaments that are written out, but do not take up any
1340 logical time in a measure. LilyPond has limited support for grace notes.
1341 The syntax is as follows.
1343 \grace @var{musicexpr}
1346 When grace music is interpreted, a score-within-a-score is set up:
1347 @var{musicexpr} has its own time bookkeeping, and you could (for
1348 example) have a separate time signature within the grace notes. While in
1349 this score-within-a-score, you can create notes, beams, slurs, etc.
1350 Unbeamed eighth notes and shorter by default have a slash through the
1353 @lilypond[fragment,verbatim]
1355 \grace c8 c4 \grace { [c16 c16] } c4
1356 \grace { \property Grace.Stem \override #'flag-style = #'() c16 } c4
1361 A grace note expression has duration 0; the next real note is assumed to
1362 be the main note. If you want the note to appear after the main note,
1363 set @code{Voice.graceAlignPosition} to @code{1}.
1367 At present, slurs or ties from the grace notes to the following notes
1368 are not supported. Also, nesting @code{\grace} notes is not
1369 supported. The following may cause run-time errors:
1371 @code{\grace @{ \grace c32 c16 @} c4}
1373 Since the meaning of such a construct is unclear, we don't consider this
1374 a loss. Similarly, juxtaposing two @code{\grace} sections is
1375 syntactically valid, but makes no sense and may cause runtime errors.
1376 Ending a staff or score with grace notes may also generate a run-time
1377 error, since there will be no main note to attach the grace notes to.
1379 The present implementation of grace notes is not robust and generally
1380 kludgey. We expect it to change after LilyPond 1.4. Syntax changes might
1381 also be implemented.
1392 @subsection Glissando
1395 @cindex @code{\glissando}
1397 A glissando line (grob @code{Voice.Glissando}) can be requested by attaching a
1398 @code{\glissando} to a note:
1400 @lilypond[fragment,relative,verbatim]
1406 Printing of an additional text (such as @emph{gliss.}) must be done
1413 @subsection Dynamics
1426 @cindex @code{\ffff}
1436 Absolute dynamic marks are specified using an identifier after a
1437 note: @code{c4-\ff}. The available dynamic marks are: @code{\ppp},
1438 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
1439 @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
1440 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}.
1442 @lilypond[verbatim,singleline,fragment,relative]
1443 c'\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff
1449 @cindex @code{\decr}
1450 @cindex @code{\rced}
1456 A crescendo mark is started with @code{\cr} and terminated with
1457 @code{\rc} (the textual reverse of @code{cr}). A decrescendo mark is
1458 started with @code{\decr} and terminated with @code{\rced}. There are
1459 also shorthands for these marks. A crescendo can be started with
1460 @code{\<} and a decrescendo can be started with @code{\>}. Either one
1461 can be terminated with @code{\!}. Note that @code{\!} must go before
1462 the last note of the dynamic mark whereas @code{\rc} and @code{\rced} go
1463 after the last note. Because these marks are bound to notes, if you
1464 want several marks during one note, you have to use spacer notes.
1466 @lilypond[fragment,verbatim,center]
1467 c'' \< \! c'' d'' \decr e'' \rced
1468 < f''1 { s4 s4 \< \! s4 \> \! s4 } >
1471 You can also use a text saying @emph{cresc.} instead of hairpins. Here
1472 is an example how to do it:
1477 @lilypond[fragment,relative,verbatim]
1479 \property Voice.crescendoText = "cresc."
1480 \property Voice.crescendoSpanner = #'dashed-line
1485 For everyday use, we recommend the identifiers @code{\cresc},
1486 @code{endcresc}, @code{\dim} and @code{\enddim}.
1490 Dynamics are grobs of @code{Voice.DynamicText} and
1491 @code{Voice.Hairpin}. They are put together on
1492 @code{Voice.DynamicLineSpanner} to align them vertically.
1501 @cindex @code{\repeat}
1503 To specify repeats, use the @code{\repeat} keyword. Since repeats
1504 should work differently when played or printed, there are a few
1505 different variants of repeats.
1509 Repeated music is fully written (played) out. Useful for MIDI
1510 output, and entering repetitive music.
1513 This is the normal notation: Repeats are not written out, but
1514 alternative endings (voltas) are printed, left to right.
1517 Alternative endings are written stacked. This has limited use but may be
1518 used to typeset two lines of lyrics in songs with repeats, see
1519 @file{input/star-spangled-banner.ly}.
1525 Make beat or measure repeats. These look like percent signs.
1531 * Manual repeat commands::
1533 * Tremolo subdivisions::
1538 @subsection Repeat syntax
1540 The syntax for repeats is
1543 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
1546 If you have alternative endings, you may add
1547 @cindex @code{\alternative}
1549 \alternative @code{@{} @var{alternative1}
1551 @var{alternative3} @dots{} @code{@}}
1553 where each @var{alternative} is a music expression.
1555 Normal notation repeats are used like this:
1556 @lilypond[fragment,verbatim]
1558 \repeat volta 2 { c'4 d' e' f' }
1559 \repeat volta 2 { f' e' d' c' }
1562 With alternative endings:
1563 @lilypond[fragment,verbatim]
1565 \repeat volta 2 {c'4 d' e' f'}
1566 \alternative { {d'2 d'} {f' f} }
1569 Folded repeats look like this:
1572 @lilypond[fragment,verbatim]
1574 \repeat fold 2 {c'4 d' e' f'}
1575 \alternative { {d'2 d'} {f' f} }
1579 If you don't give enough alternatives for all of the repeats, then
1580 the first alternative is assumed to be repeated often enough to equal
1581 the specified number of repeats.
1583 @lilypond[fragment,verbatim]
1587 \repeat volta 4 { e | c2 d2 | e2 f2 | }
1588 \alternative { { g4 g g } { a | a a a a | b2. } }
1595 Notice that timing information is not remembered at the start of an
1596 alternative, so you have to reset timing information after a repeat,
1597 e.g. using a bar-check (See @ref{Bar check}), setting
1598 @code{Score.measurePosition} or entering @code{\partial}. Slurs or ties
1599 are also not repeated.
1601 It is possible to nest @code{\repeat}s, although this probably is only
1602 meaningful for unfolded repeats.
1604 Folded repeats offer little more over simultaneous music. However, it
1605 is to be expected that more functionality -- especially for the MIDI
1606 backend -- will be implemented at some point in the future.
1608 Volta repeats are printed over all staffs in a score. You must turn them
1609 off explicitly, for example by doing
1611 \property Staff.VoltaBracket = \turnOff
1613 in all but the top staff.
1615 @node Manual repeat commands
1616 @subsection Manual repeat commands
1618 @cindex @code{repeatCommands}
1620 The property @code{repeatCommands} can be used to control the layout of
1621 repeats. Its value is a Scheme list of repeat commands, where each repeat
1629 @item (volta . @var{text})
1630 Print a volta bracket saying @var{text}.
1632 Stop a running volta bracket
1635 @lilypond[verbatim, fragment]
1637 \property Score.repeatCommands = #'((volta "93") end-repeat)
1639 \property Score.repeatCommands = #'((volta #f))
1644 Repeats brackets are @code{Staff.VoltaBracket} grobs.
1646 @node Tremolo repeats
1647 @subsection Tremolo repeats
1648 @cindex tremolo beams
1650 To place tremolo marks between notes, use @code{\repeat} with tremolo
1652 @lilypond[verbatim,center,singleline]
1654 \context Voice \notes\relative c' {
1655 \repeat "tremolo" 8 { c16 d16 }
1656 \repeat "tremolo" 4 { c16 d16 }
1657 \repeat "tremolo" 2 { c16 d16 }
1658 \repeat "tremolo" 4 c16
1663 Tremolo beams are @code{Voice.Beam} grobs. Single stem tremolos are
1664 @code{Voice.StemTremolo}.
1669 At present, the spacing between tremolo beams is not regular, since the
1670 spacing engine does not notice that not all notes are printed.
1672 @node Tremolo subdivisions
1673 @subsection Tremolo subdivisions
1674 @cindex tremolo marks
1675 @cindex @code{tremoloFlags}
1677 Tremolo marks can be printed on a single note by adding
1678 `@code{:}[@var{length}]' after the note. The length must be at least 8.
1679 A @var{length} value of 8 gives one line across the note stem. If the
1680 length is omitted, then then the last value (stored in
1681 @code{Voice.tremoloFlags}) is used.
1683 @lilypond[verbatim,fragment,center]
1684 c'2:8 c':32 | c': c': |
1690 Tremolos in this style do not carry over into the MIDI output.
1693 @node Measure repeats
1694 @subsection Measure repeats
1696 @cindex percent repeats
1697 @cindex measure repeats
1699 In the @code{percent} style, a note pattern can be repeated. It is
1700 printed once, and then the pattern is replaced with a special sign.
1701 Patterns of a one and two measures are replaced by percent-like signs,
1702 patterns that divide the measure length are replaced by slashes.
1704 @lilypond[verbatim,singleline]
1705 \context Voice { \repeat "percent" 4 { c'4 }
1706 \repeat "percent" 2 { c'2 es'2 f'4 fis'4 g'4 c''4 }
1710 The signs are represented by these grobs: @code{Voice.RepeatSlash} and
1711 @code{Voice.PercentRepeat} and @code{Voice.DoublePercentRepeat}.
1715 You can not nest percent repeats, e.g. by filling in the first measure
1716 with slashes, and repeating that measure with percents.
1718 @node Rhythmic music
1719 @section Rhythmic music
1726 @node Rhythmic staffs
1727 @subsection Rhythmic staffs
1729 Sometimes you might want to show only the rhythm of a melody. This can
1730 be done with the rhythmic staff. All pitches of notes on such a staff
1731 are squashed, and the staff itself looks has a single staff line:
1733 @lilypond[fragment,relative,verbatim]
1734 \context RhythmicStaff {
1736 c4 e8 f g2 | r4 g r2 | g1:32 | r1 |
1743 @section Piano music
1745 Piano music is an odd type of notation. Piano staffs are two normal
1746 staffs coupled with a brace. The staffs are largely independent, but
1747 sometimes voices can cross between the two staffs. The
1748 @code{PianoStaff} is especially built to handle this cross-staffing
1749 behavior. In this section we discuss the @code{PianoStaff} and some
1750 other pianistic peculiarities.
1753 * Automatic staff changes::
1754 * Manual staff switches::
1757 * Voice follower lines::
1761 @c . {Automatic staff changes}
1762 @node Automatic staff changes
1763 @subsection Automatic staff changes
1764 @cindex Automatic staff changes
1766 Voices can switch automatically between the top and the bottom
1767 staff. The syntax for this is
1769 \autochange @var{contexttype} @var{musicexp}
1771 This will switch the interpretation context of @var{musicexp} between a
1772 @var{contexttype} named @code{up} and @code{down}. Typically, you use
1773 @code{Staff} for @var{contexttype}. The autochanger switches on basis
1774 of pitch (central C is the turning point), and it looks ahead skipping
1775 over rests to switch rests in advance.
1777 @lilypond[verbatim,singleline]
1778 \score { \notes \context PianoStaff <
1779 \context Staff = "up" {
1780 \autochange Staff \context Voice = VA < \relative c' {
1781 g4 a b c d r4 a g } > }
1782 \context Staff = "down" {
1788 Note how spacer rests are used to prevent the bottom staff from
1789 terminating too soon.
1792 @node Manual staff switches
1793 @subsection Manual staff switches
1795 @cindex manual staff switches
1796 @cindex staff switch, manual
1798 Voices can be switched between staffs manually, using the following command:
1800 \translator Staff = @var{staffname} @var{music}
1802 The string @var{staffname} is the name of the staff. It switches the
1803 current voice from its current staff to the Staff called
1804 @var{staffname}. Typically @var{staffname} is @code{"up"} or
1807 The formal definition of this construct is obtuse, but for the sake of
1808 completeness we give it here.
1809 @cindex @code{\translator}
1811 \translator @var{contexttype} = @var{name}
1813 Formally, this construct is a music expression indicating
1814 that the context which is a direct child of the context of type
1815 @var{contexttype} should be shifted to a context of type
1816 @var{contexttype} and the specified name.
1824 Piano pedal instruction can be expressed using
1825 @code{\sustainDown}, @code{\sustainUp}, @code{\unaCorda},
1826 @code{\treCorde}, @code{\sostenutoDown} and @code{\sostenutoUp}.
1828 These identifiers are shorthands for spanner commands of the types
1829 @code{Sustain}, @code{UnaCorda} and @code{Sostenuto}:
1831 @lilypond[fragment,verbatim]
1832 c''4 \spanrequest \start "Sustain" c''4
1833 c''4 \spanrequest \stop "Sustain"
1836 The symbols that are printed can be modified by setting
1837 @code{pedal@var{X}Strings}, where @var{X} is one of the pedal
1838 types. Refer to the generated documentation of @rgrob{PianoPedal} for
1844 Currently, brackets are not supported, only text markings (i.e. `*Ped'
1850 @subsection Arpeggio
1853 @cindex broken arpeggio
1854 @cindex @code{\arpeggio}
1856 You can specify an arpeggio sign on a chord by attaching an
1857 @code{\arpeggio} to a note of the chord.
1860 @lilypond[fragment,relative,verbatim]
1861 \context Voice <c\arpeggio e g c>
1864 When an arpeggio crosses staffs in piano music, you attach an arpeggio
1865 to the chords in both staffs, and set
1866 @code{PianoStaff.connectArpeggios}.
1868 @lilypond[fragment,relative,verbatim]
1869 \context PianoStaff <
1870 \property PianoStaff.connectArpeggios = ##t
1871 \context Voice = one { <c'\arpeggio e g c> }
1872 \context Voice = other { \clef bass <c,,\arpeggio e g>}
1876 This command creates @code{Voice.Arpeggio} grobs. Cross staff arpeggios
1877 are @code{PianoStaff.Arpeggio}.
1881 It is not possible to mix connected arpeggios and unconnected arpeggios
1886 @node Voice follower lines
1887 @subsection Voice follower lines
1889 @cindex follow voice
1890 @cindex staff switching
1893 @cindex @code{followVoice}
1895 Whenever a voice switches to another staff a line connecting the notes
1896 can be printed automatically. This is enabled if the property
1897 @code{PianoStaff.followVoice} is set to true:
1899 @lilypond[fragment,relative,verbatim]
1900 \context PianoStaff <
1901 \property PianoStaff.followVoice = ##t
1902 \context Staff \context Voice {
1904 \translator Staff=two
1907 \context Staff=two {\clef bass \skip 1*2 }
1911 The associated grob is @code{Voice.VoiceFollower}.
1921 * Automatic syllable durations::
1927 @subsection Lyrics mode
1930 To print lyrics, you must first make a music expression from the lyric
1931 text. That music expression can be printed by selecting an appropriate
1935 @cindex @code{\lyrics}
1937 You can enter lyrics in a special input mode of LilyPond. This mode is
1938 called Lyrics mode, and it is introduced by the keyword @code{\lyrics}.
1939 The purpose of this mode is that you can enter lyrics as plain text,
1940 punctuation and accents without any hassle.
1942 Syllables are entered like notes, with pitches replaced by text. For
1943 example, @code{Twin- kle twin- kle} enters four syllables. Note that
1944 the hyphen has no special meaning for lyrics, and does not introduce
1947 Spaces can be introduced into a lyric either by using quotes:
1948 @code{"He could"4 not4} or by using an underscore without quotes:
1949 @code{He_could4 not4}. All unquoted underscores are converted to
1952 The precise definition of this mode can be found in @ref{Lyrics mode
1955 @c . {Printing lyrics}
1956 @node Printing lyrics
1957 @subsection Printing lyrics
1960 Lyrics are printed by interpreting them in the @code{Lyrics} context.
1962 @c Maybe more pedagogical to avoid \addlyrics in this first example? /MB
1964 @lilypond[verbatim,singleline]
1965 \addlyrics \notes \relative c' {
1967 \property Staff.automaticMelismata = ##t
1968 d'2 c4 b16 ( a g a b a b ) c a2
1969 b2 c4 b8 ( a16 g ) a4 g2 }
1970 \context Lyrics \lyrics {
1972 share the soft -- ware; }
1976 Notes and syllable durations are matched automatically. This is
1977 accomplished using @code{\addlyrics}, which is documented in
1978 @ref{Automatic syllable durations}. Setting @code{automaticMelismata} in
1979 the melody staff will cause slurs to be interpreted as melismata.
1981 The Lyric syllables are @code{LyricsVoice.LyricSyllable} grobs.
1984 @cindex lyric extender
1987 As you can see, extender lines are entered as @code{__}. This will
1988 create an extender, a line that extends over the entire duration of the
1989 lyric. This line will run all the way to the start of the next lyric,
1990 so you may want to shorten it by using a blank lyric (using @code{_}).
1991 The grob for this symbol is @code{LyricsVoice.LyricExtender}.
1996 If you want to have hyphens centered between syllables (rather than
1997 attached to the end of the first syllable) you can use the special
1998 `@code{-}@code{-}' lyric as a separate word between syllables. This
1999 will result in a hyphen whose length varies depending on the space
2000 between syllables. It will be centered between the syllables. The grob
2001 for this symbol is @code{LyricsVoice.LyricHyphen}.
2003 @cindex Lyric hyphen
2005 @node Automatic syllable durations
2006 @subsection Automatic syllable durations
2007 @cindex Automatic syllable durations
2009 @cindex automatic lyric durations
2010 @cindex @code{\addlyrics}
2012 If you have lyrics that are set to a melody, you can copy the rhythm
2013 of that melody into the lyrics using @code{\addlyrics}. The syntax for
2016 \addlyrics @var{musicexpr1 musicexpr2}
2019 Both @var{musicexpr1} and @var{musicexpr2} are interpreted, but every
2020 music event (``every syllable'') in @var{musicexpr2} is interpreted only
2021 when there are events in @var{musicexpr1}.
2023 @cindex @code{automaticMelismata}
2025 If the property @code{automaticMelismata} is set in the
2026 context of @var{musicexpr1}, no lyrics will be put on slurred or tied
2029 @lilypond[verbatim,fragment]
2032 \property Voice.automaticMelismata = ##t
2033 c8 () cis d8. e16 f2
2035 \context Lyrics \lyrics {
2039 If you want the lyric lines to be above the melody staff, or in some
2040 other, more complex configuration, then build that configuration first
2041 using simultaneous music, and use @code{\addlyrics} after that.
2043 @lilypond[verbatim, singleline]
2045 \context Lyrics = LA { s1 }
2046 \context Staff = SA { s1 }
2048 \context Staff = SA \relative c' { c4 e g g }
2049 \context Lyrics = LA \lyrics { geen ge -- don -- der } >
2052 For @code{\addlyrics} you should use a single rhythm melody, and single
2053 rhythm lyrics (a constant duration is the obvious choice). If you do
2054 not, you can get undesired effects when using multiple stanzas:
2056 @lilypond[verbatim,fragment]
2059 c8 () cis d8. e16 f2
2061 \context Lyrics \lyrics
2066 It is valid (but probably not very useful) to use notes instead of
2067 lyrics for @var{musicexpr2}.
2070 @subsection More stanzas
2074 If you have multiple stanzas printed underneath each other, the vertical
2075 groups of syllables should be aligned around punctuation. LilyPond can
2076 do this if you tell it which lyric lines belong to which melody.
2078 To this end, give the Voice context an identity, and set the LyricsVoice
2079 to a name starting with that identity followed by a dash.
2080 In the following example, the Voice
2081 identity is @code{duet}, and the identities of the LyricsVoices are
2082 @code{duet-1} and @code{duet-2}.
2085 @lilypond[singleline,verbatim]
2088 \notes \relative c'' \context Voice = duet { \time 3/4
2090 \lyrics \context Lyrics <
2091 \context LyricsVoice = "duet-1" {
2092 \property LyricsVoice . stanza = "Bert"
2093 Hi, my name is bert. }
2094 \context LyricsVoice = "duet-2" {
2095 \property LyricsVoice . stanza = "Ernie"
2096 Ooooo, ch\'e -- ri, je t'aime. }
2101 You can add stanza numbers by setting @code{LyricsVoice.Stanza} (for the
2102 first system) and @code{LyricsVoice.stz} for the following
2103 systems. Notice how you must surround dots with spaces in @code{\lyrics}
2109 @cindex stanza numbering
2117 LilyPond has support for both entering and printing chords. Chords are
2118 characterized by a set of pitches. They are
2119 internally stored as simultaneous music expressions. This means you can
2120 enter chords by name and print them as note head, enter them as notes
2121 and print them as chord names, or (the most common case) enter them by
2122 name, and print them as name.
2125 @lilypond[verbatim,singleline]
2126 twoWays = \notes \transpose c'' {
2136 < \context ChordNames \twoWays
2137 \context Voice \twoWays > }
2140 Note that this example also shows that the chord printing routines do
2141 not attempt to be intelligent. If you enter @code{f bes d}, it does not
2142 interpret this as an inversion.
2146 * Printing named chords::
2151 @subsection Chords mode
2154 Chord mode is a mode where you can input sets of pitches using common
2155 names. It is introduced by the keyword @code{\chords}. It is similar
2156 to note mode, but words are also looked up in a chord modifier table
2157 (containing @code{maj}, @code{dim}, etc).
2159 Dashes and carets are used to indicate chord additions and subtractions,
2160 so articulation scripts can not be entered in Chord mode.
2162 The syntax for named chords is as follows:
2164 @var{tonic}[@var{duration}][@code{-}@var{modifiers}][@code{^}@var{subtractions}][@code{/}@var{inversion}][@code{/+}@var{bass}].
2167 @var{tonic} should be the tonic note of the chord, and @var{duration} is
2168 the chord duration in the usual notation. There are two kinds of
2169 modifiers. One type is formed by @emph{chord additions}. Additions are
2170 obtained by listing intervals separated by dots. An interval is written
2171 by its number with an optional @code{+} or @code{-} to indicate raising
2172 or lowering by half a step. Chord additions have two effects: they adds
2173 the specified interval and all lower odd numbered intervals to the
2174 chord, and they may lower or raise the specified interval.
2176 Throughout these examples, chords have been shifted around the staff
2177 using @code{\transpose}.
2179 @lilypond[fragment,verbatim]
2183 c:9 c:9-.5+.7+ c:3-.5-
2193 The second type of modifier that may appear after the @code{:} is a
2194 named modifier. Named modifiers are listed in the file
2195 @file{chord-modifiers.ly}. The available modifiers are @code{m} and
2196 @code{min} which lower the 3rd half a step, `@code{aug}' which
2197 raises the 5th, `@code{dim}' which lowers the 5th,
2198 `@code{maj}' which adds a raised 7th, and `@code{sus}'
2199 which replaces the 5th with a 4th.
2201 @lilypond[fragment,verbatim]
2204 c1:m c:min7 c:maj c:aug c:dim c:sus
2210 Chord subtractions are used to eliminate notes from a chord. The
2211 notes to be subtracted are listed after a @code{^} character,
2214 @lilypond[fragment,verbatim,center]
2223 Chord inversions can be specified by appending `@code{/}' and the name
2224 of a single note to a chord. In a chord inversion, the inverted note is
2225 transposed down until it is the lowest note in the chord. If the note
2226 is not in the chord, a warning will be printed.
2228 @lilypond[fragment,verbatim,center]
2238 Bass notes can be added by `@code{/+}' and
2239 the name of a single note to a chord. This has the effect of
2240 adding the specified note to the chord, lowered by an octave,
2241 so it becomes the lowest note in the chord.
2243 @lilypond[fragment,verbatim,center]
2254 Implementation details are quite gory. For example @code{c:4} not only
2255 adds a fourth, but also removes the third.
2258 @c . {Printing named chords}
2259 @node Printing named chords
2260 @subsection Printing named chords
2262 @cindex printing chord names
2265 @cindex @code{ChordNames}
2268 For displaying printed chord names, use the @code{ChordNames} context.
2269 The chords may be entered either using the notation described above, or
2270 directly using simultaneous music.
2272 @lilypond[verbatim,singleline]
2274 \chords {a1 b c} <d f g> <e g b>
2278 \context ChordNames \scheme
2279 \context Staff \transpose c'' \scheme
2284 You can make the chord changes stand out by setting
2285 @code{ChordNames.chordChanges} to true. This will only display chord
2286 names when there's a change in the chords scheme and at the start of a
2291 c1:m c:m \break c:m c:m d
2295 \context ChordNames {
2296 \property ChordNames.chordChanges = ##t
2298 \context Staff \transpose c'' \scheme
2302 LilyPond examines chords specified as lists of notes to determine a name
2303 to give the chord. LilyPond will not try to identify chord inversions or
2304 an added bass note, which may result in strange chord names when chords
2305 are entered as a list of pitches:
2307 @lilypond[verbatim,center,singleline]
2316 \context ChordNames \scheme
2317 \context Staff \scheme
2323 By default, a chord name system proposed by Harald Banter (See
2324 @ref{Literature}) is used. The system is very regular and predictable.
2325 Typical American style chord names may be selected by setting the
2326 @code{style} property of the @code{ChordNames.ChordName} grob to
2327 @code{'american}. Similarly @code{'jazz} selects Jazz chordnames.
2329 Routines that determine the names to be printed are written in Scheme,
2330 and may be customized by the user. The code can be found in
2331 @file{scm/chord-name.scm}. Here's an example showing the differences in
2335 @c maybe just junk verbatim option?
2336 @lilypond[verbatim,singleline]
2346 \context ChordNames = banter \scheme
2347 \context ChordNames = american {
2348 \property ChordNames.ChordName \override
2349 #'style = #'american \scheme }
2350 \context ChordNames = jazz {
2351 \property ChordNames.ChordName \override
2352 #'style = #'jazz \scheme }
2353 \context Staff \transpose c'' \scheme
2360 @section Writing parts
2362 Orchestral music involves some special notation, both in the full score,
2363 as in the individual parts. This section explains how to tackle common
2364 problems in orchestral music.
2371 * Instrument names::
2373 * Sound output for transposing instruments::
2374 * Multi measure rests::
2375 * Automatic part combining::
2376 * Hara kiri staffs::
2379 @c . {Rehearsal marks}
2380 @node Rehearsal marks
2381 @subsection Rehearsal marks
2382 @cindex Rehearsal marks
2384 @cindex @code{\mark}
2385 @cindex @code{Mark_engraver}
2388 \mark @var{unsigned}
2393 This command prints a rehearsal mark above the system. You can provide
2394 a number, a string or a markup text as argument. If you use
2395 @code{\default}, the value of property @code{rehearsalMark} is used and
2396 automatically incremented.
2398 @lilypond[fragment,verbatim]
2404 c1 \mark #'(music "scripts-segno")
2409 The grob is @code{Score.RehearsalMark}. See
2410 @code{input/test/boxed-molecule.ly} if you need boxes around the marks.
2413 @subsection Bar numbers
2415 Bar numbers (grob: @code{BarNumber}) are printed at the start of the
2416 line. See @code{input/test/boxed-molecule.ly} for boxed bar numbers.
2420 It is not possible to have bar numbers printed at regular intervals
2423 @node Instrument names
2424 @subsection Instrument names
2426 You can specify an instrument name for a staff by setting
2427 @code{Staff.instrument} and @code{Staff.instr}. This will print a string
2428 before the start of the staff. For the first start, @code{instrument} is
2429 used, for the next ones @code{instr} is used.
2431 @lilypond[verbatim,singleline]
2432 \property Staff.instrument = "ploink " { c''4 }
2435 You can also use markup texts to construct more complicated instrument
2439 @lilypond[verbatim,singleline]
2441 '((font-relative-size . -2 ) (music "accidentals--1")))
2444 \property Staff.instrument = #`((kern . 0.5) (lines
2445 "2 Clarinetti" (columns " (B" ,text-flat ")")))
2453 When you put a name on a grand staff or piano staff the width of the
2454 brace is not taken into account. You must add extra spaces to the end of
2455 the name to avoid a collision.
2458 @subsection Transpose
2460 @cindex transposition of pitches
2461 @cindex @code{\transpose}
2463 A music expression can be transposed with @code{\transpose}. The syntax
2466 \transpose @var{pitch} @var{musicexpr}
2469 This means that middle C in @var{musicexpr} is transposed to
2472 @code{\transpose} distinguishes between enharmonic pitches: both
2473 @code{\transpose cis'} or @code{\transpose des'} will transpose up half
2474 a tone. The first version will print sharps and the second version
2477 @lilypond[fragment,verbatim]
2480 { \key e \major c d e f }
2482 \transpose des'' { \key e \major c d e f }
2483 \transpose cis'' { \key e \major c d e f }
2487 If you want to use both @code{\transpose} and @code{\relative}, then
2488 you must use @code{\transpose} first. @code{\relative} will have no
2489 effect music that appears inside a @code{\transpose}.
2491 @node Sound output for transposing instruments
2492 @subsection Sound output transposing instruments
2494 When you want to make a MIDI file from a score containing transposed and
2496 instruments, you have to instruct LilyPond the pitch offset (in
2497 semitones) for the transposed instruments. This is done using the
2498 @code{transposing} property. It does not affect printed output.
2500 @cindex @code{transposing}
2503 \property Staff.instrument = #"Cl. in B-flat"
2504 \property Staff.transposing = #-2
2507 @c . {Multi measure rests}
2508 @node Multi measure rests
2509 @subsection Multi measure rests
2510 @cindex Multi measure rests
2514 Multi measure rests are entered using `@code{R}'. It is specifically
2515 meant for full bar rests and for entering parts: the rest can expand to
2517 rests, or it can be printed as a single multimeasure rest This expansion
2518 is controlled by the property @code{Score.skipBars}. If this is set to true,
2519 Lily will not expand empty measures, and the appropriate number is added
2522 @lilypond[fragment,verbatim]
2523 \time 3/4 r2. | R2. | R2.*2 \property Score.skipBars = ##t R2.*17 R2.*4
2526 Notice that the @code{R2.} is printed as a whole rest, centered in the
2529 @cindex whole rests for a full measure
2533 Currently, there is no way to automatically condense multiple rests into
2534 a single multimeasure rest.
2536 @cindex condensing rests
2538 @node Automatic part combining
2539 @subsection Automatic part combining
2540 @cindex automatic part combining
2541 @cindex part combiner
2544 Automatic part combining is used to merge two parts of music onto a
2545 staff in an intelligent way. It is aimed primarily at typesetting
2546 orchestral scores. When the two parts are identical for a period of
2547 time, only one is shown. In places where the two parts differ, they are
2548 typeset as separate voices, and stem directions are set automatically.
2549 Also, solo and @emph{a due} parts can be identified and marked.
2551 The syntax for part combining is
2554 \partcombine @var{context} @var{musicexpr1} @var{musicexpr2}
2556 where the pieces of music @var{musicexpr1} and @var{musicexpr2} will be
2557 combined into one context of type @var{context}. The music expressions
2558 must be interpreted by contexts whose names should start with @code{one}
2561 The most useful function of the part combiner is to combine parts into
2562 one voice, as common for wind parts in orchestral scores:
2564 @lilypond[verbatim,singleline,fragment]
2566 \context Voice=one \partcombine Voice
2567 \context Thread=one \relative c'' {
2570 \context Thread=two \relative c'' {
2576 Notice that the first @code{g} appears only once, although it was
2577 specified twice (once in each part). Stem, slur and tie directions are
2578 set automatically, depending whether there is a solo or unisono. The
2579 first part (with context called @code{one}) always gets up stems, and
2580 `solo', while the second (called @code{two}) always gets down stems and
2583 If you just want the merging parts, and not the textual markings, you
2584 may set the property @var{soloADue} to false.
2586 @lilypond[verbatim,singleline,fragment]
2588 \property Staff.soloADue = ##f
2589 \context Voice=one \partcombine Voice
2590 \context Thread=one \relative c'' {
2593 \context Thread=two \relative c'' {
2599 There are a number of other properties that you can use to tweak the
2600 behavior of part combining, refer to the automatically generated
2601 documentation of @reng{Thread_devnull_engraver} and
2602 @reng{Voice_devnull_engraver}. Look at the documentation of the
2603 responsible engravers, @code{Thread_devnull_engraver},
2604 @code{Voice_devnull_engraver} and @code{A2_engraver}.
2608 In @code{soloADue} mode, when the two voices play the same notes on and
2609 off, the part combiner may typeset @code{a2} more than once in a
2612 @lilypond[fragment,singleline]
2614 \context Voice=one \partcombine Voice
2615 \context Thread=one \relative c'' {
2618 \context Thread=two \relative c'' {
2624 @cindex @code{Thread_devnull_engraver}
2625 @cindex @code{Voice_engraver}
2626 @cindex @code{A2_engraver}
2628 @node Hara kiri staffs
2629 @subsection Hara kiri staffs
2631 In orchestral scores, staff lines that only have rests are usually removed.
2632 This saves some space. LilyPond also supports this through the hara
2633 kiri@footnote{Hara kiri, also called Seppuku, is the ritual suicide of
2634 the Japanese Samourai warriors.} staff. This staff commits suicide when
2635 it finds itself to be empty after the line-breaking process. It will
2636 not disappear when it contains normal rests, you must use multi measure
2639 The hara kiri staff is specialized version of the Staff context. It is
2640 available as the context identifier @code{\HaraKiriStaffContext}.
2641 Observe how the second staff in this example disappears in the second
2646 \notes \relative c' <
2647 \context Staff = SA { e4 f g a \break c1 }
2648 \context Staff = SB { c4 d e f \break R1 }
2652 \translator { \HaraKiriStaffContext }
2665 A @emph{custos} (plural: @emph{custodes}; latin word for `guard') is a
2666 staff context symbol that appears at the end of a staff line. It
2667 anticipates the pitch of the first note(s) of the following line and
2668 thus helps the player or singer to manage line breaks during
2669 performance, thus enhancing readability of a score.
2674 \property Staff.Custos \set #'style = #'mensural
2679 \consists Custos_engraver
2685 Custodes were frequently used in music notation until the 17th century.
2686 There were different appearances for different notation styles.
2687 Nowadays, they have survived only in special forms of musical notation
2688 such as via the @emph{editio vaticana} dating back to the beginning of
2691 For typesetting custodes, just put a @code{Custos_engraver} into the
2692 @code{StaffContext} when declaring the @code{\paper} block. In this
2693 block, you can also globally control the appearance of the custos symbol
2694 by setting the custos @code{style} property. Currently supported styles
2695 are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
2702 \consists Custos_engraver
2703 Custos \override #'style = #'mensural
2708 The property can also be set locally, for example in a @code{\notes}
2713 \property Staff.Custos \override #'style = #'vaticana
2714 c'1 d' e' d' \break c' d' e' d'
2718 @c . {Tuning output}
2720 @section Tuning output
2722 LilyPond tries to take as much formatting as possible out of your
2723 hands. Nevertheless, there are situations where it needs some help, or
2724 where you want to override its decisions. In this section we discuss
2725 ways to do just that.
2727 Formatting is internally done by manipulating so called grobs (graphic
2728 objects). Each grob carries with it a set of properties (grob
2729 properties) specific to that object. For example, a stem grob has
2730 properties that specify its direction, length and thickness.
2732 The most direct way of tuning the output is by altering the values of
2733 these properties. There are two ways of doing that: first, you can
2734 temporarily change the definition of a certain type of grob, thus
2735 affecting a whole set of objects. Second, you can select one specific
2736 object, and set a grob property in that object.
2739 * Tuning groups of grobs ::
2740 * Tuning per grob ::
2748 @node Tuning groups of grobs
2749 @subsection Tuning groups of grobs
2751 @cindex grob description
2755 A grob definition is a Scheme association list, that is stored in a
2756 context property. By assigning to that property (using plain
2757 @code{\property}), you can change the resulting grobs.
2759 @lilypond[verbatim, fragment]
2760 c'4 \property Voice.Stem = #'((meta . ((interfaces . ())))) c'4
2763 The @code{\property} assignment effectively empties the definition of
2764 the Stem object. One of the effects is that the recipe of how it should be
2765 printed is erased, with the effect of rendering it invisible. The above
2766 assignment is available as a standard identifier, for the case that you
2770 \property Voice.Stem = \turnOff
2777 This mechanism is fairly crude, since you can only set, but not modify,
2778 the definition of a grob. For this reason, there is a more advanced
2781 The definition of a grob is actually a list of default grob
2782 properties. For example, the definition of the Stem grob (available in
2783 @file{scm/grob-description.scm}), defines the following values for
2788 (beamed-lengths . (0.0 2.5 2.0 1.5))
2789 (Y-extent-callback . ,Stem::height)
2793 You can add a property on top of the existing definition, or remove a
2794 property, thus overriding the system defaults:
2796 c'4 \property Voice.Stem \override #'thickness = #4.0
2797 c'4 \property Voice.Stem \revert #'thickness
2800 You should balance @code{\override} and @code{\revert}. If that's too
2801 much work, you can use the @code{\set} shorthand. It performs a revert
2802 followed by an override. The following example gives exactly the same
2803 result as the previous one.
2805 c'4 \property Voice.Stem \set #'thickness = #4.0
2806 c'4 \property Voice.Stem \set #'thickness = #0.8
2809 If you use @code{\set}, you must explicitly restore the default.
2812 Formally the syntax for these constructions is
2814 \property @var{context}.@var{grobname} \override @var{symbol} = @var{value}
2815 \property @var{context}.@var{grobname} \set @var{symbol} = @var{value}
2816 \property @var{context}.@var{grobname} \revert @var{symbol}
2818 Here @var{symbol} is a Scheme expression of symbol type, @var{context}
2819 and @var{grobname} are strings and @var{value} is a Scheme expression.
2822 If you revert a setting which was not set in the first place, then it
2823 has no effect. However, if the setting was set as a system default, it
2824 may remove the default value, and this may give surprising results,
2825 including crashes. In other words, @code{\override} and @code{\revert},
2826 must be carefully balanced.
2828 These are examples of correct nesting of @code{\override}, @code{\set},
2831 A clumsy but correct form:
2833 \override \revert \override \revert \override \revert
2836 Shorter version of the same:
2838 \override \set \set \revert
2841 A short form, using only @code{\set}. This requires you to know the
2844 \set \set \set \set @var{to default value}
2847 If there is no default (i.e. by default, the grob property is unset),
2850 \set \set \set \revert
2853 For the digirati, the grob description is an Scheme association
2854 list. Since a Scheme list is a singly linked list, we can treat it as a
2855 stack, and @code{\override} and @code{\revert} are just push and pop
2856 operations. This pushing and popping is also used for overriding
2857 automatic beaming settings.
2861 LilyPond will hang or crash if @var{value} contains cyclic references.
2862 The backend is not very strict in type-checking grob properties. If you
2863 @code{\revert} properties that are expected to be set by default,
2866 Some grobs are created at the moment that their context is created. An
2867 example of such a grob is the staff itself (i.e. the horizontal lines).
2868 You can not change the appearance of the staff symbol by manipulating
2869 @code{\property Staff.StaffSymbol}. At the moment that @code{\property
2870 Staff} is interpreted, a Staff context is made, and the StaffSymbol is
2871 created before any @code{\override} is effective. You can deal with this
2872 either overriding properties in a @code{\translator} definition, or by
2873 using @code{\outputproperty}.
2878 @node Tuning per grob
2879 @subsection Tuning per grob
2881 @cindex \outputproperty
2883 A second way of tuning grobs is the more arcane @code{\outputproperty}
2884 feature. The syntax is as follows:
2886 \outputproperty @var{predicate} @var{symbol} = @var{value}
2888 Here @code{predicate} is a Scheme function taking a grob argument, and
2889 returning a boolean. This statement is processed by the
2890 @code{Output_property_engraver}. It instructs the engraver to feed all
2891 grobs that it sees to @var{predicate}. Whenever the predicate returns
2892 true, the grob property @var{symbol} will be set to @var{value}.
2894 You will need to combine this statement with @code{\context} to select
2895 the appropriate context to apply this to.
2897 Here are some random examples.
2900 In the following example, all note heads occurring at current staff
2901 level, are shifted up and right by setting their @code{extra-offset}
2904 @lilypond[fragment,verbatim,singleline]
2906 \context Staff \outputproperty
2907 #(make-type-checker 'note-head-interface)
2908 #'extra-offset = #'(0.5 . 0.75)
2912 @cindex @code{extra-offset}
2914 In this example, the predicate checks the @code{text} grob property, to
2915 shift only the `m.d.' text, but not the fingering instruction "2".
2916 @lilypond[verbatim,singleline]
2917 #(define (make-text-checker text)
2918 (lambda (grob) (equal? text (ly-get-grob-property grob 'text))))
2921 \notes\relative c''' {
2922 \property Voice.Stem \set #'direction = #1
2923 \outputproperty #(make-text-checker "m.d.")
2924 #'extra-offset = #'(-3.5 . -4.5)
2932 If possible, avoid this feature: the semantics are not very clean, and
2933 the syntax and semantics are up for rewrite.
2939 @subsection What to tune?
2941 This all tells you how to tune grobs, but you don't know what variables
2942 to set? The question is not answered in this part of the manual
2943 (although you may encounter some examples.).
2945 Grob properties are tied directly to the implementation of LilyPond, and
2946 they are thus a moving target. Documentation of such variables is in the
2947 automatically generated documentation. Description of properties are
2948 generated from the source code for each version. This documentation is
2949 therefore more up to date. It should be available from the same place
2950 where you got this manual.
2952 To decide how to tune a grob, you need to find the following information
2955 which grob to modify
2957 which property to modify
2959 which context the grob comes from.
2962 Included with the automatically generated documentation is a master list
2963 of grobs. Selecting a grob will take you to an overview of the
2964 properties available for that grob.
2966 There is also a master list of contexts. Selecting one takes you to an
2967 overview of that context which lists which grob types are created there.
2970 @node Font selection
2971 @subsection Font selection
2973 Most graphics in LilyPond are composed of characters of fonts. You can
2974 alter the characteristics of the font by setting certain grob
2975 properties. The mechanism that is used for this resembles La@TeX{}'s New
2976 Font Selection Scheme. Within this scheme, a font is entirely
2977 characterized by its font name.
2979 For each grob that uses fonts (in other words, each grob that supports
2980 @code{font-interface}) a font-name must be selected before it can be
2981 printed. The font name is selected by looking at a number of grob
2986 A symbol indicating the general class of the typeface. Supported are
2987 @code{roman} (Computer Modern), @code{braces} (for piano staff braces),
2988 @code{music} (the standard music font), @code{dynamic} (font for dynamic
2989 signs) and @code{typewriter}
2992 A symbol indicating the shape of the font, there are typically several
2993 font shapes available for each font family. Choices are @code{italic},
2994 @code{caps} and @code{upright}
2997 A symbol indicating the series of the font. There are typically several
2998 font series for each font family and shape. Choices are @code{medium}
3001 @item font-relative-size
3002 A number indicating the size relative the standard size. For example,
3003 with 20pt staff height, relative size -1 corresponds to 16pt staff
3004 height, and relative size +1 corresponds to 23 pt staff height.
3006 @item font-design-size
3007 A number indicating the design size of the font.
3009 This is a feature of the Computer Modern Font: each point size has a
3010 slightly different design. Smaller design sizes are relatively wider,
3011 which enhances readability. Scalable type faces such TrueType and Adobe
3012 Type1 usually come as ``one design fits all sizes''.
3015 The name of the font, without the design size, e.g. @code{cmr},
3016 @code{cmti}, etc. Setting this overrides font-family, font-shape and
3021 The font is selected by taking the first font that satisfies all
3022 qualifiers specified. You can override any of these fields through
3023 @code{\override} and @code{\revert}. The special value @code{*} matches
3024 any value for that qualifier.
3027 \property Lyrics.LyricText \override #'font-series = #'bold
3028 \property Lyrics.LyricText \override #'font-shape = #'*
3031 @cindex @code{font-style}
3033 There are also pre-cooked font selection qualifiers. These are selected
3034 through the grob property @code{font-style}. For example, the style
3035 @code{finger} selects family @code{number} and relative size @code{-3}.
3036 Styles available include @code{volta}, @code{finger}, @code{tuplet},
3037 @code{timesig}, @code{mmrest}, @code{script}, @code{large}, @code{Large}
3040 The style sheets and tables for selecting fonts are located in
3041 @file{scm/font.scm}. Refer to this file for more information.
3045 Relative size is not linked to any real size.
3047 There is no mechanism to select magnification of particular fonts,
3048 meaning that you don't have access to continuously scaled fonts. You
3049 can scale the entire output, of course, see @ref{Output scaling}.
3051 There is no style sheet provided for other fonts besides the @TeX{}
3054 @cindex font selection
3055 @cindex font magnification
3056 @cindex @code{font-interface}
3060 @subsection Text markup
3064 LilyPond has an internal mechanism to typeset texts. You can
3065 form text markup expressions by composing scheme expressions
3066 in the following way.
3068 @lilypond[verbatim, singleline]
3073 c^#'(italic "italic")
3074 d_#'((bold italic) "ff")
3076 f_#'(lines "one" (bold "two"))
3077 g^#'(music "noteheads-2" ((raise . 2.4) "flags-u3"))
3081 Normally, the Scheme markup text is stored in the @code{text} property
3082 of a grob. Formally, it is defined as follows:
3085 text: string | (head? text+)
3086 head: markup | (markup+)
3087 markup-item: property | abbrev
3088 property: (@var{key} . @var{value})
3089 abbrev: @code{columns lines roman music bold italic named super sub}
3090 @code{overstrike text finger volta timesig mmrest mark script}
3091 @code{large Large dynamic}
3094 The markup is broken down and converted into a list of grob properties,
3095 which are prepended to the property list. The @var{key}-@var{value}
3096 pair is a grob property. A list of properties available is included in
3097 the generated documentation for @rint{Text_interface}.
3099 The following abbreviations are currently defined:
3102 horizontal mode: set all text on one line (default)
3104 vertical mode: set every text on a new line
3108 selects the Feta font (the standard font for music notation glyphs),
3109 and uses named lookup
3116 lookup by character name
3118 plain text lookup (by character value)
3124 the next text or character overstrikes this one
3126 select fingering number fontstyle
3128 select volta number fontstyle
3130 select time signature number fontstyle
3132 select multi measure rest number fontstyle
3134 select mark number fontstyle
3136 select scriptsize roman fontstyle
3138 select large roman fontstyle
3140 select Large roman fontstyle
3142 select dynamics fontstyle
3146 @cindex metronome mark
3148 One practical application of complicated markup is to fake a metronome
3152 #(define note '(columns
3153 (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
3154 #(define eight-note `(columns ,note ((kern . -0.1)
3155 (music ((raise . 3.5) "flags-u3")))))
3156 #(define dotted-eight-note
3157 `(columns ,eight-note (music "dots-dot")))
3160 \notes\relative c'' {
3161 a1^#`((columns (font-relative-size . -1)) ,dotted-eight-note " = 64")
3167 TextScript \override #'font-shape = #'upright
3173 @node Invisible grobs
3174 @subsection Invisible grobs
3175 @cindex invisible grobs
3179 ben nog steeds niet kapot van de informatiedichtheid hier.
3185 You can imagine a number of situations where you would want to make
3186 certain grobs not show up in the output. There may be aesthetic
3187 reasons, to make the output resemble an (old) manuscript as close as
3188 possible, or to make lessons or exercises for students.
3190 Grobs can be made invisible in a number of ways:
3192 Here's an example with blanked-out notes and stems:
3193 @lilypond[singleline,verbatim]
3195 \property Voice.NoteHead \override
3197 \property Voice.Stem \override
3198 #'transparent = ##t }
3201 \property Voice.NoteHead \revert #'transparent
3202 \property Voice.Stem \revert #'transparent }
3205 \notes\relative c'' {
3207 a b c b \blanknotes c \unblanknotes d
3211 This method makes the grobs invisible but they still take the normal space.
3212 To remove all traces of the grob, you can redefine the function
3216 \notes\relative c'' {
3219 as bes c bes c d \break
3220 \property Staff.KeySignature \override #'molecule-callback = #'()
3223 \paper{linewidth=5.0\cm indent=0}
3227 A very rigorous way of removing grobs from the whole score is to remove
3228 the engraver that creates them. For example,
3230 @lilypond[singleline,verbatim]
3231 \score {\notes { c'4 d'8 e'8 g2 }
3232 \paper { \translator {
3234 \remove Stem_engraver
3240 @subsection Dirty tricks
3241 @cindex embedded tex
3243 It is possible to use @TeX{} commands in the strings, but this should be
3244 avoided because it makes it impossible for LilyPond to compute the
3245 exact length of the string, which may lead to collisions. Also, @TeX{}
3246 commands won't work with direct PostScript output (see @ref{PostScript
3249 @lilypond[fragment,relative,verbatim]
3250 a'^"3 $\\times$ \\`a deux"
3253 You can also use raw PostScript commands embedded in text scripts. This
3254 offers ultimate flexibility, but requires you to learn PostScript.
3255 Currently, embedded PostScript will @strong{not} work with direct
3256 PostScript output. Note that all dimensions that you use are in staff
3261 \notes \relative c'' {
3262 a-#"\\embeddedps{3 4 moveto 5 3 rlineto stroke}"
3263 -#"\\embeddedps{ [ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke}"
3264 b-#"\\embeddedps{3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke}"
3268 \paper { linewidth = 70*\staffspace }
3275 @section Page layout
3278 The page layout is the combined product of LilyPond formatting notation,
3279 and (La)@TeX{} putting the notation on a page, including page breaks.
3280 The part of LilyPond is documented here.
3294 @subsection Paper block
3297 The most important output definition is the @code{\paper} block, for
3298 music notation. The syntax is
3301 @code{\paper @{} [@var{paperidentifier}] @var{items} @code{@}}
3304 where each of the items is one of
3307 @item An assignment.
3309 @item A context definition. See @ref{Interpretation context} for
3310 more information on context definitions.
3312 @item \stylesheet declaration. Its syntax is
3314 \stylesheet @var{alist}
3317 See @file{scm/font.scm} for details of @var{alist}.
3318 @item an @code{\elementdescriptions} declaration.
3320 \elementdescriptions @var{alist}
3322 See @file{scm/grob-description.scm} for details of
3323 @var{alist}. This command is not user-serviceable.
3327 @c . {Paper variables}
3328 @node Paper variables
3329 @subsection Paper variables
3330 @cindex Paper variables
3332 The paper block has some variables you may want to use or change:
3335 @cindex @code{indent}
3337 The indentation of the first line of music.
3338 @cindex @code{staffspace}
3340 @item @code{staffspace}
3341 The distance between two staff lines, calculated from the center
3344 @cindex @code{linewidth}
3345 @item @code{linewidth}
3346 Sets the width of the lines.
3348 If set to a negative value, a single unjustified line is produced.
3349 @c rename to singleLinePaper ?
3350 The shorthand @code{\singleLine} defines a default paper block that
3351 produces a single line.
3353 @cindex @code{textheight}
3355 @item @code{textheight}
3356 Sets the total height of the music on each page. Only used by
3359 @cindex @code{interscoreline}
3361 @item @code{interscoreline}
3362 Sets the spacing between systems. The default is 16pt.
3364 @cindex @code{interscorelinefill}
3366 @item @code{interscorelinefill}
3367 If set to a positive number, the distance between the score
3368 lines will stretch in order to fill the full page. In that
3369 case @code{interscoreline} specifies the minimum spacing.
3374 @cindex @code{stafflinethickness}
3376 @item @code{stafflinethickness}
3377 Determines the thickness of staff lines, and also acts as a scaling
3378 parameter for other line thicknesses.
3381 You may enter these dimension using units (@code{cm}, @code{in},
3382 @code{mm}, @code{pt}), or relative to another dimension
3384 linewidth = 20.0 * \staffspace
3391 @subsection Font size
3394 The Feta font provides musical symbols at six different sizes. These
3395 fonts are 11 point, 13 point, 16 point, 20 point,
3396 23 point, and 26 point. The point size of a font is the
3397 height of the five lines in a staff when displayed in the font.
3399 Definitions for these sizes are the files @file{paperSZ.ly}, where
3400 @code{SZ} is one of 11, 13, 16, 20, 23 and 26. If you include any of
3401 these files, the identifiers @code{paperEleven}, @code{paperThirteen},
3402 @code{paperSixteen}, @code{paperTwenty}, @code{paperTwentythree}, and
3403 @code{paperTwentysix} are defined respectively. The default
3404 @code{\paper} block is also set.
3406 The font definitions are generated using a Scheme function. For more
3407 details, see the file @file{scm/font.scm}.
3413 @subsection Paper size
3418 @cindex @code{papersize}
3420 To change the paper size, you must first set the
3421 @code{papersize} variable at top level. Set it to
3422 the strings @code{a4}, @code{letter}, or @code{legal}. After this
3423 specification, you must set the font as described above. If you want
3424 the default font, then use the 20 point font.
3428 \include "paper16.ly"
3431 The file @code{paper16.ly} will now include a file named @file{a4.ly}, which
3432 will set the paper variables @code{hsize} and @code{vsize} (used by
3437 @subsection Line break
3440 @cindex breaking lines
3442 Line breaks are normally computed automatically. They are chosen such
3443 that the resulting spacing has low variation, and looks neither cramped
3446 Occasionally you might want to override the automatic breaks; you can do
3447 this by specifying @code{\break}. This will force a line break at this
3448 point. Do remember that line breaks can only occur at places where there
3449 are bar lines. If you want to have a line break where there is no
3450 bar line, you can force an invisible bar line by entering @code{\bar
3451 ""}. Similarly, @code{\noBreak} forbids a line break at a certain point.
3453 @cindex @code{\penalty}
3455 The @code{\break} and @code{\noBreak} commands are defined in terms of
3456 the penalty command:
3461 This encourages or discourages LilyPond to make a line break at this
3466 The scaling of the @code{\penalty} argument is not well-defined. The
3467 command is rather kludgey, and slated for rewriting.
3471 @subsection Page break
3474 @cindex breaking pages
3476 Page breaks are normally computed by @TeX{}, so they are not under
3477 direct control of LilyPond. However, you can insert a commands into the
3478 @file{.tex} output to instruct @TeX{} where to break pages, by inserting
3479 the command @code{\newpage}
3480 @cindex @code{\newpage}
3486 @c why do so difficult?
3487 @c maybe should explain contents of between-system.ly,
3488 @c but not now, we're talking about page breaks here.
3490 @c details, see the example file @file{input/test/between-systems.ly}
3493 @c . {Output scaling}
3494 @node Output scaling
3495 @subsection Output scaling
3510 There is no mechanism to select magnification of particular fonts,
3511 meaning that you don't have access to continuously scaled fonts.
3515 @c . {Output formats}
3516 @node Output formats
3517 @section Output formats
3519 LilyPond can output processed music in different output formats.
3523 * PostScript output::
3525 * ASCIIScript output::
3529 @subsection TeX output
3532 LilyPond will use @TeX{} by default. Even if you want to produce
3533 PostScript output for viewing or printing, you should normally have
3534 LilyPond produce @TeX{} first. The .tex output must be processed by
3535 @TeX{} (@strong{not} La@TeX{}) to generate a .dvi. Then, @file{Dvips}
3536 is used to generate PostScript. Alternatively, @file{ly2dvi} can be
3537 used to generate the .dvi for you.
3541 Titling is not generated unless you use @file{ly2dvi}.
3544 @node PostScript output
3545 @subsection PostScript output
3546 @cindex PostScript output
3547 @cindex direct PostScript output
3549 LilyPond can produce PostScript directly, without going through @TeX{}.
3550 Currently, this is mainly useful if you cannot use TeX, because direct
3551 PostScript output has some problems; see Bugs below.
3554 $ lilypond -fps foo.ly
3555 GNU LilyPond 1.3.144
3556 Now processing: `foo.ly'
3558 Interpreting music...[3]
3559 Preprocessing elements...
3560 Calculating column positions...
3561 paper output to foo.ps...
3563 $ cat /usr/share/lilypond/pfa/feta20.pfa foo.ps | lpr
3569 Text font selection is broken.
3571 The .ps file does not contain the .pfa font files. To print a .ps
3572 created through direct postscript output, you should prepend the
3573 necessary .pfa files to LilyPond's .ps output, or upload them to the
3574 printer before printing.
3576 The line height calculation is broken, you must set @var{lineheight} in
3577 the paperblock if you have more than one staff in your score, e.g.
3582 % Set line height to 40 staff spaces
3588 @subsection Scheme output
3589 @cindex Scheme output
3591 In the typesetting stage, LilyPond builds a page description, which is
3592 then written to disk in postscript, @TeX{} or ASCII art. Before it is
3593 written, the page description is represented as Scheme expressions. You
3594 can also dump these Scheme expressions to a file, which may be
3595 convenient for debugging output routines. This is done with the Scheme
3599 $ lilypond -fscm foo.ly
3600 GNU LilyPond 1.3.144
3601 Now processing: `foo.ly'
3603 Interpreting music...[3]
3604 Preprocessing elements...
3605 Calculating column positions...
3606 paper output to foo.scm...
3609 ;;; Usage: guile -s x.scm > x.tex
3610 (primitive-load-path 'standalone.scm)
3614 $ guile -s foo.scm > foo.tex
3618 @node ASCIIScript output
3619 @subsection ASCIIScript output
3620 @cindex ASCIIScript output
3621 @cindex ascii script
3624 LilyPond can output ASCII Art. This is a two step process, LilyPond
3625 produces an ASCII description file, dubbed ASCIIScript (extension
3626 @file{.as}). ASCIIScript has a small and simple command set that
3627 includes font selection, character and string printing and line drawing
3628 commands. The program @file{as2text} is used to translate an .as file
3631 To produce ASCII Art, you must include an ASCII Art paper definition
3632 file in your .ly, one of:
3634 \include "paper-as5.ly"
3635 \include "paper-as9.ly"
3638 Here's an example use for ASCII Art output (the example file
3639 @file{as-email.ly} is included in the LilyPond distribution), the staff
3640 symbol has been made invisible:
3643 $ lilypond -fas as-email.ly
3644 GNU LilyPond 1.3.144
3645 Now processing: `as-email.ly'
3647 Interpreting music...[3]
3648 Preprocessing elements...
3649 Calculating column positions... [2]
3650 paper output to as-email.as...
3652 $ as2text as-email.as 2>/dev/null
3654 |/ |##|##| | | | | |
3655 /| | | | | |\ |\ |\ |\ |\ |
3656 / |_ 3 | | | | 5 | )| )| )| )| )|
3657 | /| \ 8 * * * | 8 * * * * * |
3667 The ASCII Art fonts are far from complete and not very well designed.
3668 It's easy to change the glyphs, though; if you think you can do better,
3669 have a look at @file{mf/*.af}.
3671 Lots of resizable symbols such as slurs, ties and tuplets are missing.
3673 The poor looks of most ASCII Art output and its limited general
3674 usefulness gives ASCII Art output a low priority; it may be
3675 dropped in future versions.
3682 LilyPond can produce MIDI output. The performance lacks lots of
3683 interesting effects, such as swing, articulation, slurring, etc., but it
3684 is good enough for proof-hearing the music you have entered. Ties,
3685 dynamics and tempo changes are interpreted.
3687 Dynamic marks, crescendi and decrescendi translate into MIDI volume
3688 levels. Dynamic marks translate to a fixed fraction of the available
3689 MIDI volume range, crescendi and decrescendi make the the volume vary
3690 linearly between their two extremities. The fractions be adjusted by
3691 overriding the @code{absolute-volume-alist} defined in
3692 @file{scm/midi.scm}.
3694 For each type of musical instrument (that MIDI supports), a volume range
3695 can be defined. This gives you basic equalizer control, which can
3696 enhance the quality of the MIDI output remarkably. You can add
3697 instruments and ranges or change the default settings by overriding the
3698 @code{instrument-equalizer-alist} defined in @file{scm/midi.scm}.
3700 Both loudness controls are combined to produce the final MIDI volume.
3705 It is currently not possible to use the percussion channel (generally
3706 channel 10 of a MIDI file).
3710 * MIDI instrument names::
3715 @subsection MIDI block
3719 The MIDI block is analogous to the paper block, but it is somewhat
3720 simpler. The @code{\midi} block can contain:
3724 @item a @code{\tempo} definition
3725 @item context definitions
3728 Assignments in the @code{\midi} block are not allowed.
3732 @cindex context definition
3734 Context definitions follow precisely the same syntax as within the
3735 \paper block. Translation modules for sound are called performers.
3736 The contexts for MIDI output are defined in @file{ly/performer.ly}.
3739 @node MIDI instrument names
3740 @subsection MIDI instrument names
3742 @cindex instrument names
3743 @cindex @code{Staff.midiInstrument}
3744 @cindex @code{Staff.instrument}
3746 The MIDI instrument name is set by the @code{Staff.midiInstrument}
3747 property or, if that property is not set, the @code{Staff.instrument}
3748 property. The instrument name should be chosen from the list in
3749 @ref{MIDI instruments}.
3753 If the selected string does not exactly match, then LilyPond uses the
3754 default (Grand Piano). It is not possible to select an instrument by
3767 @section Music entry
3775 When entering music with LilyPond, it is easy to introduce errors. This
3776 section deals with tricks and features that help you enter music, and
3777 find and correct mistakes.
3781 @subsection Relative
3783 @cindex relative octave specification
3785 Octaves are specified by adding @code{'} and @code{,} to pitch names.
3786 When you copy existing music, it is easy to accidentally put a pitch in
3787 the wrong octave and hard to find such an error. To prevent these
3788 errors, LilyPond features octave entry.
3790 @cindex @code{\relative}
3792 \relative @var{startpitch} @var{musicexpr}
3795 The octave of notes that appear in @var{musicexpr} are calculated as
3796 follows: If no octave changing marks are used, the basic interval
3797 between this and the last note is always taken to be a fourth or less
3798 (This distance is determined without regarding alterations; a
3799 @code{fisis} following a @code{ceses} will be put above the
3802 The octave changing marks @code{'} and @code{,} can be added to raise or
3803 lower the pitch by an extra octave. Upon entering relative mode, an
3804 absolute starting pitch must be specified that will act as the
3805 predecessor of the first note of @var{musicexpr}.
3807 Entering music that changes octave frequently is easy in relative mode.
3808 @lilypond[fragment,singleline,verbatim,center]
3814 And octave changing marks are used for intervals greater than a fourth.
3815 @lilypond[fragment,verbatim,center]
3817 c g c f, c' a, e'' }
3820 If the preceding item is a chord, the first note of the chord is used
3821 to determine the first note of the next chord. However, other notes
3822 within the second chord are determined by looking at the immediately
3825 @lilypond[fragment,verbatim,center]
3832 @cindex @code{\notes}
3834 The pitch after the @code{\relative} contains a note name. To parse
3835 the pitch as a note name, you have to be in note mode, so there must
3836 be a surrounding @code{\notes} keyword (which is not
3839 The relative conversion will not affect @code{\transpose},
3840 @code{\chords} or @code{\relative} sections in its argument. If you
3841 want to use relative within transposed music, you must place an
3842 additional @code{\relative} inside the @code{\transpose}.
3847 @subsection Bar check
3851 @cindex @code{barCheckNoSynchronize}
3855 Whenever a bar check is encountered during interpretation, a warning
3856 message is issued if it doesn't fall at a measure boundary. This can
3857 help you find errors in the input. Depending on the value of
3858 @code{barCheckNoSynchronize}, the beginning of the measure will be
3859 relocated, so this can also be used to shorten measures.
3861 A bar check is entered using the bar symbol, @code{|}:
3863 \time 3/4 c2 e4 | g2.
3866 @c . {Point and click}
3867 @node Point and click
3868 @subsection Point and click
3870 Point and click lets you find notes in the input by clicking on them in
3871 the Xdvi window. This makes it very easy to find input that causes some
3872 error in the sheet music.
3874 To use it, you need the following software
3876 @unnumberedsubsec Installation
3880 @uref{ftp://ftp.math.berkeley.edu/pub/Software/TeX/xdvi.tar.gz,plain
3881 Xdvi} version 22.36 or newer.
3883 Note that most @TeX{} distributions ship with xdvik, which is a
3884 different and less well maintained program. To find out which xdvi you
3885 are running, try @code{xdvi --version} or @code{xdvi.bin --version}.
3889 Xdvi must be configured to find the TeX fonts and music
3890 fonts. Refer to the Xdvi documentation for more information.
3893 @unnumberedsubsec Using it
3895 Add one of these lines to the top of your .ly file. The first one is for
3896 line location only. The second one is more convenient, but requires
3897 patching @code{emacsclient} and @code{server.el}.
3900 #(set! point-and-click line-location)
3903 In the emacs startup file (usually @file{~/.emacs}), add the following
3908 Make sure that the environment variable @code{XEDITOR} is set
3911 emacsclient --no-wait +%l %f
3913 The second one, that also specifies the column, only works if you have
3914 patched your emacsclient and server, and have compiled your @code{.ly}
3915 file using the @code{line-column-location} setting.
3917 When viewing, control-mousebutton 1 will take you to the originating
3918 spot in the @file{.ly} file. Control-mousebutton 2 will show all
3922 @unnumberedsubsec Column location
3924 If you want emacs to jump to the exact spot (and not just the line) on a
3925 click, you must enable column positioning. To do so, you need to patch
3926 emacsclient. Apply @file{emacsclient.patch} (included with the source
3927 package) to @file{emacsclient.c} and @file{server.el} from the emacs
3928 source code. Recompile and stick the recompiled emacsclient into a bin
3929 directory, and put @file{server.el} into a elisp directory
3930 (e.g. @file{~/usr/share/emacs/}). Add the following to your @file{.emacs}
3931 init file, before invoking server-start.
3934 (setq load-path (cons "~/usr/share/emacs" load-path))
3937 Set @code{XEDITOR} to @code{emacsclient --no-wait +%l:%c %f}
3939 At the top of the @code{ly} file, replace the @code{set!} line with the
3942 #(set! point-and-click line-column-location)
3949 When you convert the @TeX{} file to PostScript using @code{dvips}, it
3950 will complain about not finding @code{src:X:Y} files. Those complaints
3951 are harmless, and can be ignored.
3953 When using @code{line-column-location}, the cursor will be one off; it
3954 will not jump to the exact note that you clicked, but to the next one.
3958 @node Skipping corrected music
3959 @section Skipping corrected music
3961 The property @code{Score.skipTypesetting} can be used to switch on and
3962 off typesetting completely during the interpretation phase. When
3963 typesetting is switched off, the music is processed much more quickly.
3964 You can use this to skip over the parts of a score that you have already
3967 @lilypond[fragment,singleline,verbatim]
3968 \relative c'' { c8 d
3969 \property Score.skipTypesetting = ##t
3971 \property Score.skipTypesetting = ##f
3976 @node Interpretation context
3977 @section Interpretation context
3980 * Creating contexts::
3981 * Default contexts::
3982 * Context properties::
3983 * Engravers and performers::
3984 * Changing context definitions::
3985 * Defining new contexts::
3989 Interpretation contexts are objects that only exist during a run of
3990 LilyPond. During the interpretation phase of LilyPond (when it prints
3991 "interpreting music"), the music expression in a @code{\score} block is
3992 interpreted in time order. This is the same order that humans hear and
3995 During this interpretation, the interpretation context holds the
3996 state for the current point within the music. It contains information
4000 @item What notes are playing at this point?
4001 @item What symbols will be printed at this point?
4002 @item What is the current key signature, time signature, point within
4006 Contexts are grouped hierarchically: A @code{Voice} context is
4007 contained in a @code{Staff} context (because a staff can contain
4008 multiple voices at any point), a @code{Staff} context is contained in
4009 @code{Score}, @code{StaffGroup}, or @code{ChoirStaff} context.
4011 Contexts associated with sheet music output are called @emph{notation
4012 contexts}, those for sound output are called @emph{performance
4013 contexts}. The default definitions of the standard notation and
4014 performance contexts can be found in @file{ly/engraver.ly} and
4015 @file{ly/performer.ly}, respectively.
4018 @node Creating contexts
4019 @subsection Creating contexts
4021 @cindex @code{\context}
4022 @cindex context selection
4024 Contexts for a music expression can be selected manually, using the
4025 following music expression.
4028 \context @var{contexttype} [= @var{contextname}] @var{musicexpr}
4031 This instructs lilypond to interpret @var{musicexpr} within the context
4032 of type @var{contexttype} and with name @var{contextname}. If this
4033 context does not exist, it will be created.
4035 @lilypond[verbatim,singleline]
4037 \notes \relative c'' {
4038 c4 <d4 \context Staff = "another" e4> f
4044 In this example, the @code{c} and @code{d} are printed on the
4045 default staff. For the @code{e}, a context Staff called
4046 @code{another} is specified; since that does not exist, a new
4047 context is created. Within @code{another}, a (default) Voice context
4048 is created for the @code{e4}. When all music referring to a
4049 context is finished, the context is ended as well. So after the
4050 third quarter, @code{another} is removed.
4054 @node Default contexts
4055 @subsection Default contexts
4057 Most music expressions don't need an explicit @code{\context}
4058 declaration: they inherit the
4059 notation context from their parent. Each note is a music expression, and
4060 as you can see in the following example, only the sequential music
4061 enclosing the three notes has an explicit context.
4063 @lilypond[verbatim,singleline]
4064 \score { \notes \context Voice = goUp { c'4 d' e' } }
4067 There are some quirks that you must keep in mind when dealing with
4070 First, every top level music is interpreted by the Score context, in other
4071 words, you may think of @code{\score} working like
4074 \context Score @var{music}
4078 Second, contexts are created automatically to be able to interpret the
4079 music expressions. Consider the following example.
4081 @lilypond[verbatim, singleline]
4082 \score { \context Score \notes { c'4 ( d' )e' } }
4085 The sequential music is interpreted by the Score context initially
4086 (notice that the @code{\context} specification is redundant), but when a
4087 note is encountered, contexts are setup to accept that note. In this
4088 case, a Thread, Voice and Staff are created. The rest of the sequential
4089 music is also interpreted with the same Thread, Voice and Staff context,
4090 putting the notes on the same staff, in the same voice.
4092 This is a convenient mechanism, but do not expect opening chords to work
4093 without @code{\context}. For every note, a separate staff is
4096 @lilypond[verbatim, singleline]
4097 \score { \notes <c'4 es'> }
4100 Of course, if the chord is preceded by a normal note in sequential
4101 music, the chord will be interpreted by the Thread of the preceding
4103 @lilypond[verbatim,singleline]
4104 \score { \notes { c'4 <c'4 es'> } }
4109 @node Context properties
4110 @subsection Context properties
4112 Notation contexts have properties. These properties are from
4113 the @file{.ly} file using the following expression:
4114 @cindex @code{\property}
4116 \property @var{contextname}.@var{propname} = @var{value}
4119 Sets the @var{propname} property of the context @var{contextname} to the
4120 specified Scheme expression @var{value}. All @var{propname} and
4121 @var{contextname} are strings, which are typically unquoted.
4123 Properties that are set in one context are inherited by all of the
4124 contained contexts. This means that a property valid for the
4125 @code{Voice} context can be set in the @code{Score} context (for
4126 example) and thus take effect in all @code{Voice} contexts.
4128 Properties can be unset using the following expression:
4130 \property @var{contextname}.@var{propname} \unset
4133 @cindex properties, unsetting
4134 @cindex @code{\unset}
4136 This removes the definition of @var{propname} in @var{contextname}. If
4137 @var{propname} was not defined in @var{contextname} (but was inherited
4138 from a higher context), then this has no effect.
4143 The syntax of @code{\unset} is asymmetric: @code{\property \unset} is not
4144 the inverse of @code{\property \set}.
4146 @node Engravers and performers
4147 @subsection Engravers and performers
4151 Basic building blocks of translation are called engravers; they are
4152 special C++ classes.
4156 @c . {Context definitions}
4157 @node Changing context definitions
4158 @subsection Changing context definitions
4160 @cindex context definition
4161 @cindex translator definition
4163 The most common way to define a context is by extending an existing
4164 context. You can change an existing context from the paper block, by
4165 first initializing a translator with an existing context identifier:
4169 @var{context-identifier}
4172 Then you can add and remove engravers using the following syntax:
4174 \remove @var{engravername}
4175 \consists @var{engravername}
4179 Here @var{engravername} is a string, the name of an engraver in the
4183 @lilypond[verbatim,singleline]
4187 \translator { \StaffContext
4188 \remove Clef_engraver
4194 You can also set properties in a translator definition. The syntax is as
4197 @var{propname} = @var{value}
4198 @var{propname} \set @var{grob-propname} = @var{pvalue}
4199 @var{propname} \override @var{grob-propname} = @var{pvalue}
4200 @var{propname} \revert @var{grob-propname}
4202 @var{propname} is a string, @var{grob-propname} a symbol, @var{value}
4203 and @code{pvalue} are Scheme expressions. These type of property
4204 assignments happen before interpretation starts, so a @code{\property}
4205 command will override any predefined settings.
4208 To simplify editing translators, all standard contexts have standard
4209 identifiers called @var{name}@code{Context}, e.g. @code{StaffContext},
4210 @code{VoiceContext}, see @file{ly/engraver.ly}.
4212 @node Defining new contexts
4213 @subsection Defining new contexts
4215 If you want to build a context from scratch, you must also supply the
4216 following extra information:
4218 @item A name, specified by @code{\name @var{contextname}}.
4220 @item A cooperation module. This is specified by @code{\type
4227 \type "Engraver_group_engraver"
4230 \consists "Staff_symbol_engraver"
4231 \consists "Note_head_engraver"
4232 \consistsend "Axis_group_engraver"
4236 The argument of @code{\type} is the name for a special engraver that
4237 handles cooperation between simple engravers such as
4238 @code{Note_head_engraver} and @code{Staff_symbol_engraver}. Alternatives
4239 for this engraver are the following:
4241 @cindex @code{Engraver_group_engraver}
4242 @item @code{Engraver_group_engraver}
4243 The standard cooperation engraver.
4245 @cindex @code{Score_engraver}
4247 @item @code{Score_engraver}
4248 This is cooperation module that should be in the top level context,
4249 and only the top level context.
4251 @cindex @code{Grace_engraver_group}
4253 @item @code{Grace_engraver_group}
4254 This is a special cooperation module (resembling
4255 @code{Score_engraver}) that is used to create an embedded
4262 @item @code{\alias} @var{alternate-name}
4263 This specifies a different name. In the above example,
4264 @code{\property Staff.X = Y} will also work on @code{SimpleStaff}s
4266 @item @code{\consistsend} @var{engravername}
4267 Analogous to @code{\consists}, but makes sure that
4268 @var{engravername} is always added to the end of the list of
4271 Some engraver types need to be at the end of the list; this
4272 insures they stay there even if a user adds or removes engravers.
4273 End-users generally don't need this command.
4275 @item @code{\accepts} @var{contextname}
4276 Add @var{contextname} to the list of contexts this context can
4277 contain in the context hierarchy. The first listed context is the
4278 context to create by default.
4280 @item @code{\denies}. The opposite of @code{\accepts}. Added for
4281 completeness, but is never used in practice.
4284 @item @code{\name} @var{contextname}
4285 This sets the type name of the context, e.g. @code{Staff},
4286 @code{Voice}. If the name is not specified, the translator won't do
4290 In the @code{\paper} block, it is also possible to define translator
4291 identifiers. Like other block identifiers, the identifier can only
4292 be used as the very first item of a translator. In order to define
4293 such an identifier outside of @code{\score}, you must do
4298 foo = \translator @{ @dots{} @}
4305 \translator @{ \foo @dots{} @}
4313 @cindex paper types, engravers, and pre-defined translators
4320 @c . {Syntactic details}
4321 @node Syntactic details
4322 @section Syntactic details
4323 @cindex Syntactic details
4325 This section describes details that were too boring to be put elsewhere.
4330 * Music expressions::
4331 * Manipulating music expressions::
4339 @subsection Top level
4342 This section describes what you may enter at top level.
4346 @subsubsection Score
4349 @cindex score definition
4351 The output is generated combining a music expression with an output
4352 definition. A score block has the following syntax:
4355 \score @{ @var{musicexpr} @var{outputdefs} @}
4358 @var{outputdefs} are zero or more output definitions. If none is
4359 supplied, the default @code{\paper} block will be added.
4363 @c . {Default output}
4364 @subsubsection Default output
4366 Default values for the @code{\paper} and @code{\midi} block are set by
4367 entering such a block at the top level.
4370 @subsubsection Header
4372 @cindex @code{\header}
4375 A header describes bibliographic information of the file's contents. It
4376 can also appear in a @code{\score} block. Tools like @code{ly2dvi} can
4377 use this information for generating titles. Key values that are used by
4378 @code{ly2dvi} are: title, subtitle, composer, opus, poet, instrument,
4379 meter, arranger, piece and tagline.
4381 @cindex @code{ly2dvi}
4385 \header @{ @var{key1} = @var{val1}
4386 @var{key2} = @var{val2} @dots{} @}
4389 It is customary to put the @code{\header} at the top of the file.
4391 @subsubsection Default output
4393 A @code{\midi} or @code{\paper} block at top level sets the default
4394 paper block for all scores that lack an explicit paper block.
4398 @subsection Identifiers
4402 What has this section got to do with identifiers?
4403 It seems more appropriate in the introduction to Chapter 4,
4409 All of the information in a LilyPond input file, is internally
4410 represented as a Scheme value. In addition to normal Scheme data types
4411 (such as pair, number, boolean, etc.), LilyPond has a number of
4412 specialized data types,
4419 @item Translator_def
4423 @item Music_output_def
4424 @item Moment (rational number)
4427 LilyPond also includes some transient object types. Objects of these
4428 types are built during a LilyPond run, and do not `exist' per se within
4429 your input file. These objects are created as a result of your input
4430 file, so you can include commands in the input to manipulate them,
4431 during a lilypond run.
4434 @item Grob: short for Graphical object. See @ref{Grobs}.
4435 @item Molecule: device-independent page output object,
4436 including dimensions. Produced by some Grob functions
4438 @item Translator: object that produces audio objects or Grobs. This is
4439 not yet user accessible.
4440 @item Font_metric: object representing a font. (See @ref{Font metrics})
4445 @node Music expressions
4446 @subsection Music expressions
4448 @cindex music expressions
4450 Music in LilyPond is entered as a music expression. Notes, rests, lyric
4451 syllables are music expressions, and you can combine music expressions
4452 to form new ones, for example by enclosing a list of expressions in
4453 @code{\sequential @{ @}} or @code{< >}. In the following example, a
4454 compound expression is formed out of the quarter note @code{c} and a
4455 quarter note @code{d}:
4458 \sequential @{ c4 d4 @}
4461 @cindex Sequential music
4462 @cindex @code{\sequential}
4463 @cindex sequential music
4466 @cindex Simultaneous music
4467 @cindex @code{\simultaneous}
4469 The two basic compound music expressions are simultaneous and
4473 \sequential @code{@{} @var{musicexprlist} @code{@}}
4474 \simultaneous @code{@{} @var{musicexprlist} @code{@}}
4476 For both, there is a shorthand:
4478 @code{@{} @var{musicexprlist} @code{@}}
4482 @code{<} @var{musicexprlist} @code{>}
4484 for simultaneous music.
4485 In principle, the way in which you nest sequential and simultaneous to
4486 produce music is not relevant. In the following example, three chords
4487 are expressed in two different ways:
4489 @lilypond[fragment,verbatim,center]
4490 \notes \context Voice {
4491 <a c'> <b d' > <c' e'>
4492 < { a b c' } { c' d' e' } >
4497 Other compound music expressions include
4500 \transpose @var{pitch} @var{expr}
4501 \apply @var{func} @var{expr}
4502 \context @var{type} = @var{id} @var{expr}
4503 \times @var{fraction} @var{expr}
4507 @c . {Manipulating music expressions}
4508 @node Manipulating music expressions
4509 @subsection Manipulating music expressions
4511 The @code{\apply} mechanism gives you access to the internal
4512 representation of music. You can write Scheme-functions that operate
4513 directly on it. The syntax is
4515 \apply #@var{func} @var{music}
4517 This means that @var{func} is applied to @var{music}. The function
4518 @var{func} should return a music expression.
4520 This example replaces the text string of a script. It also shows a dump
4521 of the music it processes, which is useful if you want to know more
4522 about how music is stored.
4524 @lilypond[verbatim,singleline]
4525 #(define (testfunc x)
4526 (if (equal? (ly-get-mus-property x 'text) "foo")
4527 (ly-set-mus-property x 'text "bar"))
4529 (ly-set-mus-property x 'elements
4530 (map testfunc (ly-get-mus-property x 'elements)))
4535 \apply #testfunc { c'4_"foo" }
4539 For more information on what is possible, see the automatically
4540 generated documentation.
4543 Directly accessing internal representations is dangerous: the
4544 implementation is subject to changes, so you should avoid this feature
4547 A final example is a function that reverses a piece of music in time:
4549 @lilypond[verbatim,singleline]
4550 #(define (reverse-music music)
4551 (let* ((elements (ly-get-mus-property music 'elements))
4552 (reversed (reverse elements))
4553 (span-dir (ly-get-mus-property music 'span-direction)))
4554 (ly-set-mus-property music 'elements reversed)
4556 (ly-set-mus-property music 'span-direction (- span-dir)))
4557 (map reverse-music reversed)
4560 music = \notes { c'4 d'4( e'4 f'4 }
4562 \score { \context Voice {
4564 \apply #reverse-music \music
4569 More examples are given in the distributed example files in
4572 @c . {Span requests}
4578 @subsubsection Span requests
4579 @cindex Span requests
4581 Notational constructs that start and end on different notes can be
4582 entered using span requests. The syntax is as follows:
4586 \spanrequest @var{startstop} @var{type}
4590 @cindex @code{\start}
4591 @cindex @code{\stop}
4593 This defines a spanning request. The @var{startstop} parameter is either
4594 -1 (@code{\start}) or 1 (@code{\stop}) and @var{type} is a string that
4595 describes what should be started. Much of the syntactic sugar is a
4596 shorthand for @code{\spanrequest}, for example,
4598 @lilypond[fragment,verbatim,center]
4599 c'4-\spanrequest \start "slur"
4600 c'4-\spanrequest \stop "slur"
4603 Among the supported types are @code{crescendo}, @code{decrescendo},
4604 @code{beam}, @code{slur}. This is an internal command. Users are
4605 encouraged to use the shorthands which are defined in the initialization
4606 file @file{spanners.ly}.
4611 @subsection Assignments
4614 Identifiers allow objects to be assigned to names during the parse
4615 stage. To assign an identifier, you use @var{name}@code{=}@var{value}
4616 and to refer to an identifier, you precede its name with a backslash:
4617 `@code{\}@var{name}'. @var{value} is any valid Scheme value or any of
4618 the input-types listed above. Identifier assignments can appear at top
4619 level in the LilyPond file, but also in @code{\paper} blocks.
4621 An identifier can be created with any string for its name, but you will
4622 only be able to refer to identifiers whose names begin with a letter,
4623 being entirely alphabetical. It is impossible to refer to an identifier
4624 whose name is the same as the name of a keyword.
4626 The right hand side of an identifier assignment is parsed completely
4627 before the assignment is done, so it is allowed to redefine an
4628 identifier in terms of its old value, e.g.
4634 When an identifier is referenced, the information it points to is
4635 copied. For this reason, an identifier reference must always be the
4636 first item in a block.
4640 \paperIdent % wrong and invalid
4644 \paperIdent % correct
4649 @c . {Lexical modes}
4651 @subsection Lexical modes
4652 @cindex Lexical modes
4655 @cindex @code{\notes}
4656 @cindex @code{\chords}
4657 @cindex @code{\lyrics}
4659 To simplify entering notes, lyrics, and chords, LilyPond has three
4660 special input modes in addition to the default mode: note, lyrics and
4661 chords mode. These input modes change the way that normal, unquoted
4662 words are interpreted: for example, the word @code{cis} may be
4663 interpreted as a C-sharp, as a lyric syllable `cis' or as a C-sharp
4664 major triad respectively.
4666 A mode switch is entered as a compound music expression
4668 @code{\notes} @var{musicexpr}
4669 @code{\chords} @var{musicexpr}
4670 @code{\lyrics} @var{musicexpr}.
4673 In each of these cases, these expressions do not add anything to the
4674 meaning of their arguments. They just instruct the parser in what mode
4675 to parse their arguments. The modes are treated in more detail in
4676 @ref{Lyrics} and @ref{Chords}.
4678 Different input modes may be nested.
4682 @subsection Ambiguities
4687 The grammar contains a number of ambiguities. We hope to resolve them at
4691 @item The assignment
4696 is interpreted as the string identifier assignment. However,
4697 it can also be interpreted as making a string identifier @code{\foo}
4698 containing @code{"bar"}, or a music identifier @code{\foo}
4699 containing the syllable `bar'.
4701 @item If you do a nested repeat like
4713 then it is ambiguous to which @code{\repeat} the
4714 @code{\alternative} belongs. This is the classic if-then-else
4715 dilemma. It may be solved by using braces.
4717 @item The parser is not sophisticated enough to distinguish at the
4719 @code{c4*2 / 3 } and @code{c4*2 / g} (in chord mode).
4726 @c . {Lexical details}
4727 @node Lexical details
4728 @section Lexical details
4730 Even more boring details, now on lexical side of the input parser.
4741 * Version information::
4746 @subsection Comments
4749 @cindex block comment
4750 @cindex line comment
4754 A one line comment is introduced by a @code{%} character.
4755 Block comments are started by @code{%@{} and ended by @code{%@}}.
4756 They cannot be nested.
4759 @subsection Direct Scheme
4763 @cindex Scheme, in-line code
4766 LilyPond contains a Scheme interpreter (the GUILE library) for
4767 internal use. In some places, Scheme expressions also form valid syntax:
4768 wherever it is allowed,
4772 evaluates the specified Scheme code. Example:
4774 \property Staff.TestObject \override #'foobar = #(+ 1 2)
4776 @code{\override} expects two Scheme expressions, so there are two Scheme
4777 expressions. The first one is a symbol (@code{foobar}), the second one
4778 an integer (namely, 3).
4780 In-line scheme may be used at the top level. In this case the result is
4783 Scheme is a full-blown programming language, and a full discussion is
4784 outside the scope of this document. Interested readers are referred to
4785 the website @uref{http://www.schemers.org/} for more information on
4790 @subsection Keywords
4794 Keywords start with a backslash, followed by a number of lower case
4795 alphabetic characters. These are all the keywords.
4798 apply arpeggio autochange spanrequest commandspanrequest
4799 simultaneous sequential accepts alternative bar breathe
4800 char chordmodifiers chords clef cm consists consistsend
4801 context denies duration dynamicscript elementdescriptions
4802 font grace header in lyrics key mark pitch
4803 time times midi mm name pitchnames notes outputproperty
4804 override set revert partial paper penalty property pt
4805 relative remove repeat addlyrics partcombine score
4806 script stylesheet skip textscript tempo translator
4811 @subsection Integers
4819 Formed from an optional minus sign followed by digits. Arithmetic
4820 operations cannot be done with integers, and integers cannot be mixed
4825 @cindex real numbers
4831 Formed from an optional minus sign and a sequence of digits followed
4832 by a @emph{required} decimal point and an optional exponent such as
4833 @code{-1.2e3}. Reals can be built up using the usual operations:
4834 `@code{+}', `@code{-}', `@code{*}', and
4835 `@code{/}', with parentheses for grouping.
4843 A real constant can be followed by one of the dimension keywords:
4844 @code{\mm} @code{\pt}, @code{\in}, or @code{\cm}, for millimeters,
4845 points, inches and centimeters, respectively. This converts the number
4846 a number that is the internal representation of that dimension.
4854 Begins and ends with the @code{"} character. To include a @code{"}
4855 character in a string write @code{\"}. Various other backslash
4856 sequences have special interpretations as in the C language. A string
4857 that contains no spaces can be written without the quotes. Strings can
4858 be concatenated with the @code{+} operator.
4862 @subsection Main input
4865 @cindex @code{\maininput}
4867 The @code{\maininput} command is used in init files to signal that the
4868 user file must be read. This command cannot be used in a user file.
4870 @node File inclusion
4871 @subsection File inclusion
4872 @cindex @code{\include}
4874 \include @var{filename}
4877 Include @var{filename}. The argument @var{filename} may be a quoted string (an
4878 unquoted string will not work here!) or a string identifier. The full
4879 filename including the @file{.ly} extension must be given,
4882 @node Version information
4883 @subsection Version information
4884 @cindex @code{\version}
4886 \version @var{string}
4889 Specify the version of LilyPond that a file was written for. The
4890 argument is a version string in quotes, for example @code{"1.2.0"}.
4891 This is used to detect invalid input, and to aid
4892 @code{convert-ly} a tool that automatically upgrades input files. See
4893 See @ref{convert-ly} for more information on @code{convert-ly}.
4902 @c .{Local emacs vars}
4905 @c minor-mode: font-lock
4906 @c minor-mode: outline
4907 @c outline-layout: (-1 : 0)
4908 @c outline-use-mode-specific-leader: "@c \."
4909 @c outline-primary-bullet: "{"
4910 @c outline-stylish-prefixes: nil
4911 @c outline-override-protect: t