1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond.tely
4 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
6 When revising a translation, copy the HEAD committish of the
7 version that you are working on. See TRANSLATION for details.
10 @c A menu is needed before every deeper *section nesting of @node's; run
11 @c M-x texinfo-all-menus-update
12 @c to automatically fill in these menus before saving changes
15 @node Advanced notation
16 @chapter Advanced notation
18 This chapter deals with rarely-used and advanced notation.
24 * Contemporary notation::
33 This section explains how to include text (with various formatting) in
36 @cindex Text, other languages
37 To write non-ascii text (such as characters from other languages), simply
38 insert the characters directly into the lilypond file. The file must be
39 saved as UTF-8. For more information, see @ref{Text encoding}.
47 * Overview of text markup commands::
54 @subsection Text scripts
57 @cindex text items, non-empty
58 @cindex non-empty texts
60 It is possible to place arbitrary strings of text or @ref{Text markup}
61 above or below notes by using a string @code{c^"text"}. By default,
62 these indications do not influence the note spacing, but by using the
63 command @code{\fatText}, the widths will be taken into account
65 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
66 c4^"longtext" \fatText c4_"longlongtext" c4
70 To prevent text from influencing spacing, use @code{\emptyText}.
72 More complex formatting may also be added to a note by using the
74 @lilypond[fragment,ragged-right,verbatim,quote]
75 c'4^\markup { bla \bold bla }
78 The @code{\markup} is described in more detail in
92 Checking to make sure that text scripts and lyrics are within the margins is
93 a relatively large computational task. To speed up processing, lilypond does
94 not perform such calculations by default; to enable it, use
97 \override Score.PaperColumn #'keep-inside-line = ##t
103 In this manual: @ref{Text markup}.
105 Program reference: @internalsref{TextScript}.
109 @subsection Text spanners
111 @cindex Text spanners
113 Some performance indications, e.g., @i{rallentando} or @i{accelerando},
114 are written as text and are extended over many measures with dotted
115 lines. Such texts are created using text spanners; attach
116 @code{\startTextSpan} and @code{\stopTextSpan} to the first and last
117 notes of the spanner.
119 The string to be printed, as well as the style, is set through object
122 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
125 \override TextSpanner #'edge-text = #'("rall " . "")
126 c2\startTextSpan b c\stopTextSpan a
129 \override TextSpanner #'edge-text = #(cons (markup #:italic "rit" ) "")
130 c2\startTextSpan b c\stopTextSpan a
135 @cindex textSpannerUp
136 @code{textSpannerUp},
137 @cindex textSpannerDown
138 @code{textSpannerDown},
139 @cindex textSpannerNeutral
140 @code{textSpannerNeutral}.
145 To print a solid line, use
148 \override TextSpanner #'dash-fraction = #'()
154 Program reference: @internalsref{TextSpanner}.
156 Examples: @inputfileref{input/@/regression,text@/-spanner@/.ly}.
160 @subsection Text marks
162 @cindex coda on bar line
163 @cindex segno on bar line
164 @cindex fermata on bar line
165 @cindex bar lines, symbols on
168 The @code{\mark} command is primarily used for
169 @ref{Rehearsal marks},
170 but it can also be used to put signs like coda,
171 segno, and fermata on a bar line. Use @code{\markup} to
172 access the appropriate symbol (symbols are listed in
175 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
176 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
181 @code{\mark} is only typeset above the top stave of the score. If
182 you specify the @code{\mark} command at a bar line, the resulting
183 mark is placed above the bar line. If you specify it in the middle
184 of a bar, the resulting mark is positioned between notes. If it is
185 specified before the beginning of a score line, it is placed
186 before the first note of the line. Finally, if the mark occurs at
187 a line break, the mark will be printed at the
188 beginning of the next line.
189 @c IMO this is a bug; hopefully it'll be fixed soon, so I can
190 @c delete this sentence. -gp
191 If there is no next line, then the mark will not be printed at all.
196 To print the mark at the end of the current line, use
199 \override Score.RehearsalMark
200 #'break-visibility = #begin-of-line-invisible
203 @code{\mark} is often useful for adding text to the end of bar. In
204 such cases, changing the @code{#'self-alignment} is very useful
206 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
207 \override Score.RehearsalMark
208 #'break-visibility = #begin-of-line-invisible
210 \once \override Score.RehearsalMark #'self-alignment-X = #right
211 \mark "D.S. al Fine "
214 Text marks may be aligned with notation objects other than
217 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
222 \override Score.RehearsalMark #'break-align-symbol = #'key-signature
226 \override Score.RehearsalMark #'break-align-symbol = #'clef
230 \override Score.RehearsalMark #'break-align-symbol = #'time-signature
239 Although text marks are normally only printed above the topmost
240 staff, you may alter this to print them on every staff,
242 @lilypond[quote,ragged-right,verbatim,relative=2]
245 \remove "Mark_engraver"
249 \consists "Mark_engraver"
251 { c''1 \mark "foo" c'' }
253 \consists "Mark_engraver"
255 { c'1 \mark "foo" c' }
263 Program reference: @internalsref{RehearsalMark}.
267 @subsection Text markup
274 Use @code{\markup} to typeset text. Commands are entered with the
275 backslash @code{\}. To enter @code{\} and @code{#}, use double
278 @lilypond[quote,verbatim,fragment,relative=1]
280 c1_\markup { hi there }
281 c1^\markup { hi \bold there, is \italic {anyone home?} }
282 c1_\markup { "\special {weird} #characters" }
286 See @ref{Overview of text markup commands} for a list of all
289 @code{\markup} is primarily used for @internalsref{TextScript}s,
290 but it can also be used anywhere text is called in lilypond
292 @lilypond[quote,verbatim]
293 \header{ title = \markup{ \bold { foo \italic { bar! } } } }
296 \override Score.RehearsalMark
297 #'break-visibility = #begin-of-line-invisible
298 \override Score.RehearsalMark #'self-alignment-X = #right
300 \set Staff.instrumentName = \markup{ \column{ Alto solo } }
301 c2^\markup{ don't be \flat }
302 \override TextSpanner #'edge-text = #(cons (markup #:italic "rit" ) "")
304 a2\mark \markup{ \large \bold Fine }
308 \addlyrics { bar, foo \markup{ \italic bar! } }
312 A @code{\markup} command can also be placed on its own, away from any
313 @code{\score} block, see @ref{Multiple scores in a book}.
315 @lilypond[quote,ragged-right,verbatim]
316 \markup{ Here is some text. }
319 @cindex font switching
321 The markup in the example demonstrates font switching commands. The
322 command @code{\bold} and @code{\italic} apply to the first following
323 word only; to apply a command to more than one word, enclose the
327 \markup @{ \bold @{ hi there @} @}
331 For clarity, you can also do this for single arguments, e.g.,
334 \markup @{ is \italic @{ anyone @} home @}
337 In markup mode you can compose expressions, similar to mathematical
338 expressions, XML documents, and music expressions. You can stack
339 expressions grouped vertically with the command @code{\column}.
340 Similarly, @code{\center-align} aligns texts by their center lines:
342 @lilypond[quote,verbatim,fragment,relative=1]
343 c1^\markup { \column { a bbbb \line { c d } } }
344 c1^\markup { \center-align { a bbbb c } }
345 c1^\markup { \line { a b c } }
348 Lists with no previous command are not kept distinct. The expression
351 \center-align @{ @{ a b @} @{ c d @} @}
359 \center-align @{ a b c d @}
364 To keep lists of words distinct, please use quotes @code{"} or
365 the @code{\line} command
367 @lilypond[quote,verbatim,fragment,relative=1]
369 c4^\markup{ \center-align { on three lines } }
370 c4^\markup{ \center-align { "all one line" } }
371 c4^\markup{ \center-align { { on three lines } } }
372 c4^\markup{ \center-align { \line { on one line } } }
375 Markups can be stored in variables and these variables
376 may be attached to notes, like
378 allegro = \markup @{ \bold \large @{ Allegro @} @}
379 @{ a^\allegro b c d @}
382 Some objects have alignment procedures of their own, which cancel out
383 any effects of alignments applied to their markup arguments as a
384 whole. For example, the @internalsref{RehearsalMark} is horizontally
385 centered, so using @code{\mark \markup @{ \left-align .. @}} has no
388 In addition, vertical placement is performed after creating the
389 text markup object. If you wish to move an entire piece of markup,
390 you need to use the #'padding property or create an "anchor" point
391 inside the markup (generally with @code{\hspace #0}).
393 @lilypond[quote,verbatim,fragment,relative=1]
395 c'4^\markup{ \raise #5 "not raised" }
396 \once \override TextScript #'padding = #3
397 c'4^\markup{ raised }
398 c'4^\markup{ \hspace #0 \raise #1.5 raised }
401 Some situations (such as dynamic marks) have preset font-related
402 properties. If you are creating text in such situations, it
403 is advisable to cancel those properties with
404 @code{normal-text}. See @ref{Overview of text markup commands}
410 This manual: @ref{Overview of text markup commands}.
412 Program reference: @internalsref{TextScript}.
414 Init files: @file{scm/@/new@/-markup@/.scm}.
419 Kerning or generation of ligatures is only done when the @TeX{}
420 backend is used. In this case, LilyPond does not account for them so
421 texts will be spaced slightly too wide.
423 Syntax errors for markup mode are confusing.
427 @subsection Nested scores
429 It is possible to nest music inside markups, by adding a @code{\score}
430 block to a markup expression. Such a score must contain a @code{\layout}
433 @lilypond[quote,verbatim,ragged-right]
437 \relative { c4 d e f }
446 @node Overview of text markup commands
447 @subsection Overview of text markup commands
449 The following commands can all be used inside @code{\markup @{ @}}.
451 @include markup-commands.tely
455 @subsection Font selection
457 @cindex font selection
458 @cindex font magnification
459 @funindex font-interface
461 By setting the object properties described below, you can select a
462 font from the preconfigured font families. LilyPond has default
463 support for the feta music fonts. Text fonts are selected through
464 Pango/FontConfig. The serif font defaults to New Century Schoolbook,
465 the sans and typewriter to whatever the Pango installation defaults
470 @item @code{font-encoding}
471 is a symbol that sets layout of the glyphs. This should only be set to
472 select different types of non-text fonts, e.g.
474 @code{fetaBraces} for piano staff braces, @code{fetaMusic} the
475 standard music font, including ancient glyphs, @code{fetaDynamic} for
476 dynamic signs and @code{fetaNumber} for the number font.
478 @item @code{font-family}
479 is a symbol indicating the general class of the typeface. Supported are
480 @code{roman} (Computer Modern), @code{sans}, and @code{typewriter}.
482 @item @code{font-shape}
483 is a symbol indicating the shape of the font. There are typically
484 several font shapes available for each font family. Choices are
485 @code{italic}, @code{caps}, and @code{upright}.
487 @item @code{font-series}
488 is a symbol indicating the series of the font. There are typically
489 several font series for each font family and shape. Choices are
490 @code{medium} and @code{bold}.
494 Fonts selected in the way sketched above come from a predefined style
495 sheet. If you want to use a font from outside the style sheet,
497 @code{font-name} property,
499 @lilypond[fragment,verbatim]
501 \override Staff.TimeSignature #'font-name = #"Charter"
502 \override Staff.TimeSignature #'font-size = #2
505 \override #'(font-name . "Vera Bold")
506 { This text is in Vera Bold }
512 Any font can be used, as long as it is available to Pango/FontConfig.
513 To get a full list of all available fonts, run the command
515 lilypond -dshow-available-fonts blabla
517 (the last argument of the command can be anything, but has to be present).
520 The size of the font may be set with the @code{font-size}
521 property. The resulting size is taken relative to the
522 @code{text-font-size} as defined in the @code{\paper} block.
525 @cindex font magnification
528 It is also possible to change the default font family for the entire
529 document. This is done by calling the @code{make-pango-font-tree} from
530 within the @code{\paper} block. The function takes names for the font
531 families to use for roman, sans serif and monospaced text. For
534 @cindex font families, setting
543 (make-pango-font-tree "Times New Roman"
550 c'^\markup { roman: foo \sans bla \typewriter bar }
554 @c we don't do Helvetica / Courier, since GS incorrectly loads
561 Examples: @inputfileref{input/@/regression,font@/-family@/-override.ly}.
564 @node New dynamic marks
565 @subsection New dynamic marks
567 It is possible to print new dynamic marks or text that should be aligned
568 with dynamics. Use @code{make-dynamic-script} to create these
569 marks. Note that the dynamic font only contains the characters
570 @code{f,m,p,r,s} and @code{z}.
572 Some situations (such as dynamic marks) have preset font-related
573 properties. If you are creating text in such situations, it
574 is advisable to cancel those properties with
575 @code{normal-text}. See @ref{Overview of text markup commands}
578 @cindex make-dynamic-script
580 @lilypond[quote,verbatim,ragged-right]
581 sfzp = #(make-dynamic-script "sfzp")
587 @cindex Dynamics, editorial
588 @cindex Dynamics, parenthesis
590 It is also possible to print dynamics in round parenthesis or square
591 brackets. These are often used for adding editorial dynamics.
593 @lilypond[quote,verbatim,ragged-right]
594 rndf = \markup{ \center-align {\line { \bold{\italic (}
595 \dynamic f \bold{\italic )} }} }
596 boxf = \markup{ \bracket { \dynamic f } }
597 { c'1_\rndf c'1_\boxf }
602 @node Preparing parts
603 @section Preparing parts
605 This section describes various notation that are useful for preparing
609 * Multi measure rests::
614 * Instrument transpositions::
616 * Different editions from one source::
620 @node Multi measure rests
621 @subsection Multi measure rests
623 @cindex multi measure rests
624 @cindex full measure rests
625 @cindex Rests, multi measure
626 @cindex Rests, full measure
627 @cindex whole rests for a full measure
630 Rests for one full measure (or many bars) are entered using @samp{R}. It
631 is specifically meant for full bar rests and for entering parts: the rest
632 can expand to fill a score with rests, or it can be printed as a single
633 multi-measure rest. This expansion is controlled by the property
634 @code{Score.skipBars}. If this is set to true, empty measures will not
635 be expanded, and the appropriate number is added automatically
637 @lilypond[quote,ragged-right,fragment,verbatim]
638 \time 4/4 r1 | R1 | R1*2 \time 3/4 R2. \time 2/4 R2 \time 4/4
639 \set Score.skipBars = ##t R1*17 R1*4
642 The @code{1} in @code{R1} is similar to the duration notation used for
643 notes. Hence, for time signatures other than 4/4, you must enter other
644 durations. This can be done with augmentation dots or fractions
646 @lilypond[quote,ragged-right,fragment,verbatim]
647 \set Score.skipBars = ##t
656 An @code{R} spanning a single measure is printed as either a whole rest
657 or a breve, centered in the measure regardless of the time signature.
659 If there are only a few measures of rest, LilyPond prints @q{church rests}
660 (a series of rectangles) in the staff. To replace that with a simple
661 rest, use @code{MultiMeasureRest.expand-limit}.
663 @lilypond[quote,ragged-right,fragment,verbatim]
664 \set Score.skipBars = ##t
666 \override MultiMeasureRest #'expand-limit = 1
670 @cindex text on multi-measure rest
671 @cindex script on multi-measure rest
672 @cindex fermata on multi-measure rest
674 Texts can be added to multi-measure rests by using the
675 @var{note}-@code{markup} syntax @ref{Text markup}.
676 A variable (@code{\fermataMarkup}) is provided for
679 @lilypond[quote,ragged-right,verbatim,fragment]
680 \set Score.skipBars = ##t
682 R2.*10^\markup { \italic "ad lib." }
686 Warning! This text is created by @code{MultiMeasureRestText}, not
689 @lilypond[quote,ragged-right,verbatim,fragment]
690 \override TextScript #'padding = #5
692 \override MultiMeasureRestText #'padding = #5
696 If you want to have text on the left end of a multi-measure rest,
697 attach the text to a zero-length skip note, i.e.,
707 Program reference: @internalsref{MultiMeasureRestMusicGroup},
708 @internalsref{MultiMeasureRest}.
710 The layout object @internalsref{MultiMeasureRestNumber} is for the
711 default number, and @internalsref{MultiMeasureRestText} for user
717 It is not possible to use fingerings (e.g., @code{R1-4}) to put numbers
718 over multi-measure rests. And the pitch of multi-measure rests (or
719 staff-centered rests) can not be influenced.
721 @cindex condensing rests
723 There is no way to automatically condense multiple rests into a single
724 multi-measure rest. Multi-measure rests do not take part in rest
727 Be careful when entering multi-measure rests followed by whole
728 notes. The following will enter two notes lasting four measures each
732 When @code{skipBars} is set, the result will look OK, but the bar
733 numbering will be off.
736 @node Metronome marks
737 @subsection Metronome marks
740 @cindex beats per minute
741 @cindex metronome marking
743 Metronome settings can be entered as follows
745 \tempo @var{duration} = @var{per-minute}
748 In the MIDI output, they are interpreted as a tempo change. In the
749 layout output, a metronome marking is printed
751 @lilypond[quote,ragged-right,verbatim,fragment]
758 To change the tempo in the MIDI output without printing anything, make
759 the metronome marking invisible
761 \once \override Score.MetronomeMark #'transparent = ##t
764 To print other metronome markings, use these markup commands
765 @lilypond[quote,ragged-right,verbatim,relative,fragment]
768 \smaller \general-align #Y #DOWN \note #"16." #1
770 \smaller \general-align #Y #DOWN \note #"8" #1
775 See @ref{Text markup} for more details.
780 Program reference: @internalsref{MetronomeMark}.
785 Collisions are not checked. If you have notes above the top line of
786 the staff (or notes with articulations, slurs, text, etc), then the
787 metronome marking may be printed on top of musical symbols. If this
788 occurs, increase the padding of the metronome mark to place it
789 further away from the staff.
792 \override Score.MetronomeMark #'padding = #2.5
796 @node Rehearsal marks
797 @subsection Rehearsal marks
799 @cindex Rehearsal marks
802 To print a rehearsal mark, use the @code{\mark} command
804 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
813 The letter@tie{}@q{I} is skipped in accordance with engraving traditions.
814 If you wish to include the letter @q{I}, then use
817 \set Score.markFormatter = #format-mark-alphabet
820 The mark is incremented automatically if you use @code{\mark
821 \default}, but you can also use an integer argument to set the mark
822 manually. The value to use is stored in the property
823 @code{rehearsalMark}.
825 The style is defined by the property @code{markFormatter}. It is a
826 function taking the current mark (an integer) and the current context
827 as argument. It should return a markup object. In the following
828 example, @code{markFormatter} is set to a canned procedure. After a
829 few measures, it is set to function that produces a boxed number.
831 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
832 \set Score.markFormatter = #format-mark-numbers
835 \set Score.markFormatter = #format-mark-box-numbers
841 The file @file{scm/@/translation@/-functions@/.scm} contains the definitions
842 of @code{format-mark-numbers} (the default format),
843 @code{format-mark-box-numbers},
844 @code{format-mark-letters} and @code{format-mark-box-letters}.
845 These can be used as inspiration for other formatting functions.
847 You may use @code{format-mark-barnumbers}, @code{format-mark-box-barnumbers},
848 and @code{format-mark-circle-barnumbers} to get bar numbers instead of
849 incremented numbers or letters.
851 Other styles of rehearsal mark can be specified manually
858 @code{Score.markFormatter} does not affect marks specified in this manner.
859 However, it is possible to apply a @code{\markup} to the string.
862 \mark \markup@{ \box A1 @}
869 Music glyphs (such as the segno sign) may be printed inside
872 @lilypond[fragment,quote,ragged-right,verbatim,relative]
873 c1 \mark \markup { \musicglyph #"scripts.segno" }
874 c1 \mark \markup { \musicglyph #"scripts.coda" }
875 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
880 See @ref{The Feta font} for a list of symbols which may be
881 printed with @code{\musicglyph}.
883 The horizontal location of rehearsal marks can be adjusted by
884 setting @code{break-align-symbol}
886 @lilypond[fragment,quote,ragged-right,verbatim,relative]
890 \override Score.RehearsalMark #'break-align-symbol = #'key-signature
894 \override Score.RehearsalMark #'break-align-symbol = #'clef
900 @code{break-align-symbol} may also accept the following values:
901 @code{ambitus}, @code{breathing-sign}, @code{clef}, @code{custos},
902 @code{staff-bar}, @code{left-edge}, @code{key-cancellation},
903 @code{key-signature}, and @code{time-signature}. Setting
904 @code{break-align-symbol} will only have an effect if the symbol
905 appears at that point in the music.
910 This manual: @ref{Text marks}.
912 Program reference: @internalsref{RehearsalMark}.
914 Init files: @file{scm/@/translation@/-functions@/.scm} contains the
915 definition of @code{format-mark-numbers} and
916 @code{format-mark-letters}. They can be used as inspiration for other
917 formatting functions.
919 Examples: @inputfileref{input/@/regression,rehearsal@/-mark@/-letter@/.ly},
921 @inputfileref{input/@/regression,rehearsal@/-mark@/-number@/.ly}.
925 @subsection Bar numbers
928 @cindex measure numbers
929 @funindex currentBarNumber
931 Bar numbers are printed by default at the start of the line. The
932 number itself is stored in the @code{currentBarNumber} property, which
933 is normally updated automatically for every measure.
935 @lilypond[verbatim,ragged-right,quote,fragment,relative]
936 \repeat unfold 4 {c4 c c c} \break
937 \set Score.currentBarNumber = #50
938 \repeat unfold 4 {c4 c c c}
941 Bar numbers may only be printed at bar lines; to print a bar
942 number at the beginning of a piece, an empty bar line must
945 @lilypond[verbatim,ragged-right,quote,fragment,relative]
946 \set Score.currentBarNumber = #50
948 \repeat unfold 4 {c4 c c c} \break
949 \repeat unfold 4 {c4 c c c}
952 Bar numbers can be typeset at regular intervals instead of at the
953 beginning of each line. This is illustrated in the following example,
954 whose source is available as
955 @inputfileref{input/@/test,bar@/-number@/-regular@/-interval@/.ly}
957 @lilypondfile[ragged-right,quote]{bar-number-regular-interval.ly}
959 Bar numbers can be removed entirely by removing the Bar number
960 engraver from the score.
962 @lilypond[verbatim,ragged-right,quote]
966 \remove "Bar_number_engraver"
978 Program reference: @internalsref{BarNumber}.
981 @inputfileref{input/@/test,bar@/-number@/-every@/-five@/-reset@/.ly},
982 and @inputfileref{input/@/test,bar@/-number@/-regular@/-interval@/.ly}.
987 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
988 there is one at the top. To solve this, the
989 @code{padding} property of @internalsref{BarNumber} can be
990 used to position the number correctly.
993 @node Instrument names
994 @subsection Instrument names
996 In an orchestral score, instrument names are printed at the left side
999 This can be achieved by setting @internalsref{Staff}.@code{instrumentName}
1000 and @internalsref{Staff}.@code{shortInstrumentName}, or
1001 @internalsref{PianoStaff}.@code{instrumentName} and
1002 @internalsref{PianoStaff}.@code{shortInstrumentName}. This will
1004 the start of the staff. For the first staff, @code{instrumentName} is
1005 used, for the following ones, @code{shortInstrumentName} is used.
1007 @lilypond[quote,verbatim,ragged-right,relative=1,fragment]
1008 \set Staff.instrumentName = "Ploink "
1009 \set Staff.shortInstrumentName = "Plk "
1015 You can also use markup texts to construct more complicated instrument
1018 @lilypond[quote,fragment,verbatim,ragged-right]
1019 \set Staff.instrumentName = \markup {
1020 \column { "Clarinetti"
1021 \line { "in B" \smaller \flat } } }
1025 If you wish to center the instrument names, you must center all of them
1027 @lilypond[quote,verbatim,ragged-right]
1030 \set Staff.instrumentName = \markup {
1031 \center-align { "Clarinetti"
1032 \line { "in B" \smaller \flat } } }
1036 \set Staff.instrumentName = \markup{ \center-align { Vibraphone }}
1043 For longer instrument names, it may be useful to increase the
1044 @code{indent} setting in the @code{\layout} block.
1046 To center instrument names while leaving extra space to the right,
1048 @lilypond[quote,verbatim,ragged-right]
1049 \new StaffGroup \relative
1052 \set Staff.instrumentName = \markup { \hcenter-in #10 "blabla" }
1056 \set Staff.instrumentName = \markup { \hcenter-in #10 "blo" }
1062 To add instrument names to other contexts (such as @code{GrandStaff},
1063 @code{ChoirStaff}, or @code{StaffGroup}), the engraver must
1064 be added to that context.
1068 \context @{\GrandStaff \consists "Instrument_name_engraver"@}
1073 More information about adding and removing engravers can
1074 be found in @ref{Modifying context plug-ins}.
1076 Instrument names may be changed in the middle of a piece,
1078 @lilypond[quote,fragment,verbatim,ragged-right]
1079 \set Staff.instrumentName = "First"
1080 \set Staff.shortInstrumentName = "one"
1083 \set Staff.instrumentName = "Second"
1084 \set Staff.shortInstrumentName = "two"
1092 Program reference: @internalsref{InstrumentName}.
1096 @node Instrument transpositions
1097 @subsection Instrument transpositions
1099 @cindex transposition, MIDI
1100 @cindex transposition, instrument
1102 The key of a transposing instrument can also be specified. This
1103 applies to many wind instruments, for example, clarinets (B-flat, A, and
1104 E-flat), horn (F) and trumpet (B-flat, C, D, and E-flat).
1106 The transposition is entered after the keyword @code{\transposition}
1109 \transposition bes %% B-flat clarinet
1113 This command sets the property @code{instrumentTransposition}. The value of
1114 this property is used for MIDI output and quotations. It does not
1115 affect how notes are printed in the current staff. To change the printed
1116 output, see @ref{Transpose}.
1118 The pitch to use for @code{\transposition} should correspond to the
1119 real sound heard when a @code{c'} written on the staff is played by the
1120 transposing instrument. For example, when entering a score in
1121 concert pitch, typically all voices are entered in C, so
1122 they should be entered as
1135 The command @code{\transposition} should be used when the music is
1136 entered from a (transposed) orchestral part. For example, in
1137 classical horn parts, the tuning of the instrument is often changed
1138 during a piece. When copying the notes from the part, use
1139 @code{\transposition}, e.g.,
1151 @node Ottava brackets
1152 @subsection Ottava brackets
1154 @q{Ottava} brackets introduce an extra transposition of an octave for
1155 the staff. They are created by invoking the function
1156 @code{set-octavation}
1162 @lilypond[quote,ragged-right,verbatim,fragment]
1172 The @code{set-octavation} function also takes -1 (for 8va bassa), 2@tie{}(for 15ma),
1173 and -2 (for 15ma bassa) as arguments. Internally the function sets the properties
1174 @code{ottavation} (e.g., to @code{"8va"} or @code{"8vb"}) and
1175 @code{centralCPosition}. For overriding the text of the bracket, set
1176 @code{ottavation} after invoking @code{set-octavation}, i.e.,
1178 @lilypond[quote,ragged-right,verbatim]
1181 \set Staff.ottavation = #"8"
1189 Program reference: @internalsref{OttavaBracket}.
1191 Examples: @inputfileref{input/@/regression,ottava@/.ly},
1192 @inputfileref{input/@/regression,ottava@/-broken@/.ly}.
1197 @code{set-octavation} will get confused when clef changes happen
1198 during an octavation bracket.
1201 @node Different editions from one source
1202 @subsection Different editions from one source
1207 The @code{\tag} command marks music expressions with a name. These
1208 tagged expressions can be filtered out later. With this mechanism it
1209 is possible to make different versions of the same music source.
1211 In the following example, we see two versions of a piece of music, one
1212 for the full score, and one with cue notes for the instrumental part
1228 The same can be applied to articulations, texts, etc.: they are
1231 -\tag #@var{your-tag}
1233 to an articulation, for example,
1238 This defines a note with a conditional fingering indication.
1241 @cindex removeWithTag
1242 By applying the @code{\keepWithTag} and @code{\removeWithTag}
1243 commands, tagged expressions can be filtered. For example,
1247 \keepWithTag #'score @var{the music}
1248 \keepWithTag #'part @var{the music}
1253 @lilypondfile[ragged-right,quote]{tag-filter.ly}
1255 The arguments of the @code{\tag} command should be a symbol
1256 (such as @code{#'score} or @code{#'part}), followed by a
1257 music expression. It is possible to put multiple tags on
1258 a piece of music with multiple @code{\tag} entries,
1261 \tag #'original-part \tag #'transposed-part @dots{}
1267 Examples: @inputfileref{input/@/regression,tag@/-filter@/.ly}.
1272 Multiple rests are not merged if you create the score with both tagged
1277 @node Orchestral music
1278 @section Orchestral music
1280 Orchestral music involves some special notation, both in the full
1281 score and the individual parts. This section explains how to tackle
1282 some common problems in orchestral music.
1285 * Automatic part combining::
1287 * Quoting other voices::
1288 * Formatting cue notes::
1289 * Aligning to cadenzas::
1293 @node Automatic part combining
1294 @subsection Automatic part combining
1295 @cindex automatic part combining
1296 @cindex part combiner
1298 Automatic part combining is used to merge two parts of music onto a
1299 staff. It is aimed at typesetting orchestral scores. When the two
1300 parts are identical for a period of time, only one is shown. In
1301 places where the two parts differ, they are typeset as separate
1302 voices, and stem directions are set automatically. Also, solo and
1303 @emph{a due} parts are identified and can be marked.
1305 The syntax for part combining is
1308 \partcombine @var{musicexpr1} @var{musicexpr2}
1312 The following example demonstrates the basic functionality of the part
1313 combiner: putting parts on one staff, and setting stem directions and
1316 @lilypond[quote,verbatim,ragged-right,fragment]
1317 \new Staff \partcombine
1318 \relative g' { g g a( b) c c r r }
1319 \relative g' { g g r4 r e e g g }
1322 The first @code{g} appears only once, although it was
1323 specified twice (once in each part). Stem, slur, and tie directions are
1324 set automatically, depending whether there is a solo or unisono. The
1325 first part (with context called @code{one}) always gets up stems, and
1326 @q{Solo}, while the second (called @code{two}) always gets down stems and
1329 If you just want the merging parts, and not the textual markings, you
1330 may set the property @code{printPartCombineTexts} to false
1332 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
1334 \set Staff.printPartCombineTexts = ##f
1336 \relative g' { g a( b) r }
1337 \relative g' { g r4 r f }
1341 To change the text that is printed for solos or merging, you may
1342 set the @code{soloText}, @code{soloIIText}, and @code{aDueText}
1345 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
1347 \set Score.soloText = #"ichi"
1348 \set Score.soloIIText = #"ni"
1349 \set Score.aDueText = #"tachi"
1351 \relative g' { g4 g a( b) r }
1352 \relative g' { g4 g r r f }
1356 Both arguments to @code{\partcombine} will be interpreted as
1357 @internalsref{Voice} contexts. If using relative octaves,
1358 @code{\relative} should be specified for both music expressions, i.e.,
1362 \relative @dots{} @var{musicexpr1}
1363 \relative @dots{} @var{musicexpr2}
1367 A @code{\relative} section that is outside of @code{\partcombine} has
1368 no effect on the pitches of @var{musicexpr1} and @var{musicexpr2}.
1372 Program reference: @internalsref{PartCombineMusic}.
1376 When @code{printPartCombineTexts} is set, when the two voices play the
1377 same notes on and off, the part combiner may typeset @code{a2} more
1378 than once in a measure.
1380 @code{\partcombine} cannot be inside @code{\times}.
1382 @code{\partcombine} cannot be inside @code{\relative}.
1384 Internally, the @code{\partcombine} interprets both arguments as
1385 @code{Voice}s named @code{one} and @code{two}, and then decides when
1386 the parts can be combined. Consequently, if the arguments switch to
1387 differently named @internalsref{Voice} contexts, the events in those
1392 @subsection Hiding staves
1394 @cindex Frenched scores
1395 @cindex Hiding staves
1397 In orchestral scores, staff lines that only have rests are usually
1398 removed; this saves some space. This style is called @q{French Score}.
1399 For @internalsref{Lyrics},
1400 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
1401 switched on by default. When the lines of these contexts turn out
1402 empty after the line-breaking process, they are removed.
1404 For normal staves, a specialized @internalsref{Staff} context is
1405 available, which does the same: staves containing nothing (or only
1406 multi-measure rests) are removed. The context definition is stored in
1407 @code{\RemoveEmptyStaffContext} variable. Observe how the second staff
1408 in this example disappears in the second line
1410 @lilypond[quote,ragged-right,verbatim]
1412 \context { \RemoveEmptyStaffContext }
1417 \new Staff { e4 f g a \break c1 }
1418 \new Staff { c4 d e f \break R1 }
1423 The first system shows all staves in full. If empty staves should be
1424 removed from the first system too, set @code{remove-first} to true in
1425 @internalsref{VerticalAxisGroup}.
1428 \override Score.VerticalAxisGroup #'remove-first = ##t
1431 To remove other types of contexts, use @code{\AncientRemoveEmptyStaffContext}
1432 or @code{\RemoveEmptyRhythmicStaffContext}.
1434 Another application is making ossia sections, i.e., alternative
1435 melodies on a separate piece of staff, with help of a Frenched
1439 @node Quoting other voices
1440 @subsection Quoting other voices
1444 With quotations, fragments of other parts can be inserted into a part
1445 directly. Before a part can be quoted, it must be marked especially as
1446 quotable. This is done with the @code{\addQuote} command.
1449 \addQuote @var{name} @var{music}
1454 Here, @var{name} is an identifying string. The @var{music} is any kind
1455 of music. Here is an example of @code{\addQuote}
1458 \addQuote clarinet \relative c' @{
1463 This command must be entered at toplevel, i.e., outside any music
1466 After calling @code{\addQuote}, the quotation may then be done with
1467 @code{\quoteDuring} or @code{\cueDuring},
1470 \quoteDuring #@var{name} @var{music}
1473 During a part, a piece of music can be quoted with the @code{\quoteDuring}
1477 \quoteDuring #"clarinet" @{ s2. @}
1480 This would cite three quarter notes (the duration of @code{s2.}) of
1481 the previously added @code{clarinet} voice.
1484 More precisely, it takes the current time-step of the part being
1485 printed, and extracts the notes at the corresponding point of the
1486 @code{\addQuote}d voice. Therefore, the argument to @code{\addQuote}
1487 should be the entire part of the voice to be quoted, including any
1488 rests at the beginning.
1490 Quotations take into account the transposition of both source and target
1491 instruments, if they are specified using the @code{\transposition} command.
1493 @lilypond[quote,ragged-right,verbatim]
1494 \addQuote clarinet \relative c' {
1500 e'8 f'8 \quoteDuring #"clarinet" { s2 }
1504 The type of events that are present in cue notes can be trimmed with
1505 the @code{quotedEventTypes} property. The default value is
1506 @code{(note-event rest-event)}, which means that only notes and
1507 rests of the cued voice end up in the @code{\quoteDuring}.
1511 \set Staff.quotedEventTypes =
1512 #'(note-event articulation-event dynamic-event)
1516 will quote notes (but no rests), together with scripts and dynamics.
1520 Only the contents of the first @internalsref{Voice} occurring in an
1521 @code{\addQuote} command will be considered for quotation, so
1522 @var{music} can not contain @code{\new} and @code{\context Voice}
1523 statements that would switch to a different Voice.
1525 Quoting grace notes is broken and can even cause LilyPond to crash.
1529 In this manual: @ref{Instrument transpositions}.
1531 Examples: @inputfileref{input/@/regression,quote@/.ly}
1532 @inputfileref{input/@/regression,quote@/-transposition@/.ly}
1534 Program reference: @internalsref{QuoteMusic}.
1537 @node Formatting cue notes
1538 @subsection Formatting cue notes
1540 @cindex cues, formatting
1542 The previous section deals with inserting notes from another voice.
1543 There is a more advanced music function called @code{\cueDuring},
1544 which makes formatting cue notes easier.
1549 \cueDuring #@var{name} #@var{updown} @var{music}
1552 This will insert notes from the part @var{name} into a
1553 @internalsref{Voice} called @code{cue}. This happens simultaneously
1554 with @var{music}, which usually is a rest. When the cue notes start,
1555 the staff in effect becomes polyphonic for a moment. The argument
1556 @var{updown} determines whether the cue notes should be notated as a
1557 first or second voice.
1560 @lilypond[verbatim,ragged-right]
1563 \override Stem #'length-fraction = #0.8
1564 \override Beam #'thickness = #0.384
1565 \override Beam #'length-fraction = #0.8
1568 \addQuote clarinet \relative {
1573 \new Staff \relative <<
1575 % setup a context for cue notes.
1576 \new Voice = "cue" { \smaller \skip 1*21 }
1578 \set Score.skipBars = ##t
1582 \cueDuring #"clarinet" #1 {
1591 Here are a couple of hints for successful cue notes
1595 Cue notes have smaller font sizes.
1597 the cued part is marked with the instrument playing the cue.
1599 when the original part takes over again, this should be marked with
1600 the name of the original instrument.
1602 @c really? Are you sure about that last point? I'll check after 3.0 -gp
1604 @c Yes, this is good practice. Otherwise, the start of the original
1605 @c part can only be seen from the font size. This is not good enough
1606 @c for sight-reading. It is possilbe to use other
1607 @c markers (e.g. a big close-bracket over the staff) to indicate the cue
1613 Any other changes introduced by the cued part should also be
1614 undone. For example, if the cued instrument plays in a different clef,
1615 the original clef should be stated once again.
1619 The macro @code{\transposedCueDuring} is
1620 useful to add cues to instruments which use a completely different
1621 octave range (for example, having a cue of a piccolo flute within
1622 a contra bassoon part).
1624 @lilypond[verbatim,ragged-right,quote]
1625 picc = \relative c''' {
1631 \addQuote "picc" { \picc }
1633 cbsn = \relative c, {
1636 \transposedCueDuring #"picc" #UP c,, { R1 } |
1641 \context Staff = "picc" \picc
1642 \context Staff = "cbsn" \cbsn
1648 @node Aligning to cadenzas
1649 @subsection Aligning to cadenzas
1651 In an orchestral context, cadenzas present a special problem:
1652 when constructing a score that includes a cadenza, all other
1653 instruments should skip just as many notes as the length of the
1654 cadenza, otherwise they will start too soon or too late.
1656 A solution to this problem are the functions @code{mmrest-of-length}
1657 and @code{skip-of-length}. These Scheme functions take a piece of music
1658 as argument, and generate a @code{\skip} or multi-rest, exactly as
1659 long as the piece. The use of @code{mmrest-of-length} is demonstrated
1660 in the following example.
1662 @lilypond[verbatim,ragged-right,quote]
1663 cadenza = \relative c' {
1664 c4 d8 << { e f g } \\ { d4. } >>
1669 \new Staff { \cadenza c'4 }
1671 #(ly:export (mmrest-of-length cadenza))
1680 @node Contemporary notation
1681 @section Contemporary notation
1683 In the 20th century, composers have greatly expanded the musical
1684 vocabulary. With this expansion, many innovations in musical notation
1685 have been tried. The book @q{Music Notation in the 20th century} by
1686 Kurt Stone gives a comprehensive overview (see @ref{Literature
1689 This section describes notation that does
1690 not fit into traditional notation categories, such as pitches,
1691 tuplet beams, and articulation. For contemporary notation
1692 that fits into traditional notation categories, such as
1693 microtones, nested tuplet beams, and unusual fermatas, please
1694 see those sections of the documentation.
1697 * Polymetric notation::
1698 * Time administration::
1699 * Proportional notation::
1701 * Special noteheads::
1704 * Selecting notation font size::
1708 @node Polymetric notation
1709 @subsection Polymetric notation
1711 @cindex double time signatures
1712 @cindex signatures, polymetric
1713 @cindex polymetric signatures
1714 @cindex meter, polymetric
1716 Double time signatures are not supported explicitly, but they can be
1717 faked. In the next example, the markup for the time signature is
1718 created with a markup text. This markup text is inserted in the
1719 @internalsref{TimeSignature} grob. See also
1720 @inputfileref{input/@/test,compound@/-time@/.ly}).
1722 @lilypond[verbatim,ragged-right]
1725 \override #'(baseline-skip . 2) \number {
1728 \bracket \column { "5" "8" }
1733 \override Staff.TimeSignature #'stencil = #ly:text-interface::print
1734 \override Staff.TimeSignature #'text = #tsMarkup
1736 c'2 \bar ":" c'4 c'4.
1740 Each staff can also have its own time signature. This is done by
1741 moving the @internalsref{Timing_translator} to the @internalsref{Staff}
1747 \remove "Timing_translator"
1748 \remove "Default_bar_line_engraver"
1752 \consists "Timing_translator"
1753 \consists "Default_bar_line_engraver"
1760 Now, each staff has its own time signature.
1773 c4. c8 c c c4. c8 c c
1778 @lilypond[quote,ragged-right]
1782 \remove "Timing_translator"
1783 \remove "Default_bar_line_engraver"
1786 \consists "Timing_translator"
1787 \consists "Default_bar_line_engraver"
1802 c4. c8 c c c4. c8 c c
1808 A different form of polymetric notation is where note lengths have
1809 different values across staves.
1811 This notation can be created by setting a common time signature for
1812 each staff but replacing it manually using
1813 @code{timeSignatureFraction} to the desired fraction. Then the printed
1814 durations in each staff are scaled to the common time signature.
1815 The latter is done with @code{\compressMusic}, which is used similar
1816 to @code{\times}, but does not create a tuplet bracket. The syntax is
1818 \compressMusic #'(@var{numerator} . @var{denominator}) @var{musicexpr}
1823 In this example, music with the time signatures of 3/4, 9/8, and 10/8 are
1824 used in parallel. In the second staff, shown durations are multiplied by
1825 2/3, so that 2/3 * 9/8 = 3/4, and in the third staff, shown durations are
1826 multiplied by 3/5, so that 3/5 * 10/8 = 3/4.
1828 @lilypond[quote,ragged-right,verbatim,fragment]
1836 \set Staff.timeSignatureFraction = #'(9 . 8)
1837 \compressMusic #'(2 . 3)
1838 \repeat unfold 6 { c8[ c c] }
1842 \set Staff.timeSignatureFraction = #'(10 . 8)
1843 \compressMusic #'(3 . 5) {
1844 \repeat unfold 2 { c8[ c c] }
1845 \repeat unfold 2 { c8[ c] }
1846 | c4. c4. \times 2/3 { c8 c c } c4
1857 When using different time signatures in parallel, the spacing is
1858 aligned vertically, but bar lines distort the regular spacing.
1861 @node Time administration
1862 @subsection Time administration
1864 @cindex Time administration
1866 Time is administered by the @internalsref{Time_signature_engraver},
1867 which usually lives in the @internalsref{Score} context. The
1868 bookkeeping deals with the following variables
1871 @item currentBarNumber
1875 The length of the measures in the current time signature. For a 4/4
1876 time this is@tie{}1, and for 6/8 it is 3/4.
1878 @item measurePosition
1879 The point within the measure where we currently are. This quantity
1880 is reset to@tie{}0 whenever it exceeds @code{measureLength}. When that
1881 happens, @code{currentBarNumber} is incremented.
1884 If set to true, the above variables are updated for every time
1885 step. When set to false, the engraver stays in the current measure
1889 Timing can be changed by setting any of these variables explicitly.
1890 In the next example, the 4/4 time signature is printed, but
1891 @code{measureLength} is set to 5/4. After a while, the measure is
1892 shortened by 1/8, by setting @code{measurePosition} to 7/8 at 2/4
1893 in the measure, so the next bar line will fall at 2/4 + 3/8. The
1894 3/8 arises because 5/4 normally has 10/8, but we have manually
1895 set the measure position to be 7/8 and 10/8 - 7/8 = 3/8.
1897 @lilypond[quote,ragged-right,verbatim,relative,fragment]
1898 \set Score.measureLength = #(ly:make-moment 5 4)
1902 \set Score.measurePosition = #(ly:make-moment 7 8)
1908 As the example illustrates, @code{ly:make-moment n m} constructs a
1909 duration of n/m of a whole note. For example, @code{ly:make-moment 1 8} is
1911 note duration and @code{ly:make-moment 7 16} is the duration of
1912 seven sixteenths notes.
1915 @node Proportional notation
1916 @subsection Proportional notation
1917 @cindex Proportional notation
1919 Notes can be spaced proportionally to their time-difference by
1920 assigning a duration to @code{proportionalNotationDuration}
1922 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
1924 \set Score.proportionalNotationDuration = #(ly:make-moment 1 16)
1925 \new Staff { c8[ c c c c c] c4 c2 r2 }
1926 \new Staff { c2 \times 2/3 { c8 c c } c4 c1 }
1930 Setting this property only affects the ideal spacing between
1931 consecutive notes. For true proportional notation, the following
1932 settings are also required.
1936 @item True proportional notation requires that symbols are allowed to
1937 overstrike each other. That is achieved by removing the
1938 @internalsref{Separating_line_group_engraver} from
1939 @internalsref{Staff} context.
1941 @item Spacing influence of prefatory matter (clefs, bar lines, etc.)
1942 is removed by setting the @code{strict-note-spacing} property to
1943 @code{#t} in @internalsref{SpacingSpanner} grob.
1945 @item Optical spacing tweaks are switched by setting
1946 @code{uniform-stretching} in @internalsref{SpacingSpanner} to true.
1953 @inputfileref{input/@/regression,spacing-proportional/.ly}
1954 @inputfileref{input/@/regression,spacing-strict-notespacing/.ly}
1955 @inputfileref{input/@/regression,spacing-strict-spacing-grace/.ly}
1957 An example of strict proportional notation is in the
1958 example file @file{input/proportional.ly}.
1962 @subsection Clusters
1966 A cluster indicates a continuous range of pitches to be played. They
1967 can be denoted as the envelope of a set of notes. They are entered by
1968 applying the function @code{makeClusters} to a sequence of
1970 @lilypond[quote,ragged-right,relative=2,fragment,verbatim]
1971 \makeClusters { <c e > <b f'> }
1974 The following example (from
1975 @inputfileref{input/@/regression,cluster@/.ly}) shows what the result
1978 @lilypondfile[ragged-right,quote]{cluster.ly}
1980 Ordinary notes and clusters can be put together in the same staff,
1981 even simultaneously. In such a case no attempt is made to
1982 automatically avoid collisions between ordinary notes and clusters.
1986 Program reference: @internalsref{ClusterSpanner},
1987 @internalsref{ClusterSpannerBeacon},
1988 @internalsref{Cluster_spanner_engraver}.
1990 Examples: @inputfileref{input/@/regression,cluster@/.ly}.
1994 Music expressions like @code{<< @{ g8 e8 @} a4 >>} are not printed
1995 accurately. Use @code{<g a>8 <e a>8} instead.
1998 @node Special noteheads
1999 @subsection Special noteheads
2001 @cindex note heads, special
2003 Different noteheads are used by various instruments for various
2004 meanings -- crosses are used for @q{parlato} with vocalists, stopped
2005 notes on guitar; diamonds are used for harmonics on string instruments,
2006 etc. There is a shorthand (@code{\harmonic}) for diamond shapes; the
2007 other notehead styles are produced by tweaking the property
2009 @lilypond[ragged-right,relative=1,fragment,verbatim,quote]
2011 \override NoteHead #'style = #'cross
2013 \revert NoteHead #'style
2014 e d <c f\harmonic> <d a'\harmonic>
2018 To see all notehead styles, please see
2019 @inputfileref{input/@/regression,note@/-head@/-style@/.ly}.
2024 Program reference: @internalsref{NoteHead}.
2027 @node Feathered beams
2028 @subsection Feathered beams
2030 Feathered beams are printed by setting the @code{grow-direction}
2031 property of a @code{Beam}. The @code{\featherDurations} function
2032 can be used to adjust note durations.
2034 @lilypond[ragged-right,relative=1,fragment,verbatim,quote]
2035 \featherDurations #(ly:make-moment 5 4)
2037 \override Beam #'grow-direction = #LEFT
2044 The @code{\featherDuration} command only works with very short
2048 @subsection Improvisation
2050 Improvisation is sometimes denoted with slashed note heads. Such note
2051 heads can be created by adding a @internalsref{Pitch_squash_engraver}
2052 to the @internalsref{Staff} or @internalsref{Voice} context. Then, the
2056 \set squashedPosition = #0
2057 \override NoteHead #'style = #'slash
2061 switches on the slashes.
2063 There are shortcuts @code{\improvisationOn} (and an accompanying
2064 @code{\improvisationOff}) for this command sequence. They are used in
2065 the following example
2067 @lilypond[verbatim,ragged-right,quote]
2069 \consists Pitch_squash_engraver
2071 e8 e g a a16(bes)(a8) g \improvisationOn
2074 ~fis2 \improvisationOff a16(bes) a8 g e
2079 @node Selecting notation font size
2080 @subsection Selecting notation font size
2082 The easiest method of setting the font size of any context is by
2083 setting the @code{fontSize} property.
2085 @lilypond[quote,fragment,relative=1,verbatim]
2094 It does not change the size of variable symbols, such as beams or
2097 Internally, the @code{fontSize} context property will cause the
2098 @code{font-size} property to be set in all layout objects. The value
2099 of @code{font-size} is a number indicating the size relative to the
2100 standard size for the current staff height. Each step up is an
2101 increase of approximately 12% of the font size. Six steps is exactly a
2102 factor two. The Scheme function @code{magstep} converts a
2103 @code{font-size} number to a scaling factor.
2105 @lilypond[quote,fragment,relative=1,verbatim]
2107 \override NoteHead #'font-size = #-4
2109 \override NoteHead #'font-size = #3
2113 Font size changes are achieved by scaling the design size that is
2114 closest to the desired size. The standard font size (for
2115 @code{font-size} equals 0), depends on the standard staff height. For
2116 a 20pt staff, a 10pt font is selected.
2118 The @code{font-size} property can only be set on layout objects that
2119 use fonts. These are the ones supporting the
2120 @internalsref{font-interface} layout interface.
2124 The following commands set @code{fontSize} for the current voice:
2130 @funindex \normalsize
2135 @node Educational use
2136 @section Educational use
2138 With the amount of control that LilyPond offers, one can make great
2139 teaching tools in addition to great musical scores.
2143 * Blank music sheet::
2145 * Shape note heads::
2146 * Easy Notation note heads::
2147 * Analysis brackets::
2148 * Coloring objects::
2154 @subsection Balloon help
2156 Elements of notation can be marked and named with the help of a square
2157 balloon. The primary purpose of this feature is to explain notation.
2159 The following example demonstrates its use.
2161 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
2162 \new Voice \with { \consists "Balloon_engraver" }
2164 \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
2165 <c-\balloonText #'(-2 . -2) \markup { Hello } >8
2170 There are two music functions, @code{balloonText} and
2171 @code{balloonGrobText}. The latter takes the name of the grob to
2172 adorn, while the former may be used as an articulation on a note.
2173 The other arguments are the offset and the text of the label.
2176 @cindex notation, explaining
2180 Program reference: @internalsref{text-balloon-interface}.
2182 Examples: @inputfileref{input/@/regression,balloon@/.ly}.
2187 @node Blank music sheet
2188 @subsection Blank music sheet
2190 @cindex Sheet music, empty
2191 @cindex Staves, blank sheet
2193 A blank music sheet can be produced also by using invisible notes, and
2194 removing @code{Bar_number_engraver}.
2197 @lilypond[quote,verbatim]
2198 \layout{ indent = #0 }
2200 \repeat unfold 2 % Change this for more lines.
2205 \override TimeSignature #'transparent = ##t
2206 % un-comment this line if desired
2207 % \override Clef #'transparent = ##t
2208 defaultBarType = #""
2209 \remove Bar_number_engraver
2212 % modify these to get the staves you want
2213 \new Staff \emptymusic
2214 \new TabStaff \emptymusic
2220 @subsection Hidden notes
2222 @cindex Hidden notes
2223 @cindex Invisible notes
2224 @cindex Transparent notes
2226 @funindex \hideNotes
2227 @funindex \unHideNotes
2228 Hidden (or invisible or transparent) notes can be useful in preparing theory
2229 or composition exercises.
2231 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
2240 @node Shape note heads
2241 @subsection Shape note heads
2243 @cindex note heads, shape
2245 In shape note head notation, the shape of the note head corresponds
2246 to the harmonic function of a note in the scale. This notation was
2247 popular in the 19th century American song books.
2249 Shape note heads can be produced by setting @code{\aikenHeads} or
2250 @code{\sacredHarpHeads}, depending on the style desired.
2252 @lilypond[verbatim,relative=1,fragment]
2259 Shapes are determined on the step in the scale, where the base of the
2260 scale is determined by the @code{\key} command
2263 @funindex shapeNoteStyles
2264 @funindex \aikenHeads
2265 @funindex \sacredHarpHeads
2267 Shape note heads are implemented through the @code{shapeNoteStyles}
2268 property. Its value is a vector of symbols. The k-th element indicates
2269 the style to use for the k-th step of the scale. Arbitrary
2270 combinations are possible, e.g.
2272 @lilypond[verbatim,relative=1,fragment]
2273 \set shapeNoteStyles = ##(cross triangle fa #f mensural xcircle diamond)
2278 @node Easy Notation note heads
2279 @subsection Easy Notation note heads
2281 @cindex note heads, practice
2282 @cindex note heads, easy notation
2283 @cindex easy notation
2286 The @q{easy play} note head includes a note name inside the head. It is
2287 used in music for beginners
2289 @lilypond[quote,ragged-right,verbatim,fragment,staffsize=26]
2294 The command @code{\setEasyHeads} overrides settings for the
2295 @internalsref{NoteHead} object. To make the letters readable, it has
2296 to be printed in a large font size. To print with a larger font, see
2297 @ref{Setting the staff size}.
2301 @funindex \setEasyHeads
2302 @code{\setEasyHeads}
2305 @node Analysis brackets
2306 @subsection Analysis brackets
2308 @cindex phrasing brackets
2309 @cindex musicological analysis
2310 @cindex note grouping bracket
2312 Brackets are used in musical analysis to indicate structure in musical
2313 pieces. LilyPond supports a simple form of nested horizontal
2314 brackets. To use this, add the @internalsref{Horizontal_bracket_engraver}
2315 to @internalsref{Staff} context. A bracket is started with
2316 @code{\startGroup} and closed with @code{\stopGroup}
2318 @lilypond[quote,ragged-right,verbatim]
2321 c4\startGroup\startGroup
2324 c4\stopGroup\stopGroup
2328 \Staff \consists "Horizontal_bracket_engraver"
2334 Program reference: @internalsref{HorizontalBracket}.
2336 Examples: @inputfileref{input/@/regression,note@/-group@/-bracket@/.ly}.
2339 @node Coloring objects
2340 @subsection Coloring objects
2342 Individual objects may be assigned colors. You may use the
2343 color names listed in the @ref{List of colors}.
2345 @lilypond[quote,ragged-right,verbatim,fragment,relative=1]
2346 \override NoteHead #'color = #red
2348 \override NoteHead #'color = #(x11-color 'LimeGreen)
2350 \override Stem #'color = #blue
2354 The full range of colors defined for X11 can be accessed by using the
2355 Scheme function x11-color. The function takes one argument that can be a
2359 \override Beam #'color = #(x11-color 'MediumTurquoise)
2365 \override Beam #'color = #(x11-color "MediumTurquoise")
2368 The first form is quicker to write and is more efficient. However, using
2369 the second form it is possible to access X11 colors by the multi-word
2373 \override Beam #'color = #(x11-color "medium turquoise")
2376 If x11-color cannot make sense of the parameter then the color returned
2377 defaults to black. It should be obvious from the final score that
2380 This example illustrates the use of x11-color. Notice that the stem
2381 color remains black after being set to (x11-color 'Boggle), which is
2382 deliberate nonsense.
2384 @lilypond[quote,ragged-right,verbatim]
2386 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
2387 \set Staff.instrumentName = \markup {
2388 \with-color #(x11-color 'navy) "Clarinet"
2392 \override Beam #'color = #(x11-color "medium turquoise")
2394 \override NoteHead #'color = #(x11-color "LimeGreen")
2396 \override Stem #'color = #(x11-color 'Boggle)
2404 Appendix: @ref{List of colors}.
2408 Not all x11 colors are distinguishable in a web browser. For web use
2409 normal colors are recommended.
2411 An x11 color is not necessarily exactly the same shade as a similarly
2414 Notes in a chord cannot be colored with @code{\override}; use
2415 @code{\tweak} instead. See @ref{Objects connected to the input}
2420 @subsection Parentheses
2423 @cindex notes, ghost
2424 @cindex notes, parenthesized
2426 Objects may be parenthesized by prefixing @code{\parenthesize} to the music
2429 @lilypond[relative=2,fragment,verbatim,ragged-right]
2437 This only functions inside chords, even for single notes
2440 < \parenthesize NOTE>
2445 @subsection Grid lines
2447 Vertical lines can be drawn between staves synchronized with
2450 Examples: @inputfileref{input/@/regression,grid@/-lines@/.ly}.