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
15 Rhythm staff (clef, x-notehead)
20 @c .{Reference Manual}
22 @node Reference Manual
23 @chapter Reference Manual
25 This document describes GNU LilyPond and its input format. This document
26 has been revised for LilyPond 1.3.131
56 The purpose of LilyPond is explained informally by the term `music
57 typesetter'. This is not a fully correct name: not only does the
58 program print musical symbols, it also makes esthetic decisions. All
59 symbols and their placement is @emph{generated} from a high-level
60 musical description. In other words, LilyPond would be best described
61 by `music compiler' or `music to notation compiler'.
63 Internally, LilyPond is written in a mixture of Scheme and C++. Most of
64 the algorithms and low-level routines are written in C++, but these low
65 level components are glued together using Scheme data
66 structures. LilyPond is linked to GUILE, GNU's Scheme library for
69 When lilypond is run to typeset sheet music, the following happens:
72 @item GUILE Initialization: various scheme files are read
73 @item parsing: first standard .ly initialization files are read, and
74 then the user @file{.ly} file is read.
75 @item interpretation: the music in the file is processed "in playing
76 order", i.e. in the same order as your eyes scan sheet music, and in the
77 same order that you hear the notes play.
80 in this step, the results of the interpretation, a typesetting
81 specification, is solved.
83 @item the visible results ("virtual ink") is written to the output file.
86 These stages, involve data of a specific type: during parsing,
87 @strong{Music} objects are created. During the interpretation,
88 @strong{context} is constructed, and with this context af network of
89 @strong{graphical objects} (``grobs'') is created. The grobs contain
90 unknown variables, and the network forms a set of equations. After
91 solving the equations and filling in these variables, the printed output
92 (in the form of @strong{molecules}) is written to an output file.
94 These threemanship of tasks (parsing, translating, typesetting) and
95 data-structures (music, context, graphical objects) permeates the entire
96 design of the program. This manual is ordered in terms of user
97 tasks. With each concept will be explained to which of the three parts
100 LilyPond input can be classified into three types:
102 @item musical expressions: a musical expression is some combination of
104 @item output definitions: recipes for translating those musical
105 expressions into performances (MIDI) or graphics (eg. PostScript).
107 @item declarations: by declaring and naming musical expressions, you
108 can enter and edit them in manageable chunks.
122 * Defining pitch names::
132 @subsection Notes mode
136 @cindex @code{\notes}
137 Note mode is introduced by the keyword
138 @code{\notes}. In Note mode, words can only
139 contain alphabetic characters. If @code{word} is encountered,
140 LilyPond first checks for a notename of @code{word}. If no
141 notename is found, then @code{word} is treated as a string.
143 Since combinations of numbers and dots are used for indicating
144 durations, it is not possible to enter real numbers in this mode.
153 @cindex Note specification
155 @cindex entering notes
157 The verbose syntax for pitch specification is
159 @cindex @code{\pitch}
161 \pitch @var{scmpitch}
164 @var{scmpitch} is a pitch scheme object, see @ref{Pitch data type}.
166 In Note and Chord mode, pitches may be designated by names. The default
167 names are the Dutch note names. The notes are specified by the letters
168 @code{c} through @code{b}, where @code{c} is an octave below middle C
169 and the letters span the octave above that C. In Dutch,
170 @cindex note names, Dutch
171 a sharp is formed by adding @code{-is} to the end of a pitch name. A
172 flat is formed by adding @code{-es}. Double sharps and double flats are
173 obtained by adding @code{-isis} or @code{-eses}. @code{aes} and
174 @code{ees} are contracted to @code{as} and @code{es} in Dutch, but both
175 forms will be accepted.
177 LilyPond has predefined sets of notenames for various other languages.
178 To use them, simply include the language specific init file. For
179 example: @code{\include "english.ly"}. The available language files and
180 the names they define are:
183 Note Names sharp flat
184 nederlands.ly c d e f g a bes b -is -es
185 english.ly c d e f g a bf b -s/-sharp -f/-flat
186 deutsch.ly c d e f g a b h -is -es
187 norsk.ly c d e f g a b h -iss/-is -ess/-es
188 svenska.ly c d e f g a b h -iss -ess
189 italiano.ly do re mi fa sol la sib si -d -b
190 catalan.ly do re mi fa sol la sib si -d/-s -b
199 The optional octave specification takes the form of a series of
200 single quote (`@code{'}') characters or a series of comma
201 (`@code{,}') characters. Each @code{'} raises the pitch by one
202 octave; each @code{,} lowers the pitch by an octave.
204 @lilypond[fragment,verbatim,center]
205 c' d' e' f' g' a' b' c''
208 @lilypond[fragment,verbatim,center]
209 cis' dis' eis' fis' gis' ais' bis'
212 @lilypond[fragment,verbatim,center]
213 ces' des' es' fes' ges' as' bes'
216 @lilypond[fragment,verbatim,center]
217 cisis' eisis' gisis' aisis' beses'
220 @lilypond[fragment,verbatim,center]
221 ceses' eses' geses' ases' beses'
225 @c . {Defining pitch names}
226 @node Defining pitch names
227 @subsection Defining pitch names
229 @cindex defining pitch names
230 @cindex pitch names, defining
232 Note names and chord modifiers can be customised for nationalities. The
233 syntax is as follows.
235 @cindex @code{\pitchnames}
236 @cindex @code{\chordmodifiers}
238 \pitchnames @var{scheme-alist}
239 \chordmodifiers @var{scheme-alist}
242 See @file{ly/nederlands.ly} and @file{ly/chord-modifiers.ly} for
243 specific examples how to do this. Some national note names have been
244 provided, among others: Norwegian, Swedish, German, Italian, Catalan,
245 French, Dutch and English.
250 @subsection Durations
254 @cindex @code{\duration}
256 The syntax for an verbose duration specification is
258 \duration @var{scmduration}
261 In Note, Chord, and Lyrics mode, durations may be designated by numbers
262 and dots: durations are entered as their reciprocal values. For notes
263 longer than a whole note, use identifiers.
269 c'1 c'2 c'4 c'8 c'16 c'32 c'64 c'64
271 r1 r2 r4 r8 r16 r32 r64 r64
277 \notes \relative c'' {
278 a\longa a\breve \autoBeamOff
279 a1 a2 a4 a8 a16 a32 a64 a64
281 r1 r2 r4 r8 r16 r32 r64 r64
286 \remove "Clef_engraver";
287 \remove "Staff_symbol_engraver";
288 \remove "Time_signature_engraver";
289 \consists "Pitch_squash_engraver";
296 As you can see, the longa is not printed. To get a longa note head, you
297 have to use a mensural note heads. This is done accomplished by setting
298 the @code{style} property of the NoteHead grob to @code{mensural}.
300 If the duration is omitted then it is set equal to the previous duration
301 entered. At the start of parsing there is no previous duration, so then
302 a quarter note is assumed. The duration can be followed by a dot
303 (`@code{.}') to obtain dotted note lengths.
306 @lilypond[fragment,verbatim,center]
312 You can alter the length of duration by writing `@code{*}@var{fraction}'
313 after it. This will not affect the appearance of note heads or rests.
319 A note specification has the form
322 @var{pitch}[@var{octavespec}][!][?][@var{duration}]
326 LilyPond will determine what accidentals to typeset depending on the key
327 and context, so alteration refer to what note is heard, not to whether
328 accidentals are printed. A reminder accidental
329 @cindex reminder accidental
331 can be forced by adding an exclamation mark @code{!} after the pitch.
332 A cautionary accidental,
333 @cindex cautionary accidental
335 i.e., an accidental within parentheses can be obtained by adding the
336 question mark `@code{?}' after the pitch.
338 @lilypond[fragment,verbatim,center]
339 cis' d' e' cis' c'? d' e' c'!
343 @node Note head tweaks
344 @subsection Note head tweaks
348 The note head style can be adjusted with the @code{style} property of
351 @lilypond[fragment,singleline,relative,verbatim]
353 \property Voice.NoteHead \set #'style = #'cross
357 [discuss more options]
359 @cindex easy notation
362 A entirely different type of note head is the "easyplay" note head: a
363 note head that includes a note name. It is used in some publications by
364 the Hal-Leonard Corporation (a music publishing company).
366 @lilypond[singleline,verbatim]
368 \notes { c'2 e'4 f' | g'1 }
369 \paper { \translator { \EasyNotation } }
373 Note that @code{EasyNotation} overrides a @code{Score} context. You
374 probably will want to print it with magnification to make it better
377 Limitations: The staff-lines show through the letters.
385 Rests are entered like notes, with note name `@code{r}'.
386 There is also a note name
387 `@code{s}', which produces a space of the specified
398 \skip @var{duration} @code{;}
402 Skips the amount of time specified by @var{duration}. If no other
403 music is played, a gap will be left for the skipped time with no
404 notes printed. It works in Note Mode or Lyrics Mode. In Note mode,
405 this has the same effect as the spacer rest.
409 @c . {Music notation}
411 @section Music notation
412 @cindex Music notation
427 @code{\key} @var{pitch} @var{type} @code{;}
429 @cindex @code{\minor}
430 @cindex @code{\major}
431 @cindex @code{\minor}
432 @cindex @code{\ionian}
433 @cindex @code{\locrian}
434 @cindex @code{\aeolian}
435 @cindex @code{\mixolydian}
436 @cindex @code{\lydian}
437 @cindex @code{\phrygian}
438 @cindex @code{\dorian}
440 Change the key signature. @var{type} should be @code{\major} or
441 @code{\minor} to get @var{pitch}-major or @var{pitch}-minor,
442 respectively. The second argument is optional; the default is major
443 keys. The @var{\context} argument can also be given as an integer,
444 which tells the number of semitones that should be added to the pitch
445 given in the subsequent @code{\key} commands to get the corresponding
446 major key, e.g., @code{\minor} is defined as 3. The standard mode names
447 @code{\ionian}, @code{\locrian}, @code{\aeolian}, @code{\mixolydian},
448 @code{\lydian}, @code{\phrygian}, and @code{\dorian} are also defined.
450 This command sets @code{Staff.keySignature}.
454 @cindex @code{keySignature}
457 @subsection Clef changes
460 \clef @var{clefname} @code{;}
466 \property Staff.clefGlyph = @var{symbol associated with clefname}
467 \property Staff.clefPosition = @var{clef Y-position for clefname}
468 \property Staff.clefOctavation = @var{extra pitch of clefname}
471 Supported clef-names include
474 @item treble, violin, G, G2: G clef on 2nd line
475 @item french: G clef on 1st line
476 @item soprano: C clef on 1st line
477 @item mezzosoprano: C clef on 2nd line
478 @item alto: C clef on 3rd line
479 @item tenor: C clef on 4th line
480 @item baritone: C clef on 5th line
481 @item varbaritone: F clef on 3rd line
482 @item bass, F: F clef on 4th line
483 @item subbass: F clef on 5th line
484 @item percussion: percussion clef
487 Supported associated symbols (for Staff.clefGlyph) are:
490 @item clefs-C: modern style C clef
491 @item clefs-F: modern style F clef
492 @item clefs-G: modern style G clef
493 @item clefs-vaticana_do: Editio Vaticana style do clef
494 @item clefs-vaticana_fa: Editio Vaticana style fa clef
495 @item clefs-medicaea_do: Editio Medicaea style do clef
496 @item clefs-medicaea_fa: Editio Medicaea style fa clef
497 @item clefs-mensural1_c: modern style mensural C clef
498 @item clefs-mensural2_c: historic style small mensural C clef
499 @item clefs-mensural3_c: historic style big mensural C clef
500 @item clefs-mensural1_f: historic style traditional mensural F clef
501 @item clefs-mensural2_f: historic style new mensural F clef
502 @item clefs-mensural_g: historic style mensural G clef
503 @item clefs-hufnagel_do: historic style hufnagel do clef
504 @item clefs-hufnagel_fa: historic style hufnagel fa clef
505 @item clefs-hufnagel_do_fa: historic style hufnagel combined do/fa clef
506 @item clefs-percussion: modern style percussion clef
509 @emph{Modern style} means "as is typeset in current editions".
510 @emph{Historic style} means "as was typeset or written in contemporary
511 historic editions". @emph{Editio XXX style} means "as is/was printed in
515 @subsection Breath marks
517 Breath marks are entered using @code{\breathe}:
519 @lilypond[fragment,relative]
525 @c . {Time signature}
527 @subsection Time signature
528 @cindex Time signature
533 \time @var{numerator}@code{/}@var{denominator} @code{;}
536 A short-cut for doing
538 \property Score.timeSignatureFraction = #'(@var{numerator} . @var{denominator})
541 See the documentation of @code{timeSignatureFraction}
545 @subsubsection Partial
549 @cindex partial measure
550 @cindex measure, partial
551 @cindex shorten measures
552 @cindex @code{\partial}
554 \partial @var{duration} @code{;}
560 \property Score.measurePosition = @var{length of duration}
564 See the documentation of @code{measurePosition}.
575 [todo : collisiosn, rest-collisinos, voiceX identifiers, how to
576 which contexts to instantiate.]
580 @cindex @code{\shiftOff}
581 @item @code{\shiftOff}
582 Disable horizontal shifting of note heads that collide.
584 @cindex @code{\shiftOn}
585 @item @code{\shiftOn}
586 Enable note heads that collide with other note heads to be
587 shifted horiztonally. Also @code{\shiftOnn} and @code{\shiftOnnn}
588 set different shift values.
590 @cindex @code{\stemBoth}
591 @item @code{\stemBoth}
592 Allow stems, beams, and slurs to point either upwards or
593 downwards, decided automatically by LilyPond.
595 @cindex @code{\stemDown}
596 @item @code{\stemDown}
597 Force stems, beams, and slurs to point down.
599 @cindex @code{\stemUp}
601 Force stems, beams and slurs to point up.
623 @c . {Automatic beams}
624 @subsubsection Automatic beams
627 @cindex automatic beam generation
629 @cindex @code{Voice.noAutoBeaming}
631 LilyPond will group flagged notes and generate beams autmatically, where
634 This feature can be disabled by setting the @code{Voice.noAutoBeaming}
635 property to true, which you may find necessary for the melody that goes
636 with lyrics, eg. Automatic beaming can easily be overridden for
637 specific cases by specifying explicit beams. This is discussed in the
642 @cindex @code{Voice.autoBeamSettings}
643 @cindex @code{(end * * * *)}
644 @cindex @code{(begin * * * *)}
646 A large number of Voice properties are used to decide how to generate
647 beams. Their default values appear in @file{scm/auto-beam.scm}. In
648 general, beams can begin anywhere, but their ending location is
649 significant. Beams can end on a beat, or at durations specified by the
650 properties in @code{Voice.autoBeamSettings}. To end beams every quarter
651 note, for example, you could set the property @code{(end * * * *)} to
652 @code{(make-moment 1 4)}. To end beams at every three eighth notes you
653 would set it to @code{(make-moment 1 8)}. The same syntax can be used
654 to specify beam starting points using @code{(begin * * * *)}, eg:
657 \property Voice.autoBeamSettings \override
658 #'(end * * * *) = #(make-moment 1 4)
659 \property Voice.autoBeamSettings \override
660 #'(begin * * * *) = #(make-moment 1 8)
664 To allow different settings for different time signatures, instead of
665 the first two asterisks @code{* *} you can specify a time signature; use
666 @code{(end N M * *)} to restrict the definition to
667 `@var{N}@code{/}@var{M}' time. For example, to specify beams ending
668 only for 6/8 time you would use the property @code{(end 6 8 * *)}.
670 To allow different endings for notes of different durations, instead of
671 th last two asterisks you can specify a duration; use @code{(end * * N
672 M)} to restrict the definition to beams that contain notes of
673 `@var{N}@code{/}@var{M}' duration.
675 For example, to specify beam endings for beams that contain 32nd notes,
676 you would use @code{(end * * 1 32)}.
681 @cindex Automatic beams
682 @subsubsection Manual beams
683 @cindex beams, manual
687 In some cases it may be necessary to override LilyPond's automatic
688 beaming algorithm. For example, the auto beamer will not beam over
689 rests or bar lines, so if you want that, specify the begin and end point
690 manually using @code{[} and @code{]}:
693 @lilypond[fragment,relative,verbatim]
695 r4 [r8 g'' a r8] r8 [g | a] r8
700 @cindex @code{stemLeftBeamCount}
702 If you have specific wishes for the number of beams, you can fully
703 control the number of beams through the properties
704 y@code{Voice.stemLeftBeamCount} and @code{Voice.stemRightBeamCount}.
706 @lilypond[fragment,relative,verbatim]
709 [f8 r16 \property Voice.stemLeftBeamCount = #1 f g a]
713 @cindex @code{stemRightBeamCount}
716 @c . {Adjusting beams}
717 @unnumberedsubsubsec Adjusting beams
718 @cindex Adjusting beams
734 A slur connects chords and is used to indicate legato. Slurs avoid
735 crossing stems. A slur is started with @code{(} and stopped with
736 @code{)}. The starting @code{(} appears to the right of the first note
737 in the slur. The terminal @code{)} appears to the left of the last note
738 in the slur. This makes it possible to put a note in slurs from both
741 @lilypond[fragment,verbatim,center]
742 f'()g'()a' [a'8 b'(] a'4 g'2 )f'4
745 @c . {Adjusting slurs}
746 @unnumberedsubsubsec Adjusting slurs
749 @node Slur attachments
750 @subsubsection Slur attachments
752 The ending of a slur should whenever possible be attached to a note
753 head. Only in some instances where beams are involved, LilyPond may
754 attach a slur to a stem end. In some cases, you may want to override
755 LilyPond's decision, e.g., to attach the slur to the stem end. This can
756 be done through @code{Voice.Slur}'s grob-property @code{attachment}:
760 @lilypond[fragment,relative,verbatim]
761 \property Voice.Slur \set #'direction = #1
762 \property Voice.Stem \set #'length = #5.5
764 \property Voice.Slur \set #'attachment = #'(stem . stem)
769 Similarly, slurs can be attached to note heads even when beams are
773 @lilypond[fragment,relative,verbatim]
774 \property Voice.Slur \set #'direction = #1
775 \property Voice.Slur \set #'attachment = #'(head . head)
776 g''16()g()g()g()d'()d()d()d
780 If a slur would strike through a stem or beam, LilyPond will move the
781 slur away vertically (upward or downward). In some cases, this may
782 cause ugly slurs that you may want to correct:
785 @lilypond[fragment,relative,verbatim]
786 \property Voice.Stem \set #'direction = #1
787 \property Voice.Slur \set #'direction = #1
789 \property Voice.Slur \set #'attachment = #'(stem . stem)
794 LilyPond will increase the curvature of a slur trying to stay free of
795 note heads and stems. However, if the curvature would increase too much,
796 the slur will be reverted to its default shape. This decision is based
797 on @code{Voice.Slur}'s grob-property @code{beautiful} value. In some
798 cases, you may find ugly slurs beautiful, and tell LilyPond so by
799 increasing the @code{beautiful} value:
801 [hoe gedefd?? wat betekent beautiful = X?]
806 \notes \context PianoStaff <
808 \context Staff=up { s1 * 6/4 }
809 \context Staff=down <
811 \autochange Staff \context Voice
813 d,8( a' d f a d f d a f d )a
821 Slur \override #'beautiful = #5.0
822 Slur \override #'direction = #1
823 Stem \override #'direction = #-1
824 autoBeamSettings \override #'(end * * * *)
829 VerticalAlignment \override #'threshold = #'(5 . 5)
836 @cindex Adusting slurs
842 @subsection Phrasing slur
843 @cindex phrasing slur
844 @cindex phrasing mark
846 A phrasing slur (or phrasing mark) connects chords and is used to
847 indicate a musical sentence. Phrasing slurs avoid crossing stems. A
848 phrasing slur is started with @code{\(} and stopped with @code{\)}. The
849 starting @code{\(} appears to the right of the first note in the
850 phrasing slur. The terminal @code{\)} appears to the left of the last
851 note in the phrasing slur.
853 @lilypond[fragment,verbatim,center,relative]
854 \time 6/4; c''\((d)e f(e)\)d
857 [TODO: put together with breath mark.]
876 A tie connects two adjacent note heads of the same pitch. When used
877 with chords, it connects all of the note heads whose pitches match.
878 Ties are indicated using the tilde symbol `@code{~}'.
879 If you try to tie together chords which have no common pitches, a
880 warning message will appear and no ties will be created.
882 @lilypond[fragment,verbatim,center]
883 e' ~ e' <c' e' g'> ~ <c' e' g'>
891 @subsubsection Tuplets
895 Tuplets are made out of a music expression by multiplying their duration
898 @cindex @code{\times}
900 \times @var{fraction} @var{musicexpr}
903 The duration of @var{musicexpr} will be multiplied by the fraction.
904 In print, the fraction's denominator will be printed over the notes,
905 optionally with a bracket. The most common tuplet is the triplet in
906 which 3 notes have the length of 2, so the notes are 2/3 of
907 their written length:
909 @lilypond[fragment,verbatim,center]
910 g'4 \times 2/3 {c'4 c' c'} d'4 d'4
913 [todo: document tupletSpannerDuration]
919 @subsubsection Text spanner
924 @subsubsection Ottava
926 @unnumberedsubsubsec Ottava
928 [move to trick. Not a supported feature.]
930 @lilypond[fragment,relative,verbatim]
932 \property Voice.TextSpanner \set #'type = #'dotted-line
933 \property Voice.TextSpanner \set #'edge-height = #'(0 . 1.5)
934 \property Voice.TextSpanner \set #'edge-text = #'("8va " . "")
935 \property Staff.centralCPosition = #-13
936 a\spanrequest \start "text" b c a \spanrequest \stop "text"
943 @subsubsection Span requests
944 @cindex Span requests
946 @cindex @code{\spanrequest}
949 \spanrequest @var{startstop} @var{type}
951 @cindex @code{\start}
954 Define a spanning request. The @var{startstop} parameter is either -1
955 (@code{\start}) or 1 (@code{\stop}) and @var{type} is a string that
956 describes what should be started. Among the supported types are
957 @code{crescendo}, @code{decrescendo}, @code{beam}, @code{slur}.This is
958 an internal command. Users should use the shorthands which are defined
959 in the initialization file @file{spanners.ly}.
961 You can attach a (general) span request to a note using the following
964 @lilypond[fragment,verbatim,center]
965 c'4-\spanrequest \start "slur"
966 c'4-\spanrequest \stop "slur"
969 The slur syntax with parentheses is a shorthand for this.
984 @subsection Articulation
987 @cindex articulations
991 A variety of symbols can appear above and below notes to indicate
992 different characteristics of the performance. These symbols can be
993 added to a note with `@var{note}@code{-\}@var{name}'. Numerous symbols
994 are defined in @file{script.ly} and @file{script.scm}. Symbols can be
995 forced to appear above or below the note by writing
996 `@var{note}@code{^\}@var{name}' and `@var{note}@code{_\}@var{name}'
997 respectively. Here is a chart showing symbols above notes, with the
998 name of the corresponding symbol appearing underneath.
1004 \property Score.LyricSyllable \override #'font-family =
1006 \property Score.LyricSyllable \override #'font-shape = #'upright
1007 c''-\accent c''-\marcato c''-\staccatissimo c''-\fermata
1008 c''-\stopped c''-\staccato c''-\tenuto c''-\upbow
1009 c''-\downbow c''^\lheel c''-\rheel c''^\ltoe
1010 c''-\rtoe c''-\turn c''-\open c''-\flageolet
1011 c''-\reverseturn c''-\trill c''-\prall c''-\mordent
1012 c''-\prallprall c''-\prallmordent c''-\upprall c''-\downprall
1013 c''-\thumb c''-\segno c''-\coda
1015 \context Lyrics \lyrics {
1016 accent__ marcato__ staccatissimo__ fermata
1017 stopped__ staccato__ tenuto__ upbow
1018 downbow__ lheel__ rheel__ ltoe
1019 rtoe__ turn__ open__ flageolet
1020 reverseturn__ trill__ prall__ mordent
1021 prallprall__ prallmordent__ uprall__ downprall
1022 thumb__ segno__ coda
1026 linewidth = 5.875\in;
1035 @subsection Text scripts
1036 @cindex Text scripts
1038 In addition, it is possible to place arbitrary strings of text or markup
1039 text (see @ref{Text markup}) above or below notes by using a string
1040 instead of an identifier: @code{c^"text"}. It is possible to use @TeX{}
1041 commands, but this should be avoided because this makes it impossible
1042 for LilyPond to compute the exact length of the string, which may lead
1043 to collisions. Also, @TeX{} commands won't work with direct postscript
1044 output. Fingerings can be placed by simply using digits. All of these
1045 note ornaments appear in the printed output but have no effect on the
1046 MIDI rendering of the music.
1049 @subsubsection Fingerings
1052 To save typing, fingering instructions (digits 0 to 9 are
1053 supported) and single characters shorthands exist for a few
1058 \notes \context Voice {
1059 \property Voice.TextScript \set #'font-family = #'typewriter
1060 \property Voice.TextScript \set #'font-shape = #'upright
1066 c''4-^_"c-\\^{ }" s4
1073 linewidth = 5.875 \in;
1081 @cindex @code{\textscript}
1085 \textscript @var{text} @var{style}
1088 Defines a text to be printed over or under a note. @var{style} is a
1089 string that may be one of @code{roman}, @code{italic}, @code{typewriter},
1090 @code{bold}, @code{Large}, @code{large}, @code{dynamic} or @code{finger}.
1092 You can attach a general textscript request using this syntax:
1097 c4-\textscript "6" "finger"
1098 c4-\textscript "foo" "normal"
1103 This is equivalent to @code{c4-6 c4-"foo"}.
1105 @cindex @code{\script}
1114 Prints a symbol above or below a note. The argument is a string which
1115 points into the script-alias table defined in @file{scm/script.scm}.
1116 Usually the @code{\script} keyword is not used directly. Various
1117 helpful identifier definitions appear in @file{script.ly}.
1119 For information on how to add scripts, consult @file{scm/script.scm}.
1126 @subsection Grace notes
1135 @cindex @code{\grace}
1138 @cindex @code{graceAlignPosition}
1141 \grace @var{musicexpr}
1144 A grace note expression has duration 0; the next real note is
1145 assumed to be the main note.
1147 You cannot have the grace note after the main note, in terms of
1148 duration, and main notes, but you can typeset the grace notes to the
1149 right of the main note using the property
1150 @code{graceAlignPosition}.
1151 @cindex @code{flagStyle}
1153 When grace music is interpreted, a score-within-a-score is set up:
1154 @var{musicexpr} has its own time bookkeeping, and you could (for
1155 example) have a separate time signature within grace notes. While in
1156 this score-within-a-score, you can create notes, beams, slurs, etc.
1157 Unbeamed eighth notes and shorter by default have a slash through the
1158 stem. This behavior can be controlled with the
1159 @code{flagStyle} property.
1162 @lilypond[fragment,verbatim]
1164 \grace c8 c4 \grace { [c16 c16] } c4
1165 \grace { \property Grace.flagStyle = "" c16 } c4
1172 At present, nesting @code{\grace} notes is not supported. The following
1173 may cause run-time errors:
1175 @code{\grace @{ \grace c32 c16 @} c4}
1177 Since the meaning of such a construct is unclear, we don't consider
1178 this a loss. Similarly, juxtaposing two @code{\grace} sections is
1179 syntactically valid, but makes no sense and may cause runtime errors.
1181 Ending a staff or score with grace notes may also generate a run-time
1182 error, since there will be no main note to attach the grace notes to.
1184 The present implementation is not robust and generally kludgy. We expect
1185 it to change after LilyPond 1.4. Syntax changes might also be
1198 * Crescendo and Decrescendo::
1206 @subsubsection Glissando
1209 @cindex @code{\glissando}
1211 A glissando line can be requested by attaching a @code{\glissando} to a
1215 @lilypond[fragment,relative,verbatim]
1220 Printing of an additional text (such as @emph{gliss.}) must be done
1227 @subsubsection Dynamics
1240 @cindex @code{\ffff}
1254 Dynamic marks are specified by using an identifier after a note:
1255 @code{c4-\ff}. The available dynamic marks are:
1256 @code{\ppp}, @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f},
1257 @code{\ff}, @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf},
1258 @code{\sff}, @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}.
1260 @c . {Crescendo and Decrescendo}
1261 @node Crescendo and Decrescendo
1262 @subsubsection Crescendo and Decrescendo
1264 @cindex Crescendo and Decrescendo
1268 @cindex @code{\decr}
1269 @cindex @code{\rced}
1276 A crescendo mark is started with @code{\cr} and terminated with
1277 @code{\rc}, the textual reverse of @code{cr}. A decrescendo mark is
1278 started with @code{\decr} and terminated with @code{\rced}. There are
1279 also shorthands for these marks. A crescendo can be started with
1280 @code{\<} and a decrescendo can be started with @code{\>}. Either one
1281 can be terminated with @code{\!}. Note that @code{\!} must go before
1282 the last note of the dynamic mark whereas @code{\rc} and @code{\rced} go
1283 after the last note. Because these marks are bound to notes, if you
1284 want to get several marks during one note, you must use spacer notes.
1286 @lilypond[fragment,verbatim,center]
1287 c'' \< \! c'' d'' \decr e'' \rced
1288 < f''1 { s4 \< \! s2 \> \! s4 } >
1291 You can also use a text saying @emph{cresc.} instead of hairpins. Here
1292 is an example how to do it:
1294 @lilypond[fragment,relative,verbatim]
1296 \property Voice.crescendoText = "cresc."
1297 \property Voice.crescendoSpanner = #'dashed-line
1306 @subsubsection Bar lines
1310 @cindex measure lines
1317 This is a short-cut for doing
1319 \property Score.whichBar = @var{bartype}
1322 You are encouraged to use @code{\repeat} for repetitions. See
1323 @ref{Repeats}, and the documentation of @code{whichBar} in
1324 @ref{(lilypond-internals)LilyPond context properties}.
1332 @subsection Bar check
1336 @cindex @code{barCheckNoSynchronize}
1340 Whenever a bar check is encountered during interpretation, a warning
1341 message is issued if it doesn't fall at a measure boundary. This can
1342 help you find errors in the input. Depending on the value of
1343 @code{barCheckNoSynchronize}, the beginning of the measure will be
1344 relocated, so this can also be used to shorten measures.
1346 A bar check is entered using the bar symbol, @code{|}
1358 @cindex @code{\repeat}
1360 In order to specify repeats, use the @code{\repeat}
1361 keyword. Since repeats look and sound differently when played or
1362 printed, there are a few different variants of repeats.
1366 Repeated music is fully written (played) out. Useful for MIDI
1370 This is the normal notation: Repeats are not written out, but
1371 alternative endings (voltas) are printed, left to right.
1374 Alternative endings are written stacked. Which is unfortunately not
1375 practical for anything right now.
1383 * Manual repeat commands::
1385 * Tremolo subdivision::
1389 @subsection Repeat syntax
1391 The syntax for repeats is
1394 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
1397 If you have alternative endings, you may add
1399 @cindex @code{\alternative}
1401 \alternative @code{@{} @var{alternative1}
1403 @var{alternative3} @dots{} @code{@}}
1406 where each @var{alternative} is a Music expression.
1408 Normal notation repeats are used like this:
1412 @lilypond[fragment,verbatim]
1414 \repeat volta 2 { c'4 d' e' f' }
1415 \repeat volta 2 { f' e' d' c' }
1419 With alternative endings:
1423 @lilypond[fragment,verbatim]
1425 \repeat volta 2 {c'4 d' e' f'}
1426 \alternative { {d'2 d'} {f' f} }
1430 Folded repeats look like this:@footnote{Folded repeats offer little
1431 more over simultaneous music. However, it is to be expected that
1432 more functionality -- especially for the MIDI backend -- will be
1433 implemented at some point in the future.}
1437 @lilypond[fragment,verbatim]
1439 \repeat fold 2 {c'4 d' e' f'}
1440 \alternative { {d'2 d'} {f' f} }
1446 If you don't give enough alternatives for all of the repeats, then
1447 the first alternative is assumed to be repeated often enough to equal
1448 the specified number of repeats.
1451 @lilypond[fragment,verbatim]
1455 \repeat volta 3 { e | c2 d2 | e2 f2 | }
1456 \alternative { { g4 g g } { a | a a a a | b2. } }
1464 As you can see, LilyPond doesn't remember the timing information, nor
1465 are slurs or ties repeated, so you have to reset timing information
1466 after a repeat, eg using bar-checks, @code{Score.measurePosition} or
1467 @code{\partial}. We hope to fix this after 1.4.
1469 It is possible to nest @code{\repeat}, although it probably is only
1470 meaningful for unfolded repeats.
1472 @node Manual repeat commands
1473 @subsection Manual repeat commands
1475 @cindex @code{repeatCommands}
1477 The property @code{repeatCommands} can be used to control the layout of
1478 repeats. Its value is a Scheme list of repeat commands, where each repeat
1486 @item (volta . @var{text})
1487 Print a volta bracket saying @var{text}.
1489 Stop a running volta bracket
1492 @lilypond[verbatim, fragment]
1494 \property Score.repeatCommands = #'((volta "93") end-repeat)
1496 \property Score.repeatCommands = #'((volta #f))
1501 @node Tremolo repeats
1502 @subsection Tremolo repeats
1503 @cindex tremolo beams
1505 To place tremolo marks between notes, use @code{\repeat} with tremolo
1507 @lilypond[verbatim,center]
1509 \context Voice \notes\relative c' {
1510 \repeat "tremolo" 8 { c16 d16 }
1511 \repeat "tremolo" 4 { c16 d16 }
1512 \repeat "tremolo" 2 { c16 d16 }
1513 \repeat "tremolo" 4 c16
1516 linewidth = 40*\staffspace;
1521 @node Tremolo subdivision
1522 @subsection Tremolo subdivision
1523 @cindex tremolo marks
1524 @cindex @code{tremoloFlags}
1526 Tremolo marks can be printed on a single note by adding
1527 `@code{:}[@var{length}]' after the note. The length must be at least 8.
1528 A @var{length} value of 8 gives one line across the note stem. If the
1529 length is omitted, then the last value is used, or the value of the
1530 @code{tremoloFlags} property if there was no last value.
1532 @lilypond[verbatim,fragment,center]
1536 Tremolos in this style do not carry over into the MIDI output.
1538 Using this mechanism pays off when you entering many tremolos, since the
1539 default argument saves a lot of typing.
1547 @section Piano music
1549 * Automatic staff changes::
1550 * Manual staff switches::
1557 @c . {Automatic staff changes}
1558 @node Automatic staff changes
1559 @subsection Automatic staff changes
1560 @cindex Automatic staff changes
1562 Voices can be switched from top to bottom staff automatically. The
1565 \autochange @var{contexttype} @var{musicexp}
1567 This will switch notation context of @var{musicexp} between a
1568 @var{contexttype} named @code{up} and @code{down}. Typically, you use
1569 @code{Staff} for @var{contexttype}. The autochanger switches on basis
1570 of pitch (central C is the turning point), and it looks ahead skipping
1571 over rests to switch rests in advance.
1573 @lilypond[verbatim,singleline]
1574 \score { \notes \context PianoStaff <
1575 \context Staff = "up" {
1576 \autochange Staff \context Voice = VA < \relative c' { g4 a b c d r4 a g } >
1578 \context Staff = "down" {
1587 @node Manual staff switches
1588 @subsection Manual staff switches
1590 @cindex manual staff switches
1591 @cindex staff switch, manual
1593 @cindex @code{\translator}
1595 \translator @var{contexttype} = @var{name}
1598 A music expression indicating that the context which is a direct
1599 child of the a context of type @var{contexttype} should be shifted to
1600 a context of type @var{contexttype} and the specified name.
1602 Usually this is used to switch staffs in Piano music, e.g.
1605 \translator Staff = top @var{Music}
1614 Piano pedals can be entered using the following span requests of the
1615 types @code{Sustain}, @code{UnaChorda} and @code{Sostenuto}:
1616 @lilypond[fragment,verbatim]
1617 c''4 \spanrequest \start "Sustain" c4 c4 \spanrequest \stop "Sustain"
1620 For these verbose expressions, standard shorthands have been defined:
1630 The symbols that are printed can be modified by setting pedalXStrings,
1631 where one of the pedal types. Refer to the generaetd documentation for
1634 Currently, brackets are not supported, only text markings (ie. *Ped
1640 @subsection Arpeggio
1643 @cindex broken arpeggio
1644 @cindex @code{\arpeggio}
1646 You can specify an arpeggio sign on a chord by attaching an
1647 @code{\arpeggio} to a note of the chord.
1651 @lilypond[fragment,relative,verbatim]
1652 \context Voice <c'\arpeggio e g c>
1656 When an arpeggio crosses staffs in piano music, you attach an arpeggio
1657 to the chords in both staffs, and set
1658 @code{PianoStaff.connectArpeggios}. LilyPond will connect the arpeggios
1662 @lilypond[fragment,relative,verbatim]
1663 \context PianoStaff <
1664 \property PianoStaff.connectArpeggios = ##t
1665 \context Voice = one { <c''\arpeggio e g c> }
1666 \context Voice = other { \clef bass; <c,,\arpeggio e g>}
1673 @c . {Follow Thread}
1675 @subsection Follow Thread
1676 @cindex follow thread
1677 @cindex staff switching
1680 [todo: different name, eg. voice line ? ]
1682 @cindex @code{followThread}
1684 Whenever a voice switches to another staff a line connecting the notes
1685 can be printed automatically. This is enabled if the property
1686 @code{PianoStaff.followThread} is set to true:
1689 @lilypond[fragment,relative,verbatim]
1690 \context PianoStaff <
1691 \property PianoStaff.followThread = ##t
1692 \context Staff \context Voice {
1694 \translator Staff=two
1697 \context Staff=two {\clef bass; \skip 1*2;}
1711 * Automatic syllable durations::
1717 @subsection Lyrics mode
1721 @cindex @code{\lyrics}
1723 Lyrics mode is introduced by the keyword @code{\lyrics}. This mode has
1724 rules that make it easy to include punctuation and diacritical marks in
1725 words: The purpose of Lyrics mode is that you can enter lyrics in @TeX{}
1726 format or a standard encoding without needing quotes. The precise
1727 definition of this mode is ludicrous, and this will remain so until the
1728 authors of LilyPond acquire a deeper understanding of character
1729 encoding, or someone else steps up to fix this.
1731 A word in Lyrics mode begins with: an alphabetic character, @code{_},
1732 @code{?}, @code{!}, @code{:}, @code{'}, the control characters @code{^A}
1733 through @code{^F}, @code{^Q} through @code{^W}, @code{^Y}, @code{^^},
1734 any 8-bit character with ASCII code over 127, or a two-character
1735 combination of a backslash followed by one of @code{`}, @code{'},
1736 @code{"}, or @code{^}.
1738 Subsequent characters of a word can be any character that is not a digit
1739 and not white space. One important consequence of this is that a word
1740 can end with `@code{@}}', which may be confusing. However, LilyPond will
1741 issue a warning. Any @code{_} character which appears in an unquoted
1742 word is converted to a space. This provides a mechanism for introducing
1743 spaces into words without using quotes. Quoted words can also be used
1744 in Lyrics mode to specify words that cannot be written with the above
1745 rules. Here are some examples. Not all of these words are printable by
1750 2B_||_!2B % not a word because it starts with a digit
1751 ``Hello'' % not a word because it starts with `
1752 _ _ _ _ % 4 words, each one a space
1755 Since combinations of numbers and dots are used for indicating
1756 durations, you can not enter real numbers in this mode.
1758 @cindex lyrics expressions
1760 Syllables are entered like notes, with pitches replaced by text. For
1761 example, @code{Twin-4 kle4 twin-4 kle4} enters four syllables, each
1762 with quarter note duration. Note that the hyphen has no special
1763 meaning for lyrics, and does not introduce special symbols. See
1764 section @ref{Lexical modes} for a description of what is interpreted as
1767 Spaces can be introduced into a lyric either by using quotes
1768 (@code{"}) or by using an underscore without quotes: @code{He_could4
1769 not4}. All unquoted underscores are converted to spaces. Printing
1770 lyrics is discussed in the next section.
1773 @c . {Printing lyrics}
1774 @node Printing lyrics
1775 @subsection Printing lyrics
1779 Lyric syllables must be interpreted within a @code{Lyrics} context for
1780 printing them. Here is a full example:
1786 \notes \transpose c'' {
1788 e f g2 | e4 f g2 \bar "|.";
1790 \context Lyrics \lyrics {
1791 Va-4 der Ja- cob Va- der Ja- cob
1792 Slaapt gij nog?2 Slaapt4 gij nog?2
1804 @cindex lyric extender
1806 You may want a continuous line after the syllables to show melismata.
1807 To achieve this effect, add a @code{__} lyric as a separate word
1808 after the lyric to be extended. This will create an extender, a line
1809 that extends over the entire duration of the lyric. This line will
1810 run all the way to the start of the next lyric, so you may want to
1811 shorten it by using a blank lyric (using @code{_}).
1818 \notes \relative c'' {
1819 a4 () b () c () d | c () d () b () a | c () d () b () a
1821 \context Lyrics \lyrics {
1822 foo1 __ | bar2. __ _4 | baz1 __
1830 @cindex Lyric hyphen
1832 If you want to have hyphens centered between syllables (rather than
1833 attached to the end of the first syllable) you can use the special
1834 `@code{-}@code{-}' lyric as a separate word between syllables. This
1835 will result in a hyphen which length varies depending on the space
1836 between syllables, and which will be centered between the syllables.
1844 \notes \transpose c'' {
1846 e f g2 | e4 f g2 \bar "|.";
1848 \context Lyrics \lyrics {
1849 Va4 -- der Ja -- cob | Va -- der Ja -- cob |
1850 Slaapt gij nog?2 | Slaapt4 gij nog?2
1859 @c . {Automatic syllable durations}
1860 @node Automatic syllable durations
1861 @subsection Automatic syllable durations
1862 @cindex Automatic syllable durations
1865 @cindex automatic lyric durations
1866 @cindex @code{\addlyrics}
1868 If you have lyrics that are set to a melody, you can import the rhythm
1869 of that melody into the lyrics using @code{\addlyrics}. The syntax for
1872 \addlyrics @var{musicexpr1 musicexpr2}
1875 This means that both @var{musicexpr1} and @var{musicexpr2} are
1876 interpreted, but that every non-command atomic music expression
1877 (``every syllable'') in @var{musicexpr2} is interpreted using timing
1878 of @var{musicexpr1}.
1879 @cindex @code{automaticMelismata}
1881 If the property @code{automaticMelismata} is set in the
1882 context of @var{musicexpr1}, no lyrics will be put on slurred or tied
1886 @lilypond[verbatim,fragment]
1889 \property Voice.automaticMelismata = ##t
1890 c8 () cis d8. e16 f2
1892 \context Lyrics \lyrics {
1897 You should use a single rhythm melody, and single rhythm lyrics (a
1898 constant duration is the obvious choice). If you do not, you will get
1899 undesired effects when using multiple stanzas:
1902 @lilypond[verbatim,fragment]
1905 c8 () cis d8. e16 f2
1907 \context Lyrics \lyrics
1914 It is valid (but probably not very useful) to use notes instead of
1915 lyrics for @var{musicexpr2}.
1918 @subsection More stanzas
1922 If you have multiple stanzas printed underneath each other, the separate
1923 syllables should be aligned around punctuation. LilyPond can do this if
1924 you explain it which lyric lines belong to which melody.
1926 To this end, give the Voice context an identity, and set the LyricsVoice
1927 to name starting with that identity. In the following example, the Voice
1928 identity is @code{duet}, and the identities of the LyricsVoices are
1929 @code{duet-1} and @code{duet-2}.
1932 @lilypond[singleline,verbatim]
1935 \notes \relative c'' \context Voice = duet { \time 3/4; g2 e4 a2 f4 g2. }
1936 \lyrics \context Lyrics <
1937 \context LyricsVoice = "duet-1" {
1938 \property LyricsVoice . stanza = "Bert"
1939 Hi, my name is bert. }
1940 \context LyricsVoice = "duet-2" {
1941 \property LyricsVoice . stanza = "Ernie"
1942 Ooooo, ch\'e -- ri, je t'aime. }
1947 You can add stanza numbers by setting @code{LyricsVoice.Stanza} (for the
1948 first system) and @code{LyricsVoice.stz} for the following systems.
1950 @cindex stanza numbering
1958 [chords vs. simultaneous music]
1962 * Entering named chords::
1963 * Printing named chords::
1968 @subsection Chords mode
1971 Chord mode is introduced by the keyword
1972 @code{\chords}. It is similar to Note mode, but
1973 words are also looked up in a chord modifier table (containing
1974 @code{maj}, @code{dim}, etc).
1976 Since combinations of numbers and dots are used for indicating
1977 durations, you can not enter real numbers in this mode. Dashes
1978 and carets are used to indicate chord additions and subtractions,
1979 so scripts can not be entered in Chord mode.
1981 @c . {Entering named chords}
1982 @node Entering named chords
1983 @subsection Entering named chords
1984 @cindex Chords names
1986 Chord names are a way to generate simultaneous music expressions that
1987 correspond with traditional chord names. It can only be used in
1988 Chord mode (see section @ref{Lexical modes}).
1992 @var{tonic}[@var{duration}][@code{-}@var{modifiers}][@code{^}@var{subtractions}][@code{/}@var{inversion}][@code{/+}@var{bass}].
1995 @var{tonic} should be the tonic note of the chord, and @var{duration}
1996 is the chord duration in the usual notation. There are two kinds of
1997 modifiers. One type is @emph{chord additions}, which are obtained by
1998 listing intervals separated by dots. An interval is written by its
1999 number with an optional @code{+} or @code{-} to indicate raising or
2000 lowering by half a step. Chord additions has two effects: It adds
2001 the specified interval and all lower odd numbered intervals to the
2002 chord, and it may lower or raise the specified interval. Intervals
2003 must be separated by a dot (@code{.}).
2006 Throughout these examples, chords have been shifted around the staff
2007 using @code{\transpose}.
2012 @lilypond[fragment,verbatim]
2016 c:9 c:9-.5+.7+ c:3-.5- c:4.6.8
2028 The second type of modifier that may appear after the @code{:} is a
2029 named modifier. Named modifiers are listed in the file
2030 @file{chord-modifiers.ly}. The available modifiers are @code{m} and
2031 @code{min} which lower the 3rd half a step, `@code{aug}' which
2032 raises the 5th, `@code{dim}' which lowers the 5th,
2033 `@code{maj}' which adds a raised 7th, and `@code{sus}'
2034 which replaces the 5th with a 4th.
2038 @lilypond[fragment,verbatim]
2041 c1:m c:min7 c:maj c:aug c:dim c:sus
2049 Chord subtractions are used to eliminate notes from a chord. The
2050 notes to be subtracted are listed after a @code{^} character,
2053 @lilypond[fragment,verbatim,center]
2062 Chord inversions can be specified by appending `@code{/}' and
2063 the name of a single note to a chord. This has the effect of
2064 lowering the specified note by an octave so it becomes the lowest
2065 note in the chord. If the specified note is not in the chord, a
2066 warning will be printed.
2068 @lilypond[fragment,verbatim,center]
2078 Bass notes can be added by `@code{/+}' and
2079 the name of a single note to a chord. This has the effect of
2080 adding the specified note to the chord, lowered by an octave,
2081 so it becomes the lowest note in the chord.
2083 @lilypond[fragment,verbatim,center]
2092 The most interesting application is printing chord names, which is
2093 explained in the next subsection.
2095 You should not combine @code{\relative} with named chords. [FIXME]
2097 @c . {Printing named chords}
2098 @node Printing named chords
2099 @subsection Printing named chords
2105 @cindex printing chord names
2108 @cindex @code{ChordNames}
2109 @cindex @code{ChordNameVoice}
2111 For displaying printed chord names, use the @code{ChordNames} and
2112 @code{ChordNameVoice} contexts. The chords may be entered either using
2113 the notation described above, or directly using simultaneous music.
2116 @lilypond[verbatim,singleline]
2118 \chords {a1 b c} <d f g> <e g b>
2122 \context ChordNamesVoice \scheme
2123 \context Staff \transpose c'' \scheme
2129 You can make the chord changes stand out more by setting property
2130 @code{ChordNames.chordChanges} to true. This will only display chord
2131 names when there's a change in the chords scheme, but always display the
2132 chord name after a line break:
2138 c1:m \break c:m c:m c:m d
2143 \context ChordNames \scheme
2144 \context Staff \transpose c'' \scheme
2147 linewidth = 40 * \staffspace;
2159 LilyPond examines chords specified as lists of notes to determine a
2160 name to give the chord. LilyPond will not try to
2161 identify chord inversions or added base, which may result in strange
2162 chord names when chords are entered as a list of pitches:
2165 @lilypond[verbatim,center,singleline]
2174 \context ChordNamesVoice \scheme
2175 \context Staff \scheme
2181 To specify chord inversions, append @code{/<notename>}. To specify an
2182 added bass note, append @code{/+<notename}:
2185 @lilypond[verbatim,center,singleline]
2192 \context ChordNames \scheme
2193 \context Staff \transpose c'' \scheme
2199 The chord names that LilyPond should print are fully customizable. The
2200 code to print chord names is written in Scheme. It can be found in
2201 @file{scm/chord-name.scm}. Chord names are based on Banter style
2202 naming, which is unambiguous and has a logical structure. Typical
2203 American style chord names are implemented as a variation on Banter
2204 names, they can be selected by setting property @code{ChordName.style}
2209 \include "english.ly"
2214 df:m5- % Diminished triad
2215 c:5^3 % Root-fifth chord
2216 c:4^3 % Suspended fourth triad
2217 c:5+ % Augmented triad
2219 c:m5-.7- % Diminished seventh
2220 c:7+ % Major seventh
2221 c:7.4^3 % Dominant seventh suspended fourth
2222 c:5+.7 % Augmented dominant seventh
2223 c:m5-.7 % "Half" diminished seventh
2224 c:5-.7 % Dominant seventh flat fifth
2225 c:5-.7+ % Major seventh flat fifth
2226 c:m7+ % Minor-major seventh
2227 c:m7 % Minor seventh
2228 c:7 % Dominant seventh
2231 c:9^7 % Major triad w/added ninth
2232 c:6.9^7 % Six/Nine chord
2233 c:9 % Dominant ninth
2234 c:7+.9 % Major ninth
2235 c:m7.9 % Minor ninth
2240 \context ChordNames \scheme
2241 \context Staff \transpose c'' \scheme
2246 ChordName \override #'word-space = #1
2247 ChordName \override #'style = #'american
2254 Similarly, Jazz style chord names are implemented as a variation on
2255 American style names:
2261 c:6 % 6 = major triad with added sixth
2262 c:maj % triangle = maj
2267 c:m % m = minor triad
2268 c:m.6 % m6 = minor triad with added sixth
2269 c:m.7+ % m triangle = minor major seventh chord
2277 c:7.5+ % +7 = augmented dominant
2278 c:7.5- % 7b5 = hard diminished dominant
2285 c:13.9-^11 % 7(b9,13)
2286 c:13.9+^11 % 7(#9,13)
2288 c:13-.9-^11 % 7(b9,b13)
2289 c:13-.9+^11 % 7(#9,b13)
2291 % half diminished chords
2292 c:m5-.7 % slashed o = m7b5
2293 c:9.3-.5- % o/7(pure 9)
2296 c:m5-.7- % o = diminished seventh chord
2301 \context ChordNames \scheme
2302 \context Staff \transpose c'' \scheme
2307 ChordName \override #'word-space = #1
2308 ChordName \override #'style = #'jazz
2316 @section Writing parts
2321 * Instrument names::
2323 * Sound output for transposing instruments::
2324 * Multi measure rests::
2325 * Automatic part combining::
2328 @c . {Rehearsal marks}
2329 @node Rehearsal marks
2330 @subsection Rehearsal marks
2331 @cindex Rehearsal marks
2333 @cindex @code{\mark}
2334 @cindex @code{Mark_engraver}
2337 \mark @var{unsigned};
2342 With this command, you can print a rehearsal mark above the system. You
2343 can provide a number, a string or a markup text as argument. If there is
2344 no argument, the property @code{rehearsalMark} is used and automatically
2347 @lilypond[fragment,verbatim]
2353 c1 \mark #'(music "scripts-segno") ;
2358 @node Instrument names
2359 @subsection Instrument names
2361 You can specify an instrument name for a staff by setting
2362 @code{Staff.instrument} and @code{Staff.instr}. This will print a string
2363 before the start of the staff. For the first start, @code{instrument} is
2364 used, for the next ones @code{instr} is used.
2366 @lilypond[verbatim,singleline]
2368 \property Staff.instrument = "instr " { c''4 } }
2370 \translator { \StaffContext
2371 \consists "Instrument_name_engraver"; } } }
2374 This requires that you add the @code{Instrument_name_engraver} to the
2379 @subsection Transpose
2381 @cindex transposition of pitches
2382 @cindex @code{\transpose}
2384 A music expression can be transposed with @code{\transpose}. The syntax
2387 \transpose @var{pitch} @var{musicexpr}
2390 This means that middle C in @var{musicexpr} is transposed to
2393 @code{\transpose} distinguishes between enharmonic pitches: both
2394 @code{\transpose cis'} or @code{\transpose des'} will transpose up half
2395 a tone. The first version will print sharps and the second version
2399 @lilypond[fragment,verbatim]
2402 { \key e \major; c d e f }
2404 \transpose des'' { \key e \major; c d e f }
2405 \transpose cis'' { \key e \major; c d e f }
2411 If you want to use both @code{\transpose} and @code{\relative}, then
2412 you must use @code{\transpose} first. @code{\relative} will have no
2413 effect music that appears inside a @code{\transpose}.
2415 @node Sound output for transposing instruments
2416 @subsection Sound output transposing instruments
2418 When you want to play a score containing transposed and untransposed
2419 instruments, you have to instruct LilyPond the pitch offset (in
2420 semitones) for the transposed instruments. This is done using
2423 @cindex @code{transposing}
2426 \property Staff.instrument = #"Cl. in B-flat"
2427 \property Staff.transposing = #-2
2431 @c . {Multi measure rests}
2432 @node Multi measure rests
2433 @subsection Multi measure rests
2434 @cindex Multi measure rests
2438 Multi measure rests are entered using `@code{R}'. It is specifically
2439 meant for entering parts: the rest can expand to fill a score with
2440 rests, or it can be printed as a single multimeasure rest This expansion
2441 is controlled by the property @code{Score.skipBars}. If this is set to true,
2442 Lily will not expand empty measures, and the appropriate number is added
2445 @lilypond[fragment,verbatim]
2446 \time 3/4; R2.*2 \property Score.skipBars = ##t R2.*17 R2.*4
2449 Currently, there is no way to condense multiple rests into a single
2452 @cindex condensing rests
2454 @node Automatic part combining
2455 @subsection Automatic part combining
2456 @cindex automatic part combining
2457 @cindex part combiner
2459 You will already have seen that LilyPond can combine several Threads
2460 into one Voice, and put several Voices onto one Staff. The automatic
2461 part combiner takes this a step further. Two parts of music can be
2462 combined together in an intelligent way, ie, when the two parts are
2463 identical for a period of time, only one can be showed. In places where
2464 the two parts differ, stem directions can be set automatically. That is
2465 why the part combiner is of great use for the typesetting of Hymns and
2469 @subsubsection Part combine syntax
2471 The syntax for part combining is
2474 \partcombine @var{context} @var{musicexpr1} @var{musicexpr2}
2477 where the pieces of music @var{musicexpr1} and @var{musicexpr2} will be
2478 combined into one context @var{context}. The names of the music
2479 expressions must start with the prefixes @code{one} and @code{two}.
2481 @subsubsection Part combine usage
2483 @cindex @code{Thread_devnull_engraver}
2484 @cindex @code{Voice_engraver}
2485 @cindex @code{A2_engraver}
2487 The most useful function of the part combiner to combining threads into
2488 one voice, as common for wind parts in orchestral scores:
2490 @lilypond[verbatim,singleline,fragment]
2492 \context Voice=one \partcombine Voice
2493 \context Thread=one \notes\relative c'' {
2496 \context Thread=two \notes\relative c'' {
2502 If you have developed a bit of a feel for LilyPond's functioning, you
2503 will notice that what you see above is quite unusual. The first
2504 @code{g} appears only once, although it was specified twice (once in
2505 each Thread). That is the work of the
2506 @code{Thread_devnull_engraver}@footnote{On unix systems, the file
2507 @file{/dev/null} is special device: anything written to it is
2508 discarded.}, that works closely together with the part combiner. When
2509 the part combiner notices that two threads are identical, it tells the
2510 @code{Thread_devnull_engraver} to discard everything in the second
2513 Similarly, the markings @emph{@`{a}2}, @emph{Solo} and @emph{Solo II},
2514 are created by the @code{A2_engraver}. The @code{A2_engraver} also acts
2515 upon instructions of the part combiner. Another thing that the
2516 @code{A2_engraver} does, is forcing of stem, slur and tie directions,
2517 always when both threads are not identical; up for the musicexpr called
2518 @code{one}, down for the musicexpr called @code{two}.
2520 There is actually a third engraver involved in part combining; the
2521 @code{Voice_devnull_engraver}. This one takes care of removing
2522 redundant spanners such as beams, slurs, ties, crescendi, etc.
2524 If you just want the splitting of Threads and setting of directions, and
2525 not the textual markings, you may set the property @var{soloADue} to false:
2527 @lilypond[verbatim,singleline]
2529 \context Voice=one \partcombine Voice
2530 \context Thread=one \notes\relative c'' {
2533 \context Thread=two \notes\relative c'' {
2545 There are a number of other properties that you can use to tweak the
2546 behavior of part combining, refer to the automatically generated
2547 documentation of the involved engravers and the examples in the tutorial.
2556 A @emph{custos} (plural: @emph{custodes}; latin word for "guard") is a
2557 staff context symbol that appears at the end of a staff line. It
2558 anticipates the pitch of the first note(s) of the following line and
2559 thus helps the player or singer to manage line breaks during
2560 performance, thus enhancing readability of a score.
2565 \notes { c'1 d' e' d' \break c' d' e' d' }
2569 \consists Custos_engraver;
2570 Custos \override #'style = #'mensural;
2577 Custodes were frequently used in music notation until the 16th century.
2578 There were different appearences for different notation styles.
2579 Nowadays, they have survived only in special forms of musical notation
2580 such as via the editio vaticana dating back to the beginning of the 20th
2583 For typesetting custodes, just put a @code{Custos_engraver} into the
2584 @code{StaffContext} when declaring the @code{\paper} block. In this
2585 block, you can also globally control the appearance of the custos symbol
2586 by setting the custos @code{style} property. Currently supported styles
2587 are @code{vaticana}, @code{medicaea}, @code{hufnagel} and
2594 \consists Custos_engraver;
2595 Custos \override #'style = #'mensural;
2600 The property can also be set locally, for example in a @code{\notes}
2605 \property Staff.Custos \override #'style = #'vaticana
2606 c'1 d' e' d' \break c' d' e' d'
2610 @c . {Tuning output}
2612 @section Tuning output
2614 LilyPond tries to take as much formatting as possible out of your
2615 hands. Nevertheless, there are situations where it needs some help, or
2616 where you want to override its decisions.
2618 Here we discuss how you can do that.
2620 Notational output is specified in so called grobs (graphic
2621 objects). Each grob carries with it a set of properties (grob
2622 properties) specific to that grob. For example, a stem grob has grob
2623 properties that specify its direction, length and thickness.
2625 The most common way of tuning the output is to alter the values of these
2626 properties. There are two ways of doing that: first, you can
2627 specifically select a set of grobs at one point, and set properties as
2628 you wish, or secondly, you can (temporarily) modify the definition of a
2629 grob, thereby affecting an entire group of grobs.
2632 * Tuning groups of grobs ::
2633 * Tuning per grob ::
2638 @node Tuning groups of grobs
2639 @subsection Tuning groups of grobs
2641 @cindex grob description
2643 A grob definition is an association list, that is stored in a context
2644 property. By assigning to that property (using plain @code{\property}),
2645 you can change the resulting grobs.
2646 @lilypond[verbatim, fragment]
2647 c'4 \property Voice.Stem = #'((meta . ((interfaces . ())))) c'4
2649 The @code{\property} statement effectively empties the definition of the
2650 Stem object. One of the effects is that property specifying how it
2651 should be printed is erased, with the effect of rendering it invisible.
2658 This mechanism is fairly crude, since you can only set, but not modify,
2659 the definition of a grob. For this reason, there is a more advanced
2660 mechanism: you can add a property on top of an existing definition, or
2661 remove a property: @code{\override} adds a settings, @code{\revert}
2662 removes that setting.
2664 c'4 \property Voice.Stem \override #'thickness = #4.0
2665 c'4 \property Voice.Stem \revert #'thickness
2669 For the digirati, the grob description is an Scheme association
2670 list. Since it is singly linked, we can treat it as a stack, and
2671 @code{\override} and @code{\revert} are just push and pop
2672 operations. This pushing and popping is also used in the
2673 @code{autoBeamSettings} property.
2675 If you revert a setting which was not set in the first place, then it
2676 has no effect. However, if the setting was set as a system default, it
2677 may remove the default value, and this may give surprising results,
2678 including crashes. In other words, if you use @code{\override} and
2679 @code{\revert}, be sure to balance the overrides and reverts.
2681 If balancing them is too much work, use the following shorthand:
2682 @code{\set} performs a revert followed by an override:
2684 \property Voice.Stem \set #'thickness = #2.0
2687 Formally the syntax for these constructions is
2689 \property @var{context}.@var{grobname} \override @var{symbol} = @var{value}
2690 \property @var{context}.@var{grobname} \set @var{symbol} = @var{value}
2691 \property @var{context}.@var{grobname} \revert @var{symbol}
2693 Here @var{symbol} is a Scheme expression of symbol type, @var{context}
2694 and @var{grobname} are strings and @var{value} is a Scheme expression.
2696 LilyPond will hang or crash if @var{value} contains cyclic references.
2700 @node Tuning per grob
2701 @subsection Tuning per grob
2703 @cindex \outputproperty
2705 A second way of tuning grobs is the more arcane @code{\outputproperty}
2707 Syntax is as follows
2709 \outputproperty @var{predicate} @var{symbol} = @var{value}
2711 Here @code{predicate} is a Scheme functoin taking a grob a argument
2712 argument, and returning a boolean. This statement is processed by the
2713 @code{Output_property_engraver}. It instructs the engraver to feed all
2714 grobs that it sees to @var{predicate}. Whenever the predicate returns
2715 true, the grob property @var{symbol} will be set to @var{value}.
2717 You will need to combine this statement with @code{\context} to select
2718 the appropriate context to apply this to.
2720 If possible, avoid this feature: the semantics are not very clean, and
2721 the syntax and semantics are up for rewrite.
2723 Here are some random examples:
2725 @lilypond[fragment,verbatim,singleline]
2727 \context Staff \outputproperty
2728 #(make-type-checker 'note-head-interface)
2729 #'extra-offset = #'(0.5 . 0.75)
2733 @cindex @code{extra-offset}
2735 This selects all note heads occurring at current staff level, and sets
2736 the @code{extra-offset} of those heads to @code{(0.5,0.75)}, shifting
2739 Move the text "m.d.", but not the fingering instruction "2".
2740 @lilypond[verbatim,singleline]
2741 #(define (make-text-checker text)
2742 (lambda (grob) (equal? text (ly-get-elt-property grob 'text))))
2745 \notes\relative c''' {
2746 \property Voice.Stem \set #'direction = #1
2747 \outputproperty #(make-text-checker "m.d.")
2748 #'extra-offset = #'(-3.5 . -4.5)
2758 @subsection What to tune?
2760 This all tells you how to tune grobs, but what variables are there? The
2761 question is not answered in this manual (although you may encounter
2764 Grob properties are tied directly to the implementation of LilyPond, and
2765 they are thus a moving target. Refer to the automatically generated
2766 documentation of the internals (available from the website).
2768 You need the following information
2772 which grob to modify
2774 which property to modify
2776 which context the grob comes from.
2779 Included with the automatically generated documentation is a master list
2780 of grobs. Each one can be clicked, taking you to a overview of the
2781 available properties.
2783 There is also a master list of contexts. Clicking each takes you to an
2784 overview of the context, listing which grob types are created there.
2789 @subsection Text markup
2793 LilyPond has an internal mechanism to typeset texts. You can
2794 form text markup expressions by composing scheme expressions
2795 in the following way.
2798 \score { \notes \relative c' {
2801 d-#'(lines "one" (bold "text"))
2802 e-#'(music (named "noteheads-2" "flags-u3"))
2804 \paper { linewidth = 10.\cm; } }
2807 Normally, the Scheme markup text is stored in the @code{text} property
2808 of a grob. Formally, it is defined as follows:
2811 text: string | (head? text+)
2812 head: markup | (markup+)
2813 markup-item: property | abbrev | @var{fontstyle}
2814 property: (@var{key} . @var{value})
2815 abbrev: @code{rows lines roman music bold italic named super sub text}
2818 The markup is broken down and converted into a list of grob properties,
2819 which are prepended to the grop's property list. The
2820 @var{key}-@var{value} pair is a grob property.
2822 The following abbreviations are currently
2827 horizontal mode: set all text on one line (default)
2829 vertical mode: set every text on new line
2839 lookup by character name
2841 plain text lookup (by character value)
2848 @var{fontstyle} may be any of @code{finger volta timesig mmrest mark
2849 script large Large dynamic}
2854 @section Page layout
2868 @subsection Paper block
2871 The most important output definition is the @code{\paper} block, for
2872 music notation. The syntax is
2875 @code{\paper @{} [@var{paperidentifier}] @var{items} @code{@}}
2878 where each of the items is one of
2881 @item An assignment. The assignment must be terminated by a
2884 @item A context definition. See Section @ref{Notation Contexts} for
2885 more information on context definitions.
2887 @item \stylesheet declaration. Its syntax is
2889 \stylesheet @var{alist}
2892 See @file{font.scm} for details of @var{alist}.
2895 @c . {Paper variables}
2896 @node Paper variables
2897 @subsection Paper variables
2898 @cindex Paper variables
2900 The paper block has some variables you may want to use or change:
2903 @cindex @code{indent}
2905 The indentation of the first line of music.
2906 @cindex @code{staffspace}
2908 @item @code{staffspace}
2909 The distance between two staff lines, calculated from the center
2910 of the lines. You should use either this or @code{stafflinethickness}
2911 as a unit for distances you modify.
2913 @cindex @code{linewidth}
2914 @item @code{linewidth}
2915 Sets the width of the lines.
2917 If set to a negative value, a single
2918 unjustified line is produced.
2920 @cindex @code{textheight}
2922 @item @code{textheight}
2923 Sets the total height of the music on each page. Only used by
2925 @cindex @code{interscoreline}
2927 @item @code{interscoreline}
2928 Sets the spacing between the score lines. Defaults to 16 pt.
2929 @cindex @code{interscorelinefill}
2931 @item @code{interscorelinefill}
2932 If set to a positive number, the distance between the score
2933 lines will stretch in order to fill the full page. In that
2934 case @code{interscoreline} specifies the minimum spacing.
2936 @cindex @code{stafflinethickness}
2938 @item @code{stafflinethickness}
2939 Determines the thickness of staff lines, and also acts as a scaling
2940 parameter for other line thicknesses.
2947 @subsection Font size
2950 The Feta font provides musical symbols at six different sizes. These
2951 fonts are 11 point, 13 point, 16 point, 20 point,
2952 23 point, and 26 point. The point size of a font is the
2953 height of the five lines in a staff when displayed in the font.
2955 Definitions for these sizes are the files @file{paperSZ.ly}, where
2956 @code{SZ} is one of 11, 13, 16, 20, 23 and 26. If you include any of
2957 these files, the identifiers @code{paperEleven}, @code{paperThirteen},
2958 @code{paperSixteen}, @code{paperTwenty}, @code{paperTwentythree}, and
2959 @code{paperTwentysix} are defined respectively. The default
2960 @code{\paper} block is also set.
2962 The font definitions are generated using a Scheme function. For more
2963 details, see the file @file{font.scm}.
2969 @subsection Paper size
2974 @cindex @code{papersize}
2976 To change the paper size, you must first set the
2977 @code{papersize} variable at top level. Set it to
2978 the strings @code{a4}, @code{letter}, or @code{legal}. After this
2979 specification, you must set the font as described above. If you want
2980 the default font, then use the 20 point font. The new paper size will
2981 not take effect if the font is not loaded and selected afterwards.
2985 \include "paper16.ly"
2989 \paper @{ \paperSixteen @}
2993 The file "paper16.ly" will now include a file named @file{a4.ly}, which
2994 will set the paper variables @code{hsize} and @code{vsize} (used by
3005 @subsection Line break
3008 @cindex breaking lines
3010 Line breaks are normally computed automatically. They are chosen such
3011 that the resulting spacing has low variation, and looks neither cramped
3014 Occasionally you might want to override the automatic breaks; you can do
3015 this by specifying @code{\break}. This will force a line break at this
3016 point. Do remember that line breaks can only occur at places where there
3017 are barlines. If you want to have a line break where there is no
3018 barline, you can force a barline by entering @code{\bar "";}.
3020 Similarly, @code{\noBreak} forbids a line break at a certain point.
3022 @cindex @code{\penalty}
3024 The @code{\break} and @code{\noBreak} commands are defined in terms of
3025 the penalty command:
3027 \penalty @var{int} @code{;}
3030 This imposes encourages or discourages LilyPond to make a line break
3033 @strong{Warning} do not use @code{\penalty} directly. It is rather
3034 kludgy, and slated for rewriting.
3038 @subsection Page break
3041 @cindex breaking pages
3044 Page breaks are normally computed by @TeX{}, so they are not under direct
3045 control. However, you can insert a commands into the @file{.tex} output to
3046 instruct @TeX{} where to break pages. For more details, see the
3047 example file @file{input/test/between-systems.ly}
3061 LilyPond allows MIDI output, with the purpose of proof-hearing the music
3062 you enter. The performance lacks lots of interesting effects, such as
3063 swing, articulation, slurring, tieing, etc.
3065 Also note that it is not possible to use the percussion channel
3066 (generally channel 10 of a MIDI file).
3070 * MIDI instrument names::
3076 @subsection MIDI block
3080 The MIDI block is analogous to the paper block, but it is somewhat
3081 simpler. The @code{\midi} block can contain:
3085 @item a @code{\tempo} definition
3086 @item context definitions
3089 Assignments in the @code{\midi} block are not allowed.
3093 @cindex context definition
3095 Context definitions follow precisely the same syntax as within the
3096 \paper block. Translation modules for sound are called performers.
3097 The contexts for MIDI output are defined in @file{ly/performer.ly}.
3100 [Instrument Equaliser]
3102 FIXME: would it be useful to refer to files like scm/midi.scm,
3103 or to give examples of how to tweak MIDI output volume?
3106 @c . {MIDI instrument names}
3107 @node MIDI instrument names
3108 @subsection MIDI instrument names
3109 @cindex instrument names
3110 @cindex @code{Staff.midiInstrument}
3111 @cindex @code{Staff.instrument}
3113 The MIDI instrument name is set by the @code{Staff.midiInstrument}
3114 property or, if that property is not set, the @code{Staff.instrument}
3115 property. The instrument name should be chosen from the following list.
3116 If the selected string does not exactly match, then LilyPond uses the
3119 [FIXME: to appendix ]
3123 "acoustic grand" "contrabass" "lead 7 (fifths)"
3124 "bright acoustic" "tremolo strings" "lead 8 (bass+lead)"
3125 "electric grand" "pizzicato strings" "pad 1 (new age)"
3126 "honky-tonk" "orchestral strings" "pad 2 (warm)"
3127 "electric piano 1" "timpani" "pad 3 (polysynth)"
3128 "electric piano 2" "string ensemble 1" "pad 4 (choir)"
3129 "harpsichord" "string ensemble 2" "pad 5 (bowed)"
3130 "clav" "synthstrings 1" "pad 6 (metallic)"
3131 "celesta" "synthstrings 2" "pad 7 (halo)"
3132 "glockenspiel" "choir aahs" "pad 8 (sweep)"
3133 "music box" "voice oohs" "fx 1 (rain)"
3134 "vibraphone" "synth voice" "fx 2 (soundtrack)"
3135 "marimba" "orchestra hit" "fx 3 (crystal)"
3136 "xylophone" "trumpet" "fx 4 (atmosphere)"
3137 "tubular bells" "trombone" "fx 5 (brightness)"
3138 "dulcimer" "tuba" "fx 6 (goblins)"
3139 "drawbar organ" "muted trumpet" "fx 7 (echoes)"
3140 "percussive organ" "french horn" "fx 8 (sci-fi)"
3141 "rock organ" "brass section" "sitar"
3142 "church organ" "synthbrass 1" "banjo"
3143 "reed organ" "synthbrass 2" "shamisen"
3144 "accordion" "soprano sax" "koto"
3145 "harmonica" "alto sax" "kalimba"
3146 "concertina" "tenor sax" "bagpipe"
3147 "acoustic guitar (nylon)" "baritone sax" "fiddle"
3148 "acoustic guitar (steel)" "oboe" "shanai"
3149 "electric guitar (jazz)" "english horn" "tinkle bell"
3150 "electric guitar (clean)" "bassoon" "agogo"
3151 "electric guitar (muted)" "clarinet" "steel drums"
3152 "overdriven guitar" "piccolo" "woodblock"
3153 "distorted guitar" "flute" "taiko drum"
3154 "guitar harmonics" "recorder" "melodic tom"
3155 "acoustic bass" "pan flute" "synth drum"
3156 "electric bass (finger)" "blown bottle" "reverse cymbal"
3157 "electric bass (pick)" "skakuhachi" "guitar fret noise"
3158 "fretless bass" "whistle" "breath noise"
3159 "slap bass 1" "ocarina" "seashore"
3160 "slap bass 2" "lead 1 (square)" "bird tweet"
3161 "synth bass 1" "lead 2 (sawtooth)" "telephone ring"
3162 "synth bass 2" "lead 3 (calliope)" "helicopter"
3163 "violin" "lead 4 (chiff)" "applause"
3164 "viola" "lead 5 (charang)" "gunshot"
3165 "cello" "lead 6 (voice)"
3176 @cindex beats per minute
3177 @cindex metronome marking
3179 @cindex @code{\tempo}
3181 \tempo @var{duration} = @var{perminute} @code{;}
3184 Used to specify the tempo. For example, @code{\tempo 4 = 76;} requests
3185 output with 76 quarter notes per minute.
3193 @section Music entry
3204 @subsection Relative
3206 @cindex relative octave specification
3208 Octaves are specified by adding @code{'} and @code{,} to pitch names.
3209 When you copy existing music, it is easy to accidentally put a pitch in
3210 the wrong octave and hard to find such an error. To prevent these
3211 errors, LilyPond features octave entry.
3213 @cindex @code{\relative}
3215 \relative @var{startpitch} @var{musicexpr}
3218 The octave of notes that appear in @var{musicexpr} are calculated as
3219 follows: If no octave changing marks are used, the basic interval
3220 between this and the last note is always taken to be a fourth or less.
3221 The octave changing marks @code{'} and @code{,} can then
3222 be added to raise or lower the pitch by an extra octave. Upon entering
3223 relative mode, an absolute starting pitch must be specified that will
3224 act as the predecessor of the first note of @var{musicexpr}.
3226 This distance is determined without regarding accidentals: a
3227 @code{fisis} following a @code{ceses} will be put above the
3230 Entering scales is straightforward in relative mode.
3232 @lilypond[fragment,verbatim,center]
3234 g a b c d e f g g, g
3238 And octave changing marks are used for intervals greater than a fourth.
3240 @lilypond[fragment,verbatim,center]
3242 c g c f, c' a, e'' }
3245 If the preceding item is a chord, the first note of the chord is used
3246 to determine the first note of the next chord. But other notes
3247 within the second chord are determined by looking at the immediately
3250 @lilypond[fragment,verbatim,center]
3257 @cindex @code{\notes}
3259 The pitch after the @code{\relative} contains a notename. To parse
3260 the pitch as a notename, you have to be in note mode, so there must
3261 be a surrounding @code{\notes} keyword (which is not
3264 The relative conversion will not affect @code{\transpose} or
3265 @code{\relative} sections in its argument. If you want to use
3266 relative within transposed music, you must place an additional
3267 @code{\relative} inside the @code{\transpose}.
3270 @c . {Point and click}
3271 @node Point and click
3272 @subsection Point and click
3281 * Notation Contexts::
3282 * Creating contexts::
3283 * Default contexts::
3284 * Context properties::
3285 * Changing context definitions::
3286 * Defining new contexts::
3289 @c . {Music expressions}
3293 @c . {Notation Contexts}
3294 @node Notation Contexts
3295 @subsection Notation Contexts
3297 @cindex notation contexts
3299 Notation contexts are objects that only exist during a run of LilyPond.
3300 During the interpretation phase of LilyPond (when lily prints
3301 "interpreting music"), music a @code{\score} block is interpreted in
3302 time order, i.e. in much the same order that humans read, play, and
3305 During this reading, the notation context is holds the state
3306 for the current point within the music. It contains information like
3309 @item What notes are playing at this point?
3310 @item What symbols will be printed at this point?
3311 @item What is the current key signature, time signature, point within
3315 Contexts are grouped hierarchically: A @code{Voice} context is
3316 contained in a @code{Staff} context (because a staff can contain
3317 multiple voices at any point), a @code{Staff} context is contained in
3318 a @code{Score}, @code{StaffGroup}, or @code{ChoirStaff} context (because
3319 these can all contain multiple staffs).
3322 Contexts associated with sheet music output are called @emph{notation
3323 contexts}, those for sound output are called performance contexts.
3326 @node Creating contexts
3327 @subsection Creating contexts
3329 @cindex @code{\context}
3330 @cindex context selection
3332 Contexts for a music expression can be selected manually, using the
3333 following music expression.
3336 \context @var{contexttype} [= @var{contextname}] @var{musicexpr}
3339 This instructs lilypond to interpret @var{musicexpr} within the context
3340 of type @var{contexttype} and with name @var{contextname}. If this
3341 context does not exist, it will be created.
3345 @lilypond[verbatim,singleline]
3347 \notes \relative c'' {
3348 c4 <d4 \context Staff = "another" e4> f
3355 In this example, the @code{c} and @code{d} are printed on the
3356 default staff. For the @code{e}, a context Staff called
3357 @code{another} is specified; since that does not exist, a new
3358 context is created. Within @code{another}, a (default) Voice context
3359 is created for the @code{e4}. When all music referring to a
3360 context is finished, the context is ended as well. So after the
3361 third quarter, @code{another} is removed.
3365 @node Default contexts
3366 @subsection Default contexts
3368 Most music expressions don't need @code{\context}: they inherit the
3369 notation context from their parent. Each note is a music expression, and
3370 as you can see in the following example, only the sequential music
3371 enclosing the three notes has an explicit context.
3373 @lilypond[verbatim,singleline]
3374 \score { \notes \context Voice = goUp { c'4 d' e' } }
3377 There are some quirks that you must keep in mind when dealing with
3380 Every top-level music is interpreted by the Score context, in other
3381 words, you may think of @code{\score} working like
3384 \context Score @var{music}
3388 Sequential music follows the contexts of its "children". Take this example
3389 @lilypond[verbatim, singleline]
3390 \score { \context Score \notes { c'4 ( d' )e' } }
3393 The sequential music is interpreted by the Score context initially
3394 (notice that the @code{\context} specification is redundant), but when a
3395 note is encountered, contexts are setup to accept that note. In this
3396 case, a Thread, Voice and Staff are created. The rest of the sequential
3397 music is also interpreted with the same Thread, Voice and Staff context,
3398 putting the notes on the same staff, in the same voice.
3400 This is a convenient mechanism, but do not expect opening chords to work
3401 without @code{\context}. For every note, a separate staff is
3404 @lilypond[verbatim, singleline]
3405 \score { \notes <c'4 es'> }
3408 Of course, if the chord is preceded by a normal note in sequential
3409 music, the chord will be interpreted by the Thread of the preceding
3411 @lilypond[verbatim,singleline]
3412 \score { \notes { c'4 <c'4 es'> } }
3417 @node Context properties
3418 @subsection Context properties
3420 Notation contexts can be modified from within the @file{.ly} file. The
3421 following music expression does that job:
3423 @cindex @code{\property}
3425 \property @var{contextname}.@var{propname} = @var{value}
3428 Sets the @var{propname} property of the context @var{contextname} to the
3429 specified Scheme expression @var{value}. All @var{propname} and
3430 @var{contextname} are strings, which are typically unquoted.
3432 Properties that are set in one context are inherited by all of the
3433 contained contexts. This means that a property valid for the
3434 @code{Voice} context can be set in the @code{Score} context (for
3435 example) and thus take effect in all @code{Voice} contexts.
3440 @c . {Context definitions}
3441 @node Changing context definitions
3442 @subsection Changing context definitions
3444 @cindex context definition
3445 @cindex translator definition
3447 The most common way to define a context is by extending an existing
3448 context. You can change an existing context from the paper block, by
3449 first initializing a translator with an existing context identifier:
3453 @var{context-identifier}
3456 Then you can add engravers, remove engravers and set context
3457 properties. The syntax for these operations are respectively
3459 \remove @var{engravername}
3460 \consists @var{engravername}
3461 @var{propname} = @var{value}
3464 Here @var{engravername} is a string, the name of an engraver in the
3465 system. @var{propname} is a string and @var{value} is a Scheme
3468 @lilypond[verbatim,singleline]
3472 \translator { \StaffContext
3473 \consists Instrument_name_engraver;
3475 \remove Clef_engraver;
3481 These type of property assignments happen before interpretation starts,
3482 so a @code{\property} expression will override any predefined settings.
3484 Engravers are the actual C++ modules that do the work in the
3485 interpretation phase.
3488 There are some pre-defined identifiers to simplify editing translators,
3489 they are defined in @file{ly/engraver.ly}. These pre-defined
3493 @cindex @code{StaffContext}
3494 @item @code{StaffContext}
3495 Default Staff context.
3496 @cindex @code{RhythmicStaffContext}
3498 @item @code{RhythmicStaffContext}
3499 Default RhythmicStaff context.
3500 @cindex @code{VoiceContext}
3502 @item @code{VoiceContext}
3503 Default Voice context.
3504 @cindex @code{ScoreContext}
3506 @item @code{ScoreContext}
3507 Default Score context.
3509 @cindex @code{HaraKiriStaffContext}
3511 @item @code{HaraKiriStaffContext}
3512 Staff context that does not print if it only contains rests.
3513 Useful for orchestral scores.@footnote{Harakiri, also called
3514 Seppuku, is the ritual suicide of the Japanese Samourai warriors.}
3517 @node Defining new contexts
3518 @subsection Defining new contexts
3520 If you want to build a context from scratch, you must also supply the
3521 following extra information:
3523 @item A name, specified by @code{\name @var{contextname};}.
3525 @item A cooperation engraver. This is specified by @code{\type
3530 A context definition has this syntax:
3534 \translator @code{@{}
3535 @var{translatorinit} @var{translatormodifierlist}
3539 @var{translatorinit} can be an identifier or
3543 where @var{typename} is one of
3545 The cooperation engraver groups other engravers, and specifies how they
3546 should cooperate. Choices are:
3549 @cindex @code{Engraver_group_engraver}
3550 @item @code{Engraver_group_engraver}
3551 The standard cooperation engraver.
3553 @cindex @code{Score_engraver}
3555 @item @code{Score_engraver}
3556 This is cooperation module that should be in the top level context,
3557 and only the toplevel context.
3559 @cindex @code{Grace_engraver_group}
3561 @item @code{Grace_engraver_group}
3562 This is a special cooperation module (resembling
3563 @code{Score_engraver}) that is used to created an embedded
3567 @var{translatormodifierlist} is a list of items where each item is
3571 @item @code{\consists} @var{engravername} @code{;}
3572 Add @var{engravername} to the list of modules in this context.
3573 The order of engravers added with @code{\consists} is
3576 @item @code{\consistsend} @var{engravername} @code{;}
3577 Analogous to @code{\consists}, but makes sure that
3578 @var{engravername} is always added to the end of the list of
3581 Some engraver types need to be at the end of the list; this
3582 insures they are put there, and stay there, if a user adds or
3583 removes engravers. This command is usually not needed for
3586 @item @code{\accepts} @var{contextname} @code{;}
3587 Add @var{contextname} to the list of context this context can
3588 contain. The first listed context is the context to create by
3591 @item @code{\denies}. The opposite of @code{\accepts}. Added for
3592 completeness, but is never used in practice.
3595 @item @code{\remove} @var{engravername} @code{;}
3596 Remove a previously added (with @code{\consists}) engraver.
3598 @item @code{\name} @var{contextname} @code{;}
3599 This sets name of the context, e.g. @code{Staff}, @code{Voice}. If
3600 the name is not specified, the translator won't do anything.
3602 @item @var{propname} @code{=} @var{value} @code{;}
3603 A property assignment.
3606 In the @code{\paper} block, it is also possible to define translator
3607 identifiers. Like other block identifiers, the identifier can only
3608 be used as the very first item of a translator. In order to define
3609 such an identifier outside of @code{\score}, you must do
3615 foo = \translator @{ @dots{} @}
3622 \translator @{ \foo @dots{} @}
3630 @cindex paper types, engravers, and pre-defined translators
3635 Properties can be preset within the @code{\translator} block
3636 corresponding to the appropriate context. In this case, the syntax
3640 @var{propname} @code{=} @var{value}
3643 The property settings are used during the interpretation phase. They
3644 are read by the LilyPond modules where interpretation contexts are
3645 built of. These modules are called @emph{translators}. Translators for
3646 notation are called @emph{engravers}, and translators for sound are
3647 called @emph{performers}.
3652 @c . {Syntactic details}
3653 @node Syntactic details
3654 @section Syntactic details
3655 @cindex Syntactic details
3659 * Music expressions::
3660 * Manipulating music expressions::
3669 @subsection Top level
3672 This section describes what you may enter at top level.
3676 @subsubsection Score
3679 @cindex score definition
3681 The output is generated combining a music expression with an output
3682 definition. A score block has the following syntax:
3685 \score @{ @var{musicexpr} @var{outputdefs} @}
3688 @var{outputdefs} are zero or more output definitions. If no output
3689 definition is supplied, the default @code{\paper} block will be added.
3693 @c . {Default output}
3694 @subsubsection Default output
3696 Default values for the @code{\paper} and @code{\midi} block are set by
3697 entering such a block at top-level.
3700 @subsubsection Header
3702 @cindex @code{\header}
3707 \header @{ @var{key1} = @var{val1};
3708 @cindex @code{ly2dvi}
3709 @var{key2} = @var{val2}; @dots{} @}
3713 A header describes the file's contents. It can also appear in a
3714 @code{\score} block. Tools like @code{ly2dvi} can use this
3715 information for generating titles. Key values that are used by
3716 @code{ly2dvi} are: title, subtitle, composer, opus, poet, instrument,
3717 metre, arranger, piece and tagline.
3719 It is customary to put the @code{\header} at the top of the file.
3721 @subsubsection Default output
3723 A @code{\midi} or @code{\paper} block at top-level sets the default
3725 paper block for all scores that lack an explicit paper block.
3729 @subsection Identifiers
3732 All of the information in a LilyPond input file, is represented as a
3733 Scheme value. In addition to normal Scheme data types (such as pair,
3734 number, boolean, etc.), LilyPond has a number of specialized data types,
3741 @item Translator_def
3745 @item Music_output_def
3746 @item Moment (rational number)
3749 LilyPond also includes some transient object types. Objects of these
3750 types are built during a LilyPond run, and do not `exist' per se within
3751 your input file. These objects are created as a result of your input
3752 file, so you can include commands in the input to manipulate them,
3753 during a lilypond run.
3756 @item Grob: short for Graphical object. See @ref{Grobs}.
3757 @item Molecule: device-independent page output object,
3758 including dimensions. Produced by some Grob functions
3760 @item Translator: object that produces audio objects or Grobs. This is
3761 not yet user accessible.
3762 @item Font_metric: object representing a font. (See @ref{Font metrics})
3767 @node Music expressions
3768 @subsection Music expressions
3770 @cindex music expressions
3772 Music in LilyPond is entered as a music expression. Notes, rests, lyric
3773 syllables are music expressions, and you can combine music expressions
3774 to form new ones, for example by enclosing a list of expressions in
3775 @code{\sequential @{ @}} or @code{< >}. In this example, a compound
3776 expression is formed out of the quarter note @code{c} and a quarter note
3780 \sequential @{ c4 d4 @}
3783 @cindex Sequential music
3784 @cindex @code{\sequential}
3785 @cindex sequential music
3788 @cindex Simultaneous music
3789 @cindex @code{\simultaneous}
3791 The two basic compound music expressions are simultaneous and
3795 \sequential @code{@{} @var{musicexprlist} @code{@}}
3796 \simultaneous @code{@{} @var{musicexprlist} @code{@}}
3798 For both, there is a shorthand:
3800 @code{@{} @var{musicexprlist} @code{@}}
3804 @code{<} @var{musicexprlist} @code{>}
3806 for simultaneous music.
3807 Other compound music expressions include
3810 \transpose @var{pitch} @var{expr}
3811 \apply @var{func} @var{expr}
3812 \context @var{type} = @var{id} @var{expr}
3813 \times @var{fraction} @var{expr}
3816 In principle, the way in which you nest sequential and simultaneous to
3817 produce music is not relevant. In the following example, three chords
3818 are expressed in two different ways:
3820 @lilypond[fragment,verbatim,center]
3821 \notes \context Voice {
3822 <a c'> <b d' > <c' e'>
3823 < { a b c' } { c' d' e' } >
3827 However, in some cases, LilyPond will also try to choose contexts, and
3828 use the structure of the music expression to do so. This can have
3829 undesired effects: for example, LilyPond will create a separate staff
3830 for each note if you start a @code{\score} with a chord:
3831 @lilypond[verbatim,center,singleline]
3836 The solution is to explicitly instantiate the context you desire.
3837 In this case this is typically a Voice context
3838 @lilypond[verbatim,center,singleline]
3840 \notes\context Voice <c''4 e''>
3843 If you use @code{\context Staff} you will get separate stems for each
3844 note head, leading to collisions, so don't use that.
3848 @c . {Manipulating music expressions}
3849 @node Manipulating music expressions
3850 @subsection Manipulating music expressions
3852 The @code{\apply} mechanism gives you access to the internal
3853 representation of music. You can write Scheme-functions that operate
3854 directly on it. The syntax is
3856 \apply #@var{func} @var{music}
3858 This means that @var{func} is applied to @var{music}. The function
3859 @var{func} should return a music expression.
3861 This example replaces the text string of a script. It also shows a dump
3862 of the music it processes, which is useful if you want to know more
3863 about how music is stored.
3865 #(define (testfunc x)
3866 (if (equal? (ly-get-mus-property x 'text) "foo")
3867 (ly-set-mus-property x 'text "bar"))
3869 (ly-set-mus-property x 'elements
3870 (map testfunc (ly-get-mus-property x 'elements)))
3875 \apply #testfunc { c4_"foo" }
3879 For more information on what is possible, see the @ref{Tricks} and the
3880 automatically generated documentation.
3882 As always: directly accessing internal representations is dangerous: the
3883 implementation is subject to changes, so you should not use this if
3889 @subsection Assignments
3892 Identifiers allow objects to be assigned to names during the parse
3893 stage. To assign an identifier, you use @var{name}@code{=}@var{value}
3894 and to refer to an identifier, you preceed its name with a backslash:
3895 `@code{\}@var{name}'. @var{value} is any valid Scheme value or any of
3896 the input-types listed above. Identifier assignments can appear at top
3897 level in the LilyPond file, but also in @code{\paper} blocks.
3899 Semicolons are forbidden after top level assignments, but mandatory in
3900 other places. The rules about semicolons and assignments are very
3901 confusing, but when LilyPond input evolves more towards Scheme, we hope
3902 that this problem will grow smaller.
3904 An identifier can be created with any string for its name, but you will
3905 only be able to refer to identifiers whose names begin with a letter,
3906 being entirely alphabetical. It is impossible to refer to an identifier
3907 whose name is the same as the name of a keyword.
3909 The right hand side of an identifier assignment is parsed completely
3910 before the assignment is done, so it is allowed to redefine an
3911 identifier in terms of its old value, e.g.
3917 When an identifier is referenced, the information it points to is
3918 copied. For this reason, an identifier reference must always be the
3919 first item in a block.
3923 \paperIdent % wrong and invalid
3927 \paperIdent % correct
3931 @c . {Lexical details}
3932 @node Lexical details
3933 @subsection Lexical details
3934 @cindex Lexical details
3939 @subsubsection Comments
3945 A one line comment is introduced by a @code{%} character.
3946 Block comments are started by @code{%@{} and ended by @code{%@}}.
3947 They cannot be nested.
3949 @c . {Direct Scheme}
3950 @subsubsection Direct Scheme
3953 @cindex Scheme, in-line code
3956 LilyPond contains a Scheme interpreter (the GUILE library) for
3957 internal use. In some places Scheme expressions also form valid syntax:
3958 whereever it is allowed,
3962 evaluates the specified Scheme code. If this is used at toplevel, then
3963 the result is discarded. Example:
3965 \property Staff.TestObject \override #'foobar = #(+ 1 2)
3968 @code{\override} expects two Scheme expressions, so there are two Scheme
3969 expressions. The first one is a symbol (@code{foobar}), the second one
3970 an integer (namely, 3).
3972 Scheme is a full-blown programming language, and a full discussion is
3973 outside the scope of this document. Interested readers are referred to
3974 the website @uref{http://www.schemers.org/} for more information on
3979 @subsubsection Keywords
3983 Keywords start with a backslash, followed by a number of lower case
3984 alphabetic characters. These are all the keywords.
3987 apply arpeggio autochange spanrequest commandspanrequest
3988 simultaneous sequential accepts alternative bar breathe
3989 char chordmodifiers chords clef cm consists consistsend
3990 context denies duration dynamicscript elementdescriptions
3991 font grace header in lyrics key mark pitch
3992 time times midi mm name pitchnames notes outputproperty
3993 override set revert partial paper penalty property pt
3994 relative remove repeat addlyrics partcombine score
3995 script stylesheet skip textscript tempo translator
4000 @subsubsection Integers
4008 Formed from an optional minus sign followed by digits. Arithmetic
4009 operations cannot be done with integers, and integers cannot be mixed
4013 @subsubsection Reals
4014 @cindex real numbers
4020 Formed from an optional minus sign and a sequence of digits followed
4021 by a @emph{required} decimal point and an optional exponent such as
4022 @code{-1.2e3}. Reals can be built up using the usual operations:
4023 `@code{+}', `@code{-}', `@code{*}', and
4024 `@code{/}', with parentheses for grouping.
4032 A real constant can be followed by one of the dimension keywords:
4033 @code{\mm} @code{\pt}, @code{\in}, or @code{\cm}, for millimeters,
4034 points, inches and centimeters, respectively. This converts the number
4035 to a real that is the internal representation of dimensions.
4039 @subsubsection Strings
4043 Begins and ends with the @code{"} character. To include a @code{"}
4044 character in a string write @code{\"}. Various other backslash
4045 sequences have special interpretations as in the C language. A string
4046 that contains no spaces can be written without the quotes. See
4047 @ref{Lexical modes} for details on unquoted strings; their
4048 interpretation varies depending on the situation. Strings can be
4049 concatenated with the @code{+} operator.
4051 The tokenizer accepts the following commands. They have no grammatical
4052 function, hence they can appear anywhere in the input.
4056 @subsubsection Main input
4059 @cindex @code{\maininput}
4061 The @code{\maininput} command is used in init files to signal that the
4062 user file must be read. This command cannot be used in a user file.
4064 @c . {File inclusion}
4065 @subsubsection Main input
4068 @subsubsection File inclusion
4069 @cindex @code{\include}
4071 \include @var{filename}
4074 Include @var{filename}. The argument @var{filename} may be a quoted string (an
4075 unquoted string will not work here!) or a string identifier. The full
4076 filename including the @file{.ly} extension must be given,
4078 @subsubsection Version information
4079 @cindex @code{\version}
4081 \version @var{string} ;
4084 Specify the version of LilyPond that a file was written for. The
4085 argument is a version string in quotes, for example @code{"1.2.0"}.
4086 This is used to detect invalid input, and to aid
4087 @code{convert-ly} a tool that automatically upgrades input files. See
4088 See @ref{convert-ly} for more information on @code{convert-ly}.
4094 @subsubsection Defining pitch names
4095 @cindex Lexical modes
4096 @cindex definining pitch names
4097 @cindex pitch names, definining
4099 @cindex chord modifier names
4101 A @code{\paper} block at top level sets the default paper block. A
4102 @code{\midi} block at top level works similarly.
4105 @subsubsection Assignments
4109 Identifier assignments may appear at top level. @ref{Assignments}
4113 @c . {Direct scheme}
4114 @subsubsection Direct scheme
4115 @cindex Direct scheme
4117 Scheme statements maybe issued to produce interesting side-effects.
4120 @c . {Lexical modes}
4122 @subsection Lexical modes
4123 @cindex Lexical modes
4126 @cindex @code{\notes}
4127 @cindex @code{\chords}
4128 @cindex @code{\lyrics}
4130 To simplify entering notes, lyrics, and chords, LilyPond has three
4131 special input modes on top of the default mode: note, lyrics and chords
4132 mode. These input modes change the way that normal, unquoted words are
4133 interpreted: for example, the word @code{cis} may be interpreted as a
4134 C-sharp, as a lyric syllable `cis' or as a C-sharp major triad
4137 A mode switch is entered as a compound music expressions
4139 @code{\notes} @var{musicexpr}
4140 @code{\chords} @var{musicexpr}
4141 @code{\lyrics} @var{musicexpr}.
4144 In each of these cases, these expressions do not add anything to the
4145 meaning of their arguments. They are just a way to indicate that the
4146 arguments should be parsed in indicated mode. The modes are treated in
4147 more detail in the sections @ref{Note entry}, @ref{Lyrics} and
4150 You may nest different input modes.
4154 @subsection Ambiguities
4159 The grammar contains a number of ambiguities. We hope to resolve them at
4163 @item The assignment
4169 can be interpreted as making a string identifier @code{\foo}
4170 containing @code{"bar"}, or a music identifier @code{\foo}
4171 containing the syllable `bar'.
4173 @item The assignment
4179 can be interpreted as making an integer identifier
4180 containing -6, or a Request identifier containing the
4181 fingering `6' (with neutral direction).
4183 @item If you do a nested repeat like
4195 then it is ambiguous to which @code{\repeat} the
4196 @code{\alternative} belongs. This is the classic if-then-else
4197 dilemma. It may be solved by using braces.
4199 @item (an as yet unidentified ambiguity :-)
4206 @c .{Local emacs vars}
4209 @c minor-mode: font-lock
4210 @c minor-mode: outline
4211 @c outline-layout: (-1 : 0)
4212 @c outline-use-mode-specific-leader: "@c \."
4213 @c outline-primary-bullet: "{"
4214 @c outline-stylish-prefixes: nil
4215 @c outline-override-protect: t