1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond.tely
4 @c A menu is needed before every deeper *section nesting of @node's; run
5 @c M-x texinfo-all-menus-update
6 @c to automatically fill in these menus before saving changes
9 @node Advanced notation
10 @chapter Advanced notation
12 This chapter deals with rarely-used and advanced notation.
18 * Contemporary notation::
27 This section explains how to include text (with various formatting) in
30 @cindex Text, other languages
31 To write non-ascii text (such as characters from other languages), simply
32 insert the characters directly into the lilypond file. The file must be
33 saved as UTF-8. For more information, see @ref{Text encoding}.
41 * Overview of text markup commands::
48 @subsection Text scripts
51 @cindex text items, non-empty
52 @cindex non-empty texts
54 It is possible to place arbitrary strings of text or @ref{Text markup}
55 above or below notes by using a string @code{c^"text"}. By default,
56 these indications do not influence the note spacing, but by using the
57 command @code{\fatText}, the widths will be taken into account
59 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
60 c4^"longtext" \fatText c4_"longlongtext" c4
64 To prevent text from influencing spacing, use @code{\emptyText}.
66 More complex formatting may also be added to a note by using the
68 @lilypond[fragment,ragged-right,verbatim,quote]
69 c'4^\markup { bla \bold bla }
72 The @code{\markup} is described in more detail in
78 @cindex @code{\fatText}
80 @cindex @code{\emptyText}
86 Checking to make sure that text scripts and lyrics are within the margins is a relatively large computational task. To speed up processing, lilypond does not perform such calculations by default; to enable it, use
89 \override Score.PaperColumn #'keep-inside-line = ##t
95 In this manual: @ref{Text markup}.
97 Program reference: @internalsref{TextScript}.
101 @subsection Text spanners
103 @cindex Text spanners
105 Some performance indications, e.g., @i{rallentando} or @i{accelerando},
106 are written as text and are extended over many measures with dotted
107 lines. Such texts are created using text spanners; attach
108 @code{\startTextSpan} and @code{\stopTextSpan} to the first and last
109 notes of the spanner.
111 The string to be printed, as well as the style, is set through object
114 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
117 \override TextSpanner #'edge-text = #'("rall " . "")
118 c2\startTextSpan b c\stopTextSpan a
121 \override TextSpanner #'edge-text = #(cons (markup #:italic "rit" ) "")
122 c2\startTextSpan b c\stopTextSpan a
127 @cindex textSpannerUp
128 @code{textSpannerUp},
129 @cindex textSpannerDown
130 @code{textSpannerDown},
131 @cindex textSpannerNeutral
132 @code{textSpannerNeutral}.
137 To print a solid line, use
140 \override TextSpanner #'dash-fraction = #'()
146 Program reference: @internalsref{TextSpanner}.
148 Examples: @inputfileref{input/@/regression,text@/-spanner@/.ly}.
152 @subsection Text marks
154 @cindex coda on bar line
155 @cindex segno on bar line
156 @cindex fermata on bar line
157 @cindex bar lines, symbols on
160 The @code{\mark} command is primarily used for
161 @ref{Rehearsal marks},
162 but it can also be used to put signs like coda,
163 segno, and fermata on a bar line. Use @code{\markup} to
164 access the appropriate symbol
166 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
167 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
172 @code{\mark} is only typeset above the top stave of the score. If
173 you specify the @code{\mark} command at a bar line, the resulting
174 mark is placed above the bar line. If you specify it in the middle
175 of a bar, the resulting mark is positioned between notes. If it is
176 specified before the beginning of a score line, it is placed
177 before the first note of the line. Finally, if the mark occurs at
178 a line break, the mark will be printed at the
179 beginning of the next line.
180 @c IMO this is a bug; hopefully it'll be fixed soon, so I can
181 @c delete this sentence. -gp
182 If there is no next line, then the mark will not be printed at all.
187 To print the mark at the end of the current line, use
190 \override Score.RehearsalMark
191 #'break-visibility = #begin-of-line-invisible
194 @code{\mark} is often useful for adding text to the end of bar. In
195 such cases, changing the @code{#'self-alignment} is very useful
197 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
198 \override Score.RehearsalMark
199 #'break-visibility = #begin-of-line-invisible
201 \once \override Score.RehearsalMark #'self-alignment-X = #right
202 \mark "D.S. al Fine "
205 Text marks may be aligned with notation objects other than
208 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
213 \override Score.RehearsalMark #'break-align-symbol = #'key-signature
217 \override Score.RehearsalMark #'break-align-symbol = #'clef
221 \override Score.RehearsalMark #'break-align-symbol = #'time-signature
230 Although text marks are normally only printed above the topmost
231 staff, you may alter this to print them on every staff,
233 @lilypond[quote,ragged-right,verbatim,relative=2]
236 \remove "Mark_engraver"
240 \consists "Mark_engraver"
242 { c''1 \mark "foo" c'' }
244 \consists "Mark_engraver"
246 { c'1 \mark "foo" c' }
254 Program reference: @internalsref{RehearsalMark}.
258 @subsection Text markup
265 Use @code{\markup} to typeset text. Commands are entered with the
266 backslash @code{\}. To enter @code{\} and @code{#}, use double
269 @lilypond[quote,verbatim,fragment,relative=1]
271 c1_\markup { hi there }
272 c1^\markup { hi \bold there, is \italic {anyone home?} }
273 c1_\markup { "\special {weird} #characters" }
277 See @ref{Overview of text markup commands} for a list of all
280 @code{\markup} is primarily used for @internalsref{TextScript}s,
281 but it can also be used anywhere text is called in lilypond
283 @lilypond[quote,verbatim]
284 \header{ title = \markup{ \bold { foo \italic { bar! } } } }
287 \override Score.RehearsalMark
288 #'break-visibility = #begin-of-line-invisible
289 \override Score.RehearsalMark #'self-alignment-X = #right
291 \set Staff.instrument = \markup{ \column{ Alto solo } }
292 c2^\markup{ don't be \flat }
293 \override TextSpanner #'edge-text = #(cons (markup #:italic "rit" ) "")
295 a2\mark \markup{ \large \bold Fine }
299 \addlyrics { bar, foo \markup{ \italic bar! } }
303 Text can also be placed on its own, away from any @code{\score}
304 block. This is primarily used in a @code{\book} (see
305 @ref{Multiple movements}).
307 @lilypond[quote,ragged-right,verbatim]
308 \markup{ Here is some text. }
311 @cindex font switching
313 The markup in the example demonstrates font switching commands. The
314 command @code{\bold} and @code{\italic} apply to the first following
315 word only; to apply a command to more than one word, enclose the
319 \markup @{ \bold @{ hi there @} @}
323 For clarity, you can also do this for single arguments, e.g.,
326 \markup @{ is \italic @{ anyone @} home @}
329 In markup mode you can compose expressions, similar to mathematical
330 expressions, XML documents, and music expressions. You can stack
331 expressions grouped vertically with the command @code{\column}.
332 Similarly, @code{\center-align} aligns texts by their center lines:
334 @lilypond[quote,verbatim,fragment,relative=1]
335 c1^\markup { \column { a bbbb \line { c d } } }
336 c1^\markup { \center-align { a bbbb c } }
337 c1^\markup { \line { a b c } }
340 Lists with no previous command are not kept distinct. The expression
343 \center-align @{ @{ a b @} @{ c d @} @}
351 \center-align @{ a b c d @}
356 To keep lists of words distinct, please use quotes @code{"} or
357 the @code{\line} command
359 @lilypond[quote,verbatim,fragment,relative=1]
361 c4^\markup{ \center-align { on three lines } }
362 c4^\markup{ \center-align { "all one line" } }
363 c4^\markup{ \center-align { { on three lines } } }
364 c4^\markup{ \center-align { \line { on one line } } }
367 Markups can be stored in variables and these variables
368 may be attached to notes, like
370 allegro = \markup @{ \bold \large @{ Allegro @} @}
371 @{ a^\allegro b c d @}
374 Some objects have alignment procedures of their own, which cancel out
375 any effects of alignments applied to their markup arguments as a
376 whole. For example, the @internalsref{RehearsalMark} is horizontally
377 centered, so using @code{\mark \markup @{ \left-align .. @}} has no
380 In addition, vertical placement is performed after creating the
381 text markup object. If you wish to move an entire piece of markup,
382 you need to use the #'padding property or create an "anchor" point
383 inside the markup (generally with @code{\hspace #0}).
385 @lilypond[quote,verbatim,fragment,relative=1]
387 c'4^\markup{ \raise #5 "not raised" }
388 \once \override TextScript #'padding = #3
389 c'4^\markup{ raised }
390 c'4^\markup{ \hspace #0 \raise #1.5 raised }
393 Some situations (such as dynamic marks) have preset font-related
394 properties. If you are creating text in such situations, it
395 is advisable to cancel those properties with
396 @code{normal-text}. See @ref{Overview of text markup commands}
402 This manual: @ref{Overview of text markup commands}.
404 Program reference: @internalsref{TextScript}.
406 Init files: @file{scm/@/new@/-markup@/.scm}.
411 Kerning or generation of ligatures is only done when the @TeX{}
412 backend is used. In this case, LilyPond does not account for them so
413 texts will be spaced slightly too wide.
415 Syntax errors for markup mode are confusing.
419 @subsection Nested scores
421 It is possible to nest music inside markups, by adding a @code{\score}
422 block to a markup expression. Such a score must contain a @code{\layout}
425 @lilypond[quote,verbatim,ragged-right]
429 \relative { c4 d e f }
438 @node Overview of text markup commands
439 @subsection Overview of text markup commands
441 The following commands can all be used inside @code{\markup @{ @}}.
443 @include markup-commands.tely
447 @subsection Font selection
449 @cindex font selection
450 @cindex font magnification
451 @cindex @code{font-interface}
453 By setting the object properties described below, you can select a
454 font from the preconfigured font families. LilyPond has default
455 support for the feta music fonts. Text fonts are selected through
456 Pango/FontConfig. The serif font defaults to New Century Schoolbook,
457 the sans and typewriter to whatever the Pango installation defaults
462 @item @code{font-encoding}
463 is a symbol that sets layout of the glyphs. This should only be set to
464 select different types of non-text fonts, e.g.
466 @code{fetaBraces} for piano staff braces, @code{fetaMusic} the
467 standard music font, including ancient glyphs, @code{fetaDynamic} for
468 dynamic signs and @code{fetaNumber} for the number font.
470 @item @code{font-family}
471 is a symbol indicating the general class of the typeface. Supported are
472 @code{roman} (Computer Modern), @code{sans}, and @code{typewriter}.
474 @item @code{font-shape}
475 is a symbol indicating the shape of the font. There are typically
476 several font shapes available for each font family. Choices are
477 @code{italic}, @code{caps}, and @code{upright}.
479 @item @code{font-series}
480 is a symbol indicating the series of the font. There are typically
481 several font series for each font family and shape. Choices are
482 @code{medium} and @code{bold}.
486 Fonts selected in the way sketched above come from a predefined style
487 sheet. If you want to use a font from outside the style sheet,
489 @code{font-name} property,
491 @lilypond[fragment,verbatim]
493 \override Staff.TimeSignature #'font-name = #"Charter"
494 \override Staff.TimeSignature #'font-size = #2
497 \override #'(font-name . "Vera Bold")
498 { This text is in Vera Bold }
504 Any font can be used, as long as it is available to Pango/FontConfig.
506 The size of the font may be set with the @code{font-size}
507 property. The resulting size is taken relative to the
508 @code{text-font-size} as defined in the @code{\paper} block.
511 @cindex font magnification
514 It is also possible to change the default font family for the entire
515 document. This is done by calling the @code{make-pango-font-tree} from
516 within the @code{\paper} block. The function takes names for the font
517 families to use for roman, sans serif and monospaced text. For
520 @cindex font families, setting
529 (make-pango-font-tree "Times New Roman"
536 c'^\markup { roman: foo \sans bla \typewriter bar }
540 @c we don't do Helvetica / Courier, since GS incorrectly loads
547 Examples: @inputfileref{input/@/regression,font@/-family@/-override.ly}.
550 @node New dynamic marks
551 @subsection New dynamic marks
553 It is possible to print new dynamic marks or text that should be aligned
554 with dynamics. Use @code{make-dynamic-script} to create these
555 marks. Note that the dynamic font only contains the characters
556 @code{f,m,p,r,s} and @code{z}.
558 Some situations (such as dynamic marks) have preset font-related
559 properties. If you are creating text in such situations, it
560 is advisable to cancel those properties with
561 @code{normal-text}. See @ref{Overview of text markup commands}
564 @cindex make-dynamic-script
566 @lilypond[quote,verbatim,ragged-right]
567 sfzp = #(make-dynamic-script "sfzp")
573 @cindex Dynamics, editorial
574 @cindex Dynamics, parenthesis
576 It is also possible to print dynamics in round parenthesis or square
577 brackets. These are often used for adding editorial dynamics.
579 @lilypond[quote,verbatim,ragged-right]
580 rndf = \markup{ \center-align {\line { \bold{\italic (}
581 \dynamic f \bold{\italic )} }} }
582 boxf = \markup{ \bracket { \dynamic f } }
583 { c'1_\rndf c'1_\boxf }
588 @node Preparing parts
589 @section Preparing parts
591 This section describes various notation that are useful for preparing
595 * Multi measure rests::
600 * Instrument transpositions::
602 * Different editions from one source::
606 @node Multi measure rests
607 @subsection Multi measure rests
609 @cindex multi measure rests
610 @cindex full measure rests
611 @cindex Rests, multi measure
612 @cindex Rests, full measure
613 @cindex whole rests for a full measure
616 Rests for one full measure (or many bars) are entered using `@code{R}'. It
617 is specifically meant for full bar rests and for entering parts: the rest
618 can expand to fill a score with rests, or it can be printed as a single
619 multi-measure rest. This expansion is controlled by the property
620 @code{Score.skipBars}. If this is set to true, empty measures will not
621 be expanded, and the appropriate number is added automatically
623 @lilypond[quote,ragged-right,fragment,verbatim]
624 \time 4/4 r1 | R1 | R1*2 \time 3/4 R2. \time 2/4 R2 \time 4/4
625 \set Score.skipBars = ##t R1*17 R1*4
628 The @code{1} in @code{R1} is similar to the duration notation used for
629 notes. Hence, for time signatures other than 4/4, you must enter other
630 durations. This can be done with augmentation dots or fractions
632 @lilypond[quote,ragged-right,fragment,verbatim]
633 \set Score.skipBars = ##t
642 An @code{R} spanning a single measure is printed as either a whole rest
643 or a breve, centered in the measure regardless of the time signature.
645 If there are only a few measures of rest, LilyPond prints ``church rests''
646 (a series of rectangles) in the staff. To replace that with a simple
647 rest, use @code{MultiMeasureRest.expand-limit}.
649 @lilypond[quote,ragged-right,fragment,verbatim]
650 \set Score.skipBars = ##t
652 \override MultiMeasureRest #'expand-limit = 1
656 @cindex text on multi-measure rest
657 @cindex script on multi-measure rest
658 @cindex fermata on multi-measure rest
660 Texts can be added to multi-measure rests by using the
661 @var{note}-@code{markup} syntax @ref{Text markup}.
662 A variable (@code{\fermataMarkup}) is provided for
665 @lilypond[quote,ragged-right,verbatim,fragment]
666 \set Score.skipBars = ##t
668 R2.*10^\markup { \italic "ad lib." }
672 Warning! This text is created by @code{MultiMeasureRestText}, not
675 @lilypond[quote,ragged-right,verbatim,fragment]
676 \override TextScript #'padding = #5
678 \override MultiMeasureRestText #'padding = #5
682 If you want to have text on the left end of a multi-measure rest,
683 attach the text to a zero-length skip note, i.e.,
693 Program reference: @internalsref{MultiMeasureRestMusicGroup},
694 @internalsref{MultiMeasureRest}.
696 The layout object @internalsref{MultiMeasureRestNumber} is for the
697 default number, and @internalsref{MultiMeasureRestText} for user
703 It is not possible to use fingerings (e.g., @code{R1-4}) to put numbers
704 over multi-measure rests. And the pitch of multi-measure rests (or
705 staff-centered rests) can not be influenced.
707 @cindex condensing rests
709 There is no way to automatically condense multiple rests into a single
710 multi-measure rest. Multi-measure rests do not take part in rest
713 Be careful when entering multi-measure rests followed by whole
714 notes. The following will enter two notes lasting four measures each
718 When @code{skipBars} is set, the result will look OK, but the bar
719 numbering will be off.
722 @node Metronome marks
723 @subsection Metronome marks
726 @cindex beats per minute
727 @cindex metronome marking
729 Metronome settings can be entered as follows
731 \tempo @var{duration} = @var{per-minute}
734 In the MIDI output, they are interpreted as a tempo change. In the
735 layout output, a metronome marking is printed
736 @cindex @code{\tempo}
737 @lilypond[quote,ragged-right,verbatim,fragment]
744 To change the tempo in the MIDI output without printing anything, make
745 the metronome marking invisible
747 \once \override Score.MetronomeMark #'transparent = ##t
750 To print other metronome markings, use these markup commands
751 @lilypond[quote,ragged-right,verbatim,relative,fragment]
754 \smaller \general-align #Y #DOWN \note #"16." #1
756 \smaller \general-align #Y #DOWN \note #"8" #1
761 See @ref{Text markup} for more details.
766 Program reference: @internalsref{MetronomeMark}.
771 Collisions are not checked. If you have notes above the top line of
772 the staff (or notes with articulations, slurs, text, etc), then the
773 metronome marking may be printed on top of musical symbols. If this
774 occurs, increase the padding of the metronome mark to place it
775 further away from the staff.
778 \override Score.MetronomeMark #'padding = #2.5
782 @node Rehearsal marks
783 @subsection Rehearsal marks
785 @cindex Rehearsal marks
788 To print a rehearsal mark, use the @code{\mark} command
790 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
799 The letter@tie{}`I' is skipped in accordance with engraving traditions.
800 If you wish to include the letter `I', then use
803 \set Score.markFormatter = #format-mark-alphabet
806 The mark is incremented automatically if you use @code{\mark
807 \default}, but you can also use an integer argument to set the mark
808 manually. The value to use is stored in the property
809 @code{rehearsalMark}.
811 The style is defined by the property @code{markFormatter}. It is a
812 function taking the current mark (an integer) and the current context
813 as argument. It should return a markup object. In the following
814 example, @code{markFormatter} is set to a canned procedure. After a
815 few measures, it is set to function that produces a boxed number.
817 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
818 \set Score.markFormatter = #format-mark-numbers
821 \set Score.markFormatter = #format-mark-box-numbers
827 The file @file{scm/@/translation@/-functions@/.scm} contains the definitions
828 of @code{format-mark-numbers} (the default format), @code{format-mark-box-numbers},
829 @code{format-mark-letters} and @code{format-mark-box-letters}.
830 These can be used as inspiration for other formatting functions.
832 You may use @code{format-mark-barnumbers}, @code{format-mark-box-barnumbers},
833 and @code{format-mark-circle-barnumbers} to get bar numbers instead of
834 incremented numbers or letters.
839 Program reference: @internalsref{RehearsalMark}.
841 Init files: @file{scm/@/translation@/-functions@/.scm} contains the
842 definition of @code{format-mark-numbers} and
843 @code{format-mark-letters}. They can be used as inspiration for other
844 formatting functions.
846 Examples: @inputfileref{input/@/regression,rehearsal@/-mark@/-letter@/.ly},
848 @inputfileref{input/@/regression,rehearsal@/-mark@/-number@/.ly}.
852 @subsection Bar numbers
855 @cindex measure numbers
856 @cindex @code{currentBarNumber}
858 Bar numbers are printed by default at the start of the line. The
859 number itself is stored in the @code{currentBarNumber} property, which
860 is normally updated automatically for every measure.
862 Bar numbers can be typeset at regular intervals instead of at the
863 beginning of each line. This is illustrated in the following example,
864 whose source is available as
865 @inputfileref{input/@/test,bar@/-number@/-regular@/-interval@/.ly}
867 @lilypondfile[ragged-right,quote]{bar-number-regular-interval.ly}
869 Bar numbers can be typeset manually by tweaking the
870 @code{markFormatter} property
872 @lilypond[verbatim,ragged-right,quote]
874 \set Score.markFormatter
875 = #(lambda (mark context)
878 (number->string (ly:context-property context
879 'currentBarNumber)))))
881 c1 \bar "||" \mark \default c1 c1 \mark \default c1 \bar "|."
885 Bar numbers can be manually changed by setting the
886 @code{Staff.currentBarNumber} property
888 @lilypond[verbatim,ragged-right,quote]
890 \repeat unfold 4 {c4 c c c} \break
891 \set Score.currentBarNumber = #50
892 \repeat unfold 4 {c4 c c c}
896 Bar numbers can be removed entirely by removing the Bar number
897 engraver from the score.
899 @lilypond[verbatim,ragged-right,quote,relative=2]
903 \remove "Bar_number_engraver"
915 Program reference: @internalsref{BarNumber}.
918 @inputfileref{input/@/test,bar@/-number@/-every@/-five@/-reset@/.ly},
919 and @inputfileref{input/@/test,bar@/-number@/-regular@/-interval@/.ly}.
924 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
925 there is one at the top. To solve this, the
926 @code{padding} property of @internalsref{BarNumber} can be
927 used to position the number correctly.
930 @node Instrument names
931 @subsection Instrument names
933 In an orchestral score, instrument names are printed at the left side
936 This can be achieved by setting @internalsref{Staff}.@code{instrument}
937 and @internalsref{Staff}.@code{instr}. This will print a string before
938 the start of the staff. For the first staff, @code{instrument} is
939 used, for the following ones, @code{instr} is used.
941 @lilypond[quote,verbatim,ragged-right,relative=1,fragment]
942 \set Staff.instrument = "Ploink "
943 \set Staff.instr = "Plk "
949 You can also use markup texts to construct more complicated instrument
952 @lilypond[quote,fragment,verbatim,ragged-right]
953 \set Staff.instrument = \markup {
954 \column { "Clarinetti"
955 \line { "in B" \smaller \flat } } }
959 If you wish to center the instrument names, you must center all of them
961 @lilypond[quote,verbatim,ragged-right]
964 \set Staff.instrument = \markup {
965 \center-align { "Clarinetti"
966 \line { "in B" \smaller \flat } } }
970 \set Staff.instrument = \markup{ \center-align { Vibraphone }}
977 For longer instrument names, it may be useful to increase the
978 @code{indent} setting in the @code{\layout} block.
980 To center instrument names while leaving extra space to the right,
982 @lilypond[quote,verbatim,ragged-right]
983 \new StaffGroup \relative
986 \set Staff.instrument
987 = \markup { \hcenter-in #10 "blabla" }
991 \set Staff.instrument
992 = \markup { \hcenter-in #10 "blo" }
1001 Program reference: @internalsref{InstrumentName}.
1005 When you put a name on a grand staff or piano staff, the width of the
1006 brace is not taken into account. The following property setting can be
1007 used to move the instrument names to the left, in such situations.
1010 \override Score.InstrumentName #'space-alist = #'((left-edge extra-space . 2.0))
1014 @node Instrument transpositions
1015 @subsection Instrument transpositions
1017 @cindex transposition, MIDI
1018 @cindex transposition, instrument
1020 The key of a transposing instrument can also be specified. This
1021 applies to many wind instruments, for example, clarinets (B-flat, A, and
1022 E-flat), horn (F) and trumpet (B-flat, C, D, and E-flat).
1024 The transposition is entered after the keyword @code{\transposition}
1027 \transposition bes %% B-flat clarinet
1031 This command sets the property @code{instrumentTransposition}. The value of
1032 this property is used for MIDI output and quotations. It does not
1033 affect how notes are printed in the current staff. To change the printed
1034 output, see @ref{Transpose}.
1036 The pitch to use for @code{\transposition} should correspond to the
1037 real sound heard when a @code{c'} written on the staff is played by the
1038 transposing instrument. For example, when entering a score in
1039 concert pitch, typically all voices are entered in C, so
1040 they should be entered as
1053 The command @code{\transposition} should be used when the music is
1054 entered from a (transposed) orchestral part. For example, in
1055 classical horn parts, the tuning of the instrument is often changed
1056 during a piece. When copying the notes from the part, use
1057 @code{\transposition}, e.g.,
1069 @node Ottava brackets
1070 @subsection Ottava brackets
1072 `Ottava' brackets introduce an extra transposition of an octave for
1073 the staff. They are created by invoking the function
1074 @code{set-octavation}
1080 @lilypond[quote,ragged-right,verbatim,fragment]
1090 The @code{set-octavation} function also takes -1 (for 8va bassa) and 2
1091 (for 15ma) as arguments. Internally the function sets the properties
1092 @code{ottavation} (e.g., to @code{"8va"}) and
1093 @code{centralCPosition}. For overriding the text of the bracket, set
1094 @code{ottavation} after invoking @code{set-octavation}, i.e.,
1096 @lilypond[quote,ragged-right,verbatim]
1099 \set Staff.ottavation = #"8"
1107 Program reference: @internalsref{OttavaBracket}.
1109 Examples: @inputfileref{input/@/regression,ottava@/.ly},
1110 @inputfileref{input/@/regression,ottava@/-broken@/.ly}.
1115 @code{set-octavation} will get confused when clef changes happen
1116 during an octavation bracket.
1119 @node Different editions from one source
1120 @subsection Different editions from one source
1125 The @code{\tag} command marks music expressions with a name. These
1126 tagged expressions can be filtered out later. With this mechanism it
1127 is possible to make different versions of the same music source.
1129 In the following example, we see two versions of a piece of music, one
1130 for the full score, and one with cue notes for the instrumental part
1146 The same can be applied to articulations, texts, etc.: they are
1149 -\tag #@var{your-tag}
1151 to an articulation, for example,
1156 This defines a note with a conditional fingering indication.
1159 @cindex removeWithTag
1160 By applying the @code{\keepWithTag} and @code{\removeWithTag}
1161 commands, tagged expressions can be filtered. For example,
1165 \keepWithTag #'score @var{the music}
1166 \keepWithTag #'part @var{the music}
1171 @lilypondfile[ragged-right,quote]{tag-filter.ly}
1173 The arguments of the @code{\tag} command should be a symbol
1174 (such as @code{#'score} or @code{#'part}), followed by a
1175 music expression. It is possible to put multiple tags on
1176 a piece of music with multiple @code{\tag} entries,
1179 \tag #'original-part \tag #'transposed-part @dots{}
1185 Examples: @inputfileref{input/@/regression,tag@/-filter@/.ly}.
1190 Multiple rests are not merged if you create the score with both tagged
1195 @node Orchestral music
1196 @section Orchestral music
1198 Orchestral music involves some special notation, both in the full
1199 score and the individual parts. This section explains how to tackle
1200 some common problems in orchestral music.
1203 * Automatic part combining::
1205 * Quoting other voices::
1206 * Formatting cue notes::
1207 * Aligning to cadenzas::
1211 @node Automatic part combining
1212 @subsection Automatic part combining
1213 @cindex automatic part combining
1214 @cindex part combiner
1216 Automatic part combining is used to merge two parts of music onto a
1217 staff. It is aimed at typesetting orchestral scores. When the two
1218 parts are identical for a period of time, only one is shown. In
1219 places where the two parts differ, they are typeset as separate
1220 voices, and stem directions are set automatically. Also, solo and
1221 @emph{a due} parts are identified and can be marked.
1223 The syntax for part combining is
1226 \partcombine @var{musicexpr1} @var{musicexpr2}
1230 The following example demonstrates the basic functionality of the part
1231 combiner: putting parts on one staff, and setting stem directions and
1234 @lilypond[quote,verbatim,ragged-right,fragment]
1235 \new Staff \partcombine
1236 \relative g' { g g a( b) c c r r }
1237 \relative g' { g g r4 r e e g g }
1240 The first @code{g} appears only once, although it was
1241 specified twice (once in each part). Stem, slur, and tie directions are
1242 set automatically, depending whether there is a solo or unisono. The
1243 first part (with context called @code{one}) always gets up stems, and
1244 `Solo', while the second (called @code{two}) always gets down stems and
1247 If you just want the merging parts, and not the textual markings, you
1248 may set the property @code{printPartCombineTexts} to false
1250 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
1252 \set Staff.printPartCombineTexts = ##f
1254 \relative g' { g a( b) r }
1255 \relative g' { g r4 r f }
1259 To change the text that is printed for solos or merging, you may
1260 set the @code{soloText}, @code{soloIIText}, and @code{aDueText}
1263 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
1265 \set Score.soloText = #"ichi"
1266 \set Score.soloIIText = #"ni"
1267 \set Score.aDueText = #"tachi"
1269 \relative g' { g4 g a( b) r }
1270 \relative g' { g4 g r r f }
1274 Both arguments to @code{\partcombine} will be interpreted as
1275 @internalsref{Voice} contexts. If using relative octaves,
1276 @code{\relative} should be specified for both music expressions, i.e.,
1280 \relative @dots{} @var{musicexpr1}
1281 \relative @dots{} @var{musicexpr2}
1285 A @code{\relative} section that is outside of @code{\partcombine} has
1286 no effect on the pitches of @var{musicexpr1} and @var{musicexpr2}.
1290 Program reference: @internalsref{PartCombineMusic}.
1294 When @code{printPartCombineTexts} is set, when the two voices play the
1295 same notes on and off, the part combiner may typeset @code{a2} more
1296 than once in a measure.
1298 @code{\partcombine} cannot be inside @code{\times}.
1300 @code{\partcombine} cannot be inside @code{\relative}.
1302 Internally, the @code{\partcombine} interprets both arguments as
1303 @code{Voice}s named @code{one} and @code{two}, and then decides when
1304 the parts can be combined. Consequently, if the arguments switch to
1305 differently named @internalsref{Voice} contexts, the events in those
1310 @subsection Hiding staves
1312 @cindex Frenched scores
1313 @cindex Hiding staves
1315 In orchestral scores, staff lines that only have rests are usually
1316 removed; this saves some space. This style is called `French Score'.
1317 For @internalsref{Lyrics},
1318 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
1319 switched on by default. When the lines of these contexts turn out
1320 empty after the line-breaking process, they are removed.
1322 For normal staves, a specialized @internalsref{Staff} context is
1323 available, which does the same: staves containing nothing (or only
1324 multi-measure rests) are removed. The context definition is stored in
1325 @code{\RemoveEmptyStaffContext} variable. Observe how the second staff
1326 in this example disappears in the second line
1328 @lilypond[quote,ragged-right,verbatim]
1330 \context { \RemoveEmptyStaffContext }
1335 \new Staff { e4 f g a \break c1 }
1336 \new Staff { c4 d e f \break R1 }
1341 The first system shows all staves in full. If empty staves should be
1342 removed from the first system too, set @code{remove-first} to true in
1343 @internalsref{VerticalAxisGroup}.
1346 \override Score.VerticalAxisGroup #'remove-first = ##t
1349 To remove other types of contexts, use @code{\AncientRemoveEmptyStaffContext}
1350 or @code{\RemoveEmptyRhythmicStaffContext}.
1352 Another application is making ossia sections, i.e., alternative
1353 melodies on a separate piece of staff, with help of a Frenched
1354 staff. See @inputfileref{input/@/test,ossia@/.ly} for an example.
1357 @node Quoting other voices
1358 @subsection Quoting other voices
1360 With quotations, fragments of other parts can be inserted into a part
1361 directly. Before a part can be quoted, it must be marked especially as
1362 quotable. This is done with the @code{\addquote} command.
1365 \addquote @var{name} @var{music}
1370 Here, @var{name} is an identifying string. The @var{music} is any kind
1371 of music. Here is an example of @code{\addquote}
1374 \addquote clarinet \relative c' @{
1379 This command must be entered at toplevel, i.e., outside any music
1382 After calling @code{\addquote}, the quotation may then be done with
1383 @code{\quoteDuring} or @code{\cueDuring},
1386 \quoteDuring #@var{name} @var{music}
1389 During a part, a piece of music can be quoted with the @code{\quoteDuring}
1393 \quoteDuring #"clarinet" @{ s2. @}
1396 This would cite three quarter notes (the duration of @code{s2.}) of
1397 the previously added @code{clarinet} voice.
1400 More precisely, it takes the current time-step of the part being
1401 printed, and extracts the notes at the corresponding point of the
1402 @code{\addquote}d voice. Therefore, the argument to @code{\addquote}
1403 should be the entire part of the voice to be quoted, including any
1404 rests at the beginning.
1406 Quotations take into account the transposition of both source and target
1407 instruments, if they are specified using the @code{\transposition} command.
1409 @lilypond[quote,ragged-right,verbatim]
1410 \addquote clarinet \relative c' {
1416 e'8 f'8 \quoteDuring #"clarinet" { s2 }
1420 The type of events that are present in cue notes can be trimmed with
1421 the @code{quotedEventTypes} property. The default value is
1422 @code{(note-event rest-event)}, which means that only notes and
1423 rests of the cued voice end up in the @code{\quoteDuring}.
1427 \set Staff.quotedEventTypes =
1428 #'(note-event articulation-event dynamic-event)
1432 will quote notes (but no rests), together with scripts and dynamics.
1436 Only the contents of the first @internalsref{Voice} occurring in an
1437 @code{\addquote} command will be considered for quotation, so
1438 @var{music} can not contain @code{\new} and @code{\context Voice}
1439 statements that would switch to a different Voice.
1441 Quoting grace notes is broken and can even cause LilyPond to crash.
1445 In this manual: @ref{Instrument transpositions}.
1447 Examples: @inputfileref{input/@/regression,quote@/.ly}
1448 @inputfileref{input/@/regression,quote@/-transposition@/.ly}
1450 Program reference: @internalsref{QuoteMusic}.
1453 @node Formatting cue notes
1454 @subsection Formatting cue notes
1456 The previous section deals with inserting notes from another voice.
1457 There is a more advanced music function called @code{\cueDuring},
1458 which makes formatting cue notes easier.
1463 \cueDuring #@var{name} #@var{updown} @var{music}
1466 This will insert notes from the part @var{name} into a
1467 @internalsref{Voice} called @code{cue}. This happens simultaneously
1468 with @var{music}, which usually is a rest. When the cue notes start,
1469 the staff in effect becomes polyphonic for a moment. The argument
1470 @var{updown} determines whether the cue notes should be notated as a
1471 first or second voice.
1474 @lilypond[verbatim,ragged-right]
1477 \override Stem #'length-fraction = #0.8
1478 \override Beam #'thickness = #0.384
1479 \override Beam #'length-fraction = #0.8
1482 \addquote clarinet \relative {
1487 \new Staff \relative <<
1489 % setup a context for cue notes.
1490 \new Voice = "cue" { \smaller \skip 1*21 }
1492 \set Score.skipBars = ##t
1496 \cueDuring #"clarinet" #1 {
1505 Here are a couple of hints for successful cue notes
1509 Cue notes have smaller font sizes.
1511 the cued part is marked with the instrument playing the cue.
1513 when the original part takes over again, this should be marked with
1514 the name of the original instrument.
1516 @c really? Are you sure about that last point? I'll check after 3.0 -gp
1518 @c Yes, this is good practice. Otherwise, the start of the original
1519 @c part can only be seen from the font size. This is not good enough
1520 @c for sight-reading. It is possilbe to use other
1521 @c markers (e.g. a big close-bracket over the staff) to indicate the cue notes are
1526 Any other changes introduced by the cued part should also be
1527 undone. For example, if the cued instrument plays in a different clef,
1528 the original clef should be stated once again.
1533 @node Aligning to cadenzas
1534 @subsection Aligning to cadenzas
1536 In an orchestral context, cadenzas present a special problem:
1537 when constructing a score that includes a cadenza, all other
1538 instruments should skip just as many notes as the length of the
1539 cadenza, otherwise they will start too soon or too late.
1541 A solution to this problem are the functions @code{mmrest-of-length}
1542 and @code{skip-of-length}. These Scheme functions take a piece of music
1543 as argument, and generate a @code{\skip} or multi-rest, exactly as
1544 long as the piece. The use of @code{mmrest-of-length} is demonstrated
1545 in the following example.
1547 @lilypond[verbatim,ragged-right,quote]
1548 cadenza = \relative c' {
1549 c4 d8 << { e f g } \\ { d4. } >>
1554 \new Staff { \cadenza c'4 }
1556 #(ly:export (mmrest-of-length cadenza))
1565 @node Contemporary notation
1566 @section Contemporary notation
1568 In the 20th century, composers have greatly expanded the musical
1569 vocabulary. With this expansion, many innovations in musical notation
1570 have been tried. The book ``Music Notation in the 20th century'' by
1571 Kurt Stone gives a comprehensive overview (see @ref{Literature
1574 This section describes notation that does
1575 not fit into traditional notation categories, such as pitches,
1576 tuplet beams, and articulation. For contemporary notation
1577 that fits into traditional notation categories, such as
1578 microtones, nested tuplet beams, and unusual fermatas, please
1579 see those sections of the documentation.
1582 @c I don't think we should discourage modern composers who might
1583 @c want to sponsor new features. :)
1584 @c In general, the use of new, innovative notation makes a piece
1585 @c harder to understand and perform and its use should therefore be
1586 @c avoided. For this reason, support for contemporary notation in
1587 @c LilyPond is limited.
1591 * Polymetric notation::
1592 * Time administration::
1593 * Proportional notation::
1595 * Special noteheads::
1601 @node Polymetric notation
1602 @subsection Polymetric notation
1604 Double time signatures are not supported explicitly, but they can be
1605 faked. In the next example, the markup for the time signature is
1606 created with a markup text. This markup text is inserted in the
1607 @internalsref{TimeSignature} grob. See also
1608 @inputfileref{input/@/test,compound@/-time@/.ly}).
1610 @lilypond[verbatim,ragged-right]
1613 \override #'(baseline-skip . 2) \number {
1616 \bracket \column { "5" "8" }
1621 \override Staff.TimeSignature #'stencil = #ly:text-interface::print
1622 \override Staff.TimeSignature #'text = #tsMarkup
1624 c'2 \bar ":" c'4 c'4.
1628 Each staff can also have its own time signature. This is done by
1629 moving the @internalsref{Timing_translator} to the @internalsref{Staff}
1635 \remove "Timing_translator"
1636 \remove "Default_bar_line_engraver"
1640 \consists "Timing_translator"
1641 \consists "Default_bar_line_engraver"
1648 Now, each staff has its own time signature.
1661 c4. c8 c c c4. c8 c c
1666 @lilypond[quote,ragged-right]
1670 \remove "Timing_translator"
1671 \remove "Default_bar_line_engraver"
1674 \consists "Timing_translator"
1675 \consists "Default_bar_line_engraver"
1690 c4. c8 c c c4. c8 c c
1696 A different form of polymetric notation is where note lengths have
1697 different values across staves.
1699 This notation can be created by setting a common time signature for
1700 each staff but replacing it manually using
1701 @code{timeSignatureFraction} to the desired fraction. Then the printed
1702 durations in each staff are scaled to the common time signature.
1703 The latter is done with @code{\compressMusic}, which is used similar
1704 to @code{\times}, but does not create a tuplet bracket. The syntax is
1706 \compressMusic #'(@var{numerator} . @var{denominator}) @var{musicexpr}
1711 In this example, music with the time signatures of 3/4, 9/8, and 10/8 are
1712 used in parallel. In the second staff, shown durations are multiplied by
1713 2/3, so that 2/3 * 9/8 = 3/4, and in the third staff, shown durations are
1714 multiplied by 3/5, so that 3/5 * 10/8 = 3/4.
1716 @lilypond[quote,ragged-right,verbatim,fragment]
1724 \set Staff.timeSignatureFraction = #'(9 . 8)
1725 \compressMusic #'(2 . 3)
1726 \repeat unfold 6 { c8[ c c] }
1730 \set Staff.timeSignatureFraction = #'(10 . 8)
1731 \compressMusic #'(3 . 5) {
1732 \repeat unfold 2 { c8[ c c] }
1733 \repeat unfold 2 { c8[ c] }
1734 | c4. c4. \times 2/3 { c8 c c } c4
1745 When using different time signatures in parallel, the spacing is
1746 aligned vertically, but bar lines distort the regular spacing.
1749 @node Time administration
1750 @subsection Time administration
1752 @cindex Time administration
1754 Time is administered by the @internalsref{Time_signature_engraver},
1755 which usually lives in the @internalsref{Score} context. The
1756 bookkeeping deals with the following variables
1759 @item currentBarNumber
1763 The length of the measures in the current time signature. For a 4/4
1764 time this is@tie{}1, and for 6/8 it is 3/4.
1766 @item measurePosition
1767 The point within the measure where we currently are. This quantity
1768 is reset to@tie{}0 whenever it exceeds @code{measureLength}. When that
1769 happens, @code{currentBarNumber} is incremented.
1772 If set to true, the above variables are updated for every time
1773 step. When set to false, the engraver stays in the current measure
1777 Timing can be changed by setting any of these variables explicitly.
1778 In the next example, the 4/4 time signature is printed, but
1779 @code{measureLength} is set to 5/4. After a while, the measure is
1780 shortened by 1/8, by setting @code{measurePosition} to 7/8 at 2/4
1781 in the measure, so the next bar line will fall at 2/4 + 3/8. The
1782 3/8 arises because 5/4 normally has 10/8, but we have manually
1783 set the measure position to be 7/8 and 10/8 - 7/8 = 3/8.
1785 @lilypond[quote,ragged-right,verbatim,relative,fragment]
1786 \set Score.measureLength = #(ly:make-moment 5 4)
1790 \set Score.measurePosition = #(ly:make-moment 7 8)
1796 As the example illustrates, @code{ly:make-moment n m} constructs a
1797 duration of n/m of a whole note. For example, @code{ly:make-moment 1 8} is an eighth
1798 note duration and @code{ly:make-moment 7 16} is the duration of
1799 seven sixteenths notes.
1802 @node Proportional notation
1803 @subsection Proportional notation
1804 @cindex Proportional notation
1806 Notes can be spaced proportional to their time-difference by
1807 assigning a duration to @code{proportionalNotationDuration}
1809 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
1811 \set Score.proportionalNotationDuration = #(ly:make-moment 1 16)
1812 \new Staff { c8[ c c c c c] c4 c2 r2 }
1813 \new Staff { c2 \times 2/3 { c8 c c } c4 c1 }
1819 @subsection Clusters
1823 A cluster indicates a continuous range of pitches to be played. They
1824 can be denoted as the envelope of a set of notes. They are entered by
1825 applying the function @code{makeClusters} to a sequence of
1827 @lilypond[quote,ragged-right,relative=2,fragment,verbatim]
1828 \makeClusters { <c e > <b f'> }
1831 The following example (from
1832 @inputfileref{input/@/regression,cluster@/.ly}) shows what the result
1835 @lilypondfile[ragged-right,quote]{cluster.ly}
1837 Ordinary notes and clusters can be put together in the same staff,
1838 even simultaneously. In such a case no attempt is made to
1839 automatically avoid collisions between ordinary notes and clusters.
1843 Program reference: @internalsref{ClusterSpanner},
1844 @internalsref{ClusterSpannerBeacon},
1845 @internalsref{Cluster_spanner_engraver}.
1847 Examples: @inputfileref{input/@/regression,cluster@/.ly}.
1851 Music expressions like @code{<< @{ g8 e8 @} a4 >>} are not printed
1852 accurately. Use @code{<g a>8 <e a>8} instead.
1855 @node Special noteheads
1856 @subsection Special noteheads
1858 Different noteheads are used by various instruments for various
1859 meanings -- crosses are used for ``parlato'' with vocalists, stopped
1860 notes on guitar; diamonds are used for harmonics on string instruments,
1861 etc. There is a shorthand (@code{\harmonic}) for diamond shapes; the
1862 other notehead styles are produced by tweaking the property
1864 @lilypond[ragged-right,relative=1,fragment,verbatim,quote]
1866 \override NoteHead #'style = #'cross
1868 \revert NoteHead #'style
1869 e d <c f\harmonic> <d a'\harmonic>
1873 To see all notehead styles, please see
1874 @inputfileref{input/@/regression,note@/-head@/-style@/.ly}.
1879 Program reference: @internalsref{NoteHead}.
1882 @node Feathered beams
1883 @subsection Feathered beams
1885 Feathered beams are not supported natively, but they can be faked by
1886 forcing two beams to overlap. Here is an example,
1888 @c don't change relative setting witout changing positions!
1889 @lilypond[ragged-right,relative=1,fragment,verbatim,quote]
1894 \once \override Voice.Beam #'positions = #'(0 . 0.5)
1899 \once \override Voice.Beam #'positions = #'(0 . -0.5)
1907 @subsection Improvisation
1909 Improvisation is sometimes denoted with slashed note heads. Such note
1910 heads can be created by adding a @internalsref{Pitch_squash_engraver}
1911 to the @internalsref{Staff} or @internalsref{Voice} context. Then, the
1915 \set squashedPosition = #0
1916 \override NoteHead #'style = #'slash
1920 switches on the slashes.
1922 There are shortcuts @code{\improvisationOn} (and an accompanying
1923 @code{\improvisationOff}) for this command sequence. They are used in
1924 the following example
1926 @lilypond[verbatim,ragged-right,quote]
1928 \consists Pitch_squash_engraver
1930 e8 e g a a16(bes)(a8) g \improvisationOn
1933 ~fis2 \improvisationOff a16(bes) a8 g e
1938 @node Educational use
1939 @section Educational use
1941 With the amount of control that LilyPond offers, one can make great
1942 teaching tools in addition to great musical scores.
1946 * Blank music sheet::
1948 * Shape note heads ::
1949 * Easy Notation note heads::
1950 * Analysis brackets::
1951 * Coloring objects::
1956 @subsection Balloon help
1958 Elements of notation can be marked and named with the help of a square
1959 balloon. The primary purpose of this feature is to explain notation.
1961 The following example demonstrates its use.
1963 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
1966 #(add-balloon-text 'NoteHead "heads, or tails?"
1973 The function @code{add-balloon-text} takes the name of a grob, the
1974 label to print, and the position where to put the label relative to
1975 the object. In the above example, the text ``heads or tails?'' ends
1976 3 spaces below and 1 space to the right of the marked head.
1979 @cindex notation, explaining
1983 Program reference: @internalsref{text-balloon-interface}.
1985 Examples: @inputfileref{input/@/regression,balloon@/.ly}.
1990 @node Blank music sheet
1991 @subsection Blank music sheet
1993 @cindex Sheet music, empty
1994 @cindex Staves, blank sheet
1996 A blank music sheet can be produced also by using invisible notes, and
1997 removing @code{Bar_number_engraver}.
2000 @lilypond[quote,verbatim]
2002 \repeat unfold 2 % Change this for more lines.
2007 \override TimeSignature #'transparent = ##t
2008 defaultBarType = #""
2009 \remove Bar_number_engraver
2011 \new Staff \emptymusic
2012 \new TabStaff \emptymusic
2018 @subsection Hidden notes
2020 @cindex Hidden notes
2021 @cindex Invisible notes
2022 @cindex Transparent notes
2024 @cindex @code{\hideNotes}
2025 @cindex @code{\unHideNotes}
2026 Hidden (or invisible or transparent) notes can be useful in preparing theory
2027 or composition exercises.
2029 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
2038 @node Shape note heads
2039 @subsection Shape note heads
2041 In shape note head notation, the shape of the note head corresponds
2042 to the harmonic function of a note in the scale. This notation was
2043 popular in the 19th century American song books.
2045 Shape note heads can be produced by setting @code{\aikenHeads} or
2046 @code{\sacredHarpHeads}, depending on the style desired.
2048 @lilypond[verbatim,relative=1,fragment]
2055 Shapes are determined on the step in the scale, where the base of the
2056 scale is determined by the @code{\key} command
2059 @findex shapeNoteStyles
2061 @findex \sacredHarpHeads
2063 Shape note heads are implemented through the @code{shapeNoteStyles}
2064 property. Its value is a vector of symbols. The k-th element indicates
2065 the style to use for the k-th step of the scale. Arbitrary
2066 combinations are possible, e.g.
2068 @lilypond[verbatim,relative=1,fragment]
2069 \set shapeNoteStyles = ##(cross triangle fa #f mensural xcircle diamond)
2074 @node Easy Notation note heads
2075 @subsection Easy Notation note heads
2077 @cindex easy notation
2080 The `easy play' note head includes a note name inside the head. It is
2081 used in music for beginners
2083 @lilypond[quote,ragged-right,verbatim,fragment,staffsize=26]
2088 The command @code{\setEasyHeads} overrides settings for the
2089 @internalsref{NoteHead} object. To make the letters readable, it has
2090 to be printed in a large font size. To print with a larger font, see
2091 @ref{Setting global staff size}.
2095 @cindex @code{\setEasyHeads}
2096 @code{\setEasyHeads}
2099 @node Analysis brackets
2100 @subsection Analysis brackets
2102 @cindex phrasing brackets
2103 @cindex musicological analysis
2104 @cindex note grouping bracket
2106 Brackets are used in musical analysis to indicate structure in musical
2107 pieces. LilyPond supports a simple form of nested horizontal
2108 brackets. To use this, add the @internalsref{Horizontal_bracket_engraver}
2109 to @internalsref{Staff} context. A bracket is started with
2110 @code{\startGroup} and closed with @code{\stopGroup}
2112 @lilypond[quote,ragged-right,verbatim]
2115 c4\startGroup\startGroup
2118 c4\stopGroup\stopGroup
2122 \Staff \consists "Horizontal_bracket_engraver"
2128 Program reference: @internalsref{HorizontalBracket}.
2130 Examples: @inputfileref{input/@/regression,note@/-group@/-bracket@/.ly}.
2133 @node Coloring objects
2134 @subsection Coloring objects
2136 Individual objects may be assigned colors. You may use the
2137 color names listed in the @ref{List of colors}.
2139 @lilypond[quote,ragged-right,verbatim,fragment,relative=1]
2140 \override NoteHead #'color = #red
2142 \override NoteHead #'color = #(x11-color 'LimeGreen)
2144 \override Stem #'color = #blue
2148 The full range of colors defined for X11 can be accessed by using the
2149 scheme function x11-color. The function takes one argument that can be a
2153 \override Beam #'color = #(x11-color 'MediumTurquoise)
2159 \override Beam #'color = #(x11-color "MediumTurquoise")
2162 The first form is quicker to write and is more efficient. However, using
2163 the second form it is possible to access X11 colors by the multi-word
2167 \override Beam #'color = #(x11-color "medium turquoise")
2170 If x11-color cannot make sense of the parameter then the color returned
2171 defaults to black. It should be obvious from the final score that
2174 This example, illustrates the use of x11-color. Notice that the stem
2175 color remains black after being set to (x11-color 'Boggle), which is
2176 deliberate nonsense.
2178 @lilypond[quote,ragged-right,verbatim]
2180 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
2181 \set Staff.instrument = \markup {
2182 \with-color #(x11-color 'navy) "Clarinet"
2186 \override Beam #'color = #(x11-color "medium turquoise")
2188 \override NoteHead #'color = #(x11-color "LimeGreen")
2190 \override Stem #'color = #(x11-color 'Boggle)
2198 Appendix: @ref{List of colors}.
2202 Not all x11 colors are distinguishable in a web browser. For web use
2203 normal colors are recommended.
2205 An x11 color is not necessarily exactly the same shade as a similarly
2210 @subsection Parentheses
2213 @cindex notes, ghost
2214 @cindex notes, parenthesized
2216 Objects may be parenthesized by prefixing @code{\parenthesize} to the music event,
2218 @lilypond[relative=2,fragment,verbatim,ragged-right]