1 @c -*- coding: latin-1; 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.
15 * Even more than notes::
18 * Contemporary notation::
20 * Automatic notation::
24 @c really bad section name. :(
25 @node Even more than notes
26 @section Even more than notes
33 * Multi measure rests::
34 * Time administration::
39 @subsection Text scripts
42 @cindex text items, non-empty
43 @cindex non-empty texts
45 It is possible to place arbitrary strings of text or markup text (see
46 @ref{Text markup}) above or below notes by using a string
47 @code{c^"text"}. By default, these indications do not influence the
48 note spacing, but by using the command @code{\fatText}, the widths
49 will be taken into account
51 @lilypond[quote,fragment,raggedright,verbatim,relative=1]
52 c4^"longtext" \fatText c4_"longlongtext" c4
55 More complex formatting may also be added to a note by using the
57 @lilypond[fragment,raggedright,verbatim,quote]
58 c'4^\markup { bla \bold bla }
61 The @code{\markup} is described in more detail in
67 @cindex @code{\fatText}
69 @cindex @code{\emptyText}
74 In this manual: @ref{Text markup}.
76 Program reference: @internalsref{TextScriptEvent}, @internalsref{TextScript}.
80 @subsection Text spanners
83 Some performance indications, e.g., @i{rallentando} or @i{accelerando},
84 are written as text and are extended over many measures with dotted
85 lines. Such texts are created using text spanners; attach
86 @code{\startTextSpan} and @code{\stopTextSpan} to the first and last
89 The string to be printed, as well as the style, is set through object
92 @lilypond[quote,raggedright,fragment,relative=1,verbatim]
94 \override TextSpanner #'direction = #-1
95 \override TextSpanner #'edge-text = #'("rall " . "")
96 c2\startTextSpan b c\stopTextSpan a
102 Internals @internalsref{TextSpanEvent},
103 @internalsref{TextSpanner}.
105 Examples: @inputfileref{input/@/regression,text@/-spanner@/.ly}.
109 @subsection Transpose
111 @cindex transposition of pitches
112 @cindex @code{\transpose}
114 A music expression can be transposed with @code{\transpose}. The
117 \transpose @var{from} @var{to} @var{musicexpr}
120 This means that @var{musicexpr} is transposed by the interval between
121 the pitches @var{from} and @var{to}: any note with pitch @code{from}
122 is changed to @code{to}.
125 For example, consider a piece written in the key of D-major. If
126 this piece is a little too low for its performer, it can be
127 transposed up to E-major with
129 \transpose d e @dots{}
132 Consider a part written for violin (a C instrument). If
133 this part is to be played on the A clarinet, the following
134 transposition will produce the appropriate part
137 \transpose a c @dots{}
140 @code{\transpose} distinguishes between enharmonic pitches: both
141 @code{\transpose c cis} or @code{\transpose c des} will transpose up
142 half a tone. The first version will print sharps and the second
143 version will print flats
145 @lilypond[quote,raggedright,verbatim]
146 mus = { \key d \major cis d fis g }
155 @code{\transpose} may also be used to input written notes for a
156 transposing instrument. Pitches are normally entered into LilyPond
157 in C (or ``concert pitch''), but they may be entered in another
158 key. For example, when entering music for a B-flat trumpet which
159 begins on concert D, one would write
162 \transpose c bes @{ e4 @dots{} @}
165 To print this music in B-flat again (ie producing a trumpet part,
166 instead of a concert pitch conductor's score) you would wrap the
167 existing music with another @code{transpose}
170 \transpose bes c @{ \transpose c bes @{ e4 @dots{} @} @}
177 Program reference: @internalsref{TransposedMusic}, and
178 @internalsref{UntransposableMusic}.
182 If you want to use both @code{\transpose} and @code{\relative},
183 you must put @code{\transpose} outside of @code{\relative}, since
184 @code{\relative} will have no effect music that appears inside a
188 @node Ottava brackets
189 @subsection Ottava brackets
191 `Ottava' brackets introduce an extra transposition of an octave for
192 the staff. They are created by invoking the function
193 @code{set-octavation}
199 @lilypond[quote,raggedright,verbatim,fragment]
209 The @code{set-octavation} function also takes -1 (for 8va bassa) and 2
210 (for 15ma) as arguments. Internally the function sets the properties
211 @code{ottavation} (e.g., to @code{"8va"}) and
212 @code{centralCPosition}. For overriding the text of the bracket, set
213 @code{ottavation} after invoking @code{set-octavation}, i.e.,
215 @lilypond[quote,raggedright,verbatim]
218 \set Staff.ottavation = #"8"
225 Program reference: @internalsref{OttavaBracket}.
227 Examples: @inputfileref{input/@/regression,ottava@/.ly},
228 @inputfileref{input/@/regression,ottava@/-broken@/.ly}.
232 @code{set-octavation} will get confused when clef changes happen
233 during an octavation bracket.
236 @node Multi measure rests
237 @subsection Multi measure rests
238 @cindex multi measure rests
239 @cindex Rests, multi measure
243 Multi-measure rests are entered using `@code{R}'. It is specifically
244 meant for full bar rests and for entering parts: the rest can expand
245 to fill a score with rests, or it can be printed as a single
246 multi-measure rest. This expansion is controlled by the property
247 @code{Score.skipBars}. If this is set to true, empty measures will not
248 be expanded, and the appropriate number is added automatically
250 @lilypond[quote,raggedright,fragment,verbatim]
251 \time 4/4 r1 | R1 | R1*2
252 \set Score.skipBars = ##t R1*17 R1*4
255 The @code{1} in @code{R1} is similar to the duration notation used for
256 notes. Hence, for time signatures other than 4/4, you must enter other
257 durations. This can be done with augmentation dots or fractions
259 @lilypond[quote,raggedright,fragment,verbatim]
260 \set Score.skipBars = ##t
269 An @code{R} spanning a single measure is printed as either a whole rest
270 or a breve, centered in the measure regardless of the time signature.
272 If there are only a few measures of rest, LilyPond prints ``church rests''
273 (a series of rectangles) in the staff. To replace that with a simple
274 rest, use @code{MultiMeasureRest.expand-limit}.
276 @lilypond[quote,raggedright,fragment,verbatim]
277 \set Score.skipBars = ##t
279 \override MultiMeasureRest #'expand-limit = 1
284 @cindex text on multi-measure rest
285 @cindex script on multi-measure rest
286 @cindex fermata on multi-measure rest
288 Texts can be added to multi-measure rests by using the
289 @var{note}-@code{markup} syntax (see @ref{Text markup}).
290 A variable (@code{\fermataMarkup}) is provided for
293 @lilypond[quote,raggedright,verbatim,fragment]
294 \set Score.skipBars = ##t
296 R2.*10^\markup { \italic "ad lib." }
300 If you want to have text on the left end of a multi-measure rest,
301 attach the text to a zero-length skip note, i.e.,
309 @cindex whole rests for a full measure
313 Program reference: @internalsref{MultiMeasureRestEvent},
314 @internalsref{MultiMeasureTextEvent},
315 @internalsref{MultiMeasureRestMusicGroup}, and
316 @internalsref{MultiMeasureRest}.
318 The layout object @internalsref{MultiMeasureRestNumber} is for the
319 default number, and @internalsref{MultiMeasureRestText} for user
324 It is not possible to use fingerings (e.g., @code{R1-4}) to put numbers
325 over multi-measure rests. And the pitch of multi-measure rests (or
326 staff-centered rests) can not be influenced.
328 @cindex condensing rests
330 There is no way to automatically condense multiple rests into a single
331 multi-measure rest. Multi-measure rests do not take part in rest
334 Be careful when entering multi-measure rests followed by whole
335 notes. The following will enter two notes lasting four measures each
339 When @code{skipBars} is set, the result will look OK, but the bar
340 numbering will be off.
343 @node Time administration
344 @subsection Time administration
346 Time is administered by the @internalsref{Time_signature_engraver},
347 which usually lives in the @internalsref{Score} context.
348 The bookkeeping deals with the following variables
351 @item currentBarNumber
355 The length of the measures in the current time signature. For a 4/4
356 time this is@tie{}1, and for 6/8 it is 3/4.
358 @item measurePosition
359 The point within the measure where we currently are. This quantity
360 is reset to@tie{}0 whenever it exceeds @code{measureLength}. When that
361 happens, @code{currentBarNumber} is incremented.
364 If set to true, the above variables are updated for every time
365 step. When set to false, the engraver stays in the current measure
369 Timing can be changed by setting any of these variables explicitly.
370 In the next example, the 4/4 time signature is printed, but
371 @code{measureLength} is set to 5/4. After a while, the measure is
372 shortened by 1/8, by setting @code{measurePosition} to 7/8 at 2/4
373 in the measure, so the next bar line will fall at 2/4 + 3/8. The
374 3/8 arises because 5/4 normally has 10/8, but we have manually
375 set the measure position to be 7/8 and 10/8 - 7/8 = 3/8.
377 @lilypond[quote,raggedright,verbatim,relative,fragment]
378 \set Score.measureLength = #(ly:make-moment 5 4)
382 \set Score.measurePosition = #(ly:make-moment 7 8)
389 @node Preparing parts
390 @section Preparing parts
392 This section describes various notation that are useful for preparing
400 * Instrument transpositions::
401 * Different editions from one source::
405 @node Metronome marks
406 @subsection Metronome marks
409 @cindex beats per minute
410 @cindex metronome marking
412 Metronome settings can be entered as follows
414 \tempo @var{duration} = @var{per-minute}
417 In the MIDI output, they are interpreted as a tempo change. In the
418 layout output, a metronome marking is printed
419 @cindex @code{\tempo}
420 @lilypond[quote,raggedright,verbatim,fragment]
424 To change the tempo in the MIDI output without printing anything, make
425 the metronome marking invisible
427 \once \override Score.MetronomeMark #'transparent = ##t
430 To print other metronome markings, use these markup commands
431 @lilypond[quote,raggedright,verbatim,relative,fragment]
434 \smaller \general-align #Y #DOWN \note #"16." #1
436 \smaller \general-align #Y #DOWN \note #"8" #1"
441 See @ref{Text markup} for more details.
446 Program reference: @internalsref{MetronomeChangeEvent}.
450 Collisions are not checked. If you have notes above the top line of
451 the staff (or notes with articulations, slurs, text, etc), then the
452 metronome marking may be printed on top of musical symbols. If this
453 occurs, increase the padding of the metronome mark to place it
454 further away from the staff.
457 \override Score.MetronomeMark #'padding = #2.5
461 @node Rehearsal marks
462 @subsection Rehearsal marks
463 @cindex Rehearsal marks
467 To print a rehearsal mark, use the @code{\mark} command
469 @lilypond[quote,raggedright,fragment,verbatim,relative=2]
478 (The letter@tie{}`I' is skipped in accordance with engraving traditions.)
479 @c umm, is the manual the right place for feature requests? :) -gp
480 @c FIXME - should make that tunable.
482 The mark is incremented automatically if you use @code{\mark
483 \default}, but you can also use an integer argument to set the mark
484 manually. The value to use is stored in the property
485 @code{rehearsalMark}.
487 The style is defined by the property @code{markFormatter}. It is a
488 function taking the current mark (an integer) and the current context
489 as argument. It should return a markup object. In the following
490 example, @code{markFormatter} is set to a canned procedure. After a
491 few measures, it is set to function that produces a boxed number.
493 @lilypond[fragment,quote,raggedright,verbatim,relative=2]
494 \set Score.markFormatter = #format-mark-numbers
497 \set Score.markFormatter = #format-mark-box-numbers
503 The file @file{scm/@/translation@/-functions@/.scm} contains the definitions
504 of @code{format-mark-numbers} (the default format), @code{format-mark-box-numbers},
505 @code{format-mark-letters} and @code{format-mark-box-letters}.
506 These can be used as inspiration for other formatting functions.
509 @cindex coda on bar line
510 @cindex segno on bar line
511 @cindex fermata on bar line
512 @cindex bar lines, symbols on
514 The @code{\mark} command can also be used to put signs like coda,
515 segno, and fermata on a bar line. Use @code{\markup} to
516 access the appropriate symbol
518 @lilypond[fragment,quote,raggedright,verbatim,relative=2]
519 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
523 If the mark occurs at a line break, the mark will be printed at the
524 beginning of the next line.
525 @c IMO this is a bug; hopefully it'll be fixed soon, so I can
526 @c delete this sentence. -gp
527 If there is no next line, then the mark will not be printed at all.
528 To print the mark at the end of the current line, use
531 \override Score.RehearsalMark
532 #'break-visibility = #begin-of-line-invisible
538 @cindex bar lines, putting symbols on
542 Program reference: @internalsref{MarkEvent}, @internalsref{RehearsalMark}.
544 Init files: @file{scm/@/translation@/-functions@/.scm} contains the
545 definition of @code{format-mark-numbers} and
546 @code{format-mark-letters}. They can be used as inspiration for other
547 formatting functions.
549 Examples: @inputfileref{input/@/regression,rehearsal@/-mark@/-letter@/.ly},
551 @inputfileref{input/@/regression,rehearsal@/-mark@/-number@/.ly}.
555 @subsection Bar numbers
559 @cindex measure numbers
560 @cindex @code{currentBarNumber}
562 Bar numbers are printed by default at the start of the line. The
563 number itself is stored in the @code{currentBarNumber} property, which
564 is normally updated automatically for every measure.
566 Bar numbers can be typeset at regular intervals instead of at the
567 beginning of each line. This is illustrated in the following example,
568 whose source is available as
569 @inputfileref{input/@/test,bar@/-number@/-regular@/-interval@/.ly}
571 @lilypondfile[raggedright,quote]{bar-number-regular-interval.ly}
573 Bar numbers can be typeset manually by tweaking the
574 @code{markFormatter} property
576 @lilypond[verbatim,raggedright,quote]
578 \set Score.markFormatter
579 = #(lambda (mark context)
582 (number->string (ly:context-property context
583 'currentBarNumber)))))
585 c1 \bar "||" \mark \default c1 c1 \mark \default c1 \bar "|."
589 Bar numbers can be manually changed by setting the
590 @code{Staff.currentBarNumber} property
592 @lilypond[verbatim,raggedright,quote]
594 \repeat unfold 4 {c4 c c c} \break
595 \set Score.currentBarNumber = #50
596 \repeat unfold 4 {c4 c c c}
602 Program reference: @internalsref{BarNumber}.
605 @inputfileref{input/@/test,bar@/-number@/-every@/-five@/-reset@/.ly},
606 and @inputfileref{input/@/test,bar@/-number@/-regular@/-interval@/.ly}.
610 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
611 there is one at the top. To solve this, the
612 @code{padding} property of @internalsref{BarNumber} can be
613 used to position the number correctly.
616 @node Instrument names
617 @subsection Instrument names
619 In an orchestral score, instrument names are printed at the left side
622 This can be achieved by setting @internalsref{Staff}.@code{instrument}
623 and @internalsref{Staff}.@code{instr}. This will print a string before
624 the start of the staff. For the first staff, @code{instrument} is
625 used, for the following ones, @code{instr} is used.
627 @lilypond[quote,verbatim,raggedright,relative=1,fragment]
628 \set Staff.instrument = "Ploink "
629 \set Staff.instr = "Plk "
635 You can also use markup texts to construct more complicated instrument
638 @lilypond[quote,fragment,verbatim,raggedright]
639 \set Staff.instrument = \markup {
640 \column { "Clarinetti"
641 \line { "in B" \smaller \flat } } }
645 For longer instrument names, it may be useful to increase the
646 @code{indent} setting in the @code{\layout} block.
650 Program reference: @internalsref{InstrumentName}.
654 When you put a name on a grand staff or piano staff, the width of the
655 brace is not taken into account. You must add extra spaces to the end of
656 the name to avoid a collision.
659 @node Instrument transpositions
660 @subsection Instrument transpositions
661 @cindex transposition, MIDI
662 @cindex transposition, instrument
664 The key of a transposing instrument can also be specified. This
665 applies to many wind instruments, for example, clarinets (B-flat, A, and
666 E-flat), horn (F) and trumpet (B-flat, C, D, and E-flat).
668 The transposition is entered after the keyword @code{\transposition}
671 \transposition bes %% B-flat clarinet
675 This command sets the property @code{instrumentTransposition}. The value of
676 this property is used for MIDI output and quotations. It does not
677 affect how notes are printed in the current staff. To change the printed
678 output, see @ref{Transpose}.
680 The pitch to use for @code{\transposition} should correspond to the
681 transposition of the notes. For example, when entering a score in
682 concert pitch, typically all voices are entered in C, so
683 they should be entered as
696 The command @code{\transposition} should be used when the music is
697 entered from a (transposed) orchestral part. For example, in
698 classical horn parts, the tuning of the instrument is often changed
699 during a piece. When copying the notes from the part, use
700 @code{\transposition}, e.g.,
712 @node Different editions from one source
713 @subsection Different editions from one source
716 The @code{\tag} command marks music expressions with a name. These
717 tagged expressions can be filtered out later. With this mechanism it
718 is possible to make different versions of the same music source.
720 In the following example, we see two versions of a piece of music, one
721 for the full score, and one with cue notes for the instrumental part
737 The same can be applied to articulations, texts, etc.: they are
740 -\tag #@var{your-tag}
742 to an articulation, for example,
747 This defines a note with a conditional fingering indication.
750 @cindex removeWithTag
751 By applying the @code{\keepWithTag} and @code{\removeWithTag}
752 commands, tagged expressions can be filtered. For example,
756 \keepWithTag #'score @var{the music}
757 \keepWithTag #'part @var{the music}
762 @lilypondfile[raggedright,quote]{tag-filter.ly}
765 The argument of the @code{\tag} command should be a symbol, or a list
766 of symbols, for example,
768 \tag #'(original-part transposed-part) @dots{}
775 Examples: @inputfileref{input/@/regression,tag@/-filter@/.ly}.
779 Multiple rests are not merged if you create the score with both tagged
783 @node Orchestral music
784 @section Orchestral music
786 Orchestral music involves some special notation, both in the full
787 score and the individual parts. This section explains how to tackle
788 some common problems in orchestral music.
791 * Automatic part combining::
793 * Quoting other voices::
794 * Formatting cue notes::
795 * Aligning to cadenzas::
799 @node Automatic part combining
800 @subsection Automatic part combining
801 @cindex automatic part combining
802 @cindex part combiner
804 Automatic part combining is used to merge two parts of music onto a
805 staff. It is aimed at typesetting orchestral scores. When the two
806 parts are identical for a period of time, only one is shown. In
807 places where the two parts differ, they are typeset as separate
808 voices, and stem directions are set automatically. Also, solo and
809 @emph{a due} parts are identified and can be marked.
811 The syntax for part combining is
814 \partcombine @var{musicexpr1} @var{musicexpr2}
818 The following example demonstrates the basic functionality of the part
819 combiner: putting parts on one staff, and setting stem directions and
822 @lilypond[quote,verbatim,raggedright,fragment]
823 \new Staff \partcombine
824 \relative g' { g g a( b) c c r r }
825 \relative g' { g g r4 r e e g g }
828 The first @code{g} appears only once, although it was
829 specified twice (once in each part). Stem, slur, and tie directions are
830 set automatically, depending whether there is a solo or unisono. The
831 first part (with context called @code{one}) always gets up stems, and
832 `Solo', while the second (called @code{two}) always gets down stems and
835 If you just want the merging parts, and not the textual markings, you
836 may set the property @code{printPartCombineTexts} to false
838 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
840 \set Staff.printPartCombineTexts = ##f
842 \relative g' { g a( b) r }
843 \relative g' { g r4 r f }
847 To change the text that is printed for solos or merging, you may
848 set the @code{soloText}, @code{soloIIText}, and @code{aDueText}
851 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
853 \set Score.soloText = #"ichi"
854 \set Score.soloIIText = #"ni"
855 \set Score.aDueText = #"tachi"
857 \relative g' { g4 g a( b) r }
858 \relative g' { g4 g r r f }
862 Both arguments to @code{\partcombine} will be interpreted as
863 @internalsref{Voice} contexts. If using relative octaves,
864 @code{\relative} should be specified for both music expressions, i.e.,
868 \relative @dots{} @var{musicexpr1}
869 \relative @dots{} @var{musicexpr2}
873 A @code{\relative} section that is outside of @code{\partcombine} has
874 no effect on the pitches of @var{musicexpr1} and @var{musicexpr2}.
878 Program reference: @internalsref{PartCombineMusic},
879 @internalsref{SoloOneEvent}, and
880 @internalsref{SoloTwoEvent}, and
881 @internalsref{UnisonoEvent}.
885 When @code{printPartCombineTexts} is set, when the two voices play the
886 same notes on and off, the part combiner may typeset @code{a2} more
887 than once in a measure.
889 @code{\partcombine} cannot be inside @code{\times}.
891 @code{\partcombine} cannot be inside @code{\relative}.
893 Internally, the @code{\partcombine} interprets both arguments as
894 @code{Voice}s named @code{one} and @code{two}, and then decides when
895 the parts can be combined. Consequently, if the arguments switch to
896 differently named @internalsref{Voice} contexts, the events in those
901 @subsection Hiding staves
903 @cindex Frenched scores
904 @cindex Hiding staves
906 In orchestral scores, staff lines that only have rests are usually
907 removed; this saves some space. This style is called `French Score'.
908 For @internalsref{Lyrics},
909 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
910 switched on by default. When the lines of these contexts turn out
911 empty after the line-breaking process, they are removed.
913 For normal staves, a specialized @internalsref{Staff} context is
914 available, which does the same: staves containing nothing (or only
915 multi-measure rests) are removed. The context definition is stored in
916 @code{\RemoveEmptyStaffContext} variable. Observe how the second staff
917 in this example disappears in the second line
919 @lilypond[quote,raggedright,verbatim]
921 \context { \RemoveEmptyStaffContext }
926 \new Staff { e4 f g a \break c1 }
927 \new Staff { c4 d e f \break R1 }
932 The first system shows all staves in full. If empty staves should be
933 removed from the first system too, set @code{remove-first} to false in
934 @internalsref{RemoveEmptyVerticalGroup}.
936 To remove other types of contexts, use @code{\AncientRemoveEmptyStaffContext}
937 or @code{\RemoveEmptyRhythmicStaffContext}.
939 Another application is making ossia sections, i.e., alternative
940 melodies on a separate piece of staff, with help of a Frenched
941 staff. See @inputfileref{input/@/test,ossia@/.ly} for an example.
944 @node Quoting other voices
945 @subsection Quoting other voices
947 With quotations, fragments of other parts can be inserted into a part
948 directly. Before a part can be quoted, it must be marked especially as
949 quotable. This is done with the @code{\addquote} command.
952 \addquote @var{name} @var{music}
957 Here, @var{name} is an identifying string. The @var{music} is any kind
958 of music. Here is an example of @code{\addquote}
961 \addquote clarinet \relative c' @{
966 This command must be entered at toplevel, i.e., outside any music
969 After calling @code{\addquote}, the quotation may then be done with
970 @code{\quoteDuring} or @code{\cueDuring},
973 \quoteDuring #@var{name} @var{music}
976 During a part, a piece of music can be quoted with the @code{\quoteDuring}
980 \quoteDuring #"clarinet" @{ s2. @}
983 This would cite three quarter notes (the duration of @code{s2.}) of
984 the previously added @code{clarinet} voice.
987 More precisely, it takes the current time-step of the part being
988 printed, and extracts the notes at the corresponding point of the
989 @code{\addquote}d voice. Therefore, the argument to @code{\addquote}
990 should be the entire part of the voice to be quoted, including any
991 rests at the beginning.
993 Quotations take into account the transposition of both source and target
994 instruments, if they are specified using the @code{\transposition} command.
996 @lilypond[quote,raggedright,verbatim]
997 \addquote clarinet \relative c' {
1003 e'8 f'8 \quoteDuring #"clarinet" { s2 }
1007 The type of events that are present in cue notes can be trimmed with
1008 the @code{quotedEventTypes} property. The default value is
1009 @code{(note-event rest-event)}, which means that only notes and
1010 rests of the cued voice end up in the @code{\quoteDuring}.
1014 \set Staff.quotedEventTypes =
1015 #'(note-event articulation-event dynamic-event)
1019 will quote notes (but no rests), together with scripts and dynamics.
1023 Only the contents of the first @internalsref{Voice} occurring in an
1024 @code{\addquote} command will be considered for quotation, so
1025 @var{music} can not contain @code{\new} and @code{\context Voice}
1026 statements that would switch to a different Voice.
1028 Quoting grace notes is broken and can even cause LilyPond to crash.
1032 In this manual: @ref{Instrument transpositions}.
1034 Examples: @inputfileref{input/@/regression,quote@/.ly}
1035 @inputfileref{input/@/regression,quote@/-transposition@/.ly}
1037 Program reference: @internalsref{QuoteMusic}.
1040 @node Formatting cue notes
1041 @subsection Formatting cue notes
1043 The previous section deals with inserting notes from another voice.
1044 There is a more advanced music function called @code{\cueDuring},
1045 which makes formatting cue notes easier.
1050 \cueDuring #@var{name} #@var{updown} @var{music}
1053 This will insert notes from the part @var{name} into a
1054 @internalsref{Voice} called @code{cue}. This happens simultaneously
1055 with @var{music}, which usually is a rest. When the cue notes start,
1056 the staff in effect becomes polyphonic for a moment. The argument
1057 @var{updown} determines whether the cue notes should be notated as a
1058 first or second voice.
1061 @lilypond[verbatim,raggedright]
1064 \override Stem #'length = #5.5
1065 \override Beam #'thickness = #0.384
1066 \override Beam #'space-function =
1067 #(lambda (beam mult) (* 0.8 (Beam::space_function beam mult)))
1070 \addquote clarinet \relative {
1075 \new Staff \relative <<
1077 % setup a context for cue notes.
1078 \context Voice = cue { \smaller \skip 1*21 }
1080 \set Score.skipBars = ##t
1084 \cueDuring #"clarinet" #1 {
1093 Here are a couple of hints for successful cue notes
1097 Cue notes have smaller font sizes.
1099 the cued part is marked with the instrument playing the cue.
1101 when the original part takes over again, this should be marked with
1102 the name of the original instrument.
1104 @c really? Are you sure about that last point? I'll check after 3.0 -gp
1106 @c Yes, this is good practice. Otherwise, the start of the original
1107 @c part can only be seen from the font size. This is not good enough
1108 @c for sight-reading. It is possilbe to use other
1109 @c markers (eg. a big close-bracket over the staff) to indicate the cue notes are
1114 any other changes introduced by the cued part should also be
1115 undone. For example, if the cued instrument plays in a different clef,
1116 the original clef should be stated once again.
1121 @node Aligning to cadenzas
1122 @subsection Aligning to cadenzas
1124 In an orchestral context, cadenzas present a special problem:
1125 when constructing a score that includes a cadenza, all other
1126 instruments should skip just as many notes as the length of the
1127 cadenza, otherwise they will start too soon or too late.
1129 A solution to this problem are the functions @code{mmrest-of-length}
1130 and @code{skip-of-length}. These Scheme functions take a piece of music
1131 as argument, and generate a @code{\skip} or multi-rest, exactly as
1132 long as the piece. The use of @code{mmrest-of-length} is demonstrated
1133 in the following example.
1135 @lilypond[verbatim,raggedright,quote]
1136 cadenza = \relative c' {
1137 c4 d8 << { e f g } \\ { d4. } >>
1142 \new Staff { \cadenza c'4 }
1144 #(ly:export (mmrest-of-length cadenza))
1153 @node Contemporary notation
1154 @section Contemporary notation
1156 In the 20th century, composers have greatly expanded the musical
1157 vocabulary. With this expansion, many innovations in musical notation
1158 have been tried. The book ``Music Notation in the 20th century'' by
1159 Kurt Stone gives a comprehensive overview (see @ref{Literature
1160 list}). In general, the use of new, innovative notation makes a piece
1161 harder to understand and perform and its use should therefore be
1162 avoided. For this reason, support for contemporary notation in
1163 LilyPond is limited.
1167 * Polymetric notation::
1169 * Special fermatas::
1174 @node Polymetric notation
1175 @subsection Polymetric notation
1177 Double time signatures are not supported explicitly, but they can be
1178 faked. In the next example, the markup for the time signature is
1179 created with a markup text. This markup text is inserted in the
1180 @internalsref{TimeSignature} grob.
1182 @lilypond[verbatim,raggedright]
1187 \musicglyph #"scripts.stopped"
1188 \bracket \column { "5" "8" }
1193 \override Staff.TimeSignature #'print-function = #Text_interface::print
1194 \override Staff.TimeSignature #'text = #tsMarkup
1196 c'2 \bar ":" c'4 c'4.
1200 Each staff can also have its own time signature. This is done by
1201 moving the @internalsref{Timing_engraver} to the @internalsref{Staff}
1206 \context @{ \Score \remove "Timing_engraver" @}
1207 \context @{ \Staff \consists "Timing_engraver" @}
1212 Now, each staff has its own time signature.
1225 c4. c8 c c c4. c8 c c
1230 @lilypond[quote,raggedright]
1232 \context{ \Score \remove "Timing_engraver" }
1233 \context{ \Staff \consists "Timing_engraver" }
1247 c4. c8 c c c4. c8 c c
1253 A different form of polymetric notation is where note lengths have
1254 different values across staves.
1256 This notation can be created by setting a common time signature for
1257 each staff but replacing it manually using
1258 @code{timeSignatureFraction} to the desired fraction. Then the printed
1259 durations in each staff are scaled to the common time signature.
1260 The latter is done with @code{\compressmusic}, which is similar to
1261 @code{\times}, but does not create a tuplet bracket.
1264 In this example, music with the time signatures of 3/4, 9/8, and 10/8 are
1265 used in parallel. In the second staff, shown durations are multiplied by
1266 2/3, so that 2/3 * 9/8 = 3/4, and in the third staff, shown durations are
1267 multiplied by 3/5, so that 3/5 * 10/8 = 3/4.
1269 @lilypond[quote,raggedright,verbatim,fragment]
1277 \set Staff.timeSignatureFraction = #'(9 . 8)
1278 \compressmusic #'(2 . 3)
1279 \repeat unfold 6 { c8[ c c] }
1283 \set Staff.timeSignatureFraction = #'(10 . 8)
1284 \compressmusic #'(3 . 5) {
1285 \repeat unfold 2 { c8[ c c] }
1286 \repeat unfold 2 { c8[ c] }
1287 | c4. c4. \times 2/3 { c8 c c } c4
1298 When using different time signatures in parallel, the spacing is
1299 aligned vertically, but bar lines distort the regular spacing.
1304 @subsection Clusters
1308 A cluster indicates a continuous range of pitches to be played. They
1309 can be denoted as the envelope of a set of notes. They are entered by
1310 applying the function @code{makeClusters} to a sequence of
1312 @lilypond[quote,raggedright,relative=2,fragment,verbatim]
1313 \makeClusters { <c e > <b f'> }
1316 The following example (from
1317 @inputfileref{input/@/regression,cluster@/.ly}) shows what the result
1320 @lilypondfile[raggedright,quote]{cluster.ly}
1322 Ordinary notes and clusters can be put together in the same staff,
1323 even simultaneously. In such a case no attempt is made to
1324 automatically avoid collisions between ordinary notes and clusters.
1328 Program reference: @internalsref{ClusterSpanner},
1329 @internalsref{ClusterSpannerBeacon},
1330 @internalsref{Cluster_spanner_engraver}, and
1331 @internalsref{ClusterNoteEvent}.
1333 Examples: @inputfileref{input/@/regression,cluster@/.ly}.
1337 Music expressions like @code{<< @{ g8 e8 @} a4 >>} are not printed
1338 accurately. Use @code{<g a>8 <e a>8} instead.
1342 @node Special fermatas
1343 @subsection Special fermatas
1345 @cindex fermatas, special
1347 In contemporary music notation, special fermata symbols denote breaks
1348 of differing lengths. The following fermatas are supported
1350 @lilypond[quote,raggedright]
1373 \context Lyrics \lyricmode {
1374 \override LyricText #'font-family = #'typewriter
1375 "shortfermata" "fermata" "longfermata" "verylongfermata"
1380 See @ref{Articulations} for general instructions how to apply scripts
1381 such as fermatas to notes.
1383 @node Feathered beams
1384 @subsection Feathered beams
1386 Feathered beams are not supported natively, but they can be faked by
1387 forcing two beams to overlap. Here is an example,
1389 @c don't change relative setting witout changing positions!
1390 @lilypond[raggedright,relative=1,fragment,verbatim]
1395 \once \override Voice.Beam #'positions = #'(0 . 0.5)
1400 \once \override Voice.Beam #'positions = #'(0 . -0.5)
1408 @subsection Improvisation
1410 Improvisation is sometimes denoted with slashed note heads. Such note
1411 heads can be created by adding a @internalsref{Pitch_squash_engraver}
1412 to the @internalsref{Staff} or @internalsref{Voice} context. Then, the
1416 \set squashedPosition = #0
1417 \override NoteHead #'style = #'slash
1421 switches on the slashes.
1423 There are shortcuts @code{\improvisationOn} (and an accompanying
1424 @code{\improvisationOff}) for this command sequence. They are used in
1425 the following example
1427 @lilypond[verbatim,raggedright,quote]
1429 \consists Pitch_squash_engraver
1431 e8 e g a a16(bes)(a8) g \improvisationOn
1434 ~fis2 \improvisationOff a16(bes) a8 g e
1439 @node Educational use
1440 @section Educational use
1442 With the amount of control that LilyPond offers, one can make great
1443 teaching tools in addition to great musical scores.
1447 * Blank music sheet::
1449 * Shaped note heads ::
1450 * Easy Notation note heads::
1451 * Analysis brackets::
1455 @subsection Balloon help
1457 Elements of notation can be marked and named with the help of a square
1458 balloon. The primary purpose of this feature is to explain notation.
1460 The following example demonstrates its use.
1462 @lilypond[quote,verbatim,fragment,raggedright,relative=2]
1465 #(add-balloon-text 'NoteHead "heads, or tails?"
1472 The function @code{add-balloon-text} takes the name of a grob, the
1473 label to print, and the position where to put the label relative to
1474 the object. In the above example, the text ``heads or tails?'' ends
1475 3 spaces below and 1 space to the right of the marked head.
1478 @cindex notation, explaining
1482 Program reference: @internalsref{text-balloon-interface}.
1484 Examples: @inputfileref{input/@/regression,balloon@/.ly}.
1489 @node Blank music sheet
1490 @subsection Blank music sheet
1492 A blank music sheet can be produced also by using invisible notes, and
1493 removing @code{Bar_number_engraver}.
1496 @lilypond[quote,verbatim]
1498 \repeat unfold 2 % Change this for more lines.
1503 \override TimeSignature #'transparent = ##t
1504 defaultBarType = #""
1505 \remove Bar_number_engraver
1507 \context Staff \emptymusic
1508 \context TabStaff \emptymusic
1514 @subsection Hidden notes
1516 @cindex Hidden notes
1517 @cindex Invisible notes
1518 @cindex Transparent notes
1520 @cindex @code{\hideNotes}
1521 @cindex @code{\unHideNotes}
1522 Hidden (or invisible or transparent) notes can be useful in preparing theory
1523 or composition exercises.
1525 @lilypond[quote,raggedright,verbatim,relative=2,fragment]
1533 Hidden notes are also great for performing weird tricks. For example,
1534 slurs cannot be attached to rests or spacer rests, but you may wish
1535 to include that in your score -- string instruments use this notation
1536 when doing pizzicato to indicate that the note should ring for as long
1539 @lilypond[quote,raggedright,verbatim,relative=0,fragment]
1542 c4^"pizz"( \hideNotes c)
1543 \unHideNotes c( \hideNotes c)
1550 @node Shaped note heads
1551 @subsection Shaped note heads
1553 In shaped note head notation, the shape of the note head corresponds
1554 to the harmonic function of a note in the scale. This notation was
1555 popular in the 19th century American song books.
1557 Shaped note heads can be produced by setting @code{\aikenHeads} or
1558 @code{\sacredHarpHeads}, depending on the style desired.
1560 @lilypond[verbatim,relative=1,fragment]
1567 Shapes are determined on the step in the scale, where the base of the
1568 scale is determined by the @code{\key} command
1571 @findex shapeNoteStyles
1573 @findex \sacredHarpHeads
1575 Shaped note heads are implemented through the @code{shapeNoteStyles}
1576 property. Its value is a vector of symbols. The k-th element indicates
1577 the style to use for the k-th step of the scale. Arbitrary
1578 combinations are possible, eg.,
1581 @lilypond[verbatim,relative=1,fragment]
1582 \set shapeNoteStyles = ##(cross triangle fa #f mensural xcircle diamond)
1587 @node Easy Notation note heads
1588 @subsection Easy Notation note heads
1590 @cindex easy notation
1593 The `easy play' note head includes a note name inside the head. It is
1594 used in music for beginners
1596 @lilypond[quote,raggedright,verbatim,fragment,staffsize=26]
1601 The command @code{\setEasyHeads} overrides settings for the
1602 @internalsref{NoteHead} object. To make the letters readable, it has
1603 to be printed in a large font size. To print with a larger font, see
1604 @ref{Setting global staff size}.
1608 @cindex @code{\setEasyHeads}
1609 @code{\setEasyHeads}
1612 @node Analysis brackets
1613 @subsection Analysis brackets
1615 @cindex phrasing brackets
1616 @cindex musicological analysis
1617 @cindex note grouping bracket
1619 Brackets are used in musical analysis to indicate structure in musical
1620 pieces. LilyPond supports a simple form of nested horizontal
1621 brackets. To use this, add the @internalsref{Horizontal_bracket_engraver}
1622 to @internalsref{Staff} context. A bracket is started with
1623 @code{\startGroup} and closed with @code{\stopGroup}
1625 @lilypond[quote,raggedright,verbatim]
1628 c4\startGroup\startGroup
1631 c4\stopGroup\stopGroup
1635 \Staff \consists "Horizontal_bracket_engraver"
1641 Program reference: @internalsref{HorizontalBracket},
1642 @internalsref{NoteGroupingEvent}.
1644 Examples: @inputfileref{input/@/regression,note@/-group@/-bracket@/.ly}.
1650 I don't think we need this info.
1655 Whenever a note is found, a @internalsref{Stem} object is created
1656 automatically. For whole notes and rests, they are also created but
1661 @cindex @code{\stemUp}
1663 @cindex @code{\stemDown}
1665 @cindex @code{\stemNeutral}
1666 @code{\stemNeutral}.
1675 FIXME: We don't need this section. It will be moved into LSR as soon
1676 as the safe mode stuff is worked out.
1678 @n ode Controlling formatting of prefatory matter
1679 @s ubsection Controlling formatting of prefatory matter
1681 @c This section will be moved to somewhere else soon. -gp
1682 This example demonstrates how to place prefatory matter
1683 (such as the clef and key signature) at the end of a line.
1685 @lilypond[quote,verbatim]
1687 \override Staff.Clef
1688 #'break-visibility = #end-of-line-visible
1689 \override Staff.KeySignature
1690 #'break-visibility = #end-of-line-visible
1691 \set Staff.explicitClefVisibility = #end-of-line-visible
1692 \set Staff.explicitKeySignatureVisibility = #end-of-line-visible
1694 % We want the time sig to take space, otherwise there is not
1695 % enough white at the start of the line.
1697 \override Staff.TimeSignature #'transparent = ##t
1698 \set Score.defaultBarType = #"empty"
1717 @node Coloring objects
1718 @section Coloring objects
1720 @c FIXME: need link to missing list of colors
1721 Individual objects may be assigned colors. You may use color names
1722 listed HERE or the x11 color names listed THERE.
1724 @lilypond[quote,raggedright,verbatim,fragment]
1725 \override NoteHead #'color = #red
1727 \override NoteHead #'color = #(x11-color 'LimeGreen)
1729 \override Stem #'color = #blue
1738 @node Automatic notation
1739 @section Automatic notation
1741 This section describes how to change the way that accidentals and
1742 beams are automatically displayed.
1744 FIXME: this might get moved into Changing Defaults. Please send
1745 opinions to lilypond-devel. Thanks! :)
1748 * Automatic accidentals::
1749 * Setting automatic beam behavior::
1753 @node Automatic accidentals
1754 @subsection Automatic accidentals
1755 @cindex Automatic accidentals
1757 Common rules for typesetting accidentals have been placed in a
1758 function. This function is called as follows
1760 @cindex @code{set-accidental-style}
1762 #(set-accidental-style 'STYLE #('CONTEXT#))
1765 The function can take two arguments: the name of the accidental style,
1766 and an optional argument that denotes the context that should be
1767 changed. If no context name is supplied, @code{Staff} is the default,
1768 but you may wish to apply the accidental style to a single @code{Voice}
1771 The following accidental styles are supported
1774 This is the default typesetting behavior. It corresponds
1775 to 18th century common practice: Accidentals are
1776 remembered to the end of the measure in which they occur and
1777 only on their own octave.
1780 The normal behavior is to remember the accidentals on
1781 Staff-level. This variable, however, typesets accidentals
1782 individually for each voice. Apart from that, the rule is similar to
1785 As a result, accidentals from one voice do not get canceled in other
1786 voices, which is often an unwanted result
1788 @lilypond[quote,raggedright,relative=1,fragment,verbatim]
1790 #(set-accidental-style 'voice)
1797 The @code{voice} option should be used if the voices
1798 are to be read solely by individual musicians. If the staff is to be
1799 used by one musician (e.g., a conductor) then
1800 @code{modern} or @code{modern-cautionary}
1801 should be used instead.
1804 @cindex @code{modern} style accidentals
1805 This rule corresponds to the common practice in the 20th century. This rule
1806 prints the same accidentals as @code{default}, but temporary
1807 accidentals also are canceled in other octaves. Furthermore,
1808 in the same octave, they also get canceled in the following
1811 @lilypond[quote,raggedright,fragment,verbatim]
1812 #(set-accidental-style 'modern)
1813 cis' c'' cis'2 | c'' c'
1816 @item @code{modern-cautionary}
1817 @cindex @code{modern-cautionary}
1818 This rule is similar to @code{modern}, but the ``extra'' accidentals
1819 (the ones not typeset by @code{default}) are typeset as cautionary
1820 accidentals. They are printed in reduced size or with parentheses
1821 @lilypond[quote,raggedright,fragment,verbatim]
1822 #(set-accidental-style 'modern-cautionary)
1823 cis' c'' cis'2 | c'' c'
1826 @cindex @code{modern-voice}
1828 This rule is used for multivoice accidentals to be read both by musicians
1829 playing one voice and musicians playing all voices. Accidentals are
1830 typeset for each voice, but they @emph{are} canceled across voices in
1831 the same @internalsref{Staff}.
1833 @cindex @code{modern-voice-cautionary}
1834 @item modern-voice-cautionary
1835 This rule is the same as @code{modern-voice}, but with the extra
1836 accidentals (the ones not typeset by @code{voice}) typeset
1837 as cautionaries. Even though all accidentals typeset by
1838 @code{default} @emph{are} typeset by this variable,
1839 some of them are typeset as cautionaries.
1842 @cindex @code{piano} accidentals
1843 This rule reflects 20th century practice for piano notation. Very similar to
1844 @code{modern} but accidentals also get canceled
1845 across the staves in the same @internalsref{GrandStaff} or
1846 @internalsref{PianoStaff}.
1848 @item piano-cautionary
1849 @cindex @code{#(set-accidental-style 'piano-cautionary)}
1850 Same as @code{#(set-accidental-style 'piano)} but with the extra
1851 accidentals typeset as cautionaries.
1854 @cindex @code{no-reset} accidental style
1855 This is the same as @code{default} but with accidentals lasting
1856 ``forever'' and not only until the next measure
1857 @lilypond[quote,raggedright,fragment,verbatim,relative=1]
1858 #(set-accidental-style 'no-reset)
1863 This is sort of the opposite of @code{no-reset}: Accidentals
1864 are not remembered at all---and hence all accidentals are
1865 typeset relative to the key signature, regardless of what was
1868 @lilypond[quote,raggedright,fragment,verbatim,relative=1]
1869 #(set-accidental-style 'forget)
1870 \key d\major c4 c cis cis d d dis dis
1877 Program reference: @internalsref{Accidental_engraver},
1878 @internalsref{Accidental}, and @internalsref{AccidentalPlacement}.
1883 Simultaneous notes are considered to be entered in sequential
1884 mode. This means that in a chord the accidentals are typeset as if the
1885 notes in the chord happened once at a time - in the order in which
1886 they appear in the input file.
1888 This is a problem when accidentals in a chord depend on each other,
1889 which does not happen for the default accidental style. The problem
1890 can be solved by manually inserting @code{!} and @code{?} for the
1894 @node Setting automatic beam behavior
1895 @subsection Setting automatic beam behavior
1897 @cindex @code{autoBeamSettings}
1898 @cindex @code{(end * * * *)}
1899 @cindex @code{(begin * * * *)}
1900 @cindex automatic beams, tuning
1901 @cindex tuning automatic beaming
1903 @c [TODO: use \applycontext]
1905 In normal time signatures, automatic beams can start on any note but can
1906 only end in a few positions within the measure: beams can end on a beat,
1907 or at durations specified by the properties in
1908 @code{autoBeamSettings}. The defaults for @code{autoBeamSettings}
1909 are defined in @file{scm/@/auto@/-beam@/.scm}.
1911 The value of @code{autoBeamSettings} is changed with three functions,
1913 #(override-auto-beam-setting
1914 '(@var{be} @var{p} @var{q} @var{n} @var{m}) @var{a} @var{b}
1916 #(score-override-auto-beam-setting
1917 '(@var{be} @var{p} @var{q} @var{n} @var{m}) @var{a} @var{b})
1918 #(revert-auto-beam-setting '(@var{be} @var{p} @var{q} @var{n} @var{m})
1921 Here, @var{be} is the symbol @code{begin} or @code{end}, and
1922 @var{context} is an optional context (default: @code{'Voice}). It
1923 determines whether the rule applies to begin or end-points. The
1924 quantity @var{p}/@var{q} refers to the length of the beamed notes (and
1925 `@code{* *}' designates notes of any length), @var{n}/@var{M} refers
1926 to a time signature (wildcards `@code{* *}' may be entered to
1927 designate all time signatures), @var{a}/@var{b} is a duration. By
1928 default, this command changes settings for the current voice. It is
1929 also possible to adjust settings at higher contexts, by adding a
1930 @var{context} argument. @code{score-override-auto-beam-setting} is
1931 equal to @code{override-auto-beam-setting} with the argument
1932 @var{context} set to @code{'Score}.
1934 For example, if automatic beams should end on the first quarter note, use
1937 #(override-auto-beam-setting '(end * * * *) 1 4 'Staff)
1939 Since the duration of a quarter note is 1/4 of a whole note, it is
1940 entered as @code{(ly:make-moment 1 4)}.
1942 If automatic beams should end on every quarter in 5/4 time, specify
1945 #(override-auto-beam-setting '(end * * * *) 1 4 'Staff)
1946 #(override-auto-beam-setting '(end * * * *) 1 2 'Staff)
1947 #(override-auto-beam-setting '(end * * * *) 3 4 'Staff)
1948 #(override-auto-beam-setting '(end * * * *) 5 4 'Staff)
1952 The same syntax can be used to specify beam starting points. In this
1953 example, automatic beams can only end on a dotted quarter note
1955 #(override-auto-beam-setting '(end * * * *) 3 8)
1956 #(override-auto-beam-setting '(end * * * *) 1 2)
1957 #(override-auto-beam-setting '(end * * * *) 7 8)
1959 In 4/4 time signature, this means that automatic beams could end only on
1960 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
1961 3/8, has passed within the measure).
1963 Rules can also be restricted to specific time signatures. A rule that
1964 should only be applied in @var{N}/@var{M} time signature is formed by
1965 replacing the second asterisks by @var{N} and @var{M}. For example, a
1966 rule for 6/8 time exclusively looks like
1968 #(override-auto-beam-setting '(begin * * 6 8) @dots{})
1971 If a rule should be to applied only to certain types of beams, use the
1972 first pair of asterisks. Beams are classified according to the
1973 shortest note they contain. For a beam ending rule that only applies
1974 to beams with 32nd notes (and no shorter notes), use @code{(end 1 32 *
1977 @cindex automatic beam generation
1979 @cindex @code{autoBeaming}
1982 If beams are used to indicate melismata in songs, then automatic
1983 beaming should be switched off. This is done by setting
1984 @code{autoBeaming} to @code{#f}.
1988 @cindex @code{\autoBeamOff}
1989 @code{\autoBeamOff},
1990 @cindex @code{\autoBeamOn}
1996 If a score ends while an automatic beam has not been ended and is
1997 still accepting notes, this last beam will not be typeset at all. The
1998 same holds polyphonic voices, entered with @code{<< @dots{} \\ @dots{}
1999 >>}. If a polyphonic voice ends while an automatic beam is still
2000 accepting notes, it is not typeset.
2002 @node Beam formatting
2003 @subsection Beam formatting
2005 When a beam falls in the middle of the staff, the beams point normally
2006 down. However, this behaviour can be altered with the
2007 @code{neutral-direction} property.
2009 @lilypond[quote,raggedright,relative=2,fragment,verbatim]
2012 \override Beam #'neutral-direction = #-1
2014 \override Beam #'neutral-direction = #1