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
54 Durations are designated by numbers and dots. Durations are entered
55 as their reciprocal values. For example, a quarter note is entered
56 using a @code{4} (since it is a 1/4 note), and a half note is entered
57 using a @code{2} (since it is a 1/2 note). For notes longer than a
58 whole you must use the @code{\longa} (a double breve) and
59 @code{\breve} commands. Durations as short as 128th notes may be
60 specified. Shorter values are possible, but only as beamed notes.
62 @c Two 64th notes are needed to obtain beams
63 @lilypond[quote,verbatim,relative=2]
66 c4 c8 c16 c32 c64 c128 c128
69 Here are the same durations with automatic beaming turned off.
71 @c not strictly "writing rhythms"; more of a "displaying" thing,
72 @c but it's ok here. -gp
73 @lilypond[quote,verbatim,relative=2]
77 c4 c8 c16 c32 c64 c128 c128
80 A note with the duration of a quadruple breve may be entered with
81 @code{\maxima}, but this is supported only within ancient music
82 notation. For details, see @ref{Ancient notation}.
84 @cindex duration, default
85 @cindex default note duration
86 @cindex note duration, default
88 If the duration is omitted, it is set to the previously
89 entered duration. The default for the first note is a quarter
92 @lilypond[quote,verbatim,relative=2]
98 @cindex notes, double-dotted
99 @cindex double-dotted notes
103 To obtain dotted note lengths, place a dot (@code{.}) after the
104 duration. Double-dotted notes are specified by appending two
107 @lilypond[quote,verbatim,relative=2]
108 a4 b c4. b8 a4. b4.. c8.
111 Some durations cannot be represented with just binary durations
112 and dots; they can be represented only by tying two or more
113 notes together. For details, see @ref{Ties}.
115 For ways of specifying durations for the syllables of lyrics and
116 ways of aligning lyrics to notes, see @ref{Vocal music}.
118 Optionally, notes can be spaced strictly proportionately to their
119 duration. For details of this and other settings which control
120 proportional notation, see @ref{Proportional notation}.
126 @funindex \dotsNeutral
127 @funindex dotsNeutral
129 Dots are normally moved up to avoid staff lines, except in
130 polyphonic situations. Dots may be manually placed above or below
131 the staff; see @ref{Direction and placement}.
145 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
146 {alternative-breve-note.ly}
148 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
149 {changing-the-number-of-augmentation-dots-per-note.ly}
157 @rglos{Duration names notes and rests}.
160 @ref{Automatic beams},
163 @ref{Writing rhythms},
166 @ref{Ancient notation},
167 @ref{Proportional notation}.
174 @rinternals{DotColumn}.
177 @c Deliberately duplicated in Durations and Rests. -gp
178 There is no fundamental limit to rest durations (both in terms of
179 longest and shortest), but the number of glyphs is limited:
180 rests from 128th to maxima (8 x whole) may be printed.
184 @unnumberedsubsubsec Tuplets
192 Tuplets are made from a music expression by multiplying all the
193 durations with a fraction:
196 \times @var{fraction} @{ @var{music} @}
200 The duration of @code{@var{music}} will be multiplied by the
201 fraction. The fraction's denominator will be printed over or
202 under the notes, optionally with a bracket. The most common
203 tuplet is the triplet in which 3 notes have the duration of 2, so
204 the notes are 2/3 of their written length.
206 @lilypond[quote,verbatim,relative=2]
207 a2 \times 2/3 { b4 b b }
208 c4 c \times 2/3 { b4 a g }
211 @cindex tuplet bracket placement
215 @funindex \tupletDown
217 @funindex \tupletNeutral
218 @funindex tupletNeutral
220 Tuplet brackets may be manually placed above or below the staff;
221 see @ref{Direction and placement}.
223 Tuplets may be nested:
225 @lilypond[quote,verbatim,relative=2]
227 c4 \times 4/5 { f8 e f \times 2/3 { e[ f g] } } f4
230 Modifying nested tuplets which begin at the same musical moment
231 must be done with @code{\tweak}.
233 To modify the duration of notes without printing a tuplet bracket,
234 see @ref{Scaling durations}.
240 @code{\tupletNeutral}.
246 @cindex tuplet formatting
247 @cindex triplet formatting
249 @funindex tupletNumberFormatFunction
250 @funindex tupletSpannerDuration
252 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
253 {entering-several-tuplets-using-only-one--times-command.ly}
255 @cindex Tuplet number changes
257 @funindex TupletNumber
259 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
260 {changing-the-tuplet-number.ly}
262 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
263 {non-default-tuplet-numbers.ly}
265 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
266 {controlling-tuplet-bracket-visibility.ly}
268 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
269 {permitting-line-breaks-within-beamed-tuplets.ly}
278 @rlearning{Tweaking methods}.
281 @ref{Time administration},
282 @ref{Scaling durations},
283 @ref{The tweak command},
284 @ref{Polymetric notation}.
290 @rinternals{TupletBracket},
291 @rinternals{TupletNumber},
292 @rinternals{TimeScaledMusic}.
294 @cindex grace notes within tuplet brackets
297 Grace notes may be placed within tuplet brackets, @emph{except}
298 when a staff begins with a grace note followed by a tuplet. In this
299 particular case, the grace note must be placed before the @code{\times}
300 command to avoid errors.
302 @cindex tempo marks within tuplet brackets
304 When using a tuplet at the beginning of a piece with a @code{\tempo}
305 mark, the music must be explicitly entered in a @code{\new Voice}
306 block, as discussed in @rlearning{Voices contain music}.
309 @node Scaling durations
310 @unnumberedsubsubsec Scaling durations
312 @cindex scaling durations
313 @cindex durations, scaling
315 The duration of single notes, rests or chords may be multiplied by a
316 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
317 is 1) to the duration. This will not affect the appearance of the
318 notes or rests produced, but the altered duration will be used in
319 calculating the position within the measure and setting the duration
320 in the MIDI output. Multiplying factors may be combined like
321 @code{*L*M/N}. Factors are part of the duration: if a duration is
322 not specified for subsequent notes, the default duration taken from
323 the preceding note will include any scaling factor.
325 In the following example, the first three notes take up exactly
326 two beats, but no triplet bracket is printed.
328 @lilypond[quote,relative=2,verbatim]
330 % Alter durations to triplets
334 % Double the duration of chord
336 % Duration of quarter, appears like sixteenth
340 The duration of spacer rests may also be modified by
341 a multiplier. This is useful for skipping many measures, e.g.,
344 @cindex compressing music
345 @cindex expanding music
347 @funindex \scaleDurations
348 @funindex scaleDurations
350 Longer stretches of music may be compressed by a fraction in the
351 same way, as if every note, chord or rest had the fraction as a
352 multiplier. This leaves the appearance of the music unchanged but
353 the internal duration of the notes will be multiplied by the
354 fraction @emph{num}/@emph{den}. Here is an example showing how music
355 can be compressed and expanded:
357 @lilypond[quote,relative=2,verbatim]
361 % Scale music by *2/3
362 \scaleDurations 2/3 {
366 \scaleDurations 2/1 {
371 One application of this command is in polymetric
372 notation, see @ref{Polymetric notation}.
377 @ref{Invisible rests},
378 @ref{Polymetric notation}.
384 The calculation of the position within a measure must take into
385 account all the scaling factors applied to the notes within that
386 measure and any fractional carry-out from earlier measures. This
387 calculation is carried out using rational numbers. If an intermediate
388 numerator or denominator in that calculation exceeds 2^30 the
389 execution and typesetting will stop at that point without indicating
394 @unnumberedsubsubsec Ties
400 A tie connects two adjacent note heads of the same pitch. The tie
401 in effect extends the duration of a note.
403 @warning{Ties should not be confused with @emph{slurs}, which
404 indicate articulation, or @emph{phrasing slurs}, which indicate
405 musical phrasing. A tie is just a way of extending a note
406 duration, similar to the augmentation dot.}
408 A tie is entered using the tilde symbol (@code{~}).
410 @lilypond[quote,verbatim,relative=2]
414 Ties are used either when the note crosses a bar line, or when
415 dots cannot be used to denote the rhythm. Ties should also be
416 used when note values cross larger subdivisions of the measure:
418 @lilypond[verbatim,quote]
425 If you need to tie many notes across bar lines, it may be
426 easier to use automatic note splitting, see @ref{Automatic note
427 splitting}. This mechanism automatically splits long notes, and
428 ties them across bar lines.
430 @cindex ties and chords
431 @cindex chords and ties
433 When a tie is applied to a chord, all note heads whose pitches
434 match are connected. When no note heads match, no ties will be
435 created. Chords may be partially tied by placing the tie inside
438 @lilypond[quote,verbatim,relative=1]
440 <c~ e g~ b> <c e g b>
443 @cindex repeating ties
444 @cindex ties, repeating
445 @cindex volta brackets and ties
446 @cindex ties and volta brackets
451 When a second alternative of a repeat starts with a tied note, you
452 have to specify the repeated tie as follows:
454 @lilypond[quote,relative=2,verbatim]
455 \repeat volta 2 { c g <c e>2 ~ }
457 % First alternative: following note is tied normally
459 % Second alternative: following note has a repeated tie
460 { <c e>2\repeatTie d4 c } }
463 @cindex laissez vibrer
464 @cindex ties, laissez vibrer
466 @funindex \laissezVibrer
467 @funindex laissezVibrer
469 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
470 notes must not be damped at the end. It is used in notation for
471 piano, harp and other string and percussion instruments. They can
472 be entered as follows:
474 @lilypond[quote,verbatim,relative=1]
475 <c f g>1\laissezVibrer
478 @cindex ties, placement
484 @funindex \tieNeutral
487 Ties may be manually placed above or below the staff; see
488 @ref{Direction and placement}.
490 @cindex ties, appearance
503 Ties may be made dashed, dotted, or a combination of solid and
506 @lilypond[quote, verbatim, relative=1]
519 Custom dash patterns can be specified:
521 @lilypond[quote, verbatim, relative=1]
522 \tieDashPattern #0.3 #0.75
524 \tieDashPattern #0.7 #1.5
530 Dash pattern definitions for ties have the same structure as dash
531 pattern definitions for slurs. For more information about complex dash
532 patterns, see @ref{Slurs}.
534 Override @var{whiteout} and @var{layer} layout properties for ties that
535 collide with other objects in a staff.
537 @lilypond[verbatim,quote,ragged-right,relative=2]
538 \override Tie.layer = #-2
539 \override Staff.TimeSignature.layer = #-1
540 \override Staff.KeySignature.layer = #-1
541 \override Staff.TimeSignature.whiteout = ##t
542 \override Staff.KeySignature.whiteout = ##t
555 @code{\tieDashPattern},
556 @code{\tieHalfDashed},
557 @code{\tieHalfSolid},
563 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
564 {using-ties-with-arpeggios.ly}
566 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
567 {engraving-ties-manually.ly}
572 @rglos{laissez vibrer}.
576 @ref{Automatic note splitting}.
579 @rlsr{Expressive marks},
583 @rinternals{LaissezVibrerTie},
584 @rinternals{LaissezVibrerTieColumn},
585 @rinternals{TieColumn},
589 Switching staves when a tie is active will not produce a slanted tie.
591 Changing clefs or ottavations during a tie is not really well-defined.
592 In these cases, a slur may be preferable.
596 @subsection Writing rests
598 Rests are entered as part of the music in music expressions.
603 * Full measure rests::
607 @unnumberedsubsubsec Rests
610 @cindex rest, entering durations
625 Rests are entered like notes with the note name @code{r}.
626 Durations longer than a whole rest use the following predefined
629 @c \time 16/1 is used to avoid spurious bar lines
630 @c and long tracts of empty measures
631 @lilypond[quote,verbatim,relative=2]
633 % These two lines are just to prettify this example
635 \override Staff.TimeSignature.stencil = ##f
636 % Print a maxima rest, equal to four breves
638 % Print a longa rest, equal to two breves
642 r1 r2 r4 r8 r16 r32 r64 r128
646 @cindex rest, multi-measure
647 @cindex rest, whole-measure
649 Whole measure rests, centered in the middle of the measure, must be
650 entered as multi-measure rests. They can be used for a single
651 measure as well as many measures and are discussed in
652 @ref{Full measure rests}.
654 @cindex rest, specifying vertical position
656 To explicitly specify a rest's vertical position, write a note
657 followed by @code{\rest}. A rest of the duration of the note will
658 be placed at the staff position where the note would appear. This
659 allows for precise manual formatting of polyphonic music, since the
660 automatic rest collision formatter will not move these rests.
662 @lilypond[quote,verbatim,relative=2]
668 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
678 @ref{Full measure rests}.
687 @c Deliberately duplicated in Durations and Rests. -gp
688 There is no fundamental limit to rest durations (both in terms of
689 longest and shortest), but the number of glyphs is limited: there
690 are rests from 128th to maxima (8 x whole).
693 @node Invisible rests
694 @unnumberedsubsubsec Invisible rests
697 @cindex invisible rest
698 @cindex rest, invisible
706 An invisible rest (also called a @q{spacer rest}) can be entered
707 like a note with the note name@tie{}@code{s}:
709 @lilypond[verbatim,quote,relative=2]
716 Spacer rests are available only in note mode and chord mode. In
717 other situations, for example, when entering lyrics, the
718 command @code{\skip} is used to skip a musical moment.
719 @code{\skip} requires an explicit duration, but this is ignored if
720 the lyrics derive their durations from the notes in an associated
721 melody through @code{\addlyrics} or @code{\lyricsto}.
723 @lilypond[quote,verbatim,relative=2]
736 Because @code{\skip} is a command, it does not affect the default
737 durations of following notes, unlike@tie{}@code{s}.
739 @lilypond[quote,verbatim,relative=2]
742 \repeat unfold 8 { a4 }
752 A spacer rest implicitly causes @code{Staff} and @code{Voice}
753 contexts to be created if none exist, just like notes and rests
756 @lilypond[quote,verbatim,relative=2]
760 @code{\skip} simply skips musical time; it creates no output of
763 @lilypond[quote,verbatim,relative=2]
764 % This is valid input, but does nothing
765 \skip 1 \skip1 \skip 1
770 @rlearning{Visibility and color of objects}.
774 @ref{Visibility of objects}.
780 @rinternals{SkipMusic}.
783 @node Full measure rests
784 @unnumberedsubsubsec Full measure rests
786 @cindex multi-measure rests
787 @cindex full-measure rests
788 @cindex rest, multi-measure
789 @cindex rest, full-measure
790 @cindex whole rest for a full measure
791 @cindex rest, whole for a full measure
795 Rests for one or more full measures are entered like notes with
796 the note name uppercase @code{R}:
798 @lilypond[quote,verbatim,relative=2]
799 % Rest measures contracted to single measure
800 \compressFullBarRests
807 The duration of full-measure rests is identical to the duration
808 notation used for notes. The duration in a multi-measure rest must
809 always be an integral number of measure-lengths, so augmentation dots
810 or fractions must often be used:
812 @lilypond[quote,verbatim,relative=2]
813 \compressFullBarRests
819 R1*13/8 | R1*13/8*12 |
824 A full-measure rest is printed as either a whole or breve rest,
825 centered in the measure, depending on the time signature.
827 @lilypond[quote,verbatim,relative=2]
836 @cindex multi-measure rest, expanding
837 @cindex multi-measure rest, contracting
839 @funindex \expandFullBarRests
840 @funindex expandFullBarRests
841 @funindex \compressFullBarRests
842 @funindex compressFullBarRests
844 By default a multi-measure rest is expanded in the printed score to
845 show all the rest measures explicitly. Alternatively, a multi-measure
846 rest can be shown as a single measure containing a multi-measure rest
847 symbol, with the number of measures of rest printed above the measure:
849 @lilypond[quote,verbatim,relative=2]
851 \time 3/4 r2. | R2.*2 |
854 % Rest measures contracted to single measure
855 \compressFullBarRests
857 % Rest measures expanded
864 @cindex text on multi-measure rest
865 @cindex multi-measure rest, attaching text
866 @cindex script on multi-measure rest
867 @cindex multi-measure rest, script
868 @cindex fermata on multi-measure rest
869 @cindex multi-measure rest, attaching fermata
870 @cindex markup on multi-measure rest
871 @cindex multi-measure rest with markup
873 @funindex \fermataMarkup
874 @funindex fermataMarkup
875 @funindex MultiMeasureRestText
877 Markups can be added to multi-measure rests.
878 The predefined command @code{\fermataMarkup}
879 is provided for adding fermatas.
881 @lilypond[quote,verbatim,relative=2]
882 \compressFullBarRests
884 R2.*10^\markup { \italic "ad lib." }
888 @warning{Markups attached to a multi-measure rest are objects of type
889 @code{MultiMeasureRestText}, not @code{TextScript}. Overrides must
890 be directed to the correct object, or they will be ignored. See the
893 @lilypond[quote,verbatim,relative=2]
894 % This fails, as the wrong object name is specified
895 \override TextScript.padding = #5
897 % This is the correct object name to be specified
898 \override MultiMeasureRestText.padding = #5
902 When a multi-measure rest immediately follows a @code{\partial}
903 setting, resulting bar-check warnings may not be displayed.
906 @funindex \textLengthOn
907 @funindex textLengthOn
908 @funindex \textLengthOff
909 @funindex textLengthOff
910 @funindex \fermataMarkup
911 @funindex fermataMarkup
912 @funindex \compressFullBarRests
913 @funindex compressFullBarRests
914 @funindex \expandFullBarRests
915 @funindex expandFullBarRests
918 @code{\textLengthOn},
919 @code{\textLengthOff},
920 @code{\fermataMarkup},
921 @code{\compressFullBarRests},
922 @code{\expandFullBarRests}.
930 @cindex kirchenpausen
932 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
933 {changing-form-of-multi-measure-rests.ly}
935 @cindex multi-measure rests, positioning
936 @cindex positioning multi-measure rests
938 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
939 {positioning-multi-measure-rests.ly}
941 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
942 {multi-measure-rest-markup.ly}
946 @rglos{multi-measure rest}.
951 @ref{Formatting text},
958 @rinternals{MultiMeasureRest},
959 @rinternals{MultiMeasureRestNumber},
960 @rinternals{MultiMeasureRestText}.
962 @cindex fingerings and multi-measure rests
963 @cindex multi-measure rests and fingerings
966 Fingerings over multi-measure rests (e.g. @code{R1*10-4}) may result
967 in the fingering numeral colliding with the bar counter
970 @cindex condensing rests
971 @cindex rest, condensing ordinary
973 There is no way to automatically condense multiple ordinary rests
974 into a single multi-measure rest.
976 @cindex rest, collisions of
978 Multi-measure rests do not take part in rest collisions.
981 @node Displaying rhythms
982 @subsection Displaying rhythms
989 * Polymetric notation::
990 * Automatic note splitting::
991 * Showing melody rhythms::
995 @unnumberedsubsubsec Time signature
997 @cindex time signature
1003 The time signature is set as follows:
1005 @lilypond[quote,verbatim,relative=2]
1010 @cindex time signature, visibility of
1012 Time signatures are printed at the beginning of a piece
1013 and whenever the time signature changes. If a change takes place
1014 at the end of a line a warning time signature sign is printed
1015 there. This default behavior may be changed, see
1016 @ref{Visibility of objects}.
1018 @lilypond[quote,verbatim,relative=2]
1028 @cindex time signature style
1031 @funindex \numericTimeSignature
1032 @funindex numericTimeSignature
1033 @funindex \defaultTimeSignature
1034 @funindex defaultTimeSignature
1036 The time signature symbol that is used in 2/2 and 4/4 time can be
1037 changed to a numeric style:
1039 @lilypond[quote,verbatim,relative=2]
1043 % Change to numeric style
1044 \numericTimeSignature
1047 % Revert to default style
1048 \defaultTimeSignature
1054 Mensural time signatures are covered in
1055 @ref{Mensural time signatures}.
1057 @cindex time signature default settings
1058 @cindex autobeaming properties for time signatures
1059 @cindex beaming, time signature default properties
1060 @funindex \overrideTimeSignatureSettings
1062 In addition to setting the printed time signature, the @code{\time}
1063 command also sets the values of the time-signature-based properties
1064 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
1065 The predefined default values for these properties can be found in
1066 @file{scm/time-signature-settings.scm}.
1068 The default value of @code{beatStructure} can be overridden in the
1069 @code{\time} command itself by supplying it as the optional first
1072 @lilypond[quote,verbatim]
1077 \repeat unfold 7 { c8 } |
1079 \repeat unfold 7 { c8 } |
1085 Alternatively, the default values of all these time-signature-based
1086 variables, including @code{baseMoment} and @code{beamExceptions},
1087 can be set together. The values can be set independently for several
1088 different time signatures. The new values take effect when a
1089 subsequent @code{\time} command with the same value of the time
1090 signature is executed:
1092 @lilypond[quote,verbatim]
1096 \overrideTimeSignatureSettings
1097 4/4 % timeSignatureFraction
1098 1/4 % baseMomentFraction
1099 #'(3 1) % beatStructure
1100 #'() % beamExceptions
1102 \repeat unfold 8 { c8 } |
1108 @code{\overrideTimeSignatureSettings} takes four arguments:
1113 @code{@var{timeSignatureFraction}}, a fraction describing the
1114 time signature to which these values apply.
1117 @code{@var{baseMomentFraction}}, a fraction containing the numerator
1118 and denominator of the basic timing unit for the time signature.
1121 @code{@var{beatStructure}}, a Scheme list indicating the structure
1122 of the beats in the measure, in units of the base moment.
1125 @code{@var{beamExceptions}}, an alist containing any beaming rules
1126 for the time signature that go beyond ending at every beat, as
1127 described in @ref{Setting automatic beam behavior}.
1130 The context containing @code{\overrideTimeSignatureSettings} must
1131 be instantiated before the @code{\overrideTimeSignatureSettings}
1132 call is executed. That means it must either be explicitly
1133 instantiated or there must be music in the context before the
1134 @code{\overrideTimeSignatureSettings} call:
1136 @lilypond[quote,verbatim]
1139 % This call will fail because the context isn't yet instantiated
1140 \overrideTimeSignatureSettings
1141 4/4 % timeSignatureFraction
1142 1/4 % baseMomentFraction
1143 #'(3 1) % beatStructure
1144 #'() % beamExceptions
1146 c8^\markup {"Beamed (2 2)"}
1147 \repeat unfold 7 { c8 } |
1148 % This call will succeed
1149 \overrideTimeSignatureSettings
1150 4/4 % timeSignatureFraction
1151 1/4 % baseMomentFraction
1152 #'(3 1) % beatStructure
1153 #'() % beamExceptions
1155 c8^\markup {"Beamed (3 1)"}
1156 \repeat unfold 7 { c8 } |
1162 @cindex time signature properties, restoring default values
1163 @cindex restoring default properties for time signatures
1164 @funindex \revertTimeSignatureSettings
1166 Changed values of default time signature properties can be restored
1167 to the original values:
1169 @lilypond[quote,verbatim]
1172 \repeat unfold 8 { c8 } |
1173 \overrideTimeSignatureSettings
1174 4/4 % timeSignatureFraction
1175 1/4 % baseMomentFraction
1176 #'(3 1) % beatStructure
1177 #'() % beamExceptions
1179 \repeat unfold 8 { c8 } |
1180 \revertTimeSignatureSettings 4/4
1182 \repeat unfold 8 { c8 } |
1187 Different values of default time signature properties can be established
1188 for different staves by moving the @code{Timing_translator} and the
1189 @code{Default_bar_line_engraver} from the @code{Score} context to the
1190 @code{Staff} context.
1192 @lilypond[quote, verbatim]
1196 \overrideTimeSignatureSettings
1197 4/4 % timeSignatureFraction
1198 1/4 % baseMomentFraction
1199 #'(3 1) % beatStructure
1200 #'() % beamExceptions
1202 \repeat unfold 8 {c''8}
1205 \overrideTimeSignatureSettings
1206 4/4 % timeSignatureFraction
1207 1/4 % baseMomentFraction
1208 #'(1 3) % beatStructure
1209 #'() % beamExceptions
1211 \repeat unfold 8 {c''8}
1217 \remove "Timing_translator"
1218 \remove "Default_bar_line_engraver"
1222 \consists "Timing_translator"
1223 \consists "Default_bar_line_engraver"
1229 A further method of changing these time-signature-related variables,
1230 which avoids reprinting the time signature at the time of the change,
1231 is shown in @ref{Setting automatic beam behavior}.
1234 @code{\numericTimeSignature},
1235 @code{\defaultTimeSignature}.
1240 @lilypondfile[verbatim,quote,texidoc,doctitle]
1241 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1245 @rglos{time signature}
1248 @ref{Mensural time signatures},
1249 @ref{Setting automatic beam behavior},
1250 @ref{Time administration}.
1253 @file{scm/time-signature-settings.scm}.
1258 Internals Reference:
1259 @rinternals{TimeSignature},
1260 @rinternals{Timing_translator}.
1263 @node Metronome marks
1264 @unnumberedsubsubsec Metronome marks
1267 @cindex beats per minute
1268 @cindex metronome mark
1269 @cindex metronome marking with text
1274 A basic metronome mark is simple to write:
1276 @lilypond[verbatim,quote,relative=1]
1282 Metronome marks may also be printed as a range of two numbers:
1284 @lilypond[verbatim,quote,relative=1]
1290 Tempo indications with text can be used instead:
1292 @lilypond[verbatim,quote,relative=2]
1298 Combining a metronome mark and text will automatically place the
1299 metronome mark within parentheses:
1301 @lilypond[verbatim,quote,relative=2]
1302 \tempo "Allegro" 4 = 160
1307 In general, the text can be any markup object:
1309 @lilypond[verbatim,quote,relative=2]
1310 \tempo \markup { \italic Faster } 4 = 132
1311 a8-. r8 b-. r gis-. r a-. r
1314 A parenthesized metronome mark with no textual indication may be
1315 written by including an empty string in the input:
1317 @lilypond[verbatim,quote,relative=2]
1325 @lilypondfile[verbatim,quote,texidoc,doctitle]
1326 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
1328 @c perhaps also an example of how to move it horizontally?
1330 @lilypondfile[verbatim,quote,texidoc,doctitle]
1331 {changing-the-tempo-without-a-metronome-mark.ly}
1333 @lilypondfile[verbatim,quote,texidoc,doctitle]
1334 {creating-metronome-marks-in-markup-mode.ly}
1336 For more details, see @ref{Formatting text}.
1341 @rglos{metronomic indication},
1342 @rglos{tempo indication},
1343 @rglos{metronome mark}.
1346 @ref{Formatting text},
1350 @rlsr{Staff notation}.
1352 Internals Reference:
1353 @rinternals{MetronomeMark}.
1357 @unnumberedsubsubsec Upbeats
1361 @cindex partial measure
1362 @cindex measure, partial
1363 @cindex measure, pickup
1364 @cindex pickup measure
1366 @funindex measurePosition
1370 Partial or pick-up measures, such as an @emph{anacrusis} or an
1371 @emph{upbeat}, are entered using the @code{\partial} command,
1374 \partial @var{duration}
1378 where @code{@var{duration}} is the @emph{remaining} length of the
1379 partial measure @emph{before} the start of the next full measure.
1381 @lilypond[quote,verbatim,relative=1]
1387 The @var{duration} can be any value less than a full measure:
1389 @lilypond[quote,verbatim,relative=1]
1392 r4 e8 | a4 c8 b c4 |
1395 The @code{\partial @var{duration}} can also be written as;
1398 \set Timing.measurePosition -@var{duration}
1401 So @code{\partial 8} becomes:
1403 @lilypond[quote,verbatim,relative=1]
1405 \set Timing.measurePosition = #(ly:make-moment -1 8)
1409 The property @code{measurePosition} contains a rational number
1410 indicating how much of the measure has passed at this point. Note
1411 that this is set to a negative number by the @code{\partial} command:
1412 i.e., @code{\partial 4} is internally translated to @w{@code{-4}},
1413 meaning @qq{there is a quarter note left in the measure.}
1426 @rinternals{Timing_translator}.
1429 The @code{\partial} command should be used only at the beginning of a
1430 piece. If you use it after the beginning, warnings or problems may
1431 occur, so use @code{\set Timing.measurePosition} instead.
1433 @lilypond[quote,verbatim,relative=1]
1436 e8 | a4 c8 b[ c b] |
1437 \set Timing.measurePosition = #(ly:make-moment -1 4)
1438 r8 e,8 | a4 c8 b[ c b] |
1442 @node Unmetered music
1443 @unnumberedsubsubsec Unmetered music
1446 @cindex cadenza, beams
1447 @cindex cadenza, accidentals
1448 @cindex cadenza, bar lines
1449 @cindex cadenza, bar numbers
1450 @cindex unmetered music
1451 @cindex unmetered music, beams
1452 @cindex unmetered music, accidentals
1453 @cindex unmetered music, bar lines
1454 @cindex unmetered music, bar numbers
1455 @cindex accidentals, cadenzas
1456 @cindex accidentals, unmetered music
1457 @cindex bar lines, cadenzas
1458 @cindex bar lines, unmetered music
1459 @cindex bar numbers, cadenzas
1460 @cindex bar numbers, unmetered music
1461 @cindex beams, cadenzas
1462 @cindex beams, unmetered music
1464 @funindex \cadenzaOn
1466 @funindex \cadenzaOff
1467 @funindex cadenzaOff
1469 In metered music bar lines are inserted and bar numbers are calculated
1470 automatically. In unmetered music (i.e. cadenzas), this is not
1471 desirable and can be @q{switched off} using the command
1472 @code{\cadenzaOn}, then @q{switched back on} at the appropriate place
1473 using @code{\cadenzaOff}.
1475 @lilypond[verbatim,relative=2,quote]
1478 c4 c d8[ d d] f4 g4.
1484 Bar numbering is resumed at the end of the cadenza.
1486 @lilypond[verbatim,relative=2,quote]
1487 % Show all bar numbers
1488 \override Score.BarNumber.break-visibility = #all-visible
1491 c4 c d8[ d d] f4 g4.
1497 A new bar is never started within a cadenza, even if one or more
1498 @code{\bar} commands are inserted within it. Therefore, reminder
1499 accidentals will need to be added manually. See @ref{Accidentals}.
1501 @lilypond[verbatim,relative=2,quote]
1511 Automatic beaming is disabled by @code{\cadenzaOn}. Therefore, all
1512 beaming in cadenzas must be entered manually. See @ref{Manual beams}.
1514 @lilypond[verbatim,relative=2,quote]
1515 \repeat unfold 8 { c8 }
1521 \repeat unfold 8 { c8 }
1524 These predefined commands affect all staves in the score, even when
1525 placed in just one @code{Voice} context. To change this, move the
1526 @code{Timing_translator} from the @code{Score} context to the
1527 @code{Staff} context. See @ref{Polymetric notation}.
1539 @ref{Visibility of objects},
1540 @ref{Polymetric notation},
1547 @cindex cadenza, line breaks
1548 @cindex cadenza, page breaks
1549 @cindex unmetered music, line breaks
1550 @cindex unmetered music, page breaks
1551 @cindex breaks in unmetered music
1552 @cindex line breaks, cadenzas
1553 @cindex page breaks, cadenzas
1554 @cindex line breaks, unmetered music
1555 @cindex page breaks, unmetered music
1558 Automatic line and page breaks are inserted only at bar lines, so
1559 @q{invisible} bar lines will need to be inserted manually in long
1560 stretches of unmetered music to permit breaking:
1566 Explicitly create a @code{Voice} context when starting a piece with
1567 @code{\cadenzaOn}, else unexpected errors may occur.
1573 c16[^"Solo Free Time" d e f] g2.
1581 @node Polymetric notation
1582 @unnumberedsubsubsec Polymetric notation
1584 @c This section necessarily uses \set
1585 @c This is acceptable -td
1587 @cindex double time signatures
1588 @cindex signatures, polymetric
1589 @cindex time signatures, polymetric
1590 @cindex time signatures, double
1591 @cindex polymetric signatures
1592 @cindex meter, polymetric
1594 @funindex timeSignatureFraction
1595 @funindex \scaleDurations
1596 @funindex scaleDurations
1600 Polymetric notation is supported explicitly or by manually modifying the
1601 visible time signature symbol and/or scaling note durations.
1603 @subsubsubheading Different time signatures with equal-length measures
1605 Set a common time signature for each staff, and set the
1606 @code{timeSignatureFraction} to the desired fraction. Then use the
1607 @code{\scaleDurations} function to scale the durations of the notes in
1608 each staff to the common time signature.
1610 @cindex beams, with polymetric meters
1611 @cindex polymetric meters, with beams
1613 In the following example, music with the time signatures of 3/4, 9/8 and
1614 10/8 are used in parallel. In the second staff, shown durations are
1615 multiplied by 2/3 (because 2/3 * 9/8 = 3/4) and in the third staff, the
1616 shown durations are multiplied by 3/5 (because 3/5 * 10/8 = 3/4). It
1617 may be necessary to insert beams manually, as the duration scaling will
1618 affect the autobeaming rules.
1620 @lilypond[quote,verbatim]
1629 \set Staff.timeSignatureFraction = 9/8
1631 \repeat unfold 6 { c8[ c c] }
1635 \set Staff.timeSignatureFraction = 10/8
1636 \scaleDurations 3/5 {
1637 \repeat unfold 2 { c8[ c c] }
1638 \repeat unfold 2 { c8[ c] } |
1639 c4. c \times 2/3 { c8[ c c] } c4
1645 @subsubsubheading Different time signatures with unequal-length measures
1647 Each staff can be given its own independent time signature by
1648 moving the @code{Timing_translator} and the
1649 @code{Default_bar_line_engraver} to the @code{Staff} context.
1651 @lilypond[quote,verbatim]
1655 \remove "Timing_translator"
1656 \remove "Default_bar_line_engraver"
1660 \consists "Timing_translator"
1661 \consists "Default_bar_line_engraver"
1665 % Now each staff has its own time signature.
1689 @funindex \compoundMeter
1690 @cindex compound time signatures
1691 @cindex time signature, compound
1693 @subsubsubheading Compound time signatures
1695 These are created using the @code{\compoundMeter} function. The syntax
1699 \compoundMeter #'@code{(list of lists)}
1702 The simplest construction is a single list, where the @emph{last} number
1703 indicates the bottom number of the time signature and those that come
1704 before it, the top numbers.
1706 @lilypond[quote,verbatim]
1708 \compoundMeter #'((2 2 2 8))
1709 \repeat unfold 6 c8 \repeat unfold 12 c16
1713 More complex meters can be constructed using additional lists. Also,
1714 automatic beaming settings will be adjusted depending on the values.
1716 @lilypond[quote,verbatim]
1718 \compoundMeter #'((1 4) (3 8))
1719 \repeat unfold 5 c8 \repeat unfold 10 c16
1723 \compoundMeter #'((1 2 3 8) (3 4))
1724 \repeat unfold 12 c8
1731 @rglos{polymetric time signature},
1735 @ref{Automatic beams},
1737 @ref{Time signature},
1738 @ref{Scaling durations}.
1743 Internals Reference:
1744 @rinternals{TimeSignature},
1745 @rinternals{Timing_translator},
1746 @rinternals{Default_bar_line_engraver},
1750 When using different time signatures in parallel, notes at the same
1751 moment will be placed at the same horizontal location. However, the bar
1752 lines in the different staves will cause the note spacing to be less
1753 regular in each of the individual staves than would be normal without
1754 the different time signatures.
1757 @node Automatic note splitting
1758 @unnumberedsubsubsec Automatic note splitting
1760 @cindex notes, splitting
1761 @cindex splitting notes
1762 @cindex rests, splitting
1763 @cindex splitting rests
1765 @funindex Note_heads_engraver
1766 @funindex Completion_heads_engraver
1767 @funindex Completion_rest_engraver
1769 Long notes which overrun bar lines can be converted automatically to
1770 tied notes. This is done by replacing the @code{Note_heads_engraver}
1771 with the @code{Completion_heads_engraver}. Similarly, long rests which
1772 overrun bar lines are split automatically by replacing the
1773 @code{Rest_engraver} with the @code{Completion_rest_engraver}. In the
1774 following example, notes and rests crossing the bar lines are split,
1775 notes are also tied.
1777 @lilypond[quote,verbatim,relative=1]
1779 \remove "Note_heads_engraver"
1780 \consists "Completion_heads_engraver"
1781 \remove "Rest_engraver"
1782 \consists "Completion_rest_engraver"
1785 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 r1*2 }
1788 These engravers split all running notes and rests at the bar line, and
1789 inserts ties for notes. One of its uses is to debug complex scores: if
1790 the measures are not entirely filled, then the ties show exactly how
1791 much each measure is off.
1798 @rlearning{Engravers explained},
1799 @rlearning{Adding and removing engravers}.
1804 Internals Reference:
1805 @rinternals{Note_heads_engraver},
1806 @rinternals{Completion_heads_engraver},
1807 @rinternals{Rest_engraver},
1808 @rinternals{Completion_rest_engraver},
1809 @rinternals{Forbid_line_break_engraver}.
1812 Not all durations (especially those containing tuplets) can be
1813 represented exactly with normal notes and dots, but the
1814 @code{Completion_heads_engraver} will not insert tuplets.
1816 The @code{Completion_heads_engraver} only affects notes; it does not
1820 @node Showing melody rhythms
1821 @unnumberedsubsubsec Showing melody rhythms
1823 @cindex melody rhythms, showing
1824 @cindex rhythms, showing melody
1826 Sometimes you might want to show only the rhythm of a melody. This
1827 can be done with the rhythmic staff. All pitches of notes on such a
1828 staff are squashed, and the staff itself has a single line
1830 @lilypond[quote,relative=1,verbatim]
1832 \new RhythmicStaff {
1833 \new Voice = "myRhythm" {
1841 \lyricsto "myRhythm" {
1849 @cindex guitar chord charts
1850 @cindex strumming rhythms, showing
1851 @cindex guitar strumming rhythms, showing
1853 @funindex Pitch_squash_engraver
1854 @funindex \improvisationOn
1855 @funindex improvisationOn
1856 @funindex \improvisationOff
1857 @funindex improvisationOff
1859 Guitar chord charts often show the strumming rhythms. This can
1860 be done with the @code{Pitch_squash_engraver} and
1861 @code{\improvisationOn}.
1864 @lilypond[quote,verbatim]
1872 \consists "Pitch_squash_engraver"
1885 @code{\improvisationOn},
1886 @code{\improvisationOff}.
1892 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1893 {guitar-strum-rhythms.ly}
1899 Internals Reference:
1900 @rinternals{RhythmicStaff},
1901 @rinternals{Pitch_squash_engraver}.
1909 * Setting automatic beam behavior::
1914 @node Automatic beams
1915 @unnumberedsubsubsec Automatic beams
1917 By default, beams are inserted automatically:
1919 @cindex beams, manual
1920 @cindex manual beams
1921 @cindex beams, customizing rules
1923 @funindex \autoBeamOn
1924 @funindex autoBeamOn
1925 @funindex \autoBeamOff
1926 @funindex autoBeamOff
1928 @lilypond[quote,verbatim,relative=2]
1930 \time 6/8 c8 c c c8. c16 c8
1933 If these automatic decisions are not satisfactory, beaming can be
1934 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1935 entered manually if beams are to be extended over rests.
1937 If automatic beaming is not required, it may be turned off with
1938 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1940 @lilypond[quote,relative=1,verbatim]
1941 c4 c8 c8. c16 c8. c16 c8
1948 @cindex melismata, with beams
1949 @cindex beams, with melismata
1951 @warning{If beams are used to indicate melismata in songs, then
1952 automatic beaming should be switched off with @code{\autoBeamOff}
1953 and the beams indicated manually. Using @code{@bs{}partcombine} with
1954 @code{@bs{}autoBeamOff} can produce unintended results. See the
1955 snippets for more information.}
1957 Beaming patterns that differ from the automatic defaults can be
1958 created; see @ref{Setting automatic beam behavior}.
1961 @code{\autoBeamOff},
1965 @cindex beams, line breaks
1966 @cindex line breaks, beams
1967 @cindex beams, with knee gap
1968 @cindex knee gap, with beams
1972 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1973 {beams-across-line-breaks.ly}
1975 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1976 {changing-beam-knee-gap.ly}
1978 @cindex beams, \partcombine with \autoBeamOff
1979 @cindex voices, \partcombine with \autoBeamOff
1981 @lilypondfile [verbatim, quote, ragged-right, texidoc, doctitle]
1982 {partcombine-and-autobeamoff.ly}
1987 @ref{Setting automatic beam behavior}.
1990 @file{scm/auto-beam.scm}.
1995 Internals Reference:
1996 @rinternals{Auto_beam_engraver},
1997 @rinternals{Beam_engraver},
1999 @rinternals{BeamEvent},
2000 @rinternals{BeamForbidEvent},
2001 @rinternals{beam-interface},
2002 @rinternals{unbreakable-spanner-interface}.
2005 The properties of a beam are determined at the @emph{start} of its
2006 construction and any additional beam-property changes that occur before
2007 the beam has been completed will not take effect until the @emph{next},
2011 @node Setting automatic beam behavior
2012 @unnumberedsubsubsec Setting automatic beam behavior
2014 @cindex beams, with lyrics
2015 @cindex lyrics, with beams
2017 @funindex autoBeaming
2018 @funindex baseMoment
2019 @funindex beamExceptions
2020 @funindex beatStructure
2021 @funindex measureLength
2027 When automatic beaming is enabled, the placement of automatic beams
2028 is determined by three context properties:
2029 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2030 The default values of these variables may be overridden as described
2031 below, or alternatively the default values themselves may be changed
2032 as explained in @ref{Time signature}.
2034 If a @code{beamExceptions} rule is defined for the time signature in
2035 force, that rule is used to determine the beam placement. If no
2036 @code{beamExceptions} rule is defined for the time signature in force,
2037 the beam placement is determined by the settings of @code{baseMoment}
2038 and @code{beatStructure}.
2040 By default, @code{beamExceptions} rules are defined for most common
2041 time signatures, so the @code{beamException} rules must be disabled
2042 if automatic beaming is to be based on @code{baseMoment} and
2043 @code{beatStructure}. The @code{beamExceptions} rules are disabled
2047 \set Timing.beamExceptions = #'()
2051 @subsubsubheading Beaming based on @code{baseMoment} and @code{beatStructure}
2053 In most instances, automatic beams will end at the end of a beat.
2054 The ending points for beats are determined by the context properties
2055 @code{baseMoment} and @code{beatStructure}. @code{beatStructure}
2056 is a scheme list that defines the length of each beat in the measure
2057 in units of @code{baseMoment}. By default, @code{baseMoment} is
2058 one over the denominator of the time signature. By default,
2059 each unit of length @code{baseMoment} is a single beat.
2061 @lilypond[quote,relative=2,verbatim]
2063 c16^"default" c c c c |
2064 \set Timing.beatStructure = #'(2 3)
2065 c16^"(2+3)" c c c c |
2066 \set Timing.beatStructure = #'(3 2)
2067 c16^"(3+2)" c c c c |
2070 If a common time signature is being used, @code{beamExceptions}
2071 @emph{must} be disabled to enable @code{beatStructure} to work.
2072 The @code{\set Timing.beamExceptions = #'()} command can always
2073 be included if beaming is being determined by @code{beatStructure}.
2075 @lilypond[quote,relative=2,verbatim]
2077 a8^"default" a a a a a a a
2079 \set Timing.baseMoment = #(ly:make-moment 1 4)
2080 \set Timing.beatStructure = #'(1 1 1 1)
2081 a8^"no change" a a a a a a a
2083 \set Timing.beamExceptions = #'()
2084 \set Timing.baseMoment = #(ly:make-moment 1 4)
2085 \set Timing.beatStructure = #'(1 1 1 1)
2086 a8^"changed" a a a a a a a
2089 Beam setting changes can be limited to specific contexts. If no
2090 setting is included in a lower-level context, the setting of the
2091 enclosing context will apply.
2093 @lilypond[quote, verbatim,relative=1]
2096 \set Staff.beatStructure = #'(2 3 2)
2106 \set Voice.beatStructure = #'(1 3 3)
2114 When multiple voices are used the @code{Staff} context must be
2115 specified if the beaming is to be applied to all voices in the
2118 @lilypond[quote,verbatim,relative=2]
2121 % Change applied to Voice by default -- does not work correctly
2122 % Because of autogenerated voices, all beating will
2123 % be at baseMoment (1 . 8)
2124 \set beatStructure = #'(3 1 1 2)
2125 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2127 % Works correctly with context Staff specified
2128 \set Staff.beatStructure = #'(3 1 1 2)
2129 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2132 The value of @code{baseMoment} can be adjusted to change
2133 the beaming behavior, if desired. When this is done,
2134 the value of @code{beatStructure} must be set to be
2135 compatible with the new value of @code{baseMoment}.
2137 @lilypond[quote,verbatim,relative=2]
2139 \set Timing.baseMoment = #(ly:make-moment 1 16)
2140 \set Timing.beatStructure = #'(7 3)
2141 \repeat unfold 10 { a16 }
2144 @code{baseMoment} is a @i{moment}; a unit of musical duration. A
2145 quantity of type @i{moment} is created by the scheme function
2146 @code{ly:make-moment}. For more information about this function,
2147 see @ref{Time administration}.
2149 By default @code{baseMoment} is set to one over the denominator of
2150 the time signature. Any exceptions to this default can be found in
2151 @file{scm/time-signature-settings.scm}.
2153 @subsubsubheading Beaming based on @code{beamExceptions}
2155 Special autobeaming rules (other than ending a beam on a beat)
2156 are defined in the @code{beamExceptions} property.
2158 @lilypond[quote,relative=2,verbatim]
2160 \set Timing.beatStructure = #'(2 1)
2161 \set Timing.beamExceptions =
2163 (end . ;entry for end of beams
2164 ( ;start of alist of end points
2165 ((1 . 32) . (2 2 2)) ;rule for 1/32 beams -- end each 1/16
2166 ))) %close all entries
2168 \repeat unfold 6 { c32 } |
2171 @code{beamExceptions} is an alist with a key of rule-type and a value
2174 At this time the only available value of rule-type is
2175 @code{'end} for beam ending.
2177 Beaming-rules is a scheme alist (or list of pairs) that indicates the
2178 beam type and the grouping to be applied to beams containing notes with
2179 a shortest duration of that beam type.
2182 #'((beam-type1 . grouping-1)
2183 (beam-type2 . grouping-2)
2184 (beam-type3 . grouping-3))
2187 Beam type is a scheme pair indicating the duration of the beam,
2188 e.g., @code{(1 . 16)}.
2190 Grouping is a scheme list indicating the grouping to be applied to
2191 the beam. The grouping is in units of the beam type.
2193 @warning{ A @code{beamExceptions} value must be @emph{complete}
2194 exceptions list. That is, every exception that should be applied
2195 must be included in the setting. It is not possible to add, remove,
2196 or change only one of the exceptions. While this may seem cumbersome,
2197 it means that the current beaming settings need not be known in order
2198 to specify a new beaming pattern.}
2200 When the time signature is changed, default values of
2201 @code{Timing.baseMoment}, @code{Timing.beatStructure},
2202 and @code{Timing.beamExceptions} are set. Setting the time signature
2203 will reset the automatic beaming settings for the @code{Timing}
2204 context to the default behavior.
2206 @lilypond[quote,verbatim,relative=2]
2208 \repeat unfold 6 { a8 }
2210 \set Timing.beatStructure = #'(4 2)
2211 \repeat unfold 6 { a8 }
2212 % go back to default behavior
2214 \repeat unfold 6 { a8 }
2217 The default automatic beaming settings for a time signature
2218 are determined in @file{scm/time-signature-settings.scm}.
2219 Changing the default automatic beaming settings
2220 for a time signature is described in @ref{Time signature}.
2222 Many automatic beaming settings for a time signature contain an
2223 entry for @code{beamExceptions}. For example, 4/4 time tries to
2224 beam the measure in two if there are only eighth notes. The
2225 @code{beamExceptions} rule can override the @code{beatStructure} setting
2226 if @code{beamExceptions} is not reset.
2228 @lilypond[quote,verbatim,relative=2]
2230 \set Timing.baseMoment = #(ly:make-moment 1 8)
2231 \set Timing.beatStructure = #'(3 3 2)
2232 % This won't beam (3 3 2) because of beamExceptions
2233 \repeat unfold 8 {c8} |
2234 % This will beam (3 3 2) because we clear beamExceptions
2235 \set Timing.beamExceptions = #'()
2236 \repeat unfold 8 {c8}
2239 In a similar fashion, eighth notes in 3/4 time are beamed as a full
2240 measure by default. To beam eighth notes in 3/4 time on the beat,
2241 reset @code{beamExceptions}.
2243 @lilypond[quote,verbatim,relative=2]
2245 % by default we beam in (6) due to beamExceptions
2246 \repeat unfold 6 {a8} |
2247 % This will beam (1 1 1) due to beatLength
2248 \set Timing.beamExceptions = #'()
2249 \repeat unfold 6 {a8}
2252 In engraving from the Romantic and Classical periods,
2253 beams often begin midway through the measure in 3/4 time,
2254 but modern practice is to avoid the false impression of 6/8 time
2255 (see Gould, p. 153). Similar situations arise in 3/8 time.
2256 This behavior is controlled by the context property @code{beamHalfMeasure},
2257 which has effect only in time signatures with 3 in the numerator:
2259 @lilypond[quote,verbatim,relative=2]
2262 \set Timing.beamHalfMeasure = ##f
2266 @subsubsubheading How automatic beaming works
2268 When automatic beaming is enabled, the placement of automatic beams
2269 is determined by the context properties
2270 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2272 The following rules, in order of priority, apply when determining
2273 the appearance of beams:
2277 If a manual beam is specified with @code{[..]} set the beam
2278 as specified, otherwise
2281 if a beam-ending rule is defined in @code{beamExceptions}
2282 for the beam-type, use it to determine the valid places where
2283 beams may end, otherwise
2286 if a beam-ending rule is defined in @code{beamExceptions}
2287 for a longer beam-type, use it to determined the valid places
2288 where beams may end, otherwise
2291 use the values of @code{baseMoment} and @code{beatStructure} to
2292 determine the ends of the beats in the measure, and
2293 end beams at the end of beats.
2297 In the rules above, the @emph{beam-type} is the duration of the
2298 shortest note in the beamed group.
2300 The default beaming rules can be found in
2301 @file{scm/time-signature-settings.scm}.
2305 @cindex beams, subdividing
2307 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2308 {subdividing-beams.ly}
2310 @cindex beamlets, orienting
2312 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2313 {strict-beat-beaming.ly}
2315 @cindex measure groupings
2316 @cindex beats, grouping
2317 @cindex grouping beats
2318 @cindex measure sub-grouping
2320 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2321 {conducting-signs,-measure-grouping-signs.ly}
2323 @cindex beam, endings in a score
2324 @cindex beam, endings with multiple voices
2326 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2327 {beam-endings-in-score-context.ly}
2331 @ref{Time signature}.
2334 @file{scm/time-signature-settings.scm}.
2339 Internals Reference:
2340 @rinternals{Auto_beam_engraver},
2342 @rinternals{BeamForbidEvent},
2343 @rinternals{beam-interface}.
2346 If a score ends while an automatic beam has not been ended and is
2347 still accepting notes, this last beam will not be typeset at all.
2348 The same holds for polyphonic voices, entered with
2349 @code{<< @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
2350 automatic beam is still accepting notes, it is not typeset.
2351 The workaround for these problems is to manually beam the last
2352 beam in the voice or score.
2354 By default, the @code{Timing} translator is aliased to the
2355 @code{Score} context. This means that setting the time signature
2356 in one staff will affect the beaming of the other staves as well.
2357 Thus, a time signature setting in a later staff will reset custom
2358 beaming that was set in an earlier staff.
2359 One way to avoid this problem is to set the time signature
2362 @lilypond[quote,verbatim,relative=2]
2366 \set Timing.baseMoment = #(ly:make-moment 1 8)
2367 \set Timing.beatStructure = #'(1 5)
2368 \repeat unfold 6 { a8 }
2371 \repeat unfold 6 { a8 }
2376 The default beam settings for the time signature can also be changed, so
2377 that the desired beaming will always be used. Changes in automatic
2378 beaming settings for a time signature are described in
2379 @ref{Time signature}.
2381 @lilypond[quote,verbatim,relative=2]
2384 \overrideTimeSignatureSettings
2385 3/4 % timeSignatureFraction
2386 1/8 % baseMomentFraction
2387 #'(1 5) % beatStructure
2388 #'() % beamExceptions
2390 \repeat unfold 6 { a8 }
2394 \repeat unfold 6 { a8 }
2401 @unnumberedsubsubsec Manual beams
2403 @cindex beams, manual
2404 @cindex manual beams
2409 In some cases it may be necessary to override the automatic
2410 beaming algorithm. For example, the autobeamer will not put beams
2411 over rests or bar lines, and in choral scores the beaming is
2412 often set to follow the meter of the lyrics rather than the
2413 notes. Such beams can be specified manually by
2414 marking the begin and end point with @code{[} and @code{]}.
2416 @lilypond[quote,relative=1,verbatim]
2417 r4 r8[ g' a r] r g[ | a] r
2420 @cindex manual beams, direction shorthand for
2421 @cindex manual beams, grace notes
2423 Beaming direction can be set manually using direction indicators:
2425 @lilypond[quote,relative=2,verbatim]
2426 c8^[ d e] c,_[ d e f g]
2432 Individual notes may be marked with @code{\noBeam} to prevent them
2435 @lilypond[quote,verbatim,relative=2]
2440 Grace note beams and normal note beams can occur simultaneously.
2441 Unbeamed grace notes are not put into normal note beams.
2443 @lilypond[quote,verbatim,relative=2]
2445 \grace { e32[ d c d] }
2451 @funindex stemLeftBeamCount
2452 @funindex stemRightBeamCount
2454 Even more strict manual control with the beams can be achieved by
2455 setting the properties @code{stemLeftBeamCount} and
2456 @code{stemRightBeamCount}. They specify the number of beams to
2457 draw on the left and right side, respectively, of the next note.
2458 If either property is set, its value will be used only once, and
2459 then it is erased. In this example, the last @code{f} is printed
2460 with only one beam on the left side, i.e., the eighth-note beam of
2461 the group as a whole.
2463 @lilypond[quote,relative=2,verbatim]
2466 \set stemLeftBeamCount = #2
2467 \set stemRightBeamCount = #1
2469 \set stemLeftBeamCount = #1
2481 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2482 {flat-flags-and-beam-nibs.ly}
2486 @ref{Direction and placement},
2492 Internals Reference:
2494 @rinternals{BeamEvent},
2495 @rinternals{Beam_engraver},
2496 @rinternals{beam-interface},
2497 @rinternals{Stem_engraver}.
2500 @node Feathered beams
2501 @unnumberedsubsubsec Feathered beams
2503 @cindex beams, feathered
2504 @cindex feathered beams
2506 @funindex \featherDurations
2507 @funindex featherDurations
2508 @funindex grow-direction
2510 Feathered beams are used to indicate that a small group of notes
2511 should be played at an increasing (or decreasing) tempo, without
2512 changing the overall tempo of the piece. The extent of the
2513 feathered beam must be indicated manually using @code{[} and
2514 @code{]}, and the beam feathering is turned on by specifying a
2515 direction to the @code{Beam} property @code{grow-direction}.
2517 If the placement of the notes and the sound in the MIDI output is to
2518 reflect the @emph{ritardando} or @emph{accelerando} indicated by the
2519 feathered beam the notes must be grouped as a music expression delimited
2520 by braces and preceded by a @code{featherDurations} command which specifies
2521 the ratio between the durations of the first and last notes in the
2524 The square brackets show the extent of the beam and the braces show
2525 which notes are to have their durations modified. Normally these
2526 would delimit the same group of notes, but this is not required: the
2527 two commands are independent.
2529 In the following example the eight 16th notes occupy exactly the
2530 same time as a half note, but the first note is one half as long
2531 as the last one, with the intermediate notes gradually
2532 lengthening. The first four 32nd notes gradually speed up, while
2533 the last four 32nd notes are at a constant tempo.
2535 @lilypond[relative=1,verbatim,quote]
2536 \override Beam.grow-direction = #LEFT
2537 \featherDurations #(ly:make-moment 2 1)
2538 { c16[ c c c c c c c] }
2539 \override Beam.grow-direction = #RIGHT
2540 \featherDurations #(ly:make-moment 2 3)
2542 % revert to non-feathered beams
2543 \override Beam.grow-direction = #'()
2548 The spacing in the printed output represents the
2549 note durations only approximately, but the MIDI output is exact.
2552 @code{\featherDurations}.
2560 The @code{\featherDurations} command only works with very short
2561 music snippets, and when numbers in the fraction are small.
2570 * Bar and bar number checks::
2575 @unnumberedsubsubsec Bar lines
2578 @cindex measure lines
2579 @cindex closing bar lines
2580 @cindex bar lines, closing
2581 @cindex double bar lines
2582 @cindex bar lines, double
2588 Bar lines delimit measures, and are also used to indicate
2589 repeats. Normally, simple bar lines are automatically inserted
2590 into the printed output at places based on the current time
2593 The simple bar lines inserted automatically can be changed to
2594 other types with the @code{\bar} command. For example, a closing
2595 double bar line is usually placed at the end of a piece:
2597 @lilypond[quote,relative=1,verbatim]
2601 It is not invalid if the final note in a measure does not
2602 end on the automatically entered bar line: the note is assumed
2603 to carry over into the next measure. But if a long sequence
2604 of such carry-over measures appears the music can appear compressed
2605 or even flowing off the page. This is because automatic line
2606 breaks happen only at the end of complete measures, i.e., where
2607 all notes end before the end of a measure.
2609 @warning{An incorrect duration can cause line breaks to be
2610 inhibited, leading to a line of highly compressed music or
2611 music which flows off the page.}
2614 @cindex bar lines, invisible
2615 @cindex measure lines, invisible
2617 Line breaks are also permitted at manually inserted bar lines
2618 even within incomplete measures. To allow a line break without
2619 printing a bar line, use the following:
2626 This will insert an invisible bar line and allow (but not
2627 force) a line break to occur at this point. The bar number
2628 counter is not increased. To force a line break see
2629 @ref{Line breaking}.
2631 @cindex manual bar lines
2632 @cindex manual measure lines
2633 @cindex bar lines, manual
2634 @cindex measure lines, manual
2636 This and other special bar lines may be inserted manually at any
2637 point. When they coincide with the end of a measure they replace
2638 the simple bar line which would have been inserted there
2639 automatically. When they do not coincide with the end of a measure
2640 the specified bar line is inserted at that point in the printed
2643 Note that manual bar lines are purely visual. They do not affect
2644 any of the properties that a normal bar line would affect, such as
2645 measure numbers, accidentals, line breaks, etc. They do not affect
2646 the calculation and placement of subsequent automatic bar lines.
2647 When a manual bar line is placed where a normal bar line already
2648 exists, the effects of the original bar line are not altered.
2650 Two types of simple bar lines and five types of double bar lines are
2651 available for manual insertion:
2653 @lilypond[quote,relative=1,verbatim]
2665 together with dotted and dashed bar lines:
2667 @lilypond[quote,relative=1,verbatim]
2674 and nine types of repeat bar lines:
2676 @lilypond[quote,relative=1,verbatim]
2689 Additionally, a bar line can be printed as a simple tick:
2690 @lilypond[quote,relative=1,verbatim]
2693 However, as such ticks are typically used in Gregorian chant, it is
2694 preferable to use @code{\divisioMinima} there instead, described in
2695 the section @ref{Divisiones} in Gregorian chant.
2697 Lilypond supports kievan notation and provides a special kievan
2699 @lilypond[quote,relative=1,verbatim]
2702 Further details of this notation are explained in
2703 @ref{Typesetting Kievan square notation}.
2707 For in-line segno signs, there are three types of bar lines which
2708 differ in their behavior at line breaks:
2710 @lilypond[quote,relative=2,verbatim]
2728 Although the bar line types signifying repeats may be inserted
2729 manually they do not in themselves cause LilyPond to recognize
2730 a repeated section. Such repeated sections are better entered
2731 using the various repeat commands (see @ref{Repeats}), which
2732 automatically print the appropriate bar lines.
2734 In addition, you can specify @code{".|:-||"}, which is equivalent to
2735 @code{".|:"} except at line breaks, where it gives a double bar
2736 line at the end of the line and a start repeat at the beginning of
2739 @lilypond[quote,relative=2,verbatim]
2747 For combinations of repeats with the segno sign, there are six different
2750 @lilypond[quote,relative=2,verbatim]
2778 Additionally there is an @code{\inStaffSegno} command which
2779 creates a segno bar, placed in cooperation
2780 with the @code{\repeat volta} command.
2782 @funindex \defineBarLine
2783 @funindex defineBarLine
2784 @cindex bar lines, defining
2785 @cindex defining bar lines
2787 New bar line types can be defined with @code{\defineBarLine}:
2790 \defineBarLine @var{bartype} #'(@var{end} @var{begin} @var{span})
2793 The @code{\defineBarline} variables can include the
2794 @q{empty} string @code{""}, which is equivalent to an invisible
2795 bar line being printed. Or they can be set to @code{#f} which
2796 prints no bar line at all.
2798 After the definiton, the new bar line can be used by
2799 @code{\bar} @var{bartype}.
2801 There are currently ten bar line elements available:
2803 @lilypond[quote,verbatim]
2804 \defineBarLine ":" #'("" ":" "")
2805 \defineBarLine "=" #'("=" "" "")
2806 \defineBarLine "[" #'("" "[" "")
2807 \defineBarLine "]" #'("]" "" "")
2824 The @code{"="} bar line provides the double span bar line, used
2825 in combination with the segno sign. Do not use it as a standalone
2826 double thin bar line; here, @code{\bar} @var{"||"} is
2829 The @code{"-"} sign starts annotations to bar lines which
2830 are useful to distinguish those with identical appearance
2831 but different behavior at line breaks and/or different span bars.
2832 The part following the @code{"-"} sign is not used for building up
2835 @lilypond[quote,relative=2,verbatim]
2836 \defineBarLine "||-dashedSpan" #'("||" "" "!!")
2841 c1 \bar "||-dashedSpan"
2852 Furthermore, the space character @code{" "} serves as a placeholder
2853 for defining span bars correctly aligned to the main bar lines:
2855 @lilypond[quote,relative=2,verbatim]
2856 \defineBarLine ":|.-wrong" #'(":|." "" "|.")
2857 \defineBarLine ":|.-right" #'(":|." "" " |.")
2873 If additional elements are needed, LilyPond provides a simple
2874 way to define them. For more informations on modifying or adding
2875 bar lines, see file @file{scm/bar-line.scm}.
2877 In scores with many staves, a @code{\bar} command in one staff is
2878 automatically applied to all staves. The resulting bar lines are
2879 connected between different staves of a @code{StaffGroup},
2880 @code{PianoStaff}, or @code{GrandStaff}.
2882 @lilypond[quote,relative=1,verbatim]
2890 \new Staff { \clef bass c4 g e g }
2892 \new Staff { \clef bass c2 c2 }
2897 @cindex default bar lines, changing
2898 @cindex bar lines, default, changing
2901 @funindex defaultBarType
2906 The command @samp{\bar @var{bartype}} is a shortcut for
2907 @samp{\set Timing.whichBar = @var{bartype}}. A bar line is
2908 created whenever the @code{whichBar} property is set.
2910 The default bar type used for automatically inserted bar lines is
2911 @code{"|"}. This may be changed at any time with
2912 @samp{\set Timing.defaultBarType = @var{bartype}}.
2916 @ref{Line breaking},
2918 @ref{Grouping staves}.
2921 @file{scm/bar-line.scm}.
2926 Internals Reference:
2927 @rinternals{BarLine} (created at @code{Staff} level),
2928 @rinternals{SpanBar} (across staves),
2929 @rinternals{Timing_translator} (for Timing properties).
2933 @unnumberedsubsubsec Bar numbers
2936 @cindex measure numbers
2937 @cindex numbers, bar
2938 @cindex numbers, measure
2940 @funindex currentBarNumber
2942 Bar numbers are typeset by default at the start of every line except
2943 the first line. The number itself is stored in the
2944 @code{currentBarNumber} property, which is normally updated
2945 automatically for every measure. It may also be set manually:
2947 @lilypond[verbatim,quote,relative=1]
2950 \set Score.currentBarNumber = #50
2954 @cindex bar numbers, regular spacing
2956 @funindex barNumberVisibility
2959 Bar numbers can be typeset at regular intervals instead of just at
2960 the beginning of every line. To do this the default behavior
2961 must be overridden to permit bar numbers to be printed at places
2962 other than the start of a line. This is controlled by the
2963 @code{break-visibility} property of @code{BarNumber}. This takes
2964 three values which may be set to @code{#t} or @code{#f} to specify
2965 whether the corresponding bar number is visible or not. The order
2966 of the three values is @code{end of line visible}, @code{middle of
2967 line visible}, @code{beginning of line visible}. In the following
2968 example bar numbers are printed at all possible places:
2970 @lilypond[verbatim,quote,relative=1]
2971 \override Score.BarNumber.break-visibility = ##(#t #t #t)
2972 \set Score.currentBarNumber = #11
2973 % Permit first bar number to be printed
2981 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2982 {printing-the-bar-number-for-the-first-measure.ly}
2984 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2985 {printing-bar-numbers-at-regular-intervals.ly}
2987 @cindex measure number, format
2988 @cindex bar number, format
2990 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2991 {printing-bar-numbers-inside-boxes-or-circles.ly}
2993 @cindex bar numbers, with letters
2994 @cindex bar numbers, with repeats
2996 @lilypondfile[verbatim,quote,texidoc,doctitle]
2997 {alternative-bar-numbering.ly}
2999 @cindex bar number alignment
3001 @lilypondfile[verbatim,quote,texidoc,doctitle]
3002 {aligning-bar-numbers.ly}
3004 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3005 {removing-bar-numbers-from-a-score.ly}
3011 Internals Reference:
3012 @rinternals{BarNumber},
3013 @rinternals{Bar_number_engraver}.
3015 @cindex bar number collision
3016 @cindex collision, bar number
3019 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
3020 if there is one. To solve this, the @code{padding} property of
3021 @code{BarNumber} can be used to position the number correctly. See
3022 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
3025 @node Bar and bar number checks
3026 @unnumberedsubsubsec Bar and bar number checks
3029 @cindex bar number check
3030 @cindex measure check
3031 @cindex measure number check
3033 @funindex barCheckSynchronize
3036 Bar checks help detect errors in the entered durations. A bar check
3037 may be entered using the bar symbol, @code{|}, at any place where a
3038 bar line is expected to fall. If bar check lines are encountered at
3039 other places, a list of warnings is printed in the log file, showing
3040 the line numbers and lines in which the bar checks failed. In the
3041 next example, the second bar check will signal an error.
3044 \time 3/4 c2 e4 | g2 |
3047 Bar checks can also be used in lyrics:
3052 Twin -- kle | Twin -- kle |
3056 An incorrect duration can result in a completely garbled score,
3057 especially if the score is polyphonic, so a good place to start
3058 correcting input is by scanning for failed bar checks and
3059 incorrect durations.
3061 If successive bar checks are off by the same musical interval,
3062 only the first warning message is displayed. This allows the
3063 warning to focus on the source of the timing error.
3067 @funindex pipeSymbol
3069 It is also possible to redefine the action taken when a bar check
3070 or pipe symbol, @code{|}, is encountered in the input, so that
3071 it does something other than a bar check. This is done by
3072 assigning a music expression to @code{pipeSymbol}.
3073 In the following example @code{|} is set to insert a double bar
3074 line wherever it appears in the input, rather than checking
3077 @lilypond[quote,verbatim]
3078 pipeSymbol = \bar "||"
3087 @funindex \barNumberCheck
3088 @funindex barNumberCheck
3090 When copying large pieces of music, it can be helpful to check that
3091 the LilyPond bar number corresponds to the original that you are
3092 entering from. This can be checked with @code{\barNumberCheck}, for
3096 \barNumberCheck #123
3100 will print a warning if the @code{currentBarNumber} is not 123
3101 when it is processed.
3108 @node Rehearsal marks
3109 @unnumberedsubsubsec Rehearsal marks
3111 @cindex rehearsal marks
3112 @cindex mark, rehearsal
3117 To print a rehearsal mark, use the @code{\mark} command.
3119 @lilypond[quote,verbatim,relative=2]
3127 The mark is incremented automatically if you use @code{\mark
3128 \default}, but you can also use an integer argument to set the
3129 mark manually. The value to use is stored in the property
3130 @code{rehearsalMark}.
3132 @lilypond[quote,verbatim,relative=2]
3141 The letter@tie{}@q{I} is skipped in accordance with engraving
3142 traditions. If you wish to include the letter @q{I}, then use one
3143 of the following commands, depending on which style of rehearsal mark
3144 you want (letters only, letters in a hollow box, or letters in a
3148 \set Score.markFormatter = #format-mark-alphabet
3149 \set Score.markFormatter = #format-mark-box-alphabet
3150 \set Score.markFormatter = #format-mark-circle-alphabet
3153 @lilypond[quote,verbatim,relative=2]
3154 \set Score.markFormatter = #format-mark-box-alphabet
3162 @cindex rehearsal mark format
3163 @cindex rehearsal mark style
3164 @cindex style, rehearsal mark
3165 @cindex format, rehearsal mark
3166 @cindex mark, rehearsal, style
3167 @cindex mark, rehearsal, format
3168 @cindex rehearsal mark, manual
3169 @cindex mark, rehearsal, manual
3170 @cindex custom rehearsal mark
3171 @cindex manual rehearsal mark
3173 The style is defined by the property @code{markFormatter}. It is
3174 a function taking the current mark (an integer) and the current
3175 context as argument. It should return a markup object. In the
3176 following example, @code{markFormatter} is set to a pre-defined
3177 procedure. After a few measures, it is set to a procedure that
3178 produces a boxed number.
3180 @lilypond[quote,verbatim,relative=2]
3181 \set Score.markFormatter = #format-mark-numbers
3184 \set Score.markFormatter = #format-mark-box-numbers
3186 \set Score.markFormatter = #format-mark-circle-numbers
3188 \set Score.markFormatter = #format-mark-circle-letters
3192 The file @file{scm/translation-functions.scm} contains the
3193 definitions of @code{format-mark-numbers} (the default format),
3194 @code{format-mark-box-numbers}, @code{format-mark-letters} and
3195 @code{format-mark-box-letters}. These can be used as inspiration
3196 for other formatting functions.
3198 You may use @code{format-mark-barnumbers},
3199 @code{format-mark-box-barnumbers}, and
3200 @code{format-mark-circle-barnumbers} to get bar numbers instead of
3201 incremented numbers or letters.
3203 Other styles of rehearsal mark can be specified manually:
3210 Note that @code{Score.markFormatter} does not affect marks specified
3211 in this manner. However, it is possible to apply a @code{\markup} to the
3215 \mark \markup@{ \box A1 @}
3220 @cindex D.S. al Fine
3222 @cindex music glyphs
3223 @cindex glyphs, music
3225 @funindex \musicglyph
3226 @funindex musicglyph
3228 Music glyphs (such as the segno sign) may be printed inside a
3231 @lilypond[quote,verbatim,relative=1]
3232 c1 \mark \markup { \musicglyph #"scripts.segno" }
3233 c1 \mark \markup { \musicglyph #"scripts.coda" }
3234 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
3239 See @ref{The Feta font}, for a list of symbols which may be
3240 printed with @code{\musicglyph}.
3242 For common tweaks to the positioning of rehearsal marks, see
3243 @ref{Formatting text}. For more precise control, see
3244 @code{break-alignable-interface} in @ref{Aligning objects}.
3246 The file @file{scm/translation-functions.scm} contains
3247 the definitions of @code{format-mark-numbers} and
3248 @code{format-mark-letters}. They can be used as inspiration for
3249 other formatting functions.
3253 @ref{The Feta font},
3254 @ref{Formatting text},
3255 @ref{Aligning objects}.
3258 @file{scm/translation-functions.scm}.
3263 Internals Reference:
3264 @rinternals{MarkEvent},
3265 @rinternals{Mark_engraver},
3266 @rinternals{RehearsalMark}.
3269 @node Special rhythmic concerns
3270 @subsection Special rhythmic concerns
3275 * Aligning to cadenzas::
3276 * Time administration::
3280 @unnumberedsubsubsec Grace notes
3284 @cindex appoggiatura
3285 @cindex acciaccatura
3288 @funindex \slashedGrace
3289 @funindex \acciaccatura
3290 @funindex \appoggiatura
3292 Grace notes are musical ornaments, printed in a smaller font, that take
3293 up no additional logical time in a measure.
3295 @lilypond[quote,relative=2,verbatim]
3297 \grace { b16[ c16] } a2)
3300 There are three other types of grace notes possible; the
3301 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
3302 note with a slashed stem -- and the @emph{appoggiatura}, which takes a
3303 fixed fraction of the main note it is attached to and prints without the
3304 slash. It is also possible to write a grace note with a slashed stem,
3305 like the @emph{acciaccatura} but without the slur, so as to place it
3306 between notes that are slurred themselves, using the
3307 @code{\slashedGrace} function.
3309 @lilypond[quote,relative=2,verbatim]
3312 \acciaccatura { g16[ f] } e2
3313 \slashedGrace a,8 g4
3314 \slashedGrace b16 a4(
3315 \slashedGrace b8 a2)
3318 The placement of grace notes is synchronized between different staves.
3319 In the following example, there are two sixteenth grace notes for every
3322 @lilypond[quote,relative=2,verbatim]
3324 \new Staff { e2 \grace { c16[ d e f] } e2 }
3325 \new Staff { c2 \grace { g8[ b] } c2 }
3329 @cindex grace notes, following
3331 @funindex \afterGrace
3332 @funindex afterGrace
3334 If you want to end a note with a grace, use the @code{\afterGrace}
3335 command. It takes two arguments: the main note, and the grace
3336 notes following the main note.
3338 @lilypond[quote,verbatim,relative=2]
3339 c1 \afterGrace d1 { c16[ d] } c1
3342 This will put the grace notes after a space lasting 3/4 of the
3343 length of the main note. The default fraction 3/4 can be changed by
3344 setting @code{afterGraceFraction}. The following example shows
3345 the results from setting the space at the default, at 15/16, and
3346 finally at 1/2 of the main note.
3348 @lilypond[quote,verbatim,relative=2]
3351 c1 \afterGrace d1 { c16[ d] } c1
3354 #(define afterGraceFraction (cons 15 16))
3355 c1 \afterGrace d1 { c16[ d] } c1
3358 #(define afterGraceFraction (cons 1 2))
3359 c1 \afterGrace d1 { c16[ d] } c1
3364 The space between the main note and the grace note may also be
3365 specified using spacers. The following example places the grace
3366 note after a space lasting 7/8 of the main note.
3368 @lilypond[quote,verbatim,relative=2]
3372 { s2 s4. \grace { c16[ d] } }
3378 @cindex tweaking grace notes
3379 @cindex grace notes, tweaking
3380 @cindex grace notes, changing layout settings
3382 A @code{\grace} music expression will introduce special
3383 typesetting settings, for example, to produce smaller type, and
3384 set directions. Hence, when introducing layout tweaks to
3385 override the special settings, they should be placed inside
3386 the grace expression. The overrides should also be reverted
3387 inside the grace expression. Here, the grace note's default stem
3388 direction is overridden and then reverted.
3390 @lilypond[quote,verbatim,relative=2]
3402 @cindex stem, with slash
3407 @lilypondfile[verbatim,quote,texidoc,doctitle]
3408 {using-grace-note-slashes-with-normal-heads.ly}
3410 @lilypondfile[verbatim,quote,texidoc,doctitle]
3411 {tweaking-grace-layout-within-music.ly}
3413 @lilypondfile[verbatim,quote,texidoc,doctitle]
3414 {redefining-grace-note-global-defaults.ly}
3416 @lilypondfile[verbatim,quote,texidoc,doctitle]
3417 {positioning-grace-notes-with-floating-space.ly}
3421 @rglos{grace notes},
3422 @rglos{acciaccatura},
3423 @rglos{appoggiatura}.
3426 @ref{Scaling durations},
3430 @file{ly/grace-init.ly}.
3435 Internals Reference:
3436 @rinternals{GraceMusic},
3437 @rinternals{Grace_beam_engraver},
3438 @rinternals{Grace_engraver},
3439 @rinternals{Grace_spacing_engraver}.
3443 @cindex acciaccatura, multi-note
3444 @cindex multi-note acciaccatura
3445 @cindex grace-note synchronization
3447 A multi-note beamed @i{acciaccatura} is printed without a slash,
3448 and looks exactly the same as a multi-note beamed
3451 @c TODO Add link to LSR snippet to add slash when available
3453 Grace note synchronization can also lead to surprises. Staff
3454 notation, such as key signatures, bar lines, etc., are also
3455 synchronized. Take care when you mix staves with grace notes and
3456 staves without, for example,
3458 @lilypond[quote,relative=2,verbatim]
3460 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3461 \new Staff { c4 \bar ".|:" d2. }
3466 This can be remedied by inserting grace skips of the corresponding
3467 durations in the other staves. For the above example
3469 @lilypond[quote,relative=2,verbatim]
3471 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3472 \new Staff { c4 \bar ".|:" \grace s16 d2. }
3476 The use of grace notes within voice contexts confuses the way the voice
3477 is typeset. This can be overcome by inserting a rest or note between the
3478 voice command and the grace note.
3480 @lilypond[quote,verbatim]
3482 \acciaccatura { f8 } e8 r8 \acciaccatura { f8 } e8 r4
3489 r8 r8 \voiceOne \accMusic \oneVoice r8 |
3490 r8 \voiceOne r8 \accMusic \oneVoice r8 |
3495 s8 s8 \voiceTwo \accMusic \oneVoice s8 |
3496 s8 \voiceTwo r8 \accMusic \oneVoice s8 |
3503 Grace sections should only be used within sequential music expressions.
3504 Nesting or juxtaposing grace sections is not supported, and might
3505 produce crashes or other errors.
3507 Each grace note in MIDI output has a length of 1/4 of its actual
3508 duration. If the combined length of the grace notes is greater than the
3509 length of the preceding note a @qq{@code{Going back in MIDI time}}
3510 error will be generated. Either make the grace notes shorter in
3511 duration, for example:
3514 c'8 \acciaccatura @{ c'8[ d' e' f' g'] @}
3520 c'8 \acciaccatura @{ c'16[ d' e' f' g'] @}
3523 Or explicitly change the musical duration:
3526 c'8 \acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
3529 See @ref{Scaling durations}.
3532 @node Aligning to cadenzas
3533 @unnumberedsubsubsec Aligning to cadenzas
3536 @cindex cadenza, aligning to
3537 @cindex aligning to cadenza
3539 In an orchestral context, cadenzas present a special problem: when
3540 constructing a score that includes a measured cadenza or other solo
3541 passage, all other instruments should skip just as many notes as the
3542 length of the cadenza, otherwise they will start too soon or too late.
3544 One solution to this problem is to use the functions
3545 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
3546 functions take a defined piece of music as an argument and generate a
3547 multi-measure rest or @code{\skip} exactly as long as the piece.
3549 @lilypond[verbatim,quote]
3550 MyCadenza = \relative c' {
3561 #(mmrest-of-length MyCadenza)
3563 #(skip-of-length MyCadenza)
3577 @node Time administration
3578 @unnumberedsubsubsec Time administration
3580 @cindex time administration
3581 @cindex timing (within the score)
3582 @cindex music, unmetered
3583 @cindex unmetered music
3585 @funindex currentBarNumber
3586 @funindex measurePosition
3587 @funindex measureLength
3589 Time is administered by the @code{Timing_translator}, which by
3590 default is to be found in the @code{Score} context. An alias,
3591 @code{Timing}, is added to the context in which the
3592 @code{Timing_translator} is placed. To ensure that the
3593 @code{Timing} alias is available, you may need to explicitly
3594 instantiate the containing context (such as @code{Voice} or
3597 The following properties of @code{Timing} are used
3598 to keep track of timing within the score.
3601 @cindex measure number
3604 @item currentBarNumber
3605 The current measure number. For an example showing the
3606 use of this property see @ref{Bar numbers}.
3609 The length of the measures in the current time signature. For a
3610 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
3611 determines when bar lines are inserted and how automatic beams
3612 should be generated.
3614 @item measurePosition
3615 The point within the measure where we currently are. This
3616 quantity is reset by subtracting @code{measureLength} whenever
3617 @code{measureLength} is reached or exceeded. When that happens,
3618 @code{currentBarNumber} is incremented.
3621 If set to true, the above variables are updated for every time
3622 step. When set to false, the engraver stays in the current
3623 measure indefinitely.
3627 Timing can be changed by setting any of these variables
3628 explicitly. In the next example, the default 4/4 time
3629 signature is printed, but @code{measureLength} is set to 5/4.
3630 At 4/8 through the third measure, the @code{measurePosition} is
3631 advanced by 1/8 to 5/8, shortening that bar by 1/8.
3632 The next bar line then falls at 9/8 rather than 5/4.
3634 @lilypond[quote,verbatim]
3635 \new Voice \relative c' {
3636 \set Timing.measureLength = #(ly:make-moment 5 4)
3640 \set Timing.measurePosition = #(ly:make-moment 5 8)
3647 As the example illustrates, @code{ly:make-moment n m} constructs a
3648 duration of n/m of a whole note. For example,
3649 @code{ly:make-moment 1 8} is an eighth note duration and
3650 @code{ly:make-moment 7 16} is the duration of seven sixteenths
3656 @ref{Unmetered music}.
3661 Internals Reference:
3662 @rinternals{Timing_translator},