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 true in
934 @internalsref{RemoveEmptyVerticalGroup}.
937 \override Score.RemoveEmptyVerticalGroup #'remove-first = ##t
940 To remove other types of contexts, use @code{\AncientRemoveEmptyStaffContext}
941 or @code{\RemoveEmptyRhythmicStaffContext}.
943 Another application is making ossia sections, i.e., alternative
944 melodies on a separate piece of staff, with help of a Frenched
945 staff. See @inputfileref{input/@/test,ossia@/.ly} for an example.
948 @node Quoting other voices
949 @subsection Quoting other voices
951 With quotations, fragments of other parts can be inserted into a part
952 directly. Before a part can be quoted, it must be marked especially as
953 quotable. This is done with the @code{\addquote} command.
956 \addquote @var{name} @var{music}
961 Here, @var{name} is an identifying string. The @var{music} is any kind
962 of music. Here is an example of @code{\addquote}
965 \addquote clarinet \relative c' @{
970 This command must be entered at toplevel, i.e., outside any music
973 After calling @code{\addquote}, the quotation may then be done with
974 @code{\quoteDuring} or @code{\cueDuring},
977 \quoteDuring #@var{name} @var{music}
980 During a part, a piece of music can be quoted with the @code{\quoteDuring}
984 \quoteDuring #"clarinet" @{ s2. @}
987 This would cite three quarter notes (the duration of @code{s2.}) of
988 the previously added @code{clarinet} voice.
991 More precisely, it takes the current time-step of the part being
992 printed, and extracts the notes at the corresponding point of the
993 @code{\addquote}d voice. Therefore, the argument to @code{\addquote}
994 should be the entire part of the voice to be quoted, including any
995 rests at the beginning.
997 Quotations take into account the transposition of both source and target
998 instruments, if they are specified using the @code{\transposition} command.
1000 @lilypond[quote,raggedright,verbatim]
1001 \addquote clarinet \relative c' {
1007 e'8 f'8 \quoteDuring #"clarinet" { s2 }
1011 The type of events that are present in cue notes can be trimmed with
1012 the @code{quotedEventTypes} property. The default value is
1013 @code{(note-event rest-event)}, which means that only notes and
1014 rests of the cued voice end up in the @code{\quoteDuring}.
1018 \set Staff.quotedEventTypes =
1019 #'(note-event articulation-event dynamic-event)
1023 will quote notes (but no rests), together with scripts and dynamics.
1027 Only the contents of the first @internalsref{Voice} occurring in an
1028 @code{\addquote} command will be considered for quotation, so
1029 @var{music} can not contain @code{\new} and @code{\context Voice}
1030 statements that would switch to a different Voice.
1032 Quoting grace notes is broken and can even cause LilyPond to crash.
1036 In this manual: @ref{Instrument transpositions}.
1038 Examples: @inputfileref{input/@/regression,quote@/.ly}
1039 @inputfileref{input/@/regression,quote@/-transposition@/.ly}
1041 Program reference: @internalsref{QuoteMusic}.
1044 @node Formatting cue notes
1045 @subsection Formatting cue notes
1047 The previous section deals with inserting notes from another voice.
1048 There is a more advanced music function called @code{\cueDuring},
1049 which makes formatting cue notes easier.
1054 \cueDuring #@var{name} #@var{updown} @var{music}
1057 This will insert notes from the part @var{name} into a
1058 @internalsref{Voice} called @code{cue}. This happens simultaneously
1059 with @var{music}, which usually is a rest. When the cue notes start,
1060 the staff in effect becomes polyphonic for a moment. The argument
1061 @var{updown} determines whether the cue notes should be notated as a
1062 first or second voice.
1065 @lilypond[verbatim,raggedright]
1068 \override Stem #'length = #5.5
1069 \override Beam #'thickness = #0.384
1070 \override Beam #'space-function =
1071 #(lambda (beam mult) (* 0.8 (Beam::space_function beam mult)))
1074 \addquote clarinet \relative {
1079 \new Staff \relative <<
1081 % setup a context for cue notes.
1082 \context Voice = cue { \smaller \skip 1*21 }
1084 \set Score.skipBars = ##t
1088 \cueDuring #"clarinet" #1 {
1097 Here are a couple of hints for successful cue notes
1101 Cue notes have smaller font sizes.
1103 the cued part is marked with the instrument playing the cue.
1105 when the original part takes over again, this should be marked with
1106 the name of the original instrument.
1108 @c really? Are you sure about that last point? I'll check after 3.0 -gp
1110 @c Yes, this is good practice. Otherwise, the start of the original
1111 @c part can only be seen from the font size. This is not good enough
1112 @c for sight-reading. It is possilbe to use other
1113 @c markers (eg. a big close-bracket over the staff) to indicate the cue notes are
1118 any other changes introduced by the cued part should also be
1119 undone. For example, if the cued instrument plays in a different clef,
1120 the original clef should be stated once again.
1125 @node Aligning to cadenzas
1126 @subsection Aligning to cadenzas
1128 In an orchestral context, cadenzas present a special problem:
1129 when constructing a score that includes a cadenza, all other
1130 instruments should skip just as many notes as the length of the
1131 cadenza, otherwise they will start too soon or too late.
1133 A solution to this problem are the functions @code{mmrest-of-length}
1134 and @code{skip-of-length}. These Scheme functions take a piece of music
1135 as argument, and generate a @code{\skip} or multi-rest, exactly as
1136 long as the piece. The use of @code{mmrest-of-length} is demonstrated
1137 in the following example.
1139 @lilypond[verbatim,raggedright,quote]
1140 cadenza = \relative c' {
1141 c4 d8 << { e f g } \\ { d4. } >>
1146 \new Staff { \cadenza c'4 }
1148 #(ly:export (mmrest-of-length cadenza))
1157 @node Contemporary notation
1158 @section Contemporary notation
1160 In the 20th century, composers have greatly expanded the musical
1161 vocabulary. With this expansion, many innovations in musical notation
1162 have been tried. The book ``Music Notation in the 20th century'' by
1163 Kurt Stone gives a comprehensive overview (see @ref{Literature
1164 list}). In general, the use of new, innovative notation makes a piece
1165 harder to understand and perform and its use should therefore be
1166 avoided. For this reason, support for contemporary notation in
1167 LilyPond is limited.
1171 * Polymetric notation::
1173 * Special fermatas::
1178 @node Polymetric notation
1179 @subsection Polymetric notation
1181 Double time signatures are not supported explicitly, but they can be
1182 faked. In the next example, the markup for the time signature is
1183 created with a markup text. This markup text is inserted in the
1184 @internalsref{TimeSignature} grob.
1186 @lilypond[verbatim,raggedright]
1191 \musicglyph #"scripts.stopped"
1192 \bracket \column { "5" "8" }
1197 \override Staff.TimeSignature #'print-function = #Text_interface::print
1198 \override Staff.TimeSignature #'text = #tsMarkup
1200 c'2 \bar ":" c'4 c'4.
1204 Each staff can also have its own time signature. This is done by
1205 moving the @internalsref{Timing_engraver} to the @internalsref{Staff}
1210 \context @{ \Score \remove "Timing_engraver" @}
1211 \context @{ \Staff \consists "Timing_engraver" @}
1216 Now, each staff has its own time signature.
1229 c4. c8 c c c4. c8 c c
1234 @lilypond[quote,raggedright]
1236 \context{ \Score \remove "Timing_engraver" }
1237 \context{ \Staff \consists "Timing_engraver" }
1251 c4. c8 c c c4. c8 c c
1257 A different form of polymetric notation is where note lengths have
1258 different values across staves.
1260 This notation can be created by setting a common time signature for
1261 each staff but replacing it manually using
1262 @code{timeSignatureFraction} to the desired fraction. Then the printed
1263 durations in each staff are scaled to the common time signature.
1264 The latter is done with @code{\compressmusic}, which is similar to
1265 @code{\times}, but does not create a tuplet bracket.
1268 In this example, music with the time signatures of 3/4, 9/8, and 10/8 are
1269 used in parallel. In the second staff, shown durations are multiplied by
1270 2/3, so that 2/3 * 9/8 = 3/4, and in the third staff, shown durations are
1271 multiplied by 3/5, so that 3/5 * 10/8 = 3/4.
1273 @lilypond[quote,raggedright,verbatim,fragment]
1281 \set Staff.timeSignatureFraction = #'(9 . 8)
1282 \compressmusic #'(2 . 3)
1283 \repeat unfold 6 { c8[ c c] }
1287 \set Staff.timeSignatureFraction = #'(10 . 8)
1288 \compressmusic #'(3 . 5) {
1289 \repeat unfold 2 { c8[ c c] }
1290 \repeat unfold 2 { c8[ c] }
1291 | c4. c4. \times 2/3 { c8 c c } c4
1302 When using different time signatures in parallel, the spacing is
1303 aligned vertically, but bar lines distort the regular spacing.
1308 @subsection Clusters
1312 A cluster indicates a continuous range of pitches to be played. They
1313 can be denoted as the envelope of a set of notes. They are entered by
1314 applying the function @code{makeClusters} to a sequence of
1316 @lilypond[quote,raggedright,relative=2,fragment,verbatim]
1317 \makeClusters { <c e > <b f'> }
1320 The following example (from
1321 @inputfileref{input/@/regression,cluster@/.ly}) shows what the result
1324 @lilypondfile[raggedright,quote]{cluster.ly}
1326 Ordinary notes and clusters can be put together in the same staff,
1327 even simultaneously. In such a case no attempt is made to
1328 automatically avoid collisions between ordinary notes and clusters.
1332 Program reference: @internalsref{ClusterSpanner},
1333 @internalsref{ClusterSpannerBeacon},
1334 @internalsref{Cluster_spanner_engraver}, and
1335 @internalsref{ClusterNoteEvent}.
1337 Examples: @inputfileref{input/@/regression,cluster@/.ly}.
1341 Music expressions like @code{<< @{ g8 e8 @} a4 >>} are not printed
1342 accurately. Use @code{<g a>8 <e a>8} instead.
1346 @node Special fermatas
1347 @subsection Special fermatas
1349 @cindex fermatas, special
1351 In contemporary music notation, special fermata symbols denote breaks
1352 of differing lengths. The following fermatas are supported
1354 @lilypond[quote,raggedright]
1377 \context Lyrics \lyricmode {
1378 \override LyricText #'font-family = #'typewriter
1379 "shortfermata" "fermata" "longfermata" "verylongfermata"
1384 See @ref{Articulations} for general instructions how to apply scripts
1385 such as fermatas to notes.
1387 @node Feathered beams
1388 @subsection Feathered beams
1390 Feathered beams are not supported natively, but they can be faked by
1391 forcing two beams to overlap. Here is an example,
1393 @c don't change relative setting witout changing positions!
1394 @lilypond[raggedright,relative=1,fragment,verbatim]
1399 \once \override Voice.Beam #'positions = #'(0 . 0.5)
1404 \once \override Voice.Beam #'positions = #'(0 . -0.5)
1412 @subsection Improvisation
1414 Improvisation is sometimes denoted with slashed note heads. Such note
1415 heads can be created by adding a @internalsref{Pitch_squash_engraver}
1416 to the @internalsref{Staff} or @internalsref{Voice} context. Then, the
1420 \set squashedPosition = #0
1421 \override NoteHead #'style = #'slash
1425 switches on the slashes.
1427 There are shortcuts @code{\improvisationOn} (and an accompanying
1428 @code{\improvisationOff}) for this command sequence. They are used in
1429 the following example
1431 @lilypond[verbatim,raggedright,quote]
1433 \consists Pitch_squash_engraver
1435 e8 e g a a16(bes)(a8) g \improvisationOn
1438 ~fis2 \improvisationOff a16(bes) a8 g e
1443 @node Educational use
1444 @section Educational use
1446 With the amount of control that LilyPond offers, one can make great
1447 teaching tools in addition to great musical scores.
1451 * Blank music sheet::
1453 * Shaped note heads ::
1454 * Easy Notation note heads::
1455 * Analysis brackets::
1456 * Coloring objects::
1460 @subsection Balloon help
1462 Elements of notation can be marked and named with the help of a square
1463 balloon. The primary purpose of this feature is to explain notation.
1465 The following example demonstrates its use.
1467 @lilypond[quote,verbatim,fragment,raggedright,relative=2]
1470 #(add-balloon-text 'NoteHead "heads, or tails?"
1477 The function @code{add-balloon-text} takes the name of a grob, the
1478 label to print, and the position where to put the label relative to
1479 the object. In the above example, the text ``heads or tails?'' ends
1480 3 spaces below and 1 space to the right of the marked head.
1483 @cindex notation, explaining
1487 Program reference: @internalsref{text-balloon-interface}.
1489 Examples: @inputfileref{input/@/regression,balloon@/.ly}.
1494 @node Blank music sheet
1495 @subsection Blank music sheet
1497 A blank music sheet can be produced also by using invisible notes, and
1498 removing @code{Bar_number_engraver}.
1501 @lilypond[quote,verbatim]
1503 \repeat unfold 2 % Change this for more lines.
1508 \override TimeSignature #'transparent = ##t
1509 defaultBarType = #""
1510 \remove Bar_number_engraver
1512 \context Staff \emptymusic
1513 \context TabStaff \emptymusic
1519 @subsection Hidden notes
1521 @cindex Hidden notes
1522 @cindex Invisible notes
1523 @cindex Transparent notes
1525 @cindex @code{\hideNotes}
1526 @cindex @code{\unHideNotes}
1527 Hidden (or invisible or transparent) notes can be useful in preparing theory
1528 or composition exercises.
1530 @lilypond[quote,raggedright,verbatim,relative=2,fragment]
1538 Hidden notes are also great for performing weird tricks. For example,
1539 slurs cannot be attached to rests or spacer rests, but you may wish
1540 to include that in your score -- string instruments use this notation
1541 when doing pizzicato to indicate that the note should ring for as long
1544 @lilypond[quote,raggedright,verbatim,relative=0,fragment]
1547 c4^"pizz"( \hideNotes c)
1548 \unHideNotes c( \hideNotes c)
1555 @node Shaped note heads
1556 @subsection Shaped note heads
1558 In shaped note head notation, the shape of the note head corresponds
1559 to the harmonic function of a note in the scale. This notation was
1560 popular in the 19th century American song books.
1562 Shaped note heads can be produced by setting @code{\aikenHeads} or
1563 @code{\sacredHarpHeads}, depending on the style desired.
1565 @lilypond[verbatim,relative=1,fragment]
1572 Shapes are determined on the step in the scale, where the base of the
1573 scale is determined by the @code{\key} command
1576 @findex shapeNoteStyles
1578 @findex \sacredHarpHeads
1580 Shaped note heads are implemented through the @code{shapeNoteStyles}
1581 property. Its value is a vector of symbols. The k-th element indicates
1582 the style to use for the k-th step of the scale. Arbitrary
1583 combinations are possible, eg.,
1586 @lilypond[verbatim,relative=1,fragment]
1587 \set shapeNoteStyles = ##(cross triangle fa #f mensural xcircle diamond)
1592 @node Easy Notation note heads
1593 @subsection Easy Notation note heads
1595 @cindex easy notation
1598 The `easy play' note head includes a note name inside the head. It is
1599 used in music for beginners
1601 @lilypond[quote,raggedright,verbatim,fragment,staffsize=26]
1606 The command @code{\setEasyHeads} overrides settings for the
1607 @internalsref{NoteHead} object. To make the letters readable, it has
1608 to be printed in a large font size. To print with a larger font, see
1609 @ref{Setting global staff size}.
1613 @cindex @code{\setEasyHeads}
1614 @code{\setEasyHeads}
1617 @node Analysis brackets
1618 @subsection Analysis brackets
1620 @cindex phrasing brackets
1621 @cindex musicological analysis
1622 @cindex note grouping bracket
1624 Brackets are used in musical analysis to indicate structure in musical
1625 pieces. LilyPond supports a simple form of nested horizontal
1626 brackets. To use this, add the @internalsref{Horizontal_bracket_engraver}
1627 to @internalsref{Staff} context. A bracket is started with
1628 @code{\startGroup} and closed with @code{\stopGroup}
1630 @lilypond[quote,raggedright,verbatim]
1633 c4\startGroup\startGroup
1636 c4\stopGroup\stopGroup
1640 \Staff \consists "Horizontal_bracket_engraver"
1646 Program reference: @internalsref{HorizontalBracket},
1647 @internalsref{NoteGroupingEvent}.
1649 Examples: @inputfileref{input/@/regression,note@/-group@/-bracket@/.ly}.
1655 I don't think we need this info.
1660 Whenever a note is found, a @internalsref{Stem} object is created
1661 automatically. For whole notes and rests, they are also created but
1666 @cindex @code{\stemUp}
1668 @cindex @code{\stemDown}
1670 @cindex @code{\stemNeutral}
1671 @code{\stemNeutral}.
1680 FIXME: We don't need this section. It will be moved into LSR as soon
1681 as the safe mode stuff is worked out.
1683 @n ode Controlling formatting of prefatory matter
1684 @s ubsection Controlling formatting of prefatory matter
1686 @c This section will be moved to somewhere else soon. -gp
1687 This example demonstrates how to place prefatory matter
1688 (such as the clef and key signature) at the end of a line.
1690 @lilypond[quote,verbatim]
1692 \override Staff.Clef
1693 #'break-visibility = #end-of-line-visible
1694 \override Staff.KeySignature
1695 #'break-visibility = #end-of-line-visible
1696 \set Staff.explicitClefVisibility = #end-of-line-visible
1697 \set Staff.explicitKeySignatureVisibility = #end-of-line-visible
1699 % We want the time sig to take space, otherwise there is not
1700 % enough white at the start of the line.
1702 \override Staff.TimeSignature #'transparent = ##t
1703 \set Score.defaultBarType = #"empty"
1722 @node Coloring objects
1723 @subsection Coloring objects
1725 @c FIXME: need link to missing list of colors
1726 Individual objects may be assigned colors. You may use color names
1729 @lilypond[quote,raggedright,verbatim,fragment]
1730 \override NoteHead #'color = #red
1732 \override NoteHead #'color = #(x11-color 'LimeGreen)
1734 \override Stem #'color = #blue
1738 The full range of colors defined for X11 can be accessed by using the
1739 scheme function x11-color. The function takes one argument that can be a
1743 \override Beam #'color = #(x11-color 'MediumTurquoise)
1749 \override Beam #'color = #(x11-color "MediumTurquoise")
1752 The first form is quicker to write and is more efficient. However, using
1753 the second form it is possible to access X11 colors by the multi-word
1757 \override Beam #'color = #(x11-color "medium turquoise")
1760 If x11-color cannot make sense of the parameter then the color returned
1761 defaults to black. It should be obvious from the final score that
1764 This example, illustrates the use of x11-color. Notice that the stem
1765 color remains black after being set to (x11-color 'Boggle), which is
1766 deliberate nonsense.
1768 @lilypond[quote,raggedright,verbatim]
1770 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
1771 \set Staff.instrument = \markup {
1772 \with-color #(x11-color 'navy) "Clarinet"
1776 \override Beam #'color = #(x11-color "medium turquoise")
1778 \override NoteHead #'color = #(x11-color "LimeGreen")
1780 \override Stem #'color = #(x11-color 'Boggle)
1787 Not all x11 colors are distinguishable in a web browser. For web use
1788 normal colors are recommended.
1790 An x11 color is not necessarily exactly the same shade as a similarly
1799 @node Automatic notation
1800 @section Automatic notation
1802 This section describes how to change the way that accidentals and
1803 beams are automatically displayed.
1805 FIXME: this might get moved into Changing Defaults. Please send
1806 opinions to lilypond-devel. Thanks! :)
1809 * Automatic accidentals::
1810 * Setting automatic beam behavior::
1814 @node Automatic accidentals
1815 @subsection Automatic accidentals
1816 @cindex Automatic accidentals
1818 Common rules for typesetting accidentals have been placed in a
1819 function. This function is called as follows
1821 @cindex @code{set-accidental-style}
1823 #(set-accidental-style 'STYLE #('CONTEXT#))
1826 The function can take two arguments: the name of the accidental style,
1827 and an optional argument that denotes the context that should be
1828 changed. If no context name is supplied, @code{Staff} is the default,
1829 but you may wish to apply the accidental style to a single @code{Voice}
1832 The following accidental styles are supported
1835 This is the default typesetting behavior. It corresponds
1836 to 18th century common practice: Accidentals are
1837 remembered to the end of the measure in which they occur and
1838 only on their own octave.
1841 The normal behavior is to remember the accidentals on
1842 Staff-level. This variable, however, typesets accidentals
1843 individually for each voice. Apart from that, the rule is similar to
1846 As a result, accidentals from one voice do not get canceled in other
1847 voices, which is often an unwanted result
1849 @lilypond[quote,raggedright,relative=1,fragment,verbatim]
1851 #(set-accidental-style 'voice)
1858 The @code{voice} option should be used if the voices
1859 are to be read solely by individual musicians. If the staff is to be
1860 used by one musician (e.g., a conductor) then
1861 @code{modern} or @code{modern-cautionary}
1862 should be used instead.
1865 @cindex @code{modern} style accidentals
1866 This rule corresponds to the common practice in the 20th century. This rule
1867 prints the same accidentals as @code{default}, but temporary
1868 accidentals also are canceled in other octaves. Furthermore,
1869 in the same octave, they also get canceled in the following
1872 @lilypond[quote,raggedright,fragment,verbatim]
1873 #(set-accidental-style 'modern)
1874 cis' c'' cis'2 | c'' c'
1877 @item @code{modern-cautionary}
1878 @cindex @code{modern-cautionary}
1879 This rule is similar to @code{modern}, but the ``extra'' accidentals
1880 (the ones not typeset by @code{default}) are typeset as cautionary
1881 accidentals. They are printed in reduced size or with parentheses
1882 @lilypond[quote,raggedright,fragment,verbatim]
1883 #(set-accidental-style 'modern-cautionary)
1884 cis' c'' cis'2 | c'' c'
1887 @cindex @code{modern-voice}
1889 This rule is used for multivoice accidentals to be read both by musicians
1890 playing one voice and musicians playing all voices. Accidentals are
1891 typeset for each voice, but they @emph{are} canceled across voices in
1892 the same @internalsref{Staff}.
1894 @cindex @code{modern-voice-cautionary}
1895 @item modern-voice-cautionary
1896 This rule is the same as @code{modern-voice}, but with the extra
1897 accidentals (the ones not typeset by @code{voice}) typeset
1898 as cautionaries. Even though all accidentals typeset by
1899 @code{default} @emph{are} typeset by this variable,
1900 some of them are typeset as cautionaries.
1903 @cindex @code{piano} accidentals
1904 This rule reflects 20th century practice for piano notation. Very similar to
1905 @code{modern} but accidentals also get canceled
1906 across the staves in the same @internalsref{GrandStaff} or
1907 @internalsref{PianoStaff}.
1909 @item piano-cautionary
1910 @cindex @code{#(set-accidental-style 'piano-cautionary)}
1911 Same as @code{#(set-accidental-style 'piano)} but with the extra
1912 accidentals typeset as cautionaries.
1915 @cindex @code{no-reset} accidental style
1916 This is the same as @code{default} but with accidentals lasting
1917 ``forever'' and not only until the next measure
1918 @lilypond[quote,raggedright,fragment,verbatim,relative=1]
1919 #(set-accidental-style 'no-reset)
1924 This is sort of the opposite of @code{no-reset}: Accidentals
1925 are not remembered at all---and hence all accidentals are
1926 typeset relative to the key signature, regardless of what was
1929 @lilypond[quote,raggedright,fragment,verbatim,relative=1]
1930 #(set-accidental-style 'forget)
1931 \key d\major c4 c cis cis d d dis dis
1938 Program reference: @internalsref{Accidental_engraver},
1939 @internalsref{Accidental}, and @internalsref{AccidentalPlacement}.
1944 Simultaneous notes are considered to be entered in sequential
1945 mode. This means that in a chord the accidentals are typeset as if the
1946 notes in the chord happened once at a time - in the order in which
1947 they appear in the input file.
1949 This is a problem when accidentals in a chord depend on each other,
1950 which does not happen for the default accidental style. The problem
1951 can be solved by manually inserting @code{!} and @code{?} for the
1955 @node Setting automatic beam behavior
1956 @subsection Setting automatic beam behavior
1958 @cindex @code{autoBeamSettings}
1959 @cindex @code{(end * * * *)}
1960 @cindex @code{(begin * * * *)}
1961 @cindex automatic beams, tuning
1962 @cindex tuning automatic beaming
1964 @c [TODO: use \applycontext]
1966 In normal time signatures, automatic beams can start on any note but can
1967 only end in a few positions within the measure: beams can end on a beat,
1968 or at durations specified by the properties in
1969 @code{autoBeamSettings}. The defaults for @code{autoBeamSettings}
1970 are defined in @file{scm/@/auto@/-beam@/.scm}.
1972 The value of @code{autoBeamSettings} is changed with three functions,
1974 #(override-auto-beam-setting
1975 '(@var{be} @var{p} @var{q} @var{n} @var{m}) @var{a} @var{b}
1977 #(score-override-auto-beam-setting
1978 '(@var{be} @var{p} @var{q} @var{n} @var{m}) @var{a} @var{b})
1979 #(revert-auto-beam-setting '(@var{be} @var{p} @var{q} @var{n} @var{m})
1982 Here, @var{be} is the symbol @code{begin} or @code{end}, and
1983 @var{context} is an optional context (default: @code{'Voice}). It
1984 determines whether the rule applies to begin or end-points. The
1985 quantity @var{p}/@var{q} refers to the length of the beamed notes (and
1986 `@code{* *}' designates notes of any length), @var{n}/@var{M} refers
1987 to a time signature (wildcards `@code{* *}' may be entered to
1988 designate all time signatures), @var{a}/@var{b} is a duration. By
1989 default, this command changes settings for the current voice. It is
1990 also possible to adjust settings at higher contexts, by adding a
1991 @var{context} argument. @code{score-override-auto-beam-setting} is
1992 equal to @code{override-auto-beam-setting} with the argument
1993 @var{context} set to @code{'Score}.
1995 For example, if automatic beams should end on the first quarter note, use
1998 #(override-auto-beam-setting '(end * * * *) 1 4 'Staff)
2000 Since the duration of a quarter note is 1/4 of a whole note, it is
2001 entered as @code{(ly:make-moment 1 4)}.
2003 If automatic beams should end on every quarter in 5/4 time, specify
2006 #(override-auto-beam-setting '(end * * * *) 1 4 'Staff)
2007 #(override-auto-beam-setting '(end * * * *) 1 2 'Staff)
2008 #(override-auto-beam-setting '(end * * * *) 3 4 'Staff)
2009 #(override-auto-beam-setting '(end * * * *) 5 4 'Staff)
2013 The same syntax can be used to specify beam starting points. In this
2014 example, automatic beams can only end on a dotted quarter note
2016 #(override-auto-beam-setting '(end * * * *) 3 8)
2017 #(override-auto-beam-setting '(end * * * *) 1 2)
2018 #(override-auto-beam-setting '(end * * * *) 7 8)
2020 In 4/4 time signature, this means that automatic beams could end only on
2021 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
2022 3/8, has passed within the measure).
2024 Rules can also be restricted to specific time signatures. A rule that
2025 should only be applied in @var{N}/@var{M} time signature is formed by
2026 replacing the second asterisks by @var{N} and @var{M}. For example, a
2027 rule for 6/8 time exclusively looks like
2029 #(override-auto-beam-setting '(begin * * 6 8) @dots{})
2032 If a rule should be to applied only to certain types of beams, use the
2033 first pair of asterisks. Beams are classified according to the
2034 shortest note they contain. For a beam ending rule that only applies
2035 to beams with 32nd notes (and no shorter notes), use @code{(end 1 32 *
2038 @cindex automatic beam generation
2040 @cindex @code{autoBeaming}
2043 If beams are used to indicate melismata in songs, then automatic
2044 beaming should be switched off. This is done by setting
2045 @code{autoBeaming} to @code{#f}.
2049 @cindex @code{\autoBeamOff}
2050 @code{\autoBeamOff},
2051 @cindex @code{\autoBeamOn}
2057 If a score ends while an automatic beam has not been ended and is
2058 still accepting notes, this last beam will not be typeset at all. The
2059 same holds polyphonic voices, entered with @code{<< @dots{} \\ @dots{}
2060 >>}. If a polyphonic voice ends while an automatic beam is still
2061 accepting notes, it is not typeset.
2063 @node Beam formatting
2064 @subsection Beam formatting
2066 When a beam falls in the middle of the staff, the beams point normally
2067 down. However, this behaviour can be altered with the
2068 @code{neutral-direction} property.
2070 @lilypond[quote,raggedright,relative=2,fragment,verbatim]
2073 \override Beam #'neutral-direction = #-1
2075 \override Beam #'neutral-direction = #1