1 @c -*- coding: utf-8; mode: texinfo; -*-
3 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 When revising a translation, copy the HEAD committish of the
6 version that you are working on. For details, see the Contributors'
7 Guide, node Updating translation committishes..
15 @lilypondfile[quote]{rhythms-headword.ly}
17 This section discusses rhythms, rests, durations, beaming and bars.
22 * Displaying rhythms::
25 * Special rhythmic concerns::
30 @subsection Writing rhythms
40 @unnumberedsubsubsec Durations
42 @cindex durations, of notes
43 @cindex note durations
44 @cindex length of notes
51 Durations are designated by numbers and dots. Durations are entered
52 as their reciprocal values. For example, a quarter note is entered
53 using a @code{4} (since it is a 1/4 note), and a half note is entered
54 using a @code{2} (since it is a 1/2 note). For notes longer than a
55 whole you must use the @code{\longa} (a double breve) and
56 @code{\breve} commands. Durations as short as 128th notes may be
57 specified. Shorter values are possible, but only as beamed notes.
59 @c Two 64th notes are needed to obtain beams
60 @lilypond[quote,verbatim]
63 c''\longa c\breve c1 c2
64 c4 c8 c16 c32 c64 c128 c128
68 Here are the same durations with automatic beaming turned off.
70 @c not strictly "writing rhythms"; more of a "displaying" thing,
71 @c but it's ok here. -gp
72 @lilypond[quote,verbatim]
76 c''\longa c\breve c1 c2
77 c4 c8 c16 c32 c64 c128 c128
81 A note with the duration of a quadruple breve may be entered with
82 @code{\maxima}, but this is supported only within ancient music
83 notation. For details, see @ref{Ancient notation}.
85 @cindex duration, default
86 @cindex default note duration
87 @cindex note duration, default
89 If the duration is omitted, it is set to the previously
90 entered duration. The default for the first note is a quarter
93 @lilypond[quote,verbatim]
94 \relative { a' a a2 a a4 a a1 a }
97 Durations occuring on their own within a music sequence will take
98 their pitches from the preceding note or chord.
100 @lilypond[quote,verbatim]
103 c'' \longa \breve 1 2
108 @cindex notes, dotted
110 @cindex notes, double-dotted
111 @cindex double-dotted notes
115 To obtain dotted note lengths, place a dot (@code{.}) after the
116 duration. Double-dotted notes are specified by appending two
119 @lilypond[quote,verbatim]
120 \relative { a'4 b c4. b8 a4. b4.. c8. }
123 Some durations cannot be represented with just binary durations
124 and dots; they can be represented only by tying two or more
125 notes together. For details, see @ref{Ties}.
127 For ways of specifying durations for the syllables of lyrics and
128 ways of aligning lyrics to notes, see @ref{Vocal music}.
130 Optionally, notes can be spaced strictly proportionately to their
131 duration. For details of this and other settings which control
132 proportional notation, see @ref{Proportional notation}.
136 @funindex \dotsNeutral
138 Dots are normally moved up to avoid staff lines, except in
139 polyphonic situations. Dots may be manually placed above or below
140 the staff; see @ref{Direction and placement}.
154 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
155 {alternative-breve-notes.ly}
157 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
158 {changing-the-number-of-augmentation-dots-per-note.ly}
166 @rglos{Duration names notes and rests}.
169 @ref{Automatic beams},
172 @ref{Writing rhythms},
175 @ref{Ancient notation},
176 @ref{Proportional notation}.
183 @rinternals{DotColumn}.
186 @c Deliberately duplicated in Durations and Rests. -gp
187 There is no fundamental limit to rest durations (both in terms of
188 longest and shortest), but the number of glyphs is limited:
189 rests from 128th to maxima (8× whole) may be printed.
193 @unnumberedsubsubsec Tuplets
200 Tuplets are made from a music expression with the @code{\tuplet}
201 command, multiplying the speed of the music expression by a fraction:
204 \tuplet @var{fraction} @{ @var{music} @}
208 The fraction's numerator will be printed over or under the notes,
209 optionally with a bracket. The most common tuplets are triplets
210 (3@tie{}notes sound within the duration normally allowed for@tie{}2).
212 @lilypond[quote,verbatim]
214 a'2 \tuplet 3/2 { b4 4 4 }
215 c4 c \tuplet 3/2 { b4 a g }
219 @cindex tuplet grouping
221 When entering long passages of tuplets, having to write a separate
222 @code{\tuplet} command for each group is inconvenient. It is possible
223 to specify the duration of one tuplet group directly before the music
224 in order to have the tuplets grouped automatically:
226 @lilypond[quote,verbatim]
228 g'2 r8 \tuplet 3/2 8 { cis16 d e e f g g f e }
232 @cindex tuplet bracket placement
235 @funindex \tupletDown
236 @funindex \tupletNeutral
238 Tuplet brackets may be manually placed above or below the staff:
240 @lilypond[quote,verbatim]
242 \tupletUp \tuplet 3/2 { c''8 d e }
243 \tupletNeutral \tuplet 3/2 { c8 d e }
244 \tupletDown \tuplet 3/2 { f,8 g a }
245 \tupletNeutral \tuplet 3/2 { f8 g a }
249 Tuplets may be nested:
251 @lilypond[quote,verbatim]
254 c''4 \tuplet 5/4 { f8 e f \tuplet 3/2 { e[ f g] } } f4
258 Modifying nested tuplets which begin at the same musical moment must be
259 done with @code{\tweak}.
261 To modify the duration of notes without printing a tuplet bracket, see
262 @ref{Scaling durations}.
267 @code{\tupletNeutral}.
273 @cindex tuplet formatting
274 @cindex triplet formatting
276 @funindex tupletNumberFormatFunction
277 @funindex tupletSpannerDuration
279 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
280 {entering-several-tuplets-using-only-one--tuplet-command.ly}
282 @cindex Tuplet number changes
284 @funindex TupletNumber
286 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
287 {changing-the-tuplet-number.ly}
289 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
290 {non-default-tuplet-numbers.ly}
292 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
293 {controlling-tuplet-bracket-visibility.ly}
295 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
296 {permitting-line-breaks-within-beamed-tuplets.ly}
305 @rlearning{Tweaking methods}.
308 @ref{Direction and placement},
309 @ref{Time administration},
310 @ref{Scaling durations},
311 @ref{The tweak command},
312 @ref{Polymetric notation}.
318 @rinternals{TupletBracket},
319 @rinternals{TupletNumber},
320 @rinternals{TimeScaledMusic}.
323 @node Scaling durations
324 @unnumberedsubsubsec Scaling durations
326 @cindex scaling durations
327 @cindex durations, scaling
329 The duration of single notes, rests or chords may be multiplied by a
330 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
331 is 1) to the duration. This will not affect the appearance of the
332 notes or rests produced, but the altered duration will be used in
333 calculating the position within the measure and setting the duration
334 in the MIDI output. Multiplying factors may be combined like
335 @code{*L*M/N}. Factors are part of the duration: if a duration is
336 not specified for subsequent notes, the default duration taken from
337 the preceding note will include any scaling factor.
339 In the following example, the first three notes take up exactly
340 two beats, but no triplet bracket is printed.
342 @lilypond[quote,verbatim]
345 % Alter durations to triplets
349 % Double the duration of chord
351 % Duration of quarter, appears like sixteenth
356 The duration of spacer rests may also be modified by
357 a multiplier. This is useful for skipping many measures, e.g.,
360 @cindex compressing music
361 @cindex expanding music
363 @funindex \scaleDurations
365 Longer stretches of music may be compressed by a fraction in the
366 same way, as if every note, chord or rest had the fraction as a
367 multiplier. This leaves the appearance of the music unchanged but
368 the internal duration of the notes will be multiplied by the
369 fraction @emph{num}/@emph{den}. Here is an example showing how music
370 can be compressed and expanded:
372 @lilypond[quote,verbatim]
377 % Scale music by *2/3
378 \scaleDurations 2/3 {
382 \scaleDurations 2/1 {
388 One application of this command is in polymetric
389 notation, see @ref{Polymetric notation}.
394 @ref{Invisible rests},
395 @ref{Polymetric notation}.
401 The calculation of the position within a measure must take into
402 account all the scaling factors applied to the notes within that
403 measure and any fractional carry-out from earlier measures. This
404 calculation is carried out using rational numbers. If an intermediate
405 numerator or denominator in that calculation exceeds 2^30 the
406 execution and typesetting will stop at that point without indicating
411 @unnumberedsubsubsec Ties
417 A tie connects two adjacent note heads of the same pitch. The tie
418 in effect extends the duration of a note.
420 @warning{Ties should not be confused with @emph{slurs}, which
421 indicate articulation, or @emph{phrasing slurs}, which indicate
422 musical phrasing. A tie is just a way of extending a note
423 duration, similar to the augmentation dot.}
425 A tie is entered by appending a tilde symbol (@code{~}) to the first
426 of each pair of notes being tied. This indicates that the note
427 should be tied to the following note, which must be at the same pitch.
429 @lilypond[quote,verbatim]
433 Ties can make use of the @q{last explicit pitch} interpretation of
436 @lilypond[quote,verbatim]
440 Ties are used either when the note crosses a bar line, or when
441 dots cannot be used to denote the rhythm. Ties should also be
442 used when note values cross larger subdivisions of the measure:
444 @lilypond[verbatim,quote]
451 If you need to tie many notes across bar lines, it may be
452 easier to use automatic note splitting, see @ref{Automatic note
453 splitting}. This mechanism automatically splits long notes, and
454 ties them across bar lines.
456 @cindex ties and chords
457 @cindex chords and ties
459 When a tie is applied to a chord, all note heads whose pitches
460 match are connected. When no note heads match, no ties will be
461 created. Chords may be partially tied by placing the ties inside
464 @lilypond[quote,verbatim]
468 <c~ e g~ b> <c e g b> |
472 @cindex repeating ties
473 @cindex ties, repeating
474 @cindex volta brackets and ties
475 @cindex ties and volta brackets
479 When a second alternative of a repeat starts with a tied note, you
480 have to specify the repeated tie as follows:
482 @lilypond[quote,verbatim]
484 \repeat volta 2 { c'' g <c e>2~ }
486 % First alternative: following note is tied normally
488 % Second alternative: following note has a repeated tie
489 { <c e>2\repeatTie d4 c }
494 @cindex laissez vibrer
495 @cindex ties, laissez vibrer
497 @funindex \laissezVibrer
499 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
500 notes must not be damped at the end. It is used in notation for
501 piano, harp and other string and percussion instruments. They can
502 be entered as follows:
504 @lilypond[quote,verbatim,fragment]
505 <c' f' g'>1\laissezVibrer
508 @cindex ties, placement
512 @funindex \tieNeutral
514 Ties may be made to curve up or down manually; see
515 @ref{Direction and placement}.
517 @cindex ties, appearance
527 Ties may be made dashed, dotted, or a combination of solid and
530 @lilypond[quote, verbatim]
545 Custom dash patterns can be specified:
547 @lilypond[quote, verbatim]
549 \tieDashPattern #0.3 #0.75
551 \tieDashPattern #0.7 #1.5
558 Dash pattern definitions for ties have the same structure as dash
559 pattern definitions for slurs. For more information about complex dash
560 patterns, see @ref{Slurs}.
562 Override @var{whiteout} and @var{layer} layout properties of objects
563 that should cause a gap in ties.
565 @lilypond[verbatim,quote,ragged-right]
567 \override Tie.layer = #-2
568 \override Staff.TimeSignature.layer = #-1
569 \override Staff.KeySignature.layer = #-1
570 \override Staff.TimeSignature.whiteout = ##t
571 \override Staff.KeySignature.whiteout = ##t
585 @code{\tieDashPattern},
586 @code{\tieHalfDashed},
587 @code{\tieHalfSolid},
593 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
594 {using-ties-with-arpeggios.ly}
596 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
597 {engraving-ties-manually.ly}
602 @rglos{laissez vibrer}.
606 @ref{Automatic note splitting}.
609 @rlsr{Expressive marks},
613 @rinternals{LaissezVibrerTie},
614 @rinternals{LaissezVibrerTieColumn},
615 @rinternals{TieColumn},
619 Switching staves when a tie is active will not produce a slanted tie.
621 Changing clefs or ottavations during a tie is not really well-defined.
622 In these cases, a slur may be preferable.
626 @subsection Writing rests
628 Rests are entered as part of the music in music expressions.
633 * Full measure rests::
637 @unnumberedsubsubsec Rests
640 @cindex rest, entering durations
651 Rests are entered like notes with the note name @code{r}.
652 Durations longer than a whole rest use the following predefined
655 @c \time 16/1 is used to avoid spurious bar lines
656 @c and long tracts of empty measures
657 @lilypond[quote,verbatim]
659 % These two lines are just to prettify this example
661 \omit Staff.TimeSignature
662 % Print a maxima rest, equal to four breves
664 % Print a longa rest, equal to two breves
668 r1 r2 r4 r8 r16 r32 r64 r128
672 @cindex rest, multi-measure
673 @cindex rest, whole-measure
675 Whole measure rests, centered in the middle of the measure, must be
676 entered as multi-measure rests. They can be used for a single
677 measure as well as many measures and are discussed in
678 @ref{Full measure rests}.
680 @cindex rest, specifying vertical position
682 To explicitly specify a rest's vertical position, write a note
683 followed by @code{\rest}. A rest of the duration of the note will
684 be placed at the staff position where the note would appear. This
685 allows for precise manual formatting of polyphonic music, since the
686 automatic rest collision formatter will not move these rests.
688 @lilypond[quote,verbatim]
689 \relative { a'4\rest d4\rest }
694 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
704 @ref{Full measure rests}.
713 @c Deliberately duplicated in Durations and Rests. -gp
714 There is no fundamental limit to rest durations (both in terms of
715 longest and shortest), but the number of glyphs is limited: there
716 are rests from 128th to maxima (8× whole).
719 @node Invisible rests
720 @unnumberedsubsubsec Invisible rests
723 @cindex invisible rest
724 @cindex rest, invisible
731 An invisible rest (also called a @q{spacer rest}) can be entered
732 like a note with the note name@tie{}@code{s}:
734 @lilypond[verbatim,quote]
743 Spacer rests are available only in note mode and chord mode. In
744 other situations, for example, when entering lyrics, the
745 command @code{\skip} is used to skip a musical moment.
746 @code{\skip} requires an explicit duration, but this is ignored if
747 the lyrics derive their durations from the notes in an associated
748 melody through @code{\addlyrics} or @code{\lyricsto}.
750 @lilypond[quote,verbatim]
763 Because @code{\skip} is a command, it does not affect the default
764 durations of following notes, unlike@tie{}@code{s}.
766 @lilypond[quote,verbatim]
769 \repeat unfold 8 { a'4 }
779 A spacer rest implicitly causes @code{Staff} and @code{Voice}
780 contexts to be created if none exist, just like notes and rests
783 @lilypond[quote,verbatim]
787 @code{\skip} simply skips musical time; it creates no output of
790 @lilypond[quote,verbatim]
791 % This is valid input, but does nothing
792 { \skip 1 \skip1 \skip 1 }
797 @rlearning{Visibility and color of objects}.
801 @ref{Visibility of objects}.
807 @rinternals{SkipMusic}.
810 @node Full measure rests
811 @unnumberedsubsubsec Full measure rests
813 @cindex multi-measure rests
814 @cindex full-measure rests
815 @cindex rest, multi-measure
816 @cindex rest, full-measure
817 @cindex whole rest for a full measure
818 @cindex rest, whole for a full measure
820 @funindex \compressMMRests
823 Rests for one or more full measures are entered like notes with
824 the note name uppercase @code{R}:
826 @lilypond[quote,verbatim]
827 % Rest measures contracted to single measure
836 The duration of full-measure rests is identical to the duration
837 notation used for notes. The duration in a multi-measure rest must
838 always be an integral number of measure-lengths, so augmentation dots
839 or fractions must often be used:
841 @lilypond[quote,verbatim]
848 R1*13/8 | R1*13/8*12 |
854 A full-measure rest is printed as either a whole or breve rest,
855 centered in the measure, depending on the time signature.
857 @lilypond[quote,verbatim,fragment]
866 @cindex multi-measure rest, expanding
867 @cindex multi-measure rest, contracting
869 By default a multi-measure rest is expanded in the printed score to
870 show all the rest measures explicitly. Alternatively, a multi-measure
871 rest can be shown as a single measure containing a multi-measure rest
872 symbol, with the number of measures of rest printed above the measure:
874 @lilypond[quote,verbatim,fragment]
876 \time 3/4 r2. | R2.*2 |
879 % Rest measures contracted to single measure
883 % Rest measures expanded again
889 @cindex text on multi-measure rest
890 @cindex multi-measure rest, attaching text
891 @cindex script on multi-measure rest
892 @cindex multi-measure rest, script
893 @cindex fermata on multi-measure rest
894 @cindex multi-measure rest, attaching fermata
895 @cindex markup on multi-measure rest
896 @cindex multi-measure rest with markup
898 @funindex \fermataMarkup
899 @funindex MultiMeasureRestText
901 Markups can be added to multi-measure rests.
902 The predefined command @code{\fermataMarkup}
903 is provided for adding fermatas.
905 @lilypond[quote,verbatim]
908 R2.*10^\markup { \italic "ad lib." }
913 @warning{Markups attached to a multi-measure rest are objects of type
914 @code{MultiMeasureRestText}, not @code{TextScript}. Overrides must
915 be directed to the correct object, or they will be ignored. See the
918 @lilypond[quote,verbatim,fragment]
919 % This fails, as the wrong object name is specified
920 \override TextScript.padding = #5
922 % This is the correct object name to be specified
923 \override MultiMeasureRestText.padding = #5
927 When a multi-measure rest immediately follows a @code{\partial}
928 setting, resulting bar-check warnings may not be displayed.
931 @funindex \textLengthOn
932 @funindex \textLengthOff
933 @funindex \fermataMarkup
934 @funindex \compressMMRests
937 @code{\textLengthOn},
938 @code{\textLengthOff},
939 @code{\fermataMarkup},
940 @code{\compressMMRests}.
948 @cindex kirchenpausen
950 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
951 {changing-form-of-multi-measure-rests.ly}
953 @cindex multi-measure rests, positioning
954 @cindex positioning multi-measure rests
956 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
957 {positioning-multi-measure-rests.ly}
959 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
960 {multi-measure-rest-markup.ly}
964 @rglos{multi-measure rest}.
969 @ref{Formatting text},
976 @rinternals{MultiMeasureRest},
977 @rinternals{MultiMeasureRestNumber},
978 @rinternals{MultiMeasureRestText}.
980 @cindex fingerings and multi-measure rests
981 @cindex multi-measure rests and fingerings
984 Fingerings over multi-measure rests (e.g., @code{R1*10-4}) may result
985 in the fingering numeral colliding with the bar counter
988 @cindex condensing rests
989 @cindex rest, condensing ordinary
991 There is no way to automatically condense multiple ordinary rests
992 into a single multi-measure rest.
994 @cindex rest, collisions of
996 Multi-measure rests do not take part in rest collisions.
999 @node Displaying rhythms
1000 @subsection Displaying rhythms
1007 * Polymetric notation::
1008 * Automatic note splitting::
1009 * Showing melody rhythms::
1012 @node Time signature
1013 @unnumberedsubsubsec Time signature
1015 @cindex time signature
1020 The time signature is set as follows:
1022 @lilypond[quote,verbatim,fragment]
1027 Mid-measure time signature changes are covered in @ref{Upbeats}.
1029 @cindex time signature visibility
1031 Time signatures are printed at the beginning of a piece
1032 and whenever the time signature changes. If a change takes place
1033 at the end of a line a warning time signature sign is printed
1034 there. This default behavior may be changed, see
1035 @ref{Visibility of objects}.
1037 @lilypond[quote,verbatim]
1049 @cindex time signature style
1052 @funindex \numericTimeSignature
1053 @funindex \defaultTimeSignature
1055 The time signature symbol that is used in 2/2 and 4/4 time can be
1056 changed to a numeric style:
1058 @lilypond[quote,verbatim]
1063 % Change to numeric style
1064 \numericTimeSignature
1067 % Revert to default style
1068 \defaultTimeSignature
1075 Mensural time signatures are covered in
1076 @ref{Mensural time signatures}.
1078 @cindex time signature default settings
1079 @cindex autobeaming properties for time signatures
1080 @cindex beaming, time signature default properties
1081 @funindex \overrideTimeSignatureSettings
1083 In addition to setting the printed time signature, the @code{\time}
1084 command also sets the values of the time-signature-based properties
1085 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
1086 The predefined default values for these properties can be found in
1087 @file{scm/time-signature-settings.scm}.
1089 The default value of @code{beatStructure} can be overridden in the
1090 @code{\time} command itself by supplying it as the optional first
1093 @lilypond[quote,verbatim]
1098 \repeat unfold 7 { c'8 } |
1100 \repeat unfold 7 { c8 } |
1106 Alternatively, the default values of all these time-signature-based
1107 variables, including @code{baseMoment} and @code{beamExceptions},
1108 can be set together. The values can be set independently for several
1109 different time signatures. The new values take effect when a
1110 subsequent @code{\time} command with the same value of the time
1111 signature is executed:
1113 @lilypond[quote,verbatim]
1117 \overrideTimeSignatureSettings
1118 4/4 % timeSignatureFraction
1119 1/4 % baseMomentFraction
1121 #'() % beamExceptions
1123 \repeat unfold 8 { c8 } |
1129 @code{\overrideTimeSignatureSettings} takes four arguments:
1134 @code{@var{timeSignatureFraction}}, a fraction describing the
1135 time signature to which these values apply.
1138 @code{@var{baseMomentFraction}}, a fraction containing the numerator
1139 and denominator of the basic timing unit for the time signature.
1142 @code{@var{beatStructure}}, a Scheme list indicating the structure
1143 of the beats in the measure, in units of the base moment.
1146 @code{@var{beamExceptions}}, an alist containing any beaming rules
1147 for the time signature that go beyond ending at every beat, as
1148 described in @ref{Setting automatic beam behavior}.
1152 @cindex time signature properties, restoring default values
1153 @cindex restoring default properties for time signatures
1154 @funindex \revertTimeSignatureSettings
1156 Changed values of default time signature properties can be restored
1157 to the original values:
1159 @lilypond[quote,verbatim]
1162 \repeat unfold 8 { c'8 } |
1163 \overrideTimeSignatureSettings
1164 4/4 % timeSignatureFraction
1165 1/4 % baseMomentFraction
1167 #'() % beamExceptions
1169 \repeat unfold 8 { c8 } |
1170 \revertTimeSignatureSettings 4/4
1172 \repeat unfold 8 { c8 } |
1177 Different values of default time signature properties can be established
1178 for different staves by moving the @code{Timing_translator} and the
1179 @code{Default_bar_line_engraver} from the @code{Score} context to the
1180 @code{Staff} context.
1182 @lilypond[quote, verbatim]
1186 \overrideTimeSignatureSettings
1187 4/4 % timeSignatureFraction
1188 1/4 % baseMomentFraction
1190 #'() % beamExceptions
1192 \repeat unfold 8 {c''8}
1195 \overrideTimeSignatureSettings
1196 4/4 % timeSignatureFraction
1197 1/4 % baseMomentFraction
1199 #'() % beamExceptions
1201 \repeat unfold 8 {c''8}
1207 \remove "Timing_translator"
1208 \remove "Default_bar_line_engraver"
1212 \consists "Timing_translator"
1213 \consists "Default_bar_line_engraver"
1219 A further method of changing these time-signature-related variables,
1220 which avoids reprinting the time signature at the time of the change,
1221 is shown in @ref{Setting automatic beam behavior}.
1224 @code{\numericTimeSignature},
1225 @code{\defaultTimeSignature}.
1230 @lilypondfile[verbatim,quote,texidoc,doctitle]
1231 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1235 @rglos{time signature}
1238 @ref{Mensural time signatures},
1239 @ref{Setting automatic beam behavior},
1240 @ref{Time administration}.
1243 @file{scm/time-signature-settings.scm}.
1248 Internals Reference:
1249 @rinternals{TimeSignature},
1250 @rinternals{Timing_translator}.
1253 @node Metronome marks
1254 @unnumberedsubsubsec Metronome marks
1257 @cindex beats per minute
1258 @cindex metronome mark
1259 @cindex metronome marking with text
1263 A basic metronome mark is simple to write:
1265 @lilypond[verbatim,quote]
1273 Metronome marks may also be printed as a range of two numbers:
1275 @lilypond[verbatim,quote]
1283 Tempo indications with text can be used instead:
1285 @lilypond[verbatim,quote]
1293 Combining a metronome mark and text will automatically place the
1294 metronome mark within parentheses:
1296 @lilypond[verbatim,quote]
1298 \tempo "Allegro" 4 = 160
1304 In general, the text can be any markup object:
1306 @lilypond[verbatim,quote]
1308 \tempo \markup { \italic Faster } 4 = 132
1309 a'8-. r8 b-. r gis-. r a-. r
1313 A parenthesized metronome mark with no textual indication may be
1314 written by including an empty string in the input:
1316 @lilypond[verbatim,quote]
1323 @funindex \markLengthOn
1324 @funindex \markLengthOff
1326 In a part for an instrument with long periods of rests,
1327 tempo indications sometimes follow each other closely.
1328 The command @code{\markLengthOn} provides extra horizontal space
1329 to prevent tempo indications from overlapping, and @code{\markLengthOff}
1330 restores the default behavior of ignoring tempo marks
1331 for horizontal spacing.
1333 @lilypond[verbatim,quote]
1336 \tempo "Molto vivace"
1348 @lilypondfile[verbatim,quote,texidoc,doctitle]
1349 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
1351 @c perhaps also an example of how to move it horizontally?
1353 @lilypondfile[verbatim,quote,texidoc,doctitle]
1354 {changing-the-tempo-without-a-metronome-mark.ly}
1356 @lilypondfile[verbatim,quote,texidoc,doctitle]
1357 {creating-metronome-marks-in-markup-mode.ly}
1359 For more details, see @ref{Formatting text}.
1364 @rglos{metronomic indication},
1365 @rglos{tempo indication},
1366 @rglos{metronome mark}.
1369 @ref{Formatting text},
1370 @ref{Creating MIDI output}.
1373 @rlsr{Staff notation}.
1375 Internals Reference:
1376 @rinternals{MetronomeMark}.
1380 @unnumberedsubsubsec Upbeats
1384 @cindex partial measure
1385 @cindex measure, partial
1386 @cindex measure, pickup
1387 @cindex pickup measure
1388 @cindex time signature, mid-measure
1390 @funindex measurePosition
1393 Partial or pick-up measures, such as an @emph{anacrusis} or an
1394 @emph{upbeat}, are entered using the @code{\partial} command:
1397 \partial @var{duration}
1400 When @code{\partial} is used at the beginning of a score,
1401 @code{@var{duration}} is the length of the music preceding the
1404 @lilypond[quote,verbatim]
1408 r4 e'8 | a4 c8 b c4 |
1412 When @code{\partial} is used after the beginning of a score,
1413 @code{@var{duration}} is the @emph{remaining} length of the
1414 current measure. It does not create a new numbered bar.
1416 @lilypond[quote,verbatim]
1418 \set Score.barNumberVisibility = #all-bar-numbers-visible
1419 \override Score.BarNumber.break-visibility =
1420 #end-of-line-invisible
1422 d''4.~ 4 d8 d( c) b | c4.~ 4. \bar "||"
1425 c8( d) e | f2.~ 4 f8 a,( c) f |
1429 The @code{\partial} command is @emph{required} when the time
1430 signature changes in mid measure, but it may also be used alone.
1432 @lilypond[quote,verbatim]
1434 \set Score.barNumberVisibility = #all-bar-numbers-visible
1435 \override Score.BarNumber.break-visibility =
1436 #end-of-line-invisible
1439 e'8 | a4 c8 b[ c b] |
1441 r8 e,8 | a4 \bar "||"
1448 The @code{\partial} command sets the @code{Timing.measurePosition}
1449 property, which is a rational number that indicates how much of
1450 the measure has passed.
1463 @rinternals{Timing_translator}.
1466 @node Unmetered music
1467 @unnumberedsubsubsec Unmetered music
1470 @cindex cadenza, beams
1471 @cindex cadenza, accidentals
1472 @cindex cadenza, bar lines
1473 @cindex cadenza, bar numbers
1474 @cindex unmetered music
1475 @cindex unmetered music, beams
1476 @cindex unmetered music, accidentals
1477 @cindex unmetered music, bar lines
1478 @cindex unmetered music, bar numbers
1479 @cindex accidentals, cadenzas
1480 @cindex accidentals, unmetered music
1481 @cindex bar lines, cadenzas
1482 @cindex bar lines, unmetered music
1483 @cindex bar numbers, cadenzas
1484 @cindex bar numbers, unmetered music
1485 @cindex beams, cadenzas
1486 @cindex beams, unmetered music
1488 @funindex \cadenzaOn
1489 @funindex \cadenzaOff
1491 In metered music bar lines are inserted and bar numbers are calculated
1492 automatically. In unmetered music (i.e., cadenzas), this is not
1493 desirable and can be @q{switched off} using the command
1494 @code{\cadenzaOn}, then @q{switched back on} at the appropriate place
1495 using @code{\cadenzaOff}.
1497 @lilypond[verbatim,quote]
1501 c4 c d8[ d d] f4 g4.
1508 Bar numbering is resumed at the end of the cadenza.
1510 @lilypond[verbatim,quote]
1512 % Show all bar numbers
1513 \override Score.BarNumber.break-visibility = #all-visible
1516 c4 c d8[ d d] f4 g4.
1523 Inserting a @code{\bar} command within a cadenza does not start a new
1524 measure, even if a bar line is printed. So any accidentals -- which
1525 are usually assumed to remain in force until the end of the measure --
1526 will still be valid after the bar line printed by @code{\bar}. If
1527 subsequent accidentals should be printed, forced accidentals or
1528 reminder accidentals need to be inserted manually, see
1531 @lilypond[verbatim,quote]
1537 % First cis is printed without alteration even if it's after a \bar
1544 Automatic beaming is disabled by @code{\cadenzaOn}. Therefore, all
1545 beaming in cadenzas must be entered manually. See @ref{Manual beams}.
1547 @lilypond[verbatim,quote]
1549 \repeat unfold 8 { c''8 }
1555 \repeat unfold 8 { c8 }
1559 These predefined commands affect all staves in the score, even when
1560 placed in just one @code{Voice} context. To change this, move the
1561 @code{Timing_translator} from the @code{Score} context to the
1562 @code{Staff} context. See @ref{Polymetric notation}.
1574 @ref{Visibility of objects},
1575 @ref{Polymetric notation},
1582 @cindex cadenza, line breaks
1583 @cindex cadenza, page breaks
1584 @cindex unmetered music, line breaks
1585 @cindex unmetered music, page breaks
1586 @cindex breaks in unmetered music
1587 @cindex line breaks, cadenzas
1588 @cindex page breaks, cadenzas
1589 @cindex line breaks, unmetered music
1590 @cindex page breaks, unmetered music
1593 Automatic line and page breaks are inserted only at bar lines, so
1594 @q{invisible} bar lines will need to be inserted manually in long
1595 stretches of unmetered music to permit breaking:
1602 @node Polymetric notation
1603 @unnumberedsubsubsec Polymetric notation
1605 @c This section necessarily uses \set
1606 @c This is acceptable -td
1608 @cindex double time signatures
1609 @cindex signatures, polymetric
1610 @cindex time signature, polymetric
1611 @cindex time signature, double
1612 @cindex polymetric signatures
1613 @cindex meter, polymetric
1615 @funindex timeSignatureFraction
1616 @funindex \scaleDurations
1619 Polymetric notation is supported explicitly or by manually modifying the
1620 visible time signature symbol and/or scaling note durations.
1622 @subsubsubheading Different time signatures with equal-length measures
1624 Set a common time signature for each staff, and set the
1625 @code{timeSignatureFraction} to the desired fraction. Then use the
1626 @code{\scaleDurations} function to scale the durations of the notes in
1627 each staff to the common time signature.
1629 @cindex beams, with polymetric meters
1630 @cindex polymetric meters, with beams
1632 In the following example, music with the time signatures of 3/4, 9/8 and
1633 10/8 are used in parallel. In the second staff, shown durations are
1634 multiplied by 2/3 (because 2/3 * 9/8 = 3/4) and in the third staff, the
1635 shown durations are multiplied by 3/5 (because 3/5 * 10/8 = 3/4). It
1636 may be necessary to insert beams manually, as the duration scaling will
1637 affect the autobeaming rules.
1639 @lilypond[quote,verbatim]
1648 \set Staff.timeSignatureFraction = 9/8
1650 \repeat unfold 6 { c8[ c c] }
1654 \set Staff.timeSignatureFraction = 10/8
1655 \scaleDurations 3/5 {
1656 \repeat unfold 2 { c8[ c c] }
1657 \repeat unfold 2 { c8[ c] } |
1658 c4. c \tuplet 3/2 { c8[ c c] } c4
1664 @subsubsubheading Different time signatures with unequal-length measures
1666 Each staff can be given its own independent time signature by
1667 moving the @code{Timing_translator} and the
1668 @code{Default_bar_line_engraver} to the @code{Staff} context.
1670 @lilypond[quote,verbatim]
1674 \remove "Timing_translator"
1675 \remove "Default_bar_line_engraver"
1679 \consists "Timing_translator"
1680 \consists "Default_bar_line_engraver"
1684 % Now each staff has its own time signature.
1708 @funindex \compoundMeter
1709 @cindex compound time signatures
1710 @cindex time signature, compound
1712 @subsubsubheading Compound time signatures
1714 These are created using the @code{\compoundMeter} function. The syntax
1718 \compoundMeter #'(list of lists)
1721 The simplest construction is a single list, where the @emph{last} number
1722 indicates the bottom number of the time signature and those that come
1723 before it, the top numbers.
1725 @lilypond[quote,verbatim]
1727 \compoundMeter #'((2 2 2 8))
1728 \repeat unfold 6 c'8 \repeat unfold 12 c16
1732 More complex meters can be constructed using additional lists. Also,
1733 automatic beaming settings will be adjusted depending on the values.
1735 @lilypond[quote,verbatim]
1737 \compoundMeter #'((1 4) (3 8))
1738 \repeat unfold 5 c'8 \repeat unfold 10 c16
1742 \compoundMeter #'((1 2 3 8) (3 4))
1743 \repeat unfold 12 c'8
1750 @rglos{polymetric time signature},
1754 @ref{Automatic beams},
1756 @ref{Time signature},
1757 @ref{Scaling durations}.
1762 Internals Reference:
1763 @rinternals{TimeSignature},
1764 @rinternals{Timing_translator},
1765 @rinternals{Default_bar_line_engraver},
1769 When using different time signatures in parallel, notes at the same
1770 moment will be placed at the same horizontal location. However, the bar
1771 lines in the different staves will cause the note spacing to be less
1772 regular in each of the individual staves than would be normal without
1773 the different time signatures.
1776 @node Automatic note splitting
1777 @unnumberedsubsubsec Automatic note splitting
1779 @cindex notes, splitting
1780 @cindex splitting notes
1781 @cindex rests, splitting
1782 @cindex splitting rests
1784 @funindex Note_heads_engraver
1785 @funindex Completion_heads_engraver
1786 @funindex Completion_rest_engraver
1788 Long notes which overrun bar lines can be converted automatically to
1789 tied notes. This is done by replacing the @code{Note_heads_engraver}
1790 with the @code{Completion_heads_engraver}. Similarly, long rests which
1791 overrun bar lines are split automatically by replacing the
1792 @code{Rest_engraver} with the @code{Completion_rest_engraver}. In the
1793 following example, notes and rests crossing the bar lines are split,
1794 notes are also tied.
1796 @lilypond[quote,verbatim]
1798 \remove "Note_heads_engraver"
1799 \consists "Completion_heads_engraver"
1800 \remove "Rest_engraver"
1801 \consists "Completion_rest_engraver"
1804 c'2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 r1*2
1808 These engravers split all running notes and rests at the bar line, and
1809 inserts ties for notes. One of its uses is to debug complex scores: if
1810 the measures are not entirely filled, then the ties show exactly how
1811 much each measure is off.
1813 The property @code{completionUnit} sets a preferred duration for
1816 @lilypond[quote,verbatim]
1818 \remove "Note_heads_engraver"
1819 \consists "Completion_heads_engraver"
1821 \time 9/8 g\breve. d''4. \bar "||"
1822 \set completionUnit = #(ly:make-moment 3 8)
1827 These engravers split notes with scaled duration, such as those in tuplets,
1828 into notes with the same scale-factor as in the input note.
1830 @lilypond[quote,verbatim]
1832 \remove "Note_heads_engraver"
1833 \consists "Completion_heads_engraver"
1836 \tuplet 3/2 {g'4 a b}
1837 \scaleDurations 2/3 {g a b}
1839 \tuplet 3/2 {g4 a b}
1849 @rlearning{Engravers explained},
1850 @rlearning{Adding and removing engravers}.
1855 Internals Reference:
1856 @rinternals{Note_heads_engraver},
1857 @rinternals{Completion_heads_engraver},
1858 @rinternals{Rest_engraver},
1859 @rinternals{Completion_rest_engraver},
1860 @rinternals{Forbid_line_break_engraver}.
1863 For consistency with previous behavior, notes and rests with
1864 duration longer than a measure, such as @code{c1*2}, are split into
1865 notes without any scale factor, @code{@{ c1 c1 @}}. The property
1866 @code{completionFactor} controls this behavior, and setting it to
1867 @code{#f} cause split notes and rests to have the scale factor
1868 of the input durations.
1871 @node Showing melody rhythms
1872 @unnumberedsubsubsec Showing melody rhythms
1874 @cindex melody rhythms, showing
1875 @cindex rhythms, showing melody
1877 Sometimes you might want to show only the rhythm of a melody. This
1878 can be done with the rhythmic staff. All pitches of notes on such a
1879 staff are squashed, and the staff itself has a single line
1881 @lilypond[quote,verbatim]
1883 \new RhythmicStaff {
1884 \new Voice = "myRhythm" \relative {
1892 \lyricsto "myRhythm" {
1900 @cindex guitar chord charts
1901 @cindex strumming rhythms, showing
1902 @cindex guitar strumming rhythms, showing
1904 @funindex Pitch_squash_engraver
1905 @funindex \improvisationOn
1906 @funindex \improvisationOff
1908 Guitar chord charts often show the strumming rhythms. This can
1909 be done with the @code{Pitch_squash_engraver} and
1910 @code{\improvisationOn}.
1913 @lilypond[quote,verbatim]
1921 \consists "Pitch_squash_engraver"
1934 @code{\improvisationOn},
1935 @code{\improvisationOff}.
1941 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1942 {guitar-strum-rhythms.ly}
1948 Internals Reference:
1949 @rinternals{RhythmicStaff},
1950 @rinternals{Pitch_squash_engraver}.
1958 * Setting automatic beam behavior::
1963 @node Automatic beams
1964 @unnumberedsubsubsec Automatic beams
1966 By default, beams are inserted automatically:
1968 @cindex beams, manual
1969 @cindex manual beams
1970 @cindex beams, customizing rules
1972 @funindex \autoBeamOn
1973 @funindex \autoBeamOff
1975 @lilypond[quote,verbatim]
1978 \time 6/8 c8 c c c8. c16 c8
1982 If these automatic decisions are not satisfactory, beaming can be
1983 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1984 entered manually if beams are to be extended over rests.
1986 If automatic beaming is not required, it may be turned off with
1987 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1989 @lilypond[quote,verbatim]
1991 c4 c8 c8. c16 c8. c16 c8
1999 @cindex melismata, with beams
2000 @cindex beams, with melismata
2002 @warning{If beams are used to indicate melismata in songs, then
2003 automatic beaming should be switched off with @code{@bs{}autoBeamOff}
2004 and the beams indicated manually. Using @code{@bs{}partcombine} with
2005 @code{@bs{}autoBeamOff} can produce unintended results. See the
2006 snippets for more information.}
2008 Beaming patterns that differ from the automatic defaults can be
2009 created; see @ref{Setting automatic beam behavior}.
2012 @code{\autoBeamOff},
2016 @cindex beams, line breaks
2017 @cindex line breaks, beams
2018 @cindex beams, with knee gap
2019 @cindex knee gap, with beams
2023 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2024 {beams-across-line-breaks.ly}
2026 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2027 {changing-beam-knee-gap.ly}
2029 @cindex beams, \partcombine with \autoBeamOff
2030 @cindex voices, \partcombine with \autoBeamOff
2032 @lilypondfile [verbatim, quote, ragged-right, texidoc, doctitle]
2033 {partcombine-and-autobeamoff.ly}
2038 @ref{Setting automatic beam behavior}.
2041 @file{scm/auto-beam.scm}.
2046 Internals Reference:
2047 @rinternals{Auto_beam_engraver},
2048 @rinternals{Beam_engraver},
2050 @rinternals{BeamEvent},
2051 @rinternals{BeamForbidEvent},
2052 @rinternals{beam-interface},
2053 @rinternals{unbreakable-spanner-interface}.
2056 The properties of a beam are determined at the @emph{start} of its
2057 construction and any additional beam-property changes that occur before
2058 the beam has been completed will not take effect until the @emph{next},
2062 @node Setting automatic beam behavior
2063 @unnumberedsubsubsec Setting automatic beam behavior
2065 @cindex beams, with lyrics
2066 @cindex lyrics, with beams
2068 @funindex autoBeaming
2069 @funindex baseMoment
2070 @funindex \beamExceptions
2071 @funindex beatStructure
2072 @funindex measureLength
2076 When automatic beaming is enabled, the placement of automatic beams
2077 is determined by three context properties:
2078 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2079 The default values of these variables may be overridden as described
2080 below, or alternatively the default values themselves may be changed
2081 as explained in @ref{Time signature}.
2083 If a @code{beamExceptions} rule is defined for the time signature in
2084 force, that rule alone is used to determine the beam placement; the
2085 values of @code{baseMoment} and @code{beatStructure} are ignored.
2087 If no @code{beamExceptions} rule is defined for the time signature
2088 in force, the beam placement is determined by the values of
2089 @code{baseMoment} and @code{beatStructure}.
2092 @subsubsubheading Beaming based on @code{baseMoment} and @code{beatStructure}
2094 By default, @code{beamExceptions} rules are defined for most common
2095 time signatures, so the @code{beamExceptions} rules must be disabled
2096 if automatic beaming is to be based on @code{baseMoment} and
2097 @code{beatStructure}. The @code{beamExceptions} rules are disabled
2101 \set Timing.beamExceptions = #'()
2104 When @code{beamExceptions} is set to @code{#'()}, either due to an
2105 explicit setting or because no @code{beamExceptions} rules are defined
2106 internally for the time signature in force, the ending points for
2107 beams are on beats as specified by the context properties
2108 @code{baseMoment} and @code{beatStructure}. @code{beatStructure} is
2109 a scheme list that defines the length of each beat in the measure in
2110 units of @code{baseMoment}. By default, @code{baseMoment} is one
2111 over the denominator of the time signature. By default, each unit of
2112 length @code{baseMoment} is a single beat.
2114 Note that there are separate @code{beatStructure} and @code{baseMoment}
2115 values for each time signature. Changes to these variables apply only
2116 to the time signature that is currently in force, hence those changes
2117 must be placed after the @code{\time} command which starts a new time
2118 signature section, not before it. New values given to a particular
2119 time signature are retained and reinstated whenever that time signature
2122 @lilypond[quote,verbatim]
2125 c16^"default" c c c c |
2126 % beamExceptions are unlikely to be defined for 5/16 time,
2127 % but let's disable them anyway to be sure
2128 \set Timing.beamExceptions = #'()
2129 \set Timing.beatStructure = 2,3
2130 c16^"(2+3)" c c c c |
2131 \set Timing.beatStructure = 3,2
2132 c16^"(3+2)" c c c c |
2136 @lilypond[quote,verbatim]
2139 a'8^"default" a a a a a a a
2140 % Disable beamExceptions because they are definitely
2141 % defined for 4/4 time
2142 \set Timing.beamExceptions = #'()
2143 \set Timing.baseMoment = #(ly:make-moment 1/4)
2144 \set Timing.beatStructure = 1,1,1,1
2145 a8^"changed" a a a a a a a
2149 Beam setting changes can be limited to specific contexts. If no
2150 setting is included in a lower-level context, the setting of the
2151 enclosing context will apply.
2153 @lilypond[quote, verbatim]
2156 % No need to disable beamExceptions
2157 % as they are not defined for 7/8 time
2158 \set Staff.beatStructure = 2,3,2
2168 \set Voice.beatStructure = 1,3,3
2176 When multiple voices are used the @code{Staff} context must be
2177 specified if the beaming is to be applied to all voices in the
2180 @lilypond[quote,verbatim,fragment]
2183 % Change applied to Voice by default -- does not work correctly
2184 % Because of autogenerated voices, all beating will
2185 % be at baseMoment (1 . 8)
2186 \set beatStructure = 3,1,1,2
2187 << \relative {a'8 a a a16 a a a a8 a} \\ \relative {f'4. f8 f f f} >>
2189 % Works correctly with context Staff specified
2190 \set Staff.beatStructure = 3,1,1,2
2191 << \relative {a'8 a a a16 a a a a8 a} \\ \relative {f'4. f8 f f f} >>
2194 The value of @code{baseMoment} can be adjusted to change
2195 the beaming behavior, if desired. When this is done,
2196 the value of @code{beatStructure} must be set to be
2197 compatible with the new value of @code{baseMoment}.
2199 @lilypond[quote,verbatim,fragment]
2201 % No need to disable beamExceptions
2202 % as they are not defined for 5/8 time
2203 \set Timing.baseMoment = #(ly:make-moment 1/16)
2204 \set Timing.beatStructure = 7,3
2205 \repeat unfold 10 { a'16 }
2208 @code{baseMoment} is a @i{moment}; a unit of musical duration. A
2209 quantity of type @i{moment} is created by the scheme function
2210 @code{ly:make-moment}. For more information about this function,
2211 see @ref{Time administration}.
2213 By default @code{baseMoment} is set to one over the denominator of
2214 the time signature. Any exceptions to this default can be found in
2215 @file{scm/time-signature-settings.scm}.
2217 @subsubsubheading Beaming based on @code{beamExceptions}
2219 Special autobeaming rules (other than ending a beam on a beat)
2220 are defined in the @code{beamExceptions} property.
2222 The value for @code{beamExceptions}, a somewhat complex Scheme
2223 data structure, is easiest generated with the
2224 @code{\beamExceptions} function. This function is given one or
2225 more manually beamed measure-length rhythmic patterns (measures
2226 have to be separated by a bar check@tie{}@code{|} since the
2227 function has no other way to discern the measure length). Here is
2230 @lilypond[quote,verbatim]
2233 \set Timing.beatStructure = 2,1
2234 \set Timing.beamExceptions =
2235 \beamExceptions { 32[ 32] 32[ 32] 32[ 32] }
2237 \repeat unfold 6 { c32 } |
2241 @warning{A @code{beamExceptions} value must be @emph{complete}
2242 exceptions list. That is, every exception that should be applied
2243 must be included in the setting. It is not possible to add, remove,
2244 or change only one of the exceptions. While this may seem cumbersome,
2245 it means that the current beaming settings need not be known in order
2246 to specify a new beaming pattern.}
2248 When the time signature is changed, default values of
2249 @code{Timing.baseMoment}, @code{Timing.beatStructure},
2250 and @code{Timing.beamExceptions} are set. Setting the time signature
2251 will reset the automatic beaming settings for the @code{Timing}
2252 context to the default behavior.
2254 @lilypond[quote,verbatim]
2257 \repeat unfold 6 { a8 }
2259 \set Timing.beatStructure = 4,2
2260 \repeat unfold 6 { a8 }
2261 % go back to default behavior
2263 \repeat unfold 6 { a8 }
2267 The default automatic beaming settings for a time signature
2268 are determined in @file{scm/time-signature-settings.scm}.
2269 Changing the default automatic beaming settings
2270 for a time signature is described in @ref{Time signature}.
2272 Many automatic beaming settings for a time signature contain an
2273 entry for @code{beamExceptions}. For example, 4/4 time tries to
2274 beam the measure in two if there are only eighth notes. The
2275 @code{beamExceptions} rule can override the @code{beatStructure} setting
2276 if @code{beamExceptions} is not reset.
2278 @lilypond[quote,verbatim,fragment]
2280 \set Timing.baseMoment = #(ly:make-moment 1/8)
2281 \set Timing.beatStructure = 3,3,2
2282 % This won't beam (3 3 2) because of beamExceptions
2283 \repeat unfold 8 {c''8} |
2284 % This will beam (3 3 2) because we clear beamExceptions
2285 \set Timing.beamExceptions = #'()
2286 \repeat unfold 8 {c''8}
2289 In a similar fashion, eighth notes in 3/4 time are beamed as a full
2290 measure by default. To beam eighth notes in 3/4 time on the beat,
2291 reset @code{beamExceptions}.
2293 @lilypond[quote,verbatim,fragment]
2295 % by default we beam in (6) due to beamExceptions
2296 \repeat unfold 6 {a'8} |
2297 % This will beam (1 1 1) due to default baseMoment and beatStructure
2298 \set Timing.beamExceptions = #'()
2299 \repeat unfold 6 {a'8}
2302 In engraving from the Romantic and Classical periods,
2303 beams often begin midway through the measure in 3/4 time,
2304 but modern practice is to avoid the false impression of 6/8 time
2305 (see Gould, p. 153). Similar situations arise in 3/8 time.
2306 This behavior is controlled by the context property @code{beamHalfMeasure},
2307 which has effect only in time signatures with 3 in the numerator:
2309 @lilypond[quote,verbatim]
2313 \set Timing.beamHalfMeasure = ##f
2318 @subsubsubheading How automatic beaming works
2320 When automatic beaming is enabled, the placement of automatic beams
2321 is determined by the context properties
2322 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2324 The following rules, in order of priority, apply when determining
2325 the appearance of beams:
2329 If a manual beam is specified with @code{[@dots{}]} set the beam
2330 as specified, otherwise
2333 if a beam-ending rule is defined in @code{beamExceptions}
2334 for the beam-type, use it to determine the valid places where
2335 beams may end, otherwise
2338 if a beam-ending rule is defined in @code{beamExceptions}
2339 for a longer beam-type, use it to determine the valid places
2340 where beams may end, otherwise
2343 use the values of @code{baseMoment} and @code{beatStructure} to
2344 determine the ends of the beats in the measure, and
2345 end beams at the end of beats.
2349 In the rules above, the @emph{beam-type} is the duration of the
2350 shortest note in the beamed group.
2352 The default beaming rules can be found in
2353 @file{scm/time-signature-settings.scm}.
2357 @cindex beams, subdividing
2359 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2360 {subdividing-beams.ly}
2362 @cindex beamlets, orienting
2364 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2365 {strict-beat-beaming.ly}
2367 @cindex measure groupings
2368 @cindex beats, grouping
2369 @cindex grouping beats
2370 @cindex measure sub-grouping
2372 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2373 {conducting-signs,-measure-grouping-signs.ly}
2375 @cindex beam, endings in a score
2376 @cindex beam, endings with multiple voices
2378 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2379 {beam-endings-in-score-context.ly}
2383 @ref{Time signature}.
2386 @file{scm/time-signature-settings.scm}.
2391 Internals Reference:
2392 @rinternals{Auto_beam_engraver},
2394 @rinternals{BeamForbidEvent},
2395 @rinternals{beam-interface}.
2398 If a score ends while an automatic beam has not been ended and is
2399 still accepting notes, this last beam will not be typeset at all.
2400 The same holds for polyphonic voices, entered with
2401 @code{<< @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
2402 automatic beam is still accepting notes, it is not typeset.
2403 The workaround for these problems is to manually beam the last
2404 beam in the voice or score.
2406 By default, the @code{Timing} translator is aliased to the
2407 @code{Score} context. This means that setting the time signature
2408 in one staff will affect the beaming of the other staves as well.
2409 Thus, a time signature setting in a later staff will reset custom
2410 beaming that was set in an earlier staff.
2411 One way to avoid this problem is to set the time signature
2414 @lilypond[quote,verbatim]
2418 \set Timing.baseMoment = #(ly:make-moment 1/8)
2419 \set Timing.beatStructure = 1,5
2420 \set Timing.beamExceptions = #'()
2421 \repeat unfold 6 { a'8 }
2424 \repeat unfold 6 { a'8 }
2429 The default beam settings for the time signature can also be changed, so
2430 that the desired beaming will always be used. Changes in automatic
2431 beaming settings for a time signature are described in
2432 @ref{Time signature}.
2434 @lilypond[quote,verbatim]
2437 \overrideTimeSignatureSettings
2438 3/4 % timeSignatureFraction
2439 1/8 % baseMomentFraction
2441 #'() % beamExceptions
2443 \repeat unfold 6 { a'8 }
2447 \repeat unfold 6 { a'8 }
2454 @unnumberedsubsubsec Manual beams
2456 @cindex beams, manual
2457 @cindex manual beams
2462 In some cases it may be necessary to override the automatic
2463 beaming algorithm. For example, the autobeamer will not put beams
2464 over rests or bar lines, and in choral scores the beaming is
2465 often set to follow the meter of the lyrics rather than the
2466 notes. Such beams can be specified manually by
2467 marking the begin and end point with @code{[} and @code{]}.
2469 @lilypond[quote,verbatim]
2470 \relative { r4 r8[ g' a r] r g[ | a] r }
2473 @cindex manual beams, direction shorthand for
2474 @cindex manual beams, grace notes
2476 Beaming direction can be set manually using direction indicators:
2478 @lilypond[quote,verbatim]
2479 \relative { c''8^[ d e] c,_[ d e f g] }
2484 Individual notes may be marked with @code{\noBeam} to prevent them
2487 @lilypond[quote,verbatim]
2494 Grace note beams and normal note beams can occur simultaneously.
2495 Unbeamed grace notes are not put into normal note beams.
2497 @lilypond[quote,verbatim]
2500 \grace { e32 d c d }
2507 @funindex stemLeftBeamCount
2508 @funindex stemRightBeamCount
2510 Even more strict manual control with the beams can be achieved by
2511 setting the properties @code{stemLeftBeamCount} and
2512 @code{stemRightBeamCount}. They specify the number of beams to
2513 draw on the left and right side, respectively, of the next note.
2514 If either property is set, its value will be used only once, and
2515 then it is erased. In this example, the last @code{f} is printed
2516 with only one beam on the left side, i.e., the eighth-note beam of
2517 the group as a whole.
2519 @lilypond[quote,verbatim]
2523 \set stemLeftBeamCount = #2
2524 \set stemRightBeamCount = #1
2526 \set stemLeftBeamCount = #1
2539 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2540 {flat-flags-and-beam-nibs.ly}
2544 @ref{Direction and placement},
2550 Internals Reference:
2552 @rinternals{BeamEvent},
2553 @rinternals{Beam_engraver},
2554 @rinternals{beam-interface},
2555 @rinternals{Stem_engraver}.
2558 @node Feathered beams
2559 @unnumberedsubsubsec Feathered beams
2561 @cindex beams, feathered
2562 @cindex feathered beams
2564 @funindex \featherDurations
2565 @funindex grow-direction
2567 Feathered beams are used to indicate that a small group of notes
2568 should be played at an increasing (or decreasing) tempo, without
2569 changing the overall tempo of the piece. The extent of the
2570 feathered beam must be indicated manually using @code{[} and
2571 @code{]}, and the beam feathering is turned on by specifying a
2572 direction to the @code{Beam} property @code{grow-direction}.
2574 If the placement of the notes and the sound in the MIDI output is to
2575 reflect the @emph{ritardando} or @emph{accelerando} indicated by the
2576 feathered beam the notes must be grouped as a music expression delimited
2577 by braces and preceded by a @code{featherDurations} command which specifies
2578 the ratio between the durations of the first and last notes in the
2581 The square brackets show the extent of the beam and the braces show
2582 which notes are to have their durations modified. Normally these
2583 would delimit the same group of notes, but this is not required: the
2584 two commands are independent.
2586 In the following example the eight 16th notes occupy exactly the
2587 same time as a half note, but the first note is one half as long
2588 as the last one, with the intermediate notes gradually
2589 lengthening. The first four 32nd notes gradually speed up, while
2590 the last four 32nd notes are at a constant tempo.
2592 @lilypond[verbatim,quote]
2594 \override Beam.grow-direction = #LEFT
2595 \featherDurations #(ly:make-moment 2/1)
2596 { c16[ c c c c c c c] }
2597 \override Beam.grow-direction = #RIGHT
2598 \featherDurations #(ly:make-moment 2/3)
2600 % revert to non-feathered beams
2601 \override Beam.grow-direction = #'()
2607 The spacing in the printed output represents the
2608 note durations only approximately, but the MIDI output is exact.
2611 @code{\featherDurations}.
2619 The @code{\featherDurations} command only works with very short
2620 music snippets, and when numbers in the fraction are small.
2629 * Bar and bar number checks::
2634 @unnumberedsubsubsec Bar lines
2637 @cindex measure lines
2638 @cindex closing bar lines
2639 @cindex bar lines, closing
2640 @cindex double bar lines
2641 @cindex bar lines, double
2646 Bar lines delimit measures, and are also used to indicate
2647 repeats. Normally, simple bar lines are automatically inserted
2648 into the printed output at places based on the current time
2651 The simple bar lines inserted automatically can be changed to
2652 other types with the @code{\bar} command. For example, a closing
2653 double bar line is usually placed at the end of a piece:
2655 @lilypond[quote,verbatim]
2656 \relative { e'4 d c2 \bar "|." }
2659 It is not invalid if the final note in a measure does not
2660 end on the automatically entered bar line: the note is assumed
2661 to carry over into the next measure. But if a long sequence
2662 of such carry-over measures appears the music can appear compressed
2663 or even flowing off the page. This is because automatic line
2664 breaks happen only at the end of complete measures, i.e., where
2665 all notes end before the end of a measure.
2667 @warning{An incorrect duration can cause line breaks to be
2668 inhibited, leading to a line of highly compressed music or
2669 music that flows off the page.}
2672 @cindex bar lines, invisible
2673 @cindex measure lines, invisible
2675 Line breaks are also permitted at manually inserted bar lines
2676 even within incomplete measures. To allow a line break without
2677 printing a bar line, use the following:
2684 This will insert an invisible bar line and allow (but not
2685 force) a line break to occur at this point. The bar number
2686 counter is not increased. To force a line break see
2687 @ref{Line breaking}.
2689 @cindex manual bar lines
2690 @cindex manual measure lines
2691 @cindex bar lines, manual
2692 @cindex measure lines, manual
2694 This and other special bar lines may be inserted manually at any
2695 point. When they coincide with the end of a measure they replace
2696 the simple bar line which would have been inserted there
2697 automatically. When they do not coincide with the end of a measure
2698 the specified bar line is inserted at that point in the printed
2701 Note that manual bar lines are purely visual. They do not affect
2702 any of the properties that a normal bar line would affect, such as
2703 measure numbers, accidentals, line breaks, etc. They do not affect
2704 the calculation and placement of subsequent automatic bar lines.
2705 When a manual bar line is placed where a normal bar line already
2706 exists, the effects of the original bar line are not altered.
2708 Two types of simple bar lines and five types of double bar lines are
2709 available for manual insertion:
2711 @lilypond[quote,verbatim]
2725 together with dotted and dashed bar lines:
2727 @lilypond[quote,verbatim]
2736 and nine types of repeat bar lines:
2738 @lilypond[quote,verbatim]
2753 Additionally, a bar line can be printed as a simple tick:
2754 @lilypond[quote,fragment,verbatim]
2757 However, as such ticks are typically used in Gregorian chant, it is
2758 preferable to use @code{\divisioMinima} there instead, described in
2759 the section @ref{Divisiones} in Gregorian chant.
2761 LilyPond supports kievan notation and provides a special kievan
2763 @lilypond[quote,fragment,verbatim]
2766 Further details of this notation are explained in
2767 @ref{Typesetting Kievan square notation}.
2771 For in-line segno signs, there are three types of bar lines which
2772 differ in their behavior at line breaks:
2774 @lilypond[quote,verbatim]
2794 Although the bar line types signifying repeats may be inserted
2795 manually they do not in themselves cause LilyPond to recognize
2796 a repeated section. Such repeated sections are better entered
2797 using the various repeat commands (see @ref{Repeats}), which
2798 automatically print the appropriate bar lines.
2800 In addition, you can specify @code{".|:-||"}, which is equivalent to
2801 @code{".|:"} except at line breaks, where it gives a double bar
2802 line at the end of the line and a start repeat at the beginning of
2805 @lilypond[quote,verbatim]
2815 For combinations of repeats with the segno sign, there are six different
2818 @lilypond[quote,verbatim]
2848 Additionally there is an @code{\inStaffSegno} command which creates
2849 a segno bar line in conjunction with an appropriate repeat bar line
2850 when used with a @code{\repeat volta} command, see
2851 @ref{Normal repeats}.
2853 @funindex \defineBarLine
2854 @cindex bar lines, defining
2855 @cindex defining bar lines
2857 New bar line types can be defined with @code{\defineBarLine}:
2860 \defineBarLine @var{bartype} #'(@var{end} @var{begin} @var{span})
2863 The @code{\defineBarline} variables can include the
2864 @q{empty} string @code{""}, which is equivalent to an invisible
2865 bar line being printed. Or they can be set to @code{#f} which
2866 prints no bar line at all.
2868 After the definiton, the new bar line can be used by
2869 @code{\bar} @var{bartype}.
2871 There are currently ten bar line elements available:
2873 @lilypond[quote,verbatim]
2874 \defineBarLine ":" #'("" ":" "")
2875 \defineBarLine "=" #'("=" "" "")
2876 \defineBarLine "[" #'("" "[" "")
2877 \defineBarLine "]" #'("]" "" "")
2894 The @code{"="} bar line provides the double span bar line, used
2895 in combination with the segno sign. Do not use it as a standalone
2896 double thin bar line; here, @code{\bar} @var{"||"} is
2899 The @code{"-"} sign starts annotations to bar lines which
2900 are useful to distinguish those with identical appearance
2901 but different behavior at line breaks and/or different span bars.
2902 The part following the @code{"-"} sign is not used for building up
2905 @lilypond[quote,verbatim]
2906 \defineBarLine "||-dashedSpan" #'("||" "" "!!")
2909 \new Staff \relative c'' {
2911 c1 \bar "||-dashedSpan"
2914 \new Staff \relative c'' {
2922 Furthermore, the space character @code{" "} serves as a placeholder
2923 for defining span bars correctly aligned to the main bar lines:
2925 @lilypond[quote,verbatim]
2926 \defineBarLine ":|.-wrong" #'(":|." "" "|.")
2927 \defineBarLine ":|.-right" #'(":|." "" " |.")
2930 \new Staff \relative c'' {
2935 \new Staff \relative c'' {
2943 If additional elements are needed, LilyPond provides a simple
2944 way to define them. For more information on modifying or adding
2945 bar lines, see file @file{scm/bar-line.scm}.
2947 In scores with many staves, a @code{\bar} command in one staff is
2948 automatically applied to all staves. The resulting bar lines are
2949 connected between different staves of a @code{StaffGroup},
2950 @code{PianoStaff}, or @code{GrandStaff}.
2952 @lilypond[quote,verbatim]
2955 \new Staff \relative {
2960 \new Staff \relative { \clef bass c'4 g e g }
2962 \new Staff \relative { \clef bass c'2 c2 }
2967 @cindex default bar lines, changing
2968 @cindex bar lines, default, changing
2971 @funindex defaultBarType
2975 The command @samp{\bar @var{bartype}} is a shortcut for
2976 @samp{\set Timing.whichBar = @var{bartype}}. A bar line is
2977 created whenever the @code{whichBar} property is set.
2979 The default bar type used for automatically inserted bar lines is
2980 @code{"|"}. This may be changed at any time with
2981 @samp{\set Timing.defaultBarType = @var{bartype}}.
2985 @ref{Line breaking},
2987 @ref{Grouping staves}.
2990 @file{scm/bar-line.scm}.
2995 Internals Reference:
2996 @rinternals{BarLine} (created at @code{Staff} level),
2997 @rinternals{SpanBar} (across staves),
2998 @rinternals{Timing_translator} (for Timing properties).
3002 @unnumberedsubsubsec Bar numbers
3005 @cindex measure numbers
3006 @cindex numbers, bar
3007 @cindex numbers, measure
3009 @funindex currentBarNumber
3011 Bar numbers are typeset by default at the start of every line except
3012 the first line. The number itself is stored in the
3013 @code{currentBarNumber} property, which is normally updated
3014 automatically for every measure. It may also be set manually:
3016 @lilypond[verbatim,quote]
3020 \set Score.currentBarNumber = #50
3025 @cindex bar numbers, regular spacing
3027 @funindex barNumberVisibility
3030 Bar numbers can be typeset at regular intervals instead of just at the
3031 beginning of every line. To do this the default behavior must be
3032 overridden to permit bar numbers to be printed at places other than the
3033 start of a line. This is controlled by the @code{break-visibility}
3034 property of @code{BarNumber}. This takes three values which may be set
3035 to @code{#t} or @code{#f} to specify whether the corresponding bar
3036 number is visible or not. The order of the three values is
3037 @code{end of line visible}, @code{middle of line visible},
3038 @code{beginning of line visible}. In the following example bar numbers
3039 are printed at all possible places:
3041 @lilypond[verbatim,quote]
3043 \override Score.BarNumber.break-visibility = ##(#t #t #t)
3044 \set Score.currentBarNumber = #11
3045 % Permit first bar number to be printed
3054 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3055 {printing-the-bar-number-for-the-first-measure.ly}
3057 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3058 {printing-bar-numbers-at-regular-intervals.ly}
3060 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3061 {printing-bar-numbers-with-changing-regular-intervals.ly}
3063 @cindex measure number, format
3064 @cindex bar number, format
3066 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3067 {printing-bar-numbers-inside-boxes-or-circles.ly}
3069 @cindex bar numbers, with letters
3070 @cindex bar numbers, with repeats
3072 @lilypondfile[verbatim,quote,texidoc,doctitle]
3073 {alternative-bar-numbering.ly}
3075 @cindex bar number alignment
3077 @lilypondfile[verbatim,quote,texidoc,doctitle]
3078 {aligning-bar-numbers.ly}
3080 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3081 {removing-bar-numbers-from-a-score.ly}
3087 Internals Reference:
3088 @rinternals{BarNumber},
3089 @rinternals{Bar_number_engraver}.
3091 @cindex bar number collision
3092 @cindex collision, bar number
3095 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
3096 if there is one. To solve this, the @code{padding} property of
3097 @code{BarNumber} can be used to position the number correctly. See
3098 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
3101 @node Bar and bar number checks
3102 @unnumberedsubsubsec Bar and bar number checks
3105 @cindex bar number check
3106 @cindex measure check
3107 @cindex measure number check
3109 @funindex barCheckSynchronize
3112 Bar checks help detect errors in the entered durations. A bar check
3113 may be entered using the bar symbol, @code{|}, at any place where a
3114 bar line is expected to fall. If bar check lines are encountered at
3115 other places, a list of warnings is printed in the log file, showing
3116 the line numbers and lines in which the bar checks failed. In the
3117 next example, the second bar check will signal an error.
3120 \time 3/4 c2 e4 | g2 |
3123 An incorrect duration can result in a completely garbled score,
3124 especially if the score is polyphonic, so a good place to start
3125 correcting input is by scanning for failed bar checks and
3126 incorrect durations.
3128 If successive bar checks are off by the same musical interval,
3129 only the first warning message is displayed. This allows the
3130 warning to focus on the source of the timing error.
3132 Bar checks can also be inserted in lyrics:
3137 Twin -- kle | Twin -- kle |
3141 Note that bar check marks in lyrics are evaluated at the musical
3142 moment when the syllable @emph{following} the check mark is processed.
3143 If the lyrics are associated with the notes of a voice which has a
3144 rest at the beginning of a bar, then no syllable can be located at the
3145 start of that bar and a warning will be issued if a bar check mark is
3146 placed in the lyrics at that position.
3152 It is also possible to redefine the action taken when a bar check
3153 or pipe symbol, @code{|}, is encountered in the input, so that
3154 it does something other than a bar check. This is done by
3155 assigning a music expression to @code{"|"}.
3156 In the following example @code{|} is set to insert a double bar
3157 line wherever it appears in the input, rather than checking
3160 @lilypond[quote,verbatim]
3170 @funindex \barNumberCheck
3172 When copying large pieces of music, it can be helpful to check that
3173 the LilyPond bar number corresponds to the original that you are
3174 entering from. This can be checked with @code{\barNumberCheck}, for
3178 \barNumberCheck #123
3182 will print a warning if the @code{currentBarNumber} is not 123
3183 when it is processed.
3190 @node Rehearsal marks
3191 @unnumberedsubsubsec Rehearsal marks
3193 @cindex rehearsal marks
3194 @cindex mark, rehearsal
3198 To print a rehearsal mark, use the @code{\mark} command.
3200 @lilypond[quote,verbatim]
3210 The mark is incremented automatically if you use @code{\mark
3211 \default}, but you can also use an integer argument to set the
3212 mark manually. The value to use is stored in the property
3213 @code{rehearsalMark}.
3215 @lilypond[quote,verbatim]
3226 The letter@tie{}@q{I} is skipped in accordance with engraving
3227 traditions. If you wish to include the letter @q{I}, then use one
3228 of the following commands, depending on which style of rehearsal mark
3229 you want (letters only, letters in a hollow box, or letters in a
3233 \set Score.markFormatter = #format-mark-alphabet
3234 \set Score.markFormatter = #format-mark-box-alphabet
3235 \set Score.markFormatter = #format-mark-circle-alphabet
3238 @lilypond[quote,verbatim]
3240 \set Score.markFormatter = #format-mark-box-alphabet
3249 @cindex rehearsal mark format
3250 @cindex rehearsal mark style
3251 @cindex style, rehearsal mark
3252 @cindex format, rehearsal mark
3253 @cindex mark, rehearsal, style
3254 @cindex mark, rehearsal, format
3255 @cindex rehearsal mark, manual
3256 @cindex mark, rehearsal, manual
3257 @cindex custom rehearsal mark
3258 @cindex manual rehearsal mark
3260 The style is defined by the property @code{markFormatter}. It is
3261 a function taking the current mark (an integer) and the current
3262 context as argument. It should return a markup object. In the
3263 following example, @code{markFormatter} is set to a pre-defined
3264 procedure. After a few measures, it is set to a procedure that
3265 produces a boxed number.
3267 @lilypond[quote,verbatim]
3269 \set Score.markFormatter = #format-mark-numbers
3272 \set Score.markFormatter = #format-mark-box-numbers
3274 \set Score.markFormatter = #format-mark-circle-numbers
3276 \set Score.markFormatter = #format-mark-circle-letters
3281 The file @file{scm/translation-functions.scm} contains the
3282 definitions of @code{format-mark-numbers} (the default format),
3283 @code{format-mark-box-numbers}, @code{format-mark-letters} and
3284 @code{format-mark-box-letters}. These can be used as inspiration
3285 for other formatting functions.
3287 You may use @code{format-mark-barnumbers},
3288 @code{format-mark-box-barnumbers}, and
3289 @code{format-mark-circle-barnumbers} to get bar numbers instead of
3290 incremented numbers or letters.
3292 Other styles of rehearsal mark can be specified manually:
3299 Note that @code{Score.markFormatter} does not affect marks specified
3300 in this manner. However, it is possible to apply a @code{\markup} to the
3304 \mark \markup@{ \box A1 @}
3309 @cindex D.S. al Fine
3311 @cindex music glyphs
3312 @cindex glyphs, music
3314 @funindex \musicglyph
3316 Music glyphs (such as the segno sign) may be printed inside a
3319 @lilypond[quote,verbatim]
3321 c1 \mark \markup { \musicglyph #"scripts.segno" }
3322 c1 \mark \markup { \musicglyph #"scripts.coda" }
3323 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
3329 See @ref{The Feta font}, for a list of symbols which may be
3330 printed with @code{\musicglyph}.
3332 For common tweaks to the positioning of rehearsal marks, see
3333 @ref{Formatting text}. For more precise control, see
3334 @code{break-alignable-interface} in @ref{Aligning objects}.
3336 The file @file{scm/translation-functions.scm} contains
3337 the definitions of @code{format-mark-numbers} and
3338 @code{format-mark-letters}. They can be used as inspiration for
3339 other formatting functions.
3343 @ref{The Feta font},
3344 @ref{Formatting text},
3345 @ref{Aligning objects}.
3348 @file{scm/translation-functions.scm}.
3353 Internals Reference:
3354 @rinternals{MarkEvent},
3355 @rinternals{Mark_engraver},
3356 @rinternals{RehearsalMark}.
3359 @node Special rhythmic concerns
3360 @subsection Special rhythmic concerns
3365 * Aligning to cadenzas::
3366 * Time administration::
3370 @unnumberedsubsubsec Grace notes
3374 @cindex appoggiatura
3375 @cindex acciaccatura
3378 @funindex \slashedGrace
3379 @funindex \acciaccatura
3380 @funindex \appoggiatura
3382 Grace notes are musical ornaments, printed in a smaller font, that take
3383 up no additional logical time in a measure.
3385 @lilypond[quote,verbatim]
3388 \grace { b16 c16 } a2)
3392 There are three other types of grace notes possible; the
3393 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
3394 note with a slashed stem -- and the @emph{appoggiatura}, which takes a
3395 fixed fraction of the main note it is attached to and prints without the
3396 slash. It is also possible to write a grace note with a slashed stem,
3397 like the @emph{acciaccatura} but without the slur, so as to place it
3398 between notes that are slurred themselves, using the
3399 @code{\slashedGrace} function.
3401 @lilypond[quote,verbatim]
3403 \acciaccatura d''8 c4
3405 \acciaccatura { g16 f } e2
3406 \slashedGrace a,8 g4
3407 \slashedGrace b16 a4(
3408 \slashedGrace b8 a2)
3412 The placement of grace notes is synchronized between different staves.
3413 In the following example, there are two sixteenth grace notes for every
3416 @lilypond[quote,verbatim]
3418 \new Staff \relative { e''2 \grace { c16 d e f } e2 }
3419 \new Staff \relative { c''2 \grace { g8 b } c2 }
3423 @cindex grace notes, following
3425 @funindex \afterGrace
3427 If you want to end a note with a grace, use the @code{\afterGrace}
3428 command. It takes two arguments: the main note, and the grace
3429 notes following the main note.
3431 @lilypond[quote,verbatim]
3432 \relative { c''1 \afterGrace d1 { c16[ d] } c1 }
3435 This will place the grace notes @emph{after} the start of the main
3436 note. The point of time where the grace notes are placed is a
3437 given fraction of the main note's duration. The default setting
3441 afterGraceFraction = 3/4
3445 may be redefined at top level. Individual @code{\afterGrace}
3446 commands may have the fraction specified right after the command
3449 The following example shows the results from setting with the
3450 default space, setting it at @code{15/16}, and finally at
3451 @code{1/2} of the main note.
3453 @lilypond[quote,verbatim]
3455 \new Staff \relative {
3456 c''1 \afterGrace d1 { c16[ d] } c1
3458 \new Staff \relative {
3459 c''1 \afterGrace 15/16 d1 { c16[ d] } c1
3461 \new Staff \relative {
3462 c''1 \afterGrace 1/2 d1 { c16[ d] } c1
3467 The effect of @code{\afterGrace} can also be achieved using
3468 spacers. The following example places the grace note after a
3469 space lasting 7/8 of the main note.
3471 @lilypond[quote,verbatim]
3472 \new Voice \relative {
3475 { s2 s4. \grace { c16 d } }
3481 @cindex tweaking grace notes
3482 @cindex grace notes, tweaking
3483 @cindex grace notes, changing layout settings
3485 A @code{\grace} music expression will introduce special
3486 typesetting settings, for example, to produce smaller type, and
3487 set directions. Hence, when introducing layout tweaks to
3488 override the special settings, they should be placed inside
3489 the grace expression. The overrides should also be reverted
3490 inside the grace expression. Here, the grace note's default stem
3491 direction is overridden and then reverted.
3493 @lilypond[quote,verbatim]
3494 \new Voice \relative {
3505 @cindex stem, with slash
3510 @lilypondfile[verbatim,quote,texidoc,doctitle]
3511 {using-grace-note-slashes-with-normal-heads.ly}
3513 @lilypondfile[verbatim,quote,texidoc,doctitle]
3514 {tweaking-grace-layout-within-music.ly}
3516 @lilypondfile[verbatim,quote,texidoc,doctitle]
3517 {redefining-grace-note-global-defaults.ly}
3519 @lilypondfile[verbatim,quote,texidoc,doctitle]
3520 {positioning-grace-notes-with-floating-space.ly}
3524 @rglos{grace notes},
3525 @rglos{acciaccatura},
3526 @rglos{appoggiatura}.
3529 @ref{Scaling durations},
3533 @file{ly/grace-init.ly}.
3538 Internals Reference:
3539 @rinternals{GraceMusic},
3540 @rinternals{Grace_beam_engraver},
3541 @rinternals{Grace_auto_beam_engraver},
3542 @rinternals{Grace_engraver},
3543 @rinternals{Grace_spacing_engraver}.
3547 @cindex acciaccatura, multi-note
3548 @cindex multi-note acciaccatura
3549 @cindex grace-note synchronization
3551 A multi-note beamed @i{acciaccatura} is printed without a slash,
3552 and looks exactly the same as a multi-note beamed
3555 @c TODO Add link to LSR snippet to add slash when available
3557 Grace note synchronization can also lead to surprises. Staff
3558 notation, such as key signatures, bar lines, etc., are also
3559 synchronized. Take care when you mix staves with grace notes and
3560 staves without, for example,
3562 @lilypond[quote,verbatim]
3564 \new Staff \relative { e''4 \bar ".|:" \grace c16 d2. }
3565 \new Staff \relative { c''4 \bar ".|:" d2. }
3570 This can be remedied by inserting grace skips of the corresponding
3571 durations in the other staves. For the above example
3573 @lilypond[quote,verbatim]
3575 \new Staff \relative { e''4 \bar ".|:" \grace c16 d2. }
3576 \new Staff \relative { c''4 \bar ".|:" \grace s16 d2. }
3580 Please make sure that you use the @code{\grace} command for the
3581 spacer part, even if the visual part uses @code{\acciaccatura} or
3582 @code{\appoggiatura} because otherwise an ugly slur fragment will
3583 be printed, connecting the invisible grace note with the following
3586 Grace sections should only be used within sequential music expressions.
3587 Nesting or juxtaposing grace sections is not supported, and might
3588 produce crashes or other errors.
3590 Each grace note in MIDI output has a length of 1/4 of its actual
3591 duration. If the combined length of the grace notes is greater than the
3592 length of the preceding note a @qq{@code{Going back in MIDI time}}
3593 error will be generated. Either make the grace notes shorter in
3594 duration, for example:
3597 c'8 \acciaccatura @{ c'8[ d' e' f' g'] @}
3603 c'8 \acciaccatura @{ c'16[ d' e' f' g'] @}
3606 Or explicitly change the musical duration:
3609 c'8 \acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
3612 See @ref{Scaling durations}.
3615 @node Aligning to cadenzas
3616 @unnumberedsubsubsec Aligning to cadenzas
3619 @cindex cadenza, aligning to
3620 @cindex aligning to cadenza
3622 In an orchestral context, cadenzas present a special problem: when
3623 constructing a score that includes a measured cadenza or other solo
3624 passage, all other instruments should skip just as many notes as the
3625 length of the cadenza, otherwise they will start too soon or too late.
3627 One solution to this problem is to use the functions
3628 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
3629 functions take a defined piece of music as an argument and generate a
3630 multi-measure rest or @code{\skip} exactly as long as the piece.
3632 @lilypond[verbatim,quote]
3633 MyCadenza = \relative {
3644 #(mmrest-of-length MyCadenza)
3646 #(skip-of-length MyCadenza)
3660 @node Time administration
3661 @unnumberedsubsubsec Time administration
3663 @cindex time administration
3664 @cindex timing (within the score)
3665 @cindex music, unmetered
3666 @cindex unmetered music
3668 @funindex currentBarNumber
3669 @funindex measurePosition
3670 @funindex measureLength
3672 Time is administered by the @code{Timing_translator}, which by
3673 default is to be found in the @code{Score} context. An alias,
3674 @code{Timing}, is added to the context in which the
3675 @code{Timing_translator} is placed. To ensure that the
3676 @code{Timing} alias is available, you may need to explicitly
3677 instantiate the containing context (such as @code{Voice} or
3680 The following properties of @code{Timing} are used
3681 to keep track of timing within the score.
3684 @cindex measure number
3687 @item currentBarNumber
3688 The current measure number. For an example showing the
3689 use of this property see @ref{Bar numbers}.
3692 The length of the measures in the current time signature. For a
3693 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
3694 determines when bar lines are inserted and how automatic beams
3695 should be generated.
3697 @item measurePosition
3698 The point within the measure where we currently are. This
3699 quantity is reset by subtracting @code{measureLength} whenever
3700 @code{measureLength} is reached or exceeded. When that happens,
3701 @code{currentBarNumber} is incremented.
3704 If set to true, the above variables are updated for every time
3705 step. When set to false, the engraver stays in the current
3706 measure indefinitely.
3710 Timing can be changed by setting any of these variables
3711 explicitly. In the next example, the default 4/4 time
3712 signature is printed, but @code{measureLength} is set to 5/4.
3713 At 4/8 through the third measure, the @code{measurePosition} is
3714 advanced by 1/8 to 5/8, shortening that bar by 1/8.
3715 The next bar line then falls at 9/8 rather than 5/4.
3717 @lilypond[quote,verbatim]
3718 \new Voice \relative {
3719 \set Timing.measureLength = #(ly:make-moment 5/4)
3723 \set Timing.measurePosition = #(ly:make-moment 5/8)
3730 As the example illustrates, @code{ly:make-moment n/m} constructs a
3731 duration of n/m of a whole note. For example,
3732 @code{ly:make-moment 1/8} is an eighth note duration and
3733 @code{ly:make-moment 7/16} is the duration of seven sixteenths
3739 @ref{Unmetered music}.
3744 Internals Reference:
3745 @rinternals{Timing_translator},