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 \tuplet 3/2 { b4 b b }
208 c4 c \tuplet 3/2 { 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 \tuplet 5/4 { f8 e f \tuplet 3/2 { 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 \tuplet 3/2 { 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{@bs{}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 alone is used to determine the beam placement; the
2036 values of @code{baseMoment} and @code{beatStructure} are ignored.
2038 If no @code{beamExceptions} rule is defined for the time signature
2039 in force, the beam placement is determined by the values of
2040 @code{baseMoment} and @code{beatStructure}.
2043 @subsubsubheading Beaming based on @code{baseMoment} and @code{beatStructure}
2045 By default, @code{beamExceptions} rules are defined for most common
2046 time signatures, so the @code{beamExceptions} rules must be disabled
2047 if automatic beaming is to be based on @code{baseMoment} and
2048 @code{beatStructure}. The @code{beamExceptions} rules are disabled
2052 \set Timing.beamExceptions = #'()
2055 When @code{beamExceptions} is set to @code{#'()}, either due to an
2056 explicit setting or because no @code{beamExceptions} rules are defined
2057 internally for the time signature in force, the ending points for
2058 beams are on beats as specified by the context properties
2059 @code{baseMoment} and @code{beatStructure}. @code{beatStructure} is
2060 a scheme list that defines the length of each beat in the measure in
2061 units of @code{baseMoment}. By default, @code{baseMoment} is one
2062 over the denominator of the time signature. By default, each unit of
2063 length @code{baseMoment} is a single beat.
2065 @lilypond[quote,relative=2,verbatim]
2067 c16^"default" c c c c |
2068 % beamExceptions are unlikely to be defined for 5/16 time,
2069 % but let's disable them anyway to be sure
2070 \set Timing.beamExceptions = #'()
2071 \set Timing.beatStructure = #'(2 3)
2072 c16^"(2+3)" c c c c |
2073 \set Timing.beatStructure = #'(3 2)
2074 c16^"(3+2)" c c c c |
2077 @lilypond[quote,relative=2,verbatim]
2079 a8^"default" a a a a a a a
2080 % Disable beamExceptions because they are definitely
2081 % defined for 4/4 time
2082 \set Timing.beamExceptions = #'()
2083 \set Timing.baseMoment = #(ly:make-moment 1/4)
2084 \set Timing.beatStructure = #'(1 1 1 1)
2085 a8^"changed" a a a a a a a
2088 Beam setting changes can be limited to specific contexts. If no
2089 setting is included in a lower-level context, the setting of the
2090 enclosing context will apply.
2092 @lilypond[quote, verbatim,relative=1]
2095 % No need to disable beamExceptions as they are not defined for 7/8 time
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 % No need to disable beamExceptions as they are not defined for 5/8 time
2140 \set Timing.baseMoment = #(ly:make-moment 1/16)
2141 \set Timing.beatStructure = #'(7 3)
2142 \repeat unfold 10 { a16 }
2145 @code{baseMoment} is a @i{moment}; a unit of musical duration. A
2146 quantity of type @i{moment} is created by the scheme function
2147 @code{ly:make-moment}. For more information about this function,
2148 see @ref{Time administration}.
2150 By default @code{baseMoment} is set to one over the denominator of
2151 the time signature. Any exceptions to this default can be found in
2152 @file{scm/time-signature-settings.scm}.
2154 @subsubsubheading Beaming based on @code{beamExceptions}
2156 Special autobeaming rules (other than ending a beam on a beat)
2157 are defined in the @code{beamExceptions} property.
2159 @lilypond[quote,relative=2,verbatim]
2161 \set Timing.beatStructure = #'(2 1)
2162 \set Timing.beamExceptions =
2164 (end . ;entry for end of beams
2165 ( ;start of alist of end points
2166 ((1 . 32) . (2 2 2)) ;rule for 1/32 beams -- end each 1/16
2167 ))) %close all entries
2169 \repeat unfold 6 { c32 } |
2172 @code{beamExceptions} is an alist with a key of rule-type and a value
2175 At this time the only available value of rule-type is
2176 @code{'end} for beam ending.
2178 Beaming-rules is a scheme alist (or list of pairs) that indicates the
2179 beam type and the grouping to be applied to beams containing notes with
2180 a shortest duration of that beam type.
2183 #'((beam-type1 . grouping-1)
2184 (beam-type2 . grouping-2)
2185 (beam-type3 . grouping-3))
2188 Beam type is a scheme pair indicating the duration of the beam,
2189 e.g., @code{(1 . 16)}.
2191 Grouping is a scheme list indicating the grouping to be applied to
2192 the beam. The grouping is in units of the beam type.
2194 @warning{ A @code{beamExceptions} value must be @emph{complete}
2195 exceptions list. That is, every exception that should be applied
2196 must be included in the setting. It is not possible to add, remove,
2197 or change only one of the exceptions. While this may seem cumbersome,
2198 it means that the current beaming settings need not be known in order
2199 to specify a new beaming pattern.}
2201 When the time signature is changed, default values of
2202 @code{Timing.baseMoment}, @code{Timing.beatStructure},
2203 and @code{Timing.beamExceptions} are set. Setting the time signature
2204 will reset the automatic beaming settings for the @code{Timing}
2205 context to the default behavior.
2207 @lilypond[quote,verbatim,relative=2]
2209 \repeat unfold 6 { a8 }
2211 \set Timing.beatStructure = #'(4 2)
2212 \repeat unfold 6 { a8 }
2213 % go back to default behavior
2215 \repeat unfold 6 { a8 }
2218 The default automatic beaming settings for a time signature
2219 are determined in @file{scm/time-signature-settings.scm}.
2220 Changing the default automatic beaming settings
2221 for a time signature is described in @ref{Time signature}.
2223 Many automatic beaming settings for a time signature contain an
2224 entry for @code{beamExceptions}. For example, 4/4 time tries to
2225 beam the measure in two if there are only eighth notes. The
2226 @code{beamExceptions} rule can override the @code{beatStructure} setting
2227 if @code{beamExceptions} is not reset.
2229 @lilypond[quote,verbatim,relative=2]
2231 \set Timing.baseMoment = #(ly:make-moment 1/8)
2232 \set Timing.beatStructure = #'(3 3 2)
2233 % This won't beam (3 3 2) because of beamExceptions
2234 \repeat unfold 8 {c8} |
2235 % This will beam (3 3 2) because we clear beamExceptions
2236 \set Timing.beamExceptions = #'()
2237 \repeat unfold 8 {c8}
2240 In a similar fashion, eighth notes in 3/4 time are beamed as a full
2241 measure by default. To beam eighth notes in 3/4 time on the beat,
2242 reset @code{beamExceptions}.
2244 @lilypond[quote,verbatim,relative=2]
2246 % by default we beam in (6) due to beamExceptions
2247 \repeat unfold 6 {a8} |
2248 % This will beam (1 1 1) due to default baseMoment and beatStructure
2249 \set Timing.beamExceptions = #'()
2250 \repeat unfold 6 {a8}
2253 In engraving from the Romantic and Classical periods,
2254 beams often begin midway through the measure in 3/4 time,
2255 but modern practice is to avoid the false impression of 6/8 time
2256 (see Gould, p. 153). Similar situations arise in 3/8 time.
2257 This behavior is controlled by the context property @code{beamHalfMeasure},
2258 which has effect only in time signatures with 3 in the numerator:
2260 @lilypond[quote,verbatim,relative=2]
2263 \set Timing.beamHalfMeasure = ##f
2267 @subsubsubheading How automatic beaming works
2269 When automatic beaming is enabled, the placement of automatic beams
2270 is determined by the context properties
2271 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2273 The following rules, in order of priority, apply when determining
2274 the appearance of beams:
2278 If a manual beam is specified with @code{[..]} set the beam
2279 as specified, otherwise
2282 if a beam-ending rule is defined in @code{beamExceptions}
2283 for the beam-type, use it to determine the valid places where
2284 beams may end, otherwise
2287 if a beam-ending rule is defined in @code{beamExceptions}
2288 for a longer beam-type, use it to determine the valid places
2289 where beams may end, otherwise
2292 use the values of @code{baseMoment} and @code{beatStructure} to
2293 determine the ends of the beats in the measure, and
2294 end beams at the end of beats.
2298 In the rules above, the @emph{beam-type} is the duration of the
2299 shortest note in the beamed group.
2301 The default beaming rules can be found in
2302 @file{scm/time-signature-settings.scm}.
2306 @cindex beams, subdividing
2308 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2309 {subdividing-beams.ly}
2311 @cindex beamlets, orienting
2313 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2314 {strict-beat-beaming.ly}
2316 @cindex measure groupings
2317 @cindex beats, grouping
2318 @cindex grouping beats
2319 @cindex measure sub-grouping
2321 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2322 {conducting-signs,-measure-grouping-signs.ly}
2324 @cindex beam, endings in a score
2325 @cindex beam, endings with multiple voices
2327 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2328 {beam-endings-in-score-context.ly}
2332 @ref{Time signature}.
2335 @file{scm/time-signature-settings.scm}.
2340 Internals Reference:
2341 @rinternals{Auto_beam_engraver},
2343 @rinternals{BeamForbidEvent},
2344 @rinternals{beam-interface}.
2347 If a score ends while an automatic beam has not been ended and is
2348 still accepting notes, this last beam will not be typeset at all.
2349 The same holds for polyphonic voices, entered with
2350 @code{<< @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
2351 automatic beam is still accepting notes, it is not typeset.
2352 The workaround for these problems is to manually beam the last
2353 beam in the voice or score.
2355 By default, the @code{Timing} translator is aliased to the
2356 @code{Score} context. This means that setting the time signature
2357 in one staff will affect the beaming of the other staves as well.
2358 Thus, a time signature setting in a later staff will reset custom
2359 beaming that was set in an earlier staff.
2360 One way to avoid this problem is to set the time signature
2363 @lilypond[quote,verbatim,relative=2]
2367 \set Timing.baseMoment = #(ly:make-moment 1/8)
2368 \set Timing.beatStructure = #'(1 5)
2369 \repeat unfold 6 { a8 }
2372 \repeat unfold 6 { a8 }
2377 The default beam settings for the time signature can also be changed, so
2378 that the desired beaming will always be used. Changes in automatic
2379 beaming settings for a time signature are described in
2380 @ref{Time signature}.
2382 @lilypond[quote,verbatim,relative=2]
2385 \overrideTimeSignatureSettings
2386 3/4 % timeSignatureFraction
2387 1/8 % baseMomentFraction
2388 #'(1 5) % beatStructure
2389 #'() % beamExceptions
2391 \repeat unfold 6 { a8 }
2395 \repeat unfold 6 { a8 }
2402 @unnumberedsubsubsec Manual beams
2404 @cindex beams, manual
2405 @cindex manual beams
2410 In some cases it may be necessary to override the automatic
2411 beaming algorithm. For example, the autobeamer will not put beams
2412 over rests or bar lines, and in choral scores the beaming is
2413 often set to follow the meter of the lyrics rather than the
2414 notes. Such beams can be specified manually by
2415 marking the begin and end point with @code{[} and @code{]}.
2417 @lilypond[quote,relative=1,verbatim]
2418 r4 r8[ g' a r] r g[ | a] r
2421 @cindex manual beams, direction shorthand for
2422 @cindex manual beams, grace notes
2424 Beaming direction can be set manually using direction indicators:
2426 @lilypond[quote,relative=2,verbatim]
2427 c8^[ d e] c,_[ d e f g]
2433 Individual notes may be marked with @code{\noBeam} to prevent them
2436 @lilypond[quote,verbatim,relative=2]
2441 Grace note beams and normal note beams can occur simultaneously.
2442 Unbeamed grace notes are not put into normal note beams.
2444 @lilypond[quote,verbatim,relative=2]
2446 \grace { e32[ d c d] }
2452 @funindex stemLeftBeamCount
2453 @funindex stemRightBeamCount
2455 Even more strict manual control with the beams can be achieved by
2456 setting the properties @code{stemLeftBeamCount} and
2457 @code{stemRightBeamCount}. They specify the number of beams to
2458 draw on the left and right side, respectively, of the next note.
2459 If either property is set, its value will be used only once, and
2460 then it is erased. In this example, the last @code{f} is printed
2461 with only one beam on the left side, i.e., the eighth-note beam of
2462 the group as a whole.
2464 @lilypond[quote,relative=2,verbatim]
2467 \set stemLeftBeamCount = #2
2468 \set stemRightBeamCount = #1
2470 \set stemLeftBeamCount = #1
2482 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2483 {flat-flags-and-beam-nibs.ly}
2487 @ref{Direction and placement},
2493 Internals Reference:
2495 @rinternals{BeamEvent},
2496 @rinternals{Beam_engraver},
2497 @rinternals{beam-interface},
2498 @rinternals{Stem_engraver}.
2501 @node Feathered beams
2502 @unnumberedsubsubsec Feathered beams
2504 @cindex beams, feathered
2505 @cindex feathered beams
2507 @funindex \featherDurations
2508 @funindex featherDurations
2509 @funindex grow-direction
2511 Feathered beams are used to indicate that a small group of notes
2512 should be played at an increasing (or decreasing) tempo, without
2513 changing the overall tempo of the piece. The extent of the
2514 feathered beam must be indicated manually using @code{[} and
2515 @code{]}, and the beam feathering is turned on by specifying a
2516 direction to the @code{Beam} property @code{grow-direction}.
2518 If the placement of the notes and the sound in the MIDI output is to
2519 reflect the @emph{ritardando} or @emph{accelerando} indicated by the
2520 feathered beam the notes must be grouped as a music expression delimited
2521 by braces and preceded by a @code{featherDurations} command which specifies
2522 the ratio between the durations of the first and last notes in the
2525 The square brackets show the extent of the beam and the braces show
2526 which notes are to have their durations modified. Normally these
2527 would delimit the same group of notes, but this is not required: the
2528 two commands are independent.
2530 In the following example the eight 16th notes occupy exactly the
2531 same time as a half note, but the first note is one half as long
2532 as the last one, with the intermediate notes gradually
2533 lengthening. The first four 32nd notes gradually speed up, while
2534 the last four 32nd notes are at a constant tempo.
2536 @lilypond[relative=1,verbatim,quote]
2537 \override Beam.grow-direction = #LEFT
2538 \featherDurations #(ly:make-moment 2/1)
2539 { c16[ c c c c c c c] }
2540 \override Beam.grow-direction = #RIGHT
2541 \featherDurations #(ly:make-moment 2/3)
2543 % revert to non-feathered beams
2544 \override Beam.grow-direction = #'()
2549 The spacing in the printed output represents the
2550 note durations only approximately, but the MIDI output is exact.
2553 @code{\featherDurations}.
2561 The @code{\featherDurations} command only works with very short
2562 music snippets, and when numbers in the fraction are small.
2571 * Bar and bar number checks::
2576 @unnumberedsubsubsec Bar lines
2579 @cindex measure lines
2580 @cindex closing bar lines
2581 @cindex bar lines, closing
2582 @cindex double bar lines
2583 @cindex bar lines, double
2589 Bar lines delimit measures, and are also used to indicate
2590 repeats. Normally, simple bar lines are automatically inserted
2591 into the printed output at places based on the current time
2594 The simple bar lines inserted automatically can be changed to
2595 other types with the @code{\bar} command. For example, a closing
2596 double bar line is usually placed at the end of a piece:
2598 @lilypond[quote,relative=1,verbatim]
2602 It is not invalid if the final note in a measure does not
2603 end on the automatically entered bar line: the note is assumed
2604 to carry over into the next measure. But if a long sequence
2605 of such carry-over measures appears the music can appear compressed
2606 or even flowing off the page. This is because automatic line
2607 breaks happen only at the end of complete measures, i.e., where
2608 all notes end before the end of a measure.
2610 @warning{An incorrect duration can cause line breaks to be
2611 inhibited, leading to a line of highly compressed music or
2612 music which flows off the page.}
2615 @cindex bar lines, invisible
2616 @cindex measure lines, invisible
2618 Line breaks are also permitted at manually inserted bar lines
2619 even within incomplete measures. To allow a line break without
2620 printing a bar line, use the following:
2627 This will insert an invisible bar line and allow (but not
2628 force) a line break to occur at this point. The bar number
2629 counter is not increased. To force a line break see
2630 @ref{Line breaking}.
2632 @cindex manual bar lines
2633 @cindex manual measure lines
2634 @cindex bar lines, manual
2635 @cindex measure lines, manual
2637 This and other special bar lines may be inserted manually at any
2638 point. When they coincide with the end of a measure they replace
2639 the simple bar line which would have been inserted there
2640 automatically. When they do not coincide with the end of a measure
2641 the specified bar line is inserted at that point in the printed
2644 Note that manual bar lines are purely visual. They do not affect
2645 any of the properties that a normal bar line would affect, such as
2646 measure numbers, accidentals, line breaks, etc. They do not affect
2647 the calculation and placement of subsequent automatic bar lines.
2648 When a manual bar line is placed where a normal bar line already
2649 exists, the effects of the original bar line are not altered.
2651 Two types of simple bar lines and five types of double bar lines are
2652 available for manual insertion:
2654 @lilypond[quote,relative=1,verbatim]
2666 together with dotted and dashed bar lines:
2668 @lilypond[quote,relative=1,verbatim]
2675 and nine types of repeat bar lines:
2677 @lilypond[quote,relative=1,verbatim]
2690 Additionally, a bar line can be printed as a simple tick:
2691 @lilypond[quote,relative=1,verbatim]
2694 However, as such ticks are typically used in Gregorian chant, it is
2695 preferable to use @code{\divisioMinima} there instead, described in
2696 the section @ref{Divisiones} in Gregorian chant.
2698 Lilypond supports kievan notation and provides a special kievan
2700 @lilypond[quote,relative=1,verbatim]
2703 Further details of this notation are explained in
2704 @ref{Typesetting Kievan square notation}.
2708 For in-line segno signs, there are three types of bar lines which
2709 differ in their behavior at line breaks:
2711 @lilypond[quote,relative=2,verbatim]
2729 Although the bar line types signifying repeats may be inserted
2730 manually they do not in themselves cause LilyPond to recognize
2731 a repeated section. Such repeated sections are better entered
2732 using the various repeat commands (see @ref{Repeats}), which
2733 automatically print the appropriate bar lines.
2735 In addition, you can specify @code{".|:-||"}, which is equivalent to
2736 @code{".|:"} except at line breaks, where it gives a double bar
2737 line at the end of the line and a start repeat at the beginning of
2740 @lilypond[quote,relative=2,verbatim]
2748 For combinations of repeats with the segno sign, there are six different
2751 @lilypond[quote,relative=2,verbatim]
2779 Additionally there is an @code{\inStaffSegno} command which
2780 creates a segno bar, placed in cooperation
2781 with the @code{\repeat volta} command.
2783 @funindex \defineBarLine
2784 @funindex defineBarLine
2785 @cindex bar lines, defining
2786 @cindex defining bar lines
2788 New bar line types can be defined with @code{\defineBarLine}:
2791 \defineBarLine @var{bartype} #'(@var{end} @var{begin} @var{span})
2794 The @code{\defineBarline} variables can include the
2795 @q{empty} string @code{""}, which is equivalent to an invisible
2796 bar line being printed. Or they can be set to @code{#f} which
2797 prints no bar line at all.
2799 After the definiton, the new bar line can be used by
2800 @code{\bar} @var{bartype}.
2802 There are currently ten bar line elements available:
2804 @lilypond[quote,verbatim]
2805 \defineBarLine ":" #'("" ":" "")
2806 \defineBarLine "=" #'("=" "" "")
2807 \defineBarLine "[" #'("" "[" "")
2808 \defineBarLine "]" #'("]" "" "")
2825 The @code{"="} bar line provides the double span bar line, used
2826 in combination with the segno sign. Do not use it as a standalone
2827 double thin bar line; here, @code{\bar} @var{"||"} is
2830 The @code{"-"} sign starts annotations to bar lines which
2831 are useful to distinguish those with identical appearance
2832 but different behavior at line breaks and/or different span bars.
2833 The part following the @code{"-"} sign is not used for building up
2836 @lilypond[quote,relative=2,verbatim]
2837 \defineBarLine "||-dashedSpan" #'("||" "" "!!")
2842 c1 \bar "||-dashedSpan"
2853 Furthermore, the space character @code{" "} serves as a placeholder
2854 for defining span bars correctly aligned to the main bar lines:
2856 @lilypond[quote,relative=2,verbatim]
2857 \defineBarLine ":|.-wrong" #'(":|." "" "|.")
2858 \defineBarLine ":|.-right" #'(":|." "" " |.")
2874 If additional elements are needed, LilyPond provides a simple
2875 way to define them. For more informations on modifying or adding
2876 bar lines, see file @file{scm/bar-line.scm}.
2878 In scores with many staves, a @code{\bar} command in one staff is
2879 automatically applied to all staves. The resulting bar lines are
2880 connected between different staves of a @code{StaffGroup},
2881 @code{PianoStaff}, or @code{GrandStaff}.
2883 @lilypond[quote,relative=1,verbatim]
2891 \new Staff { \clef bass c4 g e g }
2893 \new Staff { \clef bass c2 c2 }
2898 @cindex default bar lines, changing
2899 @cindex bar lines, default, changing
2902 @funindex defaultBarType
2907 The command @samp{\bar @var{bartype}} is a shortcut for
2908 @samp{\set Timing.whichBar = @var{bartype}}. A bar line is
2909 created whenever the @code{whichBar} property is set.
2911 The default bar type used for automatically inserted bar lines is
2912 @code{"|"}. This may be changed at any time with
2913 @samp{\set Timing.defaultBarType = @var{bartype}}.
2917 @ref{Line breaking},
2919 @ref{Grouping staves}.
2922 @file{scm/bar-line.scm}.
2927 Internals Reference:
2928 @rinternals{BarLine} (created at @code{Staff} level),
2929 @rinternals{SpanBar} (across staves),
2930 @rinternals{Timing_translator} (for Timing properties).
2934 @unnumberedsubsubsec Bar numbers
2937 @cindex measure numbers
2938 @cindex numbers, bar
2939 @cindex numbers, measure
2941 @funindex currentBarNumber
2943 Bar numbers are typeset by default at the start of every line except
2944 the first line. The number itself is stored in the
2945 @code{currentBarNumber} property, which is normally updated
2946 automatically for every measure. It may also be set manually:
2948 @lilypond[verbatim,quote,relative=1]
2951 \set Score.currentBarNumber = #50
2955 @cindex bar numbers, regular spacing
2957 @funindex barNumberVisibility
2960 Bar numbers can be typeset at regular intervals instead of just at
2961 the beginning of every line. To do this the default behavior
2962 must be overridden to permit bar numbers to be printed at places
2963 other than the start of a line. This is controlled by the
2964 @code{break-visibility} property of @code{BarNumber}. This takes
2965 three values which may be set to @code{#t} or @code{#f} to specify
2966 whether the corresponding bar number is visible or not. The order
2967 of the three values is @code{end of line visible}, @code{middle of
2968 line visible}, @code{beginning of line visible}. In the following
2969 example bar numbers are printed at all possible places:
2971 @lilypond[verbatim,quote,relative=1]
2972 \override Score.BarNumber.break-visibility = ##(#t #t #t)
2973 \set Score.currentBarNumber = #11
2974 % Permit first bar number to be printed
2982 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2983 {printing-the-bar-number-for-the-first-measure.ly}
2985 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2986 {printing-bar-numbers-at-regular-intervals.ly}
2988 @cindex measure number, format
2989 @cindex bar number, format
2991 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2992 {printing-bar-numbers-inside-boxes-or-circles.ly}
2994 @cindex bar numbers, with letters
2995 @cindex bar numbers, with repeats
2997 @lilypondfile[verbatim,quote,texidoc,doctitle]
2998 {alternative-bar-numbering.ly}
3000 @cindex bar number alignment
3002 @lilypondfile[verbatim,quote,texidoc,doctitle]
3003 {aligning-bar-numbers.ly}
3005 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3006 {removing-bar-numbers-from-a-score.ly}
3012 Internals Reference:
3013 @rinternals{BarNumber},
3014 @rinternals{Bar_number_engraver}.
3016 @cindex bar number collision
3017 @cindex collision, bar number
3020 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
3021 if there is one. To solve this, the @code{padding} property of
3022 @code{BarNumber} can be used to position the number correctly. See
3023 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
3026 @node Bar and bar number checks
3027 @unnumberedsubsubsec Bar and bar number checks
3030 @cindex bar number check
3031 @cindex measure check
3032 @cindex measure number check
3034 @funindex barCheckSynchronize
3037 Bar checks help detect errors in the entered durations. A bar check
3038 may be entered using the bar symbol, @code{|}, at any place where a
3039 bar line is expected to fall. If bar check lines are encountered at
3040 other places, a list of warnings is printed in the log file, showing
3041 the line numbers and lines in which the bar checks failed. In the
3042 next example, the second bar check will signal an error.
3045 \time 3/4 c2 e4 | g2 |
3048 Bar checks can also be used in lyrics:
3053 Twin -- kle | Twin -- kle |
3057 An incorrect duration can result in a completely garbled score,
3058 especially if the score is polyphonic, so a good place to start
3059 correcting input is by scanning for failed bar checks and
3060 incorrect durations.
3062 If successive bar checks are off by the same musical interval,
3063 only the first warning message is displayed. This allows the
3064 warning to focus on the source of the timing error.
3068 @funindex pipeSymbol
3070 It is also possible to redefine the action taken when a bar check
3071 or pipe symbol, @code{|}, is encountered in the input, so that
3072 it does something other than a bar check. This is done by
3073 assigning a music expression to @code{pipeSymbol}.
3074 In the following example @code{|} is set to insert a double bar
3075 line wherever it appears in the input, rather than checking
3078 @lilypond[quote,verbatim]
3079 pipeSymbol = \bar "||"
3088 @funindex \barNumberCheck
3089 @funindex barNumberCheck
3091 When copying large pieces of music, it can be helpful to check that
3092 the LilyPond bar number corresponds to the original that you are
3093 entering from. This can be checked with @code{\barNumberCheck}, for
3097 \barNumberCheck #123
3101 will print a warning if the @code{currentBarNumber} is not 123
3102 when it is processed.
3109 @node Rehearsal marks
3110 @unnumberedsubsubsec Rehearsal marks
3112 @cindex rehearsal marks
3113 @cindex mark, rehearsal
3118 To print a rehearsal mark, use the @code{\mark} command.
3120 @lilypond[quote,verbatim,relative=2]
3128 The mark is incremented automatically if you use @code{\mark
3129 \default}, but you can also use an integer argument to set the
3130 mark manually. The value to use is stored in the property
3131 @code{rehearsalMark}.
3133 @lilypond[quote,verbatim,relative=2]
3142 The letter@tie{}@q{I} is skipped in accordance with engraving
3143 traditions. If you wish to include the letter @q{I}, then use one
3144 of the following commands, depending on which style of rehearsal mark
3145 you want (letters only, letters in a hollow box, or letters in a
3149 \set Score.markFormatter = #format-mark-alphabet
3150 \set Score.markFormatter = #format-mark-box-alphabet
3151 \set Score.markFormatter = #format-mark-circle-alphabet
3154 @lilypond[quote,verbatim,relative=2]
3155 \set Score.markFormatter = #format-mark-box-alphabet
3163 @cindex rehearsal mark format
3164 @cindex rehearsal mark style
3165 @cindex style, rehearsal mark
3166 @cindex format, rehearsal mark
3167 @cindex mark, rehearsal, style
3168 @cindex mark, rehearsal, format
3169 @cindex rehearsal mark, manual
3170 @cindex mark, rehearsal, manual
3171 @cindex custom rehearsal mark
3172 @cindex manual rehearsal mark
3174 The style is defined by the property @code{markFormatter}. It is
3175 a function taking the current mark (an integer) and the current
3176 context as argument. It should return a markup object. In the
3177 following example, @code{markFormatter} is set to a pre-defined
3178 procedure. After a few measures, it is set to a procedure that
3179 produces a boxed number.
3181 @lilypond[quote,verbatim,relative=2]
3182 \set Score.markFormatter = #format-mark-numbers
3185 \set Score.markFormatter = #format-mark-box-numbers
3187 \set Score.markFormatter = #format-mark-circle-numbers
3189 \set Score.markFormatter = #format-mark-circle-letters
3193 The file @file{scm/translation-functions.scm} contains the
3194 definitions of @code{format-mark-numbers} (the default format),
3195 @code{format-mark-box-numbers}, @code{format-mark-letters} and
3196 @code{format-mark-box-letters}. These can be used as inspiration
3197 for other formatting functions.
3199 You may use @code{format-mark-barnumbers},
3200 @code{format-mark-box-barnumbers}, and
3201 @code{format-mark-circle-barnumbers} to get bar numbers instead of
3202 incremented numbers or letters.
3204 Other styles of rehearsal mark can be specified manually:
3211 Note that @code{Score.markFormatter} does not affect marks specified
3212 in this manner. However, it is possible to apply a @code{\markup} to the
3216 \mark \markup@{ \box A1 @}
3221 @cindex D.S. al Fine
3223 @cindex music glyphs
3224 @cindex glyphs, music
3226 @funindex \musicglyph
3227 @funindex musicglyph
3229 Music glyphs (such as the segno sign) may be printed inside a
3232 @lilypond[quote,verbatim,relative=1]
3233 c1 \mark \markup { \musicglyph #"scripts.segno" }
3234 c1 \mark \markup { \musicglyph #"scripts.coda" }
3235 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
3240 See @ref{The Feta font}, for a list of symbols which may be
3241 printed with @code{\musicglyph}.
3243 For common tweaks to the positioning of rehearsal marks, see
3244 @ref{Formatting text}. For more precise control, see
3245 @code{break-alignable-interface} in @ref{Aligning objects}.
3247 The file @file{scm/translation-functions.scm} contains
3248 the definitions of @code{format-mark-numbers} and
3249 @code{format-mark-letters}. They can be used as inspiration for
3250 other formatting functions.
3254 @ref{The Feta font},
3255 @ref{Formatting text},
3256 @ref{Aligning objects}.
3259 @file{scm/translation-functions.scm}.
3264 Internals Reference:
3265 @rinternals{MarkEvent},
3266 @rinternals{Mark_engraver},
3267 @rinternals{RehearsalMark}.
3270 @node Special rhythmic concerns
3271 @subsection Special rhythmic concerns
3276 * Aligning to cadenzas::
3277 * Time administration::
3281 @unnumberedsubsubsec Grace notes
3285 @cindex appoggiatura
3286 @cindex acciaccatura
3289 @funindex \slashedGrace
3290 @funindex \acciaccatura
3291 @funindex \appoggiatura
3293 Grace notes are musical ornaments, printed in a smaller font, that take
3294 up no additional logical time in a measure.
3296 @lilypond[quote,relative=2,verbatim]
3298 \grace { b16[ c16] } a2)
3301 There are three other types of grace notes possible; the
3302 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
3303 note with a slashed stem -- and the @emph{appoggiatura}, which takes a
3304 fixed fraction of the main note it is attached to and prints without the
3305 slash. It is also possible to write a grace note with a slashed stem,
3306 like the @emph{acciaccatura} but without the slur, so as to place it
3307 between notes that are slurred themselves, using the
3308 @code{\slashedGrace} function.
3310 @lilypond[quote,relative=2,verbatim]
3313 \acciaccatura { g16[ f] } e2
3314 \slashedGrace a,8 g4
3315 \slashedGrace b16 a4(
3316 \slashedGrace b8 a2)
3319 The placement of grace notes is synchronized between different staves.
3320 In the following example, there are two sixteenth grace notes for every
3323 @lilypond[quote,relative=2,verbatim]
3325 \new Staff { e2 \grace { c16[ d e f] } e2 }
3326 \new Staff { c2 \grace { g8[ b] } c2 }
3330 @cindex grace notes, following
3332 @funindex \afterGrace
3333 @funindex afterGrace
3335 If you want to end a note with a grace, use the @code{\afterGrace}
3336 command. It takes two arguments: the main note, and the grace
3337 notes following the main note.
3339 @lilypond[quote,verbatim,relative=2]
3340 c1 \afterGrace d1 { c16[ d] } c1
3343 This will put the grace notes after a space lasting 3/4 of the
3344 length of the main note. The default fraction 3/4 can be changed by
3345 setting @code{afterGraceFraction}. The following example shows
3346 the results from setting the space at the default, at 15/16, and
3347 finally at 1/2 of the main note.
3349 @lilypond[quote,verbatim,relative=2]
3352 c1 \afterGrace d1 { c16[ d] } c1
3355 #(define afterGraceFraction (cons 15 16))
3356 c1 \afterGrace d1 { c16[ d] } c1
3359 #(define afterGraceFraction (cons 1 2))
3360 c1 \afterGrace d1 { c16[ d] } c1
3365 The space between the main note and the grace note may also be
3366 specified using spacers. The following example places the grace
3367 note after a space lasting 7/8 of the main note.
3369 @lilypond[quote,verbatim,relative=2]
3373 { s2 s4. \grace { c16[ d] } }
3379 @cindex tweaking grace notes
3380 @cindex grace notes, tweaking
3381 @cindex grace notes, changing layout settings
3383 A @code{\grace} music expression will introduce special
3384 typesetting settings, for example, to produce smaller type, and
3385 set directions. Hence, when introducing layout tweaks to
3386 override the special settings, they should be placed inside
3387 the grace expression. The overrides should also be reverted
3388 inside the grace expression. Here, the grace note's default stem
3389 direction is overridden and then reverted.
3391 @lilypond[quote,verbatim,relative=2]
3403 @cindex stem, with slash
3408 @lilypondfile[verbatim,quote,texidoc,doctitle]
3409 {using-grace-note-slashes-with-normal-heads.ly}
3411 @lilypondfile[verbatim,quote,texidoc,doctitle]
3412 {tweaking-grace-layout-within-music.ly}
3414 @lilypondfile[verbatim,quote,texidoc,doctitle]
3415 {redefining-grace-note-global-defaults.ly}
3417 @lilypondfile[verbatim,quote,texidoc,doctitle]
3418 {positioning-grace-notes-with-floating-space.ly}
3422 @rglos{grace notes},
3423 @rglos{acciaccatura},
3424 @rglos{appoggiatura}.
3427 @ref{Scaling durations},
3431 @file{ly/grace-init.ly}.
3436 Internals Reference:
3437 @rinternals{GraceMusic},
3438 @rinternals{Grace_beam_engraver},
3439 @rinternals{Grace_engraver},
3440 @rinternals{Grace_spacing_engraver}.
3444 @cindex acciaccatura, multi-note
3445 @cindex multi-note acciaccatura
3446 @cindex grace-note synchronization
3448 A multi-note beamed @i{acciaccatura} is printed without a slash,
3449 and looks exactly the same as a multi-note beamed
3452 @c TODO Add link to LSR snippet to add slash when available
3454 Grace note synchronization can also lead to surprises. Staff
3455 notation, such as key signatures, bar lines, etc., are also
3456 synchronized. Take care when you mix staves with grace notes and
3457 staves without, for example,
3459 @lilypond[quote,relative=2,verbatim]
3461 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3462 \new Staff { c4 \bar ".|:" d2. }
3467 This can be remedied by inserting grace skips of the corresponding
3468 durations in the other staves. For the above example
3470 @lilypond[quote,relative=2,verbatim]
3472 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3473 \new Staff { c4 \bar ".|:" \grace s16 d2. }
3477 The use of grace notes within voice contexts confuses the way the voice
3478 is typeset. This can be overcome by inserting a rest or note between the
3479 voice command and the grace note.
3481 @lilypond[quote,verbatim]
3483 \acciaccatura { f8 } e8 r8 \acciaccatura { f8 } e8 r4
3490 r8 r8 \voiceOne \accMusic \oneVoice r8 |
3491 r8 \voiceOne r8 \accMusic \oneVoice r8 |
3496 s8 s8 \voiceTwo \accMusic \oneVoice s8 |
3497 s8 \voiceTwo r8 \accMusic \oneVoice s8 |
3504 Grace sections should only be used within sequential music expressions.
3505 Nesting or juxtaposing grace sections is not supported, and might
3506 produce crashes or other errors.
3508 Each grace note in MIDI output has a length of 1/4 of its actual
3509 duration. If the combined length of the grace notes is greater than the
3510 length of the preceding note a @qq{@code{Going back in MIDI time}}
3511 error will be generated. Either make the grace notes shorter in
3512 duration, for example:
3515 c'8 \acciaccatura @{ c'8[ d' e' f' g'] @}
3521 c'8 \acciaccatura @{ c'16[ d' e' f' g'] @}
3524 Or explicitly change the musical duration:
3527 c'8 \acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
3530 See @ref{Scaling durations}.
3533 @node Aligning to cadenzas
3534 @unnumberedsubsubsec Aligning to cadenzas
3537 @cindex cadenza, aligning to
3538 @cindex aligning to cadenza
3540 In an orchestral context, cadenzas present a special problem: when
3541 constructing a score that includes a measured cadenza or other solo
3542 passage, all other instruments should skip just as many notes as the
3543 length of the cadenza, otherwise they will start too soon or too late.
3545 One solution to this problem is to use the functions
3546 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
3547 functions take a defined piece of music as an argument and generate a
3548 multi-measure rest or @code{\skip} exactly as long as the piece.
3550 @lilypond[verbatim,quote]
3551 MyCadenza = \relative c' {
3562 #(mmrest-of-length MyCadenza)
3564 #(skip-of-length MyCadenza)
3578 @node Time administration
3579 @unnumberedsubsubsec Time administration
3581 @cindex time administration
3582 @cindex timing (within the score)
3583 @cindex music, unmetered
3584 @cindex unmetered music
3586 @funindex currentBarNumber
3587 @funindex measurePosition
3588 @funindex measureLength
3590 Time is administered by the @code{Timing_translator}, which by
3591 default is to be found in the @code{Score} context. An alias,
3592 @code{Timing}, is added to the context in which the
3593 @code{Timing_translator} is placed. To ensure that the
3594 @code{Timing} alias is available, you may need to explicitly
3595 instantiate the containing context (such as @code{Voice} or
3598 The following properties of @code{Timing} are used
3599 to keep track of timing within the score.
3602 @cindex measure number
3605 @item currentBarNumber
3606 The current measure number. For an example showing the
3607 use of this property see @ref{Bar numbers}.
3610 The length of the measures in the current time signature. For a
3611 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
3612 determines when bar lines are inserted and how automatic beams
3613 should be generated.
3615 @item measurePosition
3616 The point within the measure where we currently are. This
3617 quantity is reset by subtracting @code{measureLength} whenever
3618 @code{measureLength} is reached or exceeded. When that happens,
3619 @code{currentBarNumber} is incremented.
3622 If set to true, the above variables are updated for every time
3623 step. When set to false, the engraver stays in the current
3624 measure indefinitely.
3628 Timing can be changed by setting any of these variables
3629 explicitly. In the next example, the default 4/4 time
3630 signature is printed, but @code{measureLength} is set to 5/4.
3631 At 4/8 through the third measure, the @code{measurePosition} is
3632 advanced by 1/8 to 5/8, shortening that bar by 1/8.
3633 The next bar line then falls at 9/8 rather than 5/4.
3635 @lilypond[quote,verbatim]
3636 \new Voice \relative c' {
3637 \set Timing.measureLength = #(ly:make-moment 5/4)
3641 \set Timing.measurePosition = #(ly:make-moment 5/8)
3648 As the example illustrates, @code{ly:make-moment n m} constructs a
3649 duration of n/m of a whole note. For example,
3650 @code{ly:make-moment 1 8} is an eighth note duration and
3651 @code{ly:make-moment 7 16} is the duration of seven sixteenths
3657 @ref{Unmetered music}.
3662 Internals Reference:
3663 @rinternals{Timing_translator},