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 with the @code{\tuplet}
193 command, multiplying the speed of the music expression by a
197 \tuplet @var{fraction} @{ @var{music} @}
201 The fraction's numerator will be printed over or
202 under the notes, optionally with a bracket. The most common
203 tuplets are triplets: 3@tie{}notes sound within the duration
204 normally allowed for@tie{}2:
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 grouping
213 When entering long passages of tuplets, having to write a separate
214 @code{\tuplet} command for each group is inconvenient. It is
215 possible to specify the duration of one tuplet group directly
216 before the music in order to have the tuplets grouped
219 @lilypond[quote,verbatim,relative=2]
220 g2 r8 \tuplet 3/2 8 { cis16 d e e f g g f e }
223 @cindex tuplet bracket placement
227 @funindex \tupletDown
229 @funindex \tupletNeutral
230 @funindex tupletNeutral
232 Tuplet brackets may be manually placed above or below the staff;
233 see @ref{Direction and placement}.
235 Tuplets may be nested:
237 @lilypond[quote,verbatim,relative=2]
239 c4 \tuplet 5/4 { f8 e f \tuplet 3/2 { e[ f g] } } f4
242 Modifying nested tuplets which begin at the same musical moment
243 must be done with @code{\tweak}.
245 To modify the duration of notes without printing a tuplet bracket,
246 see @ref{Scaling durations}.
252 @code{\tupletNeutral}.
258 @cindex tuplet formatting
259 @cindex triplet formatting
261 @funindex tupletNumberFormatFunction
262 @funindex tupletSpannerDuration
264 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
265 {entering-several-tuplets-using-only-one--times-command.ly}
267 @cindex Tuplet number changes
269 @funindex TupletNumber
271 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
272 {changing-the-tuplet-number.ly}
274 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
275 {non-default-tuplet-numbers.ly}
277 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
278 {controlling-tuplet-bracket-visibility.ly}
280 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
281 {permitting-line-breaks-within-beamed-tuplets.ly}
290 @rlearning{Tweaking methods}.
293 @ref{Time administration},
294 @ref{Scaling durations},
295 @ref{The tweak command},
296 @ref{Polymetric notation}.
302 @rinternals{TupletBracket},
303 @rinternals{TupletNumber},
304 @rinternals{TimeScaledMusic}.
306 @cindex grace notes within tuplet brackets
309 Grace notes may be placed within tuplet brackets, @emph{except}
310 when a staff begins with a grace note followed by a tuplet. In this
311 particular case, the grace note must be placed before the @code{\tuplet}
312 command to avoid errors.
314 @cindex tempo marks within tuplet brackets
316 When using a tuplet at the beginning of a piece with a @code{\tempo}
317 mark, the music must be explicitly entered in a @code{\new Voice}
318 block, as discussed in @rlearning{Voices contain music}.
321 @node Scaling durations
322 @unnumberedsubsubsec Scaling durations
324 @cindex scaling durations
325 @cindex durations, scaling
327 The duration of single notes, rests or chords may be multiplied by a
328 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
329 is 1) to the duration. This will not affect the appearance of the
330 notes or rests produced, but the altered duration will be used in
331 calculating the position within the measure and setting the duration
332 in the MIDI output. Multiplying factors may be combined like
333 @code{*L*M/N}. Factors are part of the duration: if a duration is
334 not specified for subsequent notes, the default duration taken from
335 the preceding note will include any scaling factor.
337 In the following example, the first three notes take up exactly
338 two beats, but no triplet bracket is printed.
340 @lilypond[quote,relative=2,verbatim]
342 % Alter durations to triplets
346 % Double the duration of chord
348 % Duration of quarter, appears like sixteenth
352 The duration of spacer rests may also be modified by
353 a multiplier. This is useful for skipping many measures, e.g.,
356 @cindex compressing music
357 @cindex expanding music
359 @funindex \scaleDurations
360 @funindex scaleDurations
362 Longer stretches of music may be compressed by a fraction in the
363 same way, as if every note, chord or rest had the fraction as a
364 multiplier. This leaves the appearance of the music unchanged but
365 the internal duration of the notes will be multiplied by the
366 fraction @emph{num}/@emph{den}. Here is an example showing how music
367 can be compressed and expanded:
369 @lilypond[quote,relative=2,verbatim]
373 % Scale music by *2/3
374 \scaleDurations 2/3 {
378 \scaleDurations 2/1 {
383 One application of this command is in polymetric
384 notation, see @ref{Polymetric notation}.
389 @ref{Invisible rests},
390 @ref{Polymetric notation}.
396 The calculation of the position within a measure must take into
397 account all the scaling factors applied to the notes within that
398 measure and any fractional carry-out from earlier measures. This
399 calculation is carried out using rational numbers. If an intermediate
400 numerator or denominator in that calculation exceeds 2^30 the
401 execution and typesetting will stop at that point without indicating
406 @unnumberedsubsubsec Ties
412 A tie connects two adjacent note heads of the same pitch. The tie
413 in effect extends the duration of a note.
415 @warning{Ties should not be confused with @emph{slurs}, which
416 indicate articulation, or @emph{phrasing slurs}, which indicate
417 musical phrasing. A tie is just a way of extending a note
418 duration, similar to the augmentation dot.}
420 A tie is entered using the tilde symbol (@code{~}).
422 @lilypond[quote,verbatim,relative=2]
426 Ties are used either when the note crosses a bar line, or when
427 dots cannot be used to denote the rhythm. Ties should also be
428 used when note values cross larger subdivisions of the measure:
430 @lilypond[verbatim,quote]
437 If you need to tie many notes across bar lines, it may be
438 easier to use automatic note splitting, see @ref{Automatic note
439 splitting}. This mechanism automatically splits long notes, and
440 ties them across bar lines.
442 @cindex ties and chords
443 @cindex chords and ties
445 When a tie is applied to a chord, all note heads whose pitches
446 match are connected. When no note heads match, no ties will be
447 created. Chords may be partially tied by placing the tie inside
450 @lilypond[quote,verbatim,relative=1]
452 <c~ e g~ b> <c e g b>
455 @cindex repeating ties
456 @cindex ties, repeating
457 @cindex volta brackets and ties
458 @cindex ties and volta brackets
463 When a second alternative of a repeat starts with a tied note, you
464 have to specify the repeated tie as follows:
466 @lilypond[quote,relative=2,verbatim]
467 \repeat volta 2 { c g <c e>2 ~ }
469 % First alternative: following note is tied normally
471 % Second alternative: following note has a repeated tie
472 { <c e>2\repeatTie d4 c } }
475 @cindex laissez vibrer
476 @cindex ties, laissez vibrer
478 @funindex \laissezVibrer
479 @funindex laissezVibrer
481 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
482 notes must not be damped at the end. It is used in notation for
483 piano, harp and other string and percussion instruments. They can
484 be entered as follows:
486 @lilypond[quote,verbatim,relative=1]
487 <c f g>1\laissezVibrer
490 @cindex ties, placement
496 @funindex \tieNeutral
499 Ties may be manually placed above or below the staff; see
500 @ref{Direction and placement}.
502 @cindex ties, appearance
515 Ties may be made dashed, dotted, or a combination of solid and
518 @lilypond[quote, verbatim, relative=1]
531 Custom dash patterns can be specified:
533 @lilypond[quote, verbatim, relative=1]
534 \tieDashPattern #0.3 #0.75
536 \tieDashPattern #0.7 #1.5
542 Dash pattern definitions for ties have the same structure as dash
543 pattern definitions for slurs. For more information about complex dash
544 patterns, see @ref{Slurs}.
546 Override @var{whiteout} and @var{layer} layout properties for ties that
547 collide with other objects in a staff.
549 @lilypond[verbatim,quote,ragged-right,relative=2]
550 \override Tie.layer = #-2
551 \override Staff.TimeSignature.layer = #-1
552 \override Staff.KeySignature.layer = #-1
553 \override Staff.TimeSignature.whiteout = ##t
554 \override Staff.KeySignature.whiteout = ##t
567 @code{\tieDashPattern},
568 @code{\tieHalfDashed},
569 @code{\tieHalfSolid},
575 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
576 {using-ties-with-arpeggios.ly}
578 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
579 {engraving-ties-manually.ly}
584 @rglos{laissez vibrer}.
588 @ref{Automatic note splitting}.
591 @rlsr{Expressive marks},
595 @rinternals{LaissezVibrerTie},
596 @rinternals{LaissezVibrerTieColumn},
597 @rinternals{TieColumn},
601 Switching staves when a tie is active will not produce a slanted tie.
603 Changing clefs or ottavations during a tie is not really well-defined.
604 In these cases, a slur may be preferable.
608 @subsection Writing rests
610 Rests are entered as part of the music in music expressions.
615 * Full measure rests::
619 @unnumberedsubsubsec Rests
622 @cindex rest, entering durations
637 Rests are entered like notes with the note name @code{r}.
638 Durations longer than a whole rest use the following predefined
641 @c \time 16/1 is used to avoid spurious bar lines
642 @c and long tracts of empty measures
643 @lilypond[quote,verbatim,relative=2]
645 % These two lines are just to prettify this example
647 \override Staff.TimeSignature.stencil = ##f
648 % Print a maxima rest, equal to four breves
650 % Print a longa rest, equal to two breves
654 r1 r2 r4 r8 r16 r32 r64 r128
658 @cindex rest, multi-measure
659 @cindex rest, whole-measure
661 Whole measure rests, centered in the middle of the measure, must be
662 entered as multi-measure rests. They can be used for a single
663 measure as well as many measures and are discussed in
664 @ref{Full measure rests}.
666 @cindex rest, specifying vertical position
668 To explicitly specify a rest's vertical position, write a note
669 followed by @code{\rest}. A rest of the duration of the note will
670 be placed at the staff position where the note would appear. This
671 allows for precise manual formatting of polyphonic music, since the
672 automatic rest collision formatter will not move these rests.
674 @lilypond[quote,verbatim,relative=2]
680 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
690 @ref{Full measure rests}.
699 @c Deliberately duplicated in Durations and Rests. -gp
700 There is no fundamental limit to rest durations (both in terms of
701 longest and shortest), but the number of glyphs is limited: there
702 are rests from 128th to maxima (8 x whole).
705 @node Invisible rests
706 @unnumberedsubsubsec Invisible rests
709 @cindex invisible rest
710 @cindex rest, invisible
718 An invisible rest (also called a @q{spacer rest}) can be entered
719 like a note with the note name@tie{}@code{s}:
721 @lilypond[verbatim,quote,relative=2]
728 Spacer rests are available only in note mode and chord mode. In
729 other situations, for example, when entering lyrics, the
730 command @code{\skip} is used to skip a musical moment.
731 @code{\skip} requires an explicit duration, but this is ignored if
732 the lyrics derive their durations from the notes in an associated
733 melody through @code{\addlyrics} or @code{\lyricsto}.
735 @lilypond[quote,verbatim,relative=2]
748 Because @code{\skip} is a command, it does not affect the default
749 durations of following notes, unlike@tie{}@code{s}.
751 @lilypond[quote,verbatim,relative=2]
754 \repeat unfold 8 { a4 }
764 A spacer rest implicitly causes @code{Staff} and @code{Voice}
765 contexts to be created if none exist, just like notes and rests
768 @lilypond[quote,verbatim,relative=2]
772 @code{\skip} simply skips musical time; it creates no output of
775 @lilypond[quote,verbatim,relative=2]
776 % This is valid input, but does nothing
777 \skip 1 \skip1 \skip 1
782 @rlearning{Visibility and color of objects}.
786 @ref{Visibility of objects}.
792 @rinternals{SkipMusic}.
795 @node Full measure rests
796 @unnumberedsubsubsec Full measure rests
798 @cindex multi-measure rests
799 @cindex full-measure rests
800 @cindex rest, multi-measure
801 @cindex rest, full-measure
802 @cindex whole rest for a full measure
803 @cindex rest, whole for a full measure
807 Rests for one or more full measures are entered like notes with
808 the note name uppercase @code{R}:
810 @lilypond[quote,verbatim,relative=2]
811 % Rest measures contracted to single measure
812 \compressFullBarRests
819 The duration of full-measure rests is identical to the duration
820 notation used for notes. The duration in a multi-measure rest must
821 always be an integral number of measure-lengths, so augmentation dots
822 or fractions must often be used:
824 @lilypond[quote,verbatim,relative=2]
825 \compressFullBarRests
831 R1*13/8 | R1*13/8*12 |
836 A full-measure rest is printed as either a whole or breve rest,
837 centered in the measure, depending on the time signature.
839 @lilypond[quote,verbatim,relative=2]
848 @cindex multi-measure rest, expanding
849 @cindex multi-measure rest, contracting
851 @funindex \expandFullBarRests
852 @funindex expandFullBarRests
853 @funindex \compressFullBarRests
854 @funindex compressFullBarRests
856 By default a multi-measure rest is expanded in the printed score to
857 show all the rest measures explicitly. Alternatively, a multi-measure
858 rest can be shown as a single measure containing a multi-measure rest
859 symbol, with the number of measures of rest printed above the measure:
861 @lilypond[quote,verbatim,relative=2]
863 \time 3/4 r2. | R2.*2 |
866 % Rest measures contracted to single measure
867 \compressFullBarRests
869 % Rest measures expanded
876 @cindex text on multi-measure rest
877 @cindex multi-measure rest, attaching text
878 @cindex script on multi-measure rest
879 @cindex multi-measure rest, script
880 @cindex fermata on multi-measure rest
881 @cindex multi-measure rest, attaching fermata
882 @cindex markup on multi-measure rest
883 @cindex multi-measure rest with markup
885 @funindex \fermataMarkup
886 @funindex fermataMarkup
887 @funindex MultiMeasureRestText
889 Markups can be added to multi-measure rests.
890 The predefined command @code{\fermataMarkup}
891 is provided for adding fermatas.
893 @lilypond[quote,verbatim,relative=2]
894 \compressFullBarRests
896 R2.*10^\markup { \italic "ad lib." }
900 @warning{Markups attached to a multi-measure rest are objects of type
901 @code{MultiMeasureRestText}, not @code{TextScript}. Overrides must
902 be directed to the correct object, or they will be ignored. See the
905 @lilypond[quote,verbatim,relative=2]
906 % This fails, as the wrong object name is specified
907 \override TextScript.padding = #5
909 % This is the correct object name to be specified
910 \override MultiMeasureRestText.padding = #5
914 When a multi-measure rest immediately follows a @code{\partial}
915 setting, resulting bar-check warnings may not be displayed.
918 @funindex \textLengthOn
919 @funindex textLengthOn
920 @funindex \textLengthOff
921 @funindex textLengthOff
922 @funindex \fermataMarkup
923 @funindex fermataMarkup
924 @funindex \compressFullBarRests
925 @funindex compressFullBarRests
926 @funindex \expandFullBarRests
927 @funindex expandFullBarRests
930 @code{\textLengthOn},
931 @code{\textLengthOff},
932 @code{\fermataMarkup},
933 @code{\compressFullBarRests},
934 @code{\expandFullBarRests}.
942 @cindex kirchenpausen
944 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
945 {changing-form-of-multi-measure-rests.ly}
947 @cindex multi-measure rests, positioning
948 @cindex positioning multi-measure rests
950 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
951 {positioning-multi-measure-rests.ly}
953 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
954 {multi-measure-rest-markup.ly}
958 @rglos{multi-measure rest}.
963 @ref{Formatting text},
970 @rinternals{MultiMeasureRest},
971 @rinternals{MultiMeasureRestNumber},
972 @rinternals{MultiMeasureRestText}.
974 @cindex fingerings and multi-measure rests
975 @cindex multi-measure rests and fingerings
978 Fingerings over multi-measure rests (e.g. @code{R1*10-4}) may result
979 in the fingering numeral colliding with the bar counter
982 @cindex condensing rests
983 @cindex rest, condensing ordinary
985 There is no way to automatically condense multiple ordinary rests
986 into a single multi-measure rest.
988 @cindex rest, collisions of
990 Multi-measure rests do not take part in rest collisions.
993 @node Displaying rhythms
994 @subsection Displaying rhythms
1001 * Polymetric notation::
1002 * Automatic note splitting::
1003 * Showing melody rhythms::
1006 @node Time signature
1007 @unnumberedsubsubsec Time signature
1009 @cindex time signature
1015 The time signature is set as follows:
1017 @lilypond[quote,verbatim,relative=2]
1022 @cindex time signature, visibility of
1024 Time signatures are printed at the beginning of a piece
1025 and whenever the time signature changes. If a change takes place
1026 at the end of a line a warning time signature sign is printed
1027 there. This default behavior may be changed, see
1028 @ref{Visibility of objects}.
1030 @lilypond[quote,verbatim,relative=2]
1040 @cindex time signature style
1043 @funindex \numericTimeSignature
1044 @funindex numericTimeSignature
1045 @funindex \defaultTimeSignature
1046 @funindex defaultTimeSignature
1048 The time signature symbol that is used in 2/2 and 4/4 time can be
1049 changed to a numeric style:
1051 @lilypond[quote,verbatim,relative=2]
1055 % Change to numeric style
1056 \numericTimeSignature
1059 % Revert to default style
1060 \defaultTimeSignature
1066 Mensural time signatures are covered in
1067 @ref{Mensural time signatures}.
1069 @cindex time signature default settings
1070 @cindex autobeaming properties for time signatures
1071 @cindex beaming, time signature default properties
1072 @funindex \overrideTimeSignatureSettings
1074 In addition to setting the printed time signature, the @code{\time}
1075 command also sets the values of the time-signature-based properties
1076 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
1077 The predefined default values for these properties can be found in
1078 @file{scm/time-signature-settings.scm}.
1080 The default value of @code{beatStructure} can be overridden in the
1081 @code{\time} command itself by supplying it as the optional first
1084 @lilypond[quote,verbatim]
1089 \repeat unfold 7 { c8 } |
1091 \repeat unfold 7 { c8 } |
1097 Alternatively, the default values of all these time-signature-based
1098 variables, including @code{baseMoment} and @code{beamExceptions},
1099 can be set together. The values can be set independently for several
1100 different time signatures. The new values take effect when a
1101 subsequent @code{\time} command with the same value of the time
1102 signature is executed:
1104 @lilypond[quote,verbatim]
1108 \overrideTimeSignatureSettings
1109 4/4 % timeSignatureFraction
1110 1/4 % baseMomentFraction
1111 #'(3 1) % beatStructure
1112 #'() % beamExceptions
1114 \repeat unfold 8 { c8 } |
1120 @code{\overrideTimeSignatureSettings} takes four arguments:
1125 @code{@var{timeSignatureFraction}}, a fraction describing the
1126 time signature to which these values apply.
1129 @code{@var{baseMomentFraction}}, a fraction containing the numerator
1130 and denominator of the basic timing unit for the time signature.
1133 @code{@var{beatStructure}}, a Scheme list indicating the structure
1134 of the beats in the measure, in units of the base moment.
1137 @code{@var{beamExceptions}}, an alist containing any beaming rules
1138 for the time signature that go beyond ending at every beat, as
1139 described in @ref{Setting automatic beam behavior}.
1142 The context containing @code{\overrideTimeSignatureSettings} must
1143 be instantiated before the @code{\overrideTimeSignatureSettings}
1144 call is executed. That means it must either be explicitly
1145 instantiated or there must be music in the context before the
1146 @code{\overrideTimeSignatureSettings} call:
1148 @lilypond[quote,verbatim]
1151 % This call will fail because the context isn't yet instantiated
1152 \overrideTimeSignatureSettings
1153 4/4 % timeSignatureFraction
1154 1/4 % baseMomentFraction
1155 #'(3 1) % beatStructure
1156 #'() % beamExceptions
1158 c8^\markup {"Beamed (2 2)"}
1159 \repeat unfold 7 { c8 } |
1160 % This call will succeed
1161 \overrideTimeSignatureSettings
1162 4/4 % timeSignatureFraction
1163 1/4 % baseMomentFraction
1164 #'(3 1) % beatStructure
1165 #'() % beamExceptions
1167 c8^\markup {"Beamed (3 1)"}
1168 \repeat unfold 7 { c8 } |
1174 @cindex time signature properties, restoring default values
1175 @cindex restoring default properties for time signatures
1176 @funindex \revertTimeSignatureSettings
1178 Changed values of default time signature properties can be restored
1179 to the original values:
1181 @lilypond[quote,verbatim]
1184 \repeat unfold 8 { c8 } |
1185 \overrideTimeSignatureSettings
1186 4/4 % timeSignatureFraction
1187 1/4 % baseMomentFraction
1188 #'(3 1) % beatStructure
1189 #'() % beamExceptions
1191 \repeat unfold 8 { c8 } |
1192 \revertTimeSignatureSettings 4/4
1194 \repeat unfold 8 { c8 } |
1199 Different values of default time signature properties can be established
1200 for different staves by moving the @code{Timing_translator} and the
1201 @code{Default_bar_line_engraver} from the @code{Score} context to the
1202 @code{Staff} context.
1204 @lilypond[quote, verbatim]
1208 \overrideTimeSignatureSettings
1209 4/4 % timeSignatureFraction
1210 1/4 % baseMomentFraction
1211 #'(3 1) % beatStructure
1212 #'() % beamExceptions
1214 \repeat unfold 8 {c''8}
1217 \overrideTimeSignatureSettings
1218 4/4 % timeSignatureFraction
1219 1/4 % baseMomentFraction
1220 #'(1 3) % beatStructure
1221 #'() % beamExceptions
1223 \repeat unfold 8 {c''8}
1229 \remove "Timing_translator"
1230 \remove "Default_bar_line_engraver"
1234 \consists "Timing_translator"
1235 \consists "Default_bar_line_engraver"
1241 A further method of changing these time-signature-related variables,
1242 which avoids reprinting the time signature at the time of the change,
1243 is shown in @ref{Setting automatic beam behavior}.
1246 @code{\numericTimeSignature},
1247 @code{\defaultTimeSignature}.
1252 @lilypondfile[verbatim,quote,texidoc,doctitle]
1253 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1257 @rglos{time signature}
1260 @ref{Mensural time signatures},
1261 @ref{Setting automatic beam behavior},
1262 @ref{Time administration}.
1265 @file{scm/time-signature-settings.scm}.
1270 Internals Reference:
1271 @rinternals{TimeSignature},
1272 @rinternals{Timing_translator}.
1275 @node Metronome marks
1276 @unnumberedsubsubsec Metronome marks
1279 @cindex beats per minute
1280 @cindex metronome mark
1281 @cindex metronome marking with text
1286 A basic metronome mark is simple to write:
1288 @lilypond[verbatim,quote,relative=1]
1294 Metronome marks may also be printed as a range of two numbers:
1296 @lilypond[verbatim,quote,relative=1]
1302 Tempo indications with text can be used instead:
1304 @lilypond[verbatim,quote,relative=2]
1310 Combining a metronome mark and text will automatically place the
1311 metronome mark within parentheses:
1313 @lilypond[verbatim,quote,relative=2]
1314 \tempo "Allegro" 4 = 160
1319 In general, the text can be any markup object:
1321 @lilypond[verbatim,quote,relative=2]
1322 \tempo \markup { \italic Faster } 4 = 132
1323 a8-. r8 b-. r gis-. r a-. r
1326 A parenthesized metronome mark with no textual indication may be
1327 written by including an empty string in the input:
1329 @lilypond[verbatim,quote,relative=2]
1337 @lilypondfile[verbatim,quote,texidoc,doctitle]
1338 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
1340 @c perhaps also an example of how to move it horizontally?
1342 @lilypondfile[verbatim,quote,texidoc,doctitle]
1343 {changing-the-tempo-without-a-metronome-mark.ly}
1345 @lilypondfile[verbatim,quote,texidoc,doctitle]
1346 {creating-metronome-marks-in-markup-mode.ly}
1348 For more details, see @ref{Formatting text}.
1353 @rglos{metronomic indication},
1354 @rglos{tempo indication},
1355 @rglos{metronome mark}.
1358 @ref{Formatting text},
1362 @rlsr{Staff notation}.
1364 Internals Reference:
1365 @rinternals{MetronomeMark}.
1369 @unnumberedsubsubsec Upbeats
1373 @cindex partial measure
1374 @cindex measure, partial
1375 @cindex measure, pickup
1376 @cindex pickup measure
1378 @funindex measurePosition
1382 Partial or pick-up measures, such as an @emph{anacrusis} or an
1383 @emph{upbeat}, are entered using the @code{\partial} command,
1386 \partial @var{duration}
1390 where @code{@var{duration}} is the @emph{remaining} length of the
1391 partial measure @emph{before} the start of the next full measure.
1393 @lilypond[quote,verbatim,relative=1]
1399 The @var{duration} can be any value less than a full measure:
1401 @lilypond[quote,verbatim,relative=1]
1404 r4 e8 | a4 c8 b c4 |
1407 The @code{\partial @var{duration}} can also be written as;
1410 \set Timing.measurePosition -@var{duration}
1413 So @code{\partial 8} becomes:
1415 @lilypond[quote,verbatim,relative=1]
1417 \set Timing.measurePosition = #(ly:make-moment -1/8)
1421 The property @code{measurePosition} contains a rational number
1422 indicating how much of the measure has passed at this point. Note
1423 that this is set to a negative number by the @code{\partial} command:
1424 i.e., @code{\partial 4} is internally translated to @w{@code{-4}},
1425 meaning @qq{there is a quarter note left in the measure.}
1438 @rinternals{Timing_translator}.
1441 The @code{\partial} command should be used only at the beginning of a
1442 piece. If you use it after the beginning, warnings or problems may
1443 occur, so use @code{\set Timing.measurePosition} instead.
1445 @lilypond[quote,verbatim,relative=1]
1448 e8 | a4 c8 b[ c b] |
1449 \set Timing.measurePosition = #(ly:make-moment -1/4)
1450 r8 e,8 | a4 c8 b[ c b] |
1454 @node Unmetered music
1455 @unnumberedsubsubsec Unmetered music
1458 @cindex cadenza, beams
1459 @cindex cadenza, accidentals
1460 @cindex cadenza, bar lines
1461 @cindex cadenza, bar numbers
1462 @cindex unmetered music
1463 @cindex unmetered music, beams
1464 @cindex unmetered music, accidentals
1465 @cindex unmetered music, bar lines
1466 @cindex unmetered music, bar numbers
1467 @cindex accidentals, cadenzas
1468 @cindex accidentals, unmetered music
1469 @cindex bar lines, cadenzas
1470 @cindex bar lines, unmetered music
1471 @cindex bar numbers, cadenzas
1472 @cindex bar numbers, unmetered music
1473 @cindex beams, cadenzas
1474 @cindex beams, unmetered music
1476 @funindex \cadenzaOn
1478 @funindex \cadenzaOff
1479 @funindex cadenzaOff
1481 In metered music bar lines are inserted and bar numbers are calculated
1482 automatically. In unmetered music (i.e. cadenzas), this is not
1483 desirable and can be @q{switched off} using the command
1484 @code{\cadenzaOn}, then @q{switched back on} at the appropriate place
1485 using @code{\cadenzaOff}.
1487 @lilypond[verbatim,relative=2,quote]
1490 c4 c d8[ d d] f4 g4.
1496 Bar numbering is resumed at the end of the cadenza.
1498 @lilypond[verbatim,relative=2,quote]
1499 % Show all bar numbers
1500 \override Score.BarNumber.break-visibility = #all-visible
1503 c4 c d8[ d d] f4 g4.
1509 A new bar is never started within a cadenza, even if one or more
1510 @code{\bar} commands are inserted within it. Therefore, reminder
1511 accidentals will need to be added manually. See @ref{Accidentals}.
1513 @lilypond[verbatim,relative=2,quote]
1523 Automatic beaming is disabled by @code{\cadenzaOn}. Therefore, all
1524 beaming in cadenzas must be entered manually. See @ref{Manual beams}.
1526 @lilypond[verbatim,relative=2,quote]
1527 \repeat unfold 8 { c8 }
1533 \repeat unfold 8 { c8 }
1536 These predefined commands affect all staves in the score, even when
1537 placed in just one @code{Voice} context. To change this, move the
1538 @code{Timing_translator} from the @code{Score} context to the
1539 @code{Staff} context. See @ref{Polymetric notation}.
1551 @ref{Visibility of objects},
1552 @ref{Polymetric notation},
1559 @cindex cadenza, line breaks
1560 @cindex cadenza, page breaks
1561 @cindex unmetered music, line breaks
1562 @cindex unmetered music, page breaks
1563 @cindex breaks in unmetered music
1564 @cindex line breaks, cadenzas
1565 @cindex page breaks, cadenzas
1566 @cindex line breaks, unmetered music
1567 @cindex page breaks, unmetered music
1570 Automatic line and page breaks are inserted only at bar lines, so
1571 @q{invisible} bar lines will need to be inserted manually in long
1572 stretches of unmetered music to permit breaking:
1578 Explicitly create a @code{Voice} context when starting a piece with
1579 @code{\cadenzaOn}, else unexpected errors may occur.
1585 c16[^"Solo Free Time" d e f] g2.
1593 @node Polymetric notation
1594 @unnumberedsubsubsec Polymetric notation
1596 @c This section necessarily uses \set
1597 @c This is acceptable -td
1599 @cindex double time signatures
1600 @cindex signatures, polymetric
1601 @cindex time signatures, polymetric
1602 @cindex time signatures, double
1603 @cindex polymetric signatures
1604 @cindex meter, polymetric
1606 @funindex timeSignatureFraction
1607 @funindex \scaleDurations
1608 @funindex scaleDurations
1612 Polymetric notation is supported explicitly or by manually modifying the
1613 visible time signature symbol and/or scaling note durations.
1615 @subsubsubheading Different time signatures with equal-length measures
1617 Set a common time signature for each staff, and set the
1618 @code{timeSignatureFraction} to the desired fraction. Then use the
1619 @code{\scaleDurations} function to scale the durations of the notes in
1620 each staff to the common time signature.
1622 @cindex beams, with polymetric meters
1623 @cindex polymetric meters, with beams
1625 In the following example, music with the time signatures of 3/4, 9/8 and
1626 10/8 are used in parallel. In the second staff, shown durations are
1627 multiplied by 2/3 (because 2/3 * 9/8 = 3/4) and in the third staff, the
1628 shown durations are multiplied by 3/5 (because 3/5 * 10/8 = 3/4). It
1629 may be necessary to insert beams manually, as the duration scaling will
1630 affect the autobeaming rules.
1632 @lilypond[quote,verbatim]
1641 \set Staff.timeSignatureFraction = 9/8
1643 \repeat unfold 6 { c8[ c c] }
1647 \set Staff.timeSignatureFraction = 10/8
1648 \scaleDurations 3/5 {
1649 \repeat unfold 2 { c8[ c c] }
1650 \repeat unfold 2 { c8[ c] } |
1651 c4. c \tuplet 3/2 { c8[ c c] } c4
1657 @subsubsubheading Different time signatures with unequal-length measures
1659 Each staff can be given its own independent time signature by
1660 moving the @code{Timing_translator} and the
1661 @code{Default_bar_line_engraver} to the @code{Staff} context.
1663 @lilypond[quote,verbatim]
1667 \remove "Timing_translator"
1668 \remove "Default_bar_line_engraver"
1672 \consists "Timing_translator"
1673 \consists "Default_bar_line_engraver"
1677 % Now each staff has its own time signature.
1701 @funindex \compoundMeter
1702 @cindex compound time signatures
1703 @cindex time signature, compound
1705 @subsubsubheading Compound time signatures
1707 These are created using the @code{\compoundMeter} function. The syntax
1711 \compoundMeter #'@code{(list of lists)}
1714 The simplest construction is a single list, where the @emph{last} number
1715 indicates the bottom number of the time signature and those that come
1716 before it, the top numbers.
1718 @lilypond[quote,verbatim]
1720 \compoundMeter #'((2 2 2 8))
1721 \repeat unfold 6 c8 \repeat unfold 12 c16
1725 More complex meters can be constructed using additional lists. Also,
1726 automatic beaming settings will be adjusted depending on the values.
1728 @lilypond[quote,verbatim]
1730 \compoundMeter #'((1 4) (3 8))
1731 \repeat unfold 5 c8 \repeat unfold 10 c16
1735 \compoundMeter #'((1 2 3 8) (3 4))
1736 \repeat unfold 12 c8
1743 @rglos{polymetric time signature},
1747 @ref{Automatic beams},
1749 @ref{Time signature},
1750 @ref{Scaling durations}.
1755 Internals Reference:
1756 @rinternals{TimeSignature},
1757 @rinternals{Timing_translator},
1758 @rinternals{Default_bar_line_engraver},
1762 When using different time signatures in parallel, notes at the same
1763 moment will be placed at the same horizontal location. However, the bar
1764 lines in the different staves will cause the note spacing to be less
1765 regular in each of the individual staves than would be normal without
1766 the different time signatures.
1769 @node Automatic note splitting
1770 @unnumberedsubsubsec Automatic note splitting
1772 @cindex notes, splitting
1773 @cindex splitting notes
1774 @cindex rests, splitting
1775 @cindex splitting rests
1777 @funindex Note_heads_engraver
1778 @funindex Completion_heads_engraver
1779 @funindex Completion_rest_engraver
1781 Long notes which overrun bar lines can be converted automatically to
1782 tied notes. This is done by replacing the @code{Note_heads_engraver}
1783 with the @code{Completion_heads_engraver}. Similarly, long rests which
1784 overrun bar lines are split automatically by replacing the
1785 @code{Rest_engraver} with the @code{Completion_rest_engraver}. In the
1786 following example, notes and rests crossing the bar lines are split,
1787 notes are also tied.
1789 @lilypond[quote,verbatim,relative=1]
1791 \remove "Note_heads_engraver"
1792 \consists "Completion_heads_engraver"
1793 \remove "Rest_engraver"
1794 \consists "Completion_rest_engraver"
1797 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 r1*2 }
1800 These engravers split all running notes and rests at the bar line, and
1801 inserts ties for notes. One of its uses is to debug complex scores: if
1802 the measures are not entirely filled, then the ties show exactly how
1803 much each measure is off.
1810 @rlearning{Engravers explained},
1811 @rlearning{Adding and removing engravers}.
1816 Internals Reference:
1817 @rinternals{Note_heads_engraver},
1818 @rinternals{Completion_heads_engraver},
1819 @rinternals{Rest_engraver},
1820 @rinternals{Completion_rest_engraver},
1821 @rinternals{Forbid_line_break_engraver}.
1824 Not all durations (especially those containing tuplets) can be
1825 represented exactly with normal notes and dots, but the
1826 @code{Completion_heads_engraver} will not insert tuplets.
1828 The @code{Completion_heads_engraver} only affects notes; it does not
1832 @node Showing melody rhythms
1833 @unnumberedsubsubsec Showing melody rhythms
1835 @cindex melody rhythms, showing
1836 @cindex rhythms, showing melody
1838 Sometimes you might want to show only the rhythm of a melody. This
1839 can be done with the rhythmic staff. All pitches of notes on such a
1840 staff are squashed, and the staff itself has a single line
1842 @lilypond[quote,relative=1,verbatim]
1844 \new RhythmicStaff {
1845 \new Voice = "myRhythm" {
1853 \lyricsto "myRhythm" {
1861 @cindex guitar chord charts
1862 @cindex strumming rhythms, showing
1863 @cindex guitar strumming rhythms, showing
1865 @funindex Pitch_squash_engraver
1866 @funindex \improvisationOn
1867 @funindex improvisationOn
1868 @funindex \improvisationOff
1869 @funindex improvisationOff
1871 Guitar chord charts often show the strumming rhythms. This can
1872 be done with the @code{Pitch_squash_engraver} and
1873 @code{\improvisationOn}.
1876 @lilypond[quote,verbatim]
1884 \consists "Pitch_squash_engraver"
1897 @code{\improvisationOn},
1898 @code{\improvisationOff}.
1904 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1905 {guitar-strum-rhythms.ly}
1911 Internals Reference:
1912 @rinternals{RhythmicStaff},
1913 @rinternals{Pitch_squash_engraver}.
1921 * Setting automatic beam behavior::
1926 @node Automatic beams
1927 @unnumberedsubsubsec Automatic beams
1929 By default, beams are inserted automatically:
1931 @cindex beams, manual
1932 @cindex manual beams
1933 @cindex beams, customizing rules
1935 @funindex \autoBeamOn
1936 @funindex autoBeamOn
1937 @funindex \autoBeamOff
1938 @funindex autoBeamOff
1940 @lilypond[quote,verbatim,relative=2]
1942 \time 6/8 c8 c c c8. c16 c8
1945 If these automatic decisions are not satisfactory, beaming can be
1946 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1947 entered manually if beams are to be extended over rests.
1949 If automatic beaming is not required, it may be turned off with
1950 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1952 @lilypond[quote,relative=1,verbatim]
1953 c4 c8 c8. c16 c8. c16 c8
1960 @cindex melismata, with beams
1961 @cindex beams, with melismata
1963 @warning{If beams are used to indicate melismata in songs, then
1964 automatic beaming should be switched off with @code{@bs{}autoBeamOff}
1965 and the beams indicated manually. Using @code{@bs{}partcombine} with
1966 @code{@bs{}autoBeamOff} can produce unintended results. See the
1967 snippets for more information.}
1969 Beaming patterns that differ from the automatic defaults can be
1970 created; see @ref{Setting automatic beam behavior}.
1973 @code{\autoBeamOff},
1977 @cindex beams, line breaks
1978 @cindex line breaks, beams
1979 @cindex beams, with knee gap
1980 @cindex knee gap, with beams
1984 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1985 {beams-across-line-breaks.ly}
1987 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1988 {changing-beam-knee-gap.ly}
1990 @cindex beams, \partcombine with \autoBeamOff
1991 @cindex voices, \partcombine with \autoBeamOff
1993 @lilypondfile [verbatim, quote, ragged-right, texidoc, doctitle]
1994 {partcombine-and-autobeamoff.ly}
1999 @ref{Setting automatic beam behavior}.
2002 @file{scm/auto-beam.scm}.
2007 Internals Reference:
2008 @rinternals{Auto_beam_engraver},
2009 @rinternals{Beam_engraver},
2011 @rinternals{BeamEvent},
2012 @rinternals{BeamForbidEvent},
2013 @rinternals{beam-interface},
2014 @rinternals{unbreakable-spanner-interface}.
2017 The properties of a beam are determined at the @emph{start} of its
2018 construction and any additional beam-property changes that occur before
2019 the beam has been completed will not take effect until the @emph{next},
2023 @node Setting automatic beam behavior
2024 @unnumberedsubsubsec Setting automatic beam behavior
2026 @cindex beams, with lyrics
2027 @cindex lyrics, with beams
2029 @funindex autoBeaming
2030 @funindex baseMoment
2031 @funindex beamExceptions
2032 @funindex beatStructure
2033 @funindex measureLength
2039 When automatic beaming is enabled, the placement of automatic beams
2040 is determined by three context properties:
2041 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2042 The default values of these variables may be overridden as described
2043 below, or alternatively the default values themselves may be changed
2044 as explained in @ref{Time signature}.
2046 If a @code{beamExceptions} rule is defined for the time signature in
2047 force, that rule alone is used to determine the beam placement; the
2048 values of @code{baseMoment} and @code{beatStructure} are ignored.
2050 If no @code{beamExceptions} rule is defined for the time signature
2051 in force, the beam placement is determined by the values of
2052 @code{baseMoment} and @code{beatStructure}.
2055 @subsubsubheading Beaming based on @code{baseMoment} and @code{beatStructure}
2057 By default, @code{beamExceptions} rules are defined for most common
2058 time signatures, so the @code{beamExceptions} rules must be disabled
2059 if automatic beaming is to be based on @code{baseMoment} and
2060 @code{beatStructure}. The @code{beamExceptions} rules are disabled
2064 \set Timing.beamExceptions = #'()
2067 When @code{beamExceptions} is set to @code{#'()}, either due to an
2068 explicit setting or because no @code{beamExceptions} rules are defined
2069 internally for the time signature in force, the ending points for
2070 beams are on beats as specified by the context properties
2071 @code{baseMoment} and @code{beatStructure}. @code{beatStructure} is
2072 a scheme list that defines the length of each beat in the measure in
2073 units of @code{baseMoment}. By default, @code{baseMoment} is one
2074 over the denominator of the time signature. By default, each unit of
2075 length @code{baseMoment} is a single beat.
2077 @lilypond[quote,relative=2,verbatim]
2079 c16^"default" c c c c |
2080 % beamExceptions are unlikely to be defined for 5/16 time,
2081 % but let's disable them anyway to be sure
2082 \set Timing.beamExceptions = #'()
2083 \set Timing.beatStructure = #'(2 3)
2084 c16^"(2+3)" c c c c |
2085 \set Timing.beatStructure = #'(3 2)
2086 c16^"(3+2)" c c c c |
2089 @lilypond[quote,relative=2,verbatim]
2091 a8^"default" a a a a a a a
2092 % Disable beamExceptions because they are definitely
2093 % defined for 4/4 time
2094 \set Timing.beamExceptions = #'()
2095 \set Timing.baseMoment = #(ly:make-moment 1/4)
2096 \set Timing.beatStructure = #'(1 1 1 1)
2097 a8^"changed" a a a a a a a
2100 Beam setting changes can be limited to specific contexts. If no
2101 setting is included in a lower-level context, the setting of the
2102 enclosing context will apply.
2104 @lilypond[quote, verbatim,relative=1]
2107 % No need to disable beamExceptions as they are not defined for 7/8 time
2108 \set Staff.beatStructure = #'(2 3 2)
2118 \set Voice.beatStructure = #'(1 3 3)
2126 When multiple voices are used the @code{Staff} context must be
2127 specified if the beaming is to be applied to all voices in the
2130 @lilypond[quote,verbatim,relative=2]
2133 % Change applied to Voice by default -- does not work correctly
2134 % Because of autogenerated voices, all beating will
2135 % be at baseMoment (1 . 8)
2136 \set beatStructure = #'(3 1 1 2)
2137 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2139 % Works correctly with context Staff specified
2140 \set Staff.beatStructure = #'(3 1 1 2)
2141 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2144 The value of @code{baseMoment} can be adjusted to change
2145 the beaming behavior, if desired. When this is done,
2146 the value of @code{beatStructure} must be set to be
2147 compatible with the new value of @code{baseMoment}.
2149 @lilypond[quote,verbatim,relative=2]
2151 % No need to disable beamExceptions as they are not defined for 5/8 time
2152 \set Timing.baseMoment = #(ly:make-moment 1/16)
2153 \set Timing.beatStructure = #'(7 3)
2154 \repeat unfold 10 { a16 }
2157 @code{baseMoment} is a @i{moment}; a unit of musical duration. A
2158 quantity of type @i{moment} is created by the scheme function
2159 @code{ly:make-moment}. For more information about this function,
2160 see @ref{Time administration}.
2162 By default @code{baseMoment} is set to one over the denominator of
2163 the time signature. Any exceptions to this default can be found in
2164 @file{scm/time-signature-settings.scm}.
2166 @subsubsubheading Beaming based on @code{beamExceptions}
2168 Special autobeaming rules (other than ending a beam on a beat)
2169 are defined in the @code{beamExceptions} property.
2171 @lilypond[quote,relative=2,verbatim]
2173 \set Timing.beatStructure = #'(2 1)
2174 \set Timing.beamExceptions =
2176 (end . ;entry for end of beams
2177 ( ;start of alist of end points
2178 ((1 . 32) . (2 2 2)) ;rule for 1/32 beams -- end each 1/16
2179 ))) %close all entries
2181 \repeat unfold 6 { c32 } |
2184 @code{beamExceptions} is an alist with a key of rule-type and a value
2187 At this time the only available value of rule-type is
2188 @code{'end} for beam ending.
2190 Beaming-rules is a scheme alist (or list of pairs) that indicates the
2191 beam type and the grouping to be applied to beams containing notes with
2192 a shortest duration of that beam type.
2195 #'((beam-type1 . grouping-1)
2196 (beam-type2 . grouping-2)
2197 (beam-type3 . grouping-3))
2200 Beam type is a scheme pair indicating the duration of the beam,
2201 e.g., @code{(1 . 16)}.
2203 Grouping is a scheme list indicating the grouping to be applied to
2204 the beam. The grouping is in units of the beam type.
2206 @warning{ A @code{beamExceptions} value must be @emph{complete}
2207 exceptions list. That is, every exception that should be applied
2208 must be included in the setting. It is not possible to add, remove,
2209 or change only one of the exceptions. While this may seem cumbersome,
2210 it means that the current beaming settings need not be known in order
2211 to specify a new beaming pattern.}
2213 When the time signature is changed, default values of
2214 @code{Timing.baseMoment}, @code{Timing.beatStructure},
2215 and @code{Timing.beamExceptions} are set. Setting the time signature
2216 will reset the automatic beaming settings for the @code{Timing}
2217 context to the default behavior.
2219 @lilypond[quote,verbatim,relative=2]
2221 \repeat unfold 6 { a8 }
2223 \set Timing.beatStructure = #'(4 2)
2224 \repeat unfold 6 { a8 }
2225 % go back to default behavior
2227 \repeat unfold 6 { a8 }
2230 The default automatic beaming settings for a time signature
2231 are determined in @file{scm/time-signature-settings.scm}.
2232 Changing the default automatic beaming settings
2233 for a time signature is described in @ref{Time signature}.
2235 Many automatic beaming settings for a time signature contain an
2236 entry for @code{beamExceptions}. For example, 4/4 time tries to
2237 beam the measure in two if there are only eighth notes. The
2238 @code{beamExceptions} rule can override the @code{beatStructure} setting
2239 if @code{beamExceptions} is not reset.
2241 @lilypond[quote,verbatim,relative=2]
2243 \set Timing.baseMoment = #(ly:make-moment 1/8)
2244 \set Timing.beatStructure = #'(3 3 2)
2245 % This won't beam (3 3 2) because of beamExceptions
2246 \repeat unfold 8 {c8} |
2247 % This will beam (3 3 2) because we clear beamExceptions
2248 \set Timing.beamExceptions = #'()
2249 \repeat unfold 8 {c8}
2252 In a similar fashion, eighth notes in 3/4 time are beamed as a full
2253 measure by default. To beam eighth notes in 3/4 time on the beat,
2254 reset @code{beamExceptions}.
2256 @lilypond[quote,verbatim,relative=2]
2258 % by default we beam in (6) due to beamExceptions
2259 \repeat unfold 6 {a8} |
2260 % This will beam (1 1 1) due to default baseMoment and beatStructure
2261 \set Timing.beamExceptions = #'()
2262 \repeat unfold 6 {a8}
2265 In engraving from the Romantic and Classical periods,
2266 beams often begin midway through the measure in 3/4 time,
2267 but modern practice is to avoid the false impression of 6/8 time
2268 (see Gould, p. 153). Similar situations arise in 3/8 time.
2269 This behavior is controlled by the context property @code{beamHalfMeasure},
2270 which has effect only in time signatures with 3 in the numerator:
2272 @lilypond[quote,verbatim,relative=2]
2275 \set Timing.beamHalfMeasure = ##f
2279 @subsubsubheading How automatic beaming works
2281 When automatic beaming is enabled, the placement of automatic beams
2282 is determined by the context properties
2283 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2285 The following rules, in order of priority, apply when determining
2286 the appearance of beams:
2290 If a manual beam is specified with @code{[..]} set the beam
2291 as specified, otherwise
2294 if a beam-ending rule is defined in @code{beamExceptions}
2295 for the beam-type, use it to determine the valid places where
2296 beams may end, otherwise
2299 if a beam-ending rule is defined in @code{beamExceptions}
2300 for a longer beam-type, use it to determine the valid places
2301 where beams may end, otherwise
2304 use the values of @code{baseMoment} and @code{beatStructure} to
2305 determine the ends of the beats in the measure, and
2306 end beams at the end of beats.
2310 In the rules above, the @emph{beam-type} is the duration of the
2311 shortest note in the beamed group.
2313 The default beaming rules can be found in
2314 @file{scm/time-signature-settings.scm}.
2318 @cindex beams, subdividing
2320 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2321 {subdividing-beams.ly}
2323 @cindex beamlets, orienting
2325 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2326 {strict-beat-beaming.ly}
2328 @cindex measure groupings
2329 @cindex beats, grouping
2330 @cindex grouping beats
2331 @cindex measure sub-grouping
2333 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2334 {conducting-signs,-measure-grouping-signs.ly}
2336 @cindex beam, endings in a score
2337 @cindex beam, endings with multiple voices
2339 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2340 {beam-endings-in-score-context.ly}
2344 @ref{Time signature}.
2347 @file{scm/time-signature-settings.scm}.
2352 Internals Reference:
2353 @rinternals{Auto_beam_engraver},
2355 @rinternals{BeamForbidEvent},
2356 @rinternals{beam-interface}.
2359 If a score ends while an automatic beam has not been ended and is
2360 still accepting notes, this last beam will not be typeset at all.
2361 The same holds for polyphonic voices, entered with
2362 @code{<< @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
2363 automatic beam is still accepting notes, it is not typeset.
2364 The workaround for these problems is to manually beam the last
2365 beam in the voice or score.
2367 By default, the @code{Timing} translator is aliased to the
2368 @code{Score} context. This means that setting the time signature
2369 in one staff will affect the beaming of the other staves as well.
2370 Thus, a time signature setting in a later staff will reset custom
2371 beaming that was set in an earlier staff.
2372 One way to avoid this problem is to set the time signature
2375 @lilypond[quote,verbatim,relative=2]
2379 \set Timing.baseMoment = #(ly:make-moment 1/8)
2380 \set Timing.beatStructure = #'(1 5)
2381 \repeat unfold 6 { a8 }
2384 \repeat unfold 6 { a8 }
2389 The default beam settings for the time signature can also be changed, so
2390 that the desired beaming will always be used. Changes in automatic
2391 beaming settings for a time signature are described in
2392 @ref{Time signature}.
2394 @lilypond[quote,verbatim,relative=2]
2397 \overrideTimeSignatureSettings
2398 3/4 % timeSignatureFraction
2399 1/8 % baseMomentFraction
2400 #'(1 5) % beatStructure
2401 #'() % beamExceptions
2403 \repeat unfold 6 { a8 }
2407 \repeat unfold 6 { a8 }
2414 @unnumberedsubsubsec Manual beams
2416 @cindex beams, manual
2417 @cindex manual beams
2422 In some cases it may be necessary to override the automatic
2423 beaming algorithm. For example, the autobeamer will not put beams
2424 over rests or bar lines, and in choral scores the beaming is
2425 often set to follow the meter of the lyrics rather than the
2426 notes. Such beams can be specified manually by
2427 marking the begin and end point with @code{[} and @code{]}.
2429 @lilypond[quote,relative=1,verbatim]
2430 r4 r8[ g' a r] r g[ | a] r
2433 @cindex manual beams, direction shorthand for
2434 @cindex manual beams, grace notes
2436 Beaming direction can be set manually using direction indicators:
2438 @lilypond[quote,relative=2,verbatim]
2439 c8^[ d e] c,_[ d e f g]
2445 Individual notes may be marked with @code{\noBeam} to prevent them
2448 @lilypond[quote,verbatim,relative=2]
2453 Grace note beams and normal note beams can occur simultaneously.
2454 Unbeamed grace notes are not put into normal note beams.
2456 @lilypond[quote,verbatim,relative=2]
2458 \grace { e32[ d c d] }
2464 @funindex stemLeftBeamCount
2465 @funindex stemRightBeamCount
2467 Even more strict manual control with the beams can be achieved by
2468 setting the properties @code{stemLeftBeamCount} and
2469 @code{stemRightBeamCount}. They specify the number of beams to
2470 draw on the left and right side, respectively, of the next note.
2471 If either property is set, its value will be used only once, and
2472 then it is erased. In this example, the last @code{f} is printed
2473 with only one beam on the left side, i.e., the eighth-note beam of
2474 the group as a whole.
2476 @lilypond[quote,relative=2,verbatim]
2479 \set stemLeftBeamCount = #2
2480 \set stemRightBeamCount = #1
2482 \set stemLeftBeamCount = #1
2494 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2495 {flat-flags-and-beam-nibs.ly}
2499 @ref{Direction and placement},
2505 Internals Reference:
2507 @rinternals{BeamEvent},
2508 @rinternals{Beam_engraver},
2509 @rinternals{beam-interface},
2510 @rinternals{Stem_engraver}.
2513 @node Feathered beams
2514 @unnumberedsubsubsec Feathered beams
2516 @cindex beams, feathered
2517 @cindex feathered beams
2519 @funindex \featherDurations
2520 @funindex featherDurations
2521 @funindex grow-direction
2523 Feathered beams are used to indicate that a small group of notes
2524 should be played at an increasing (or decreasing) tempo, without
2525 changing the overall tempo of the piece. The extent of the
2526 feathered beam must be indicated manually using @code{[} and
2527 @code{]}, and the beam feathering is turned on by specifying a
2528 direction to the @code{Beam} property @code{grow-direction}.
2530 If the placement of the notes and the sound in the MIDI output is to
2531 reflect the @emph{ritardando} or @emph{accelerando} indicated by the
2532 feathered beam the notes must be grouped as a music expression delimited
2533 by braces and preceded by a @code{featherDurations} command which specifies
2534 the ratio between the durations of the first and last notes in the
2537 The square brackets show the extent of the beam and the braces show
2538 which notes are to have their durations modified. Normally these
2539 would delimit the same group of notes, but this is not required: the
2540 two commands are independent.
2542 In the following example the eight 16th notes occupy exactly the
2543 same time as a half note, but the first note is one half as long
2544 as the last one, with the intermediate notes gradually
2545 lengthening. The first four 32nd notes gradually speed up, while
2546 the last four 32nd notes are at a constant tempo.
2548 @lilypond[relative=1,verbatim,quote]
2549 \override Beam.grow-direction = #LEFT
2550 \featherDurations #(ly:make-moment 2/1)
2551 { c16[ c c c c c c c] }
2552 \override Beam.grow-direction = #RIGHT
2553 \featherDurations #(ly:make-moment 2/3)
2555 % revert to non-feathered beams
2556 \override Beam.grow-direction = #'()
2561 The spacing in the printed output represents the
2562 note durations only approximately, but the MIDI output is exact.
2565 @code{\featherDurations}.
2573 The @code{\featherDurations} command only works with very short
2574 music snippets, and when numbers in the fraction are small.
2583 * Bar and bar number checks::
2588 @unnumberedsubsubsec Bar lines
2591 @cindex measure lines
2592 @cindex closing bar lines
2593 @cindex bar lines, closing
2594 @cindex double bar lines
2595 @cindex bar lines, double
2601 Bar lines delimit measures, and are also used to indicate
2602 repeats. Normally, simple bar lines are automatically inserted
2603 into the printed output at places based on the current time
2606 The simple bar lines inserted automatically can be changed to
2607 other types with the @code{\bar} command. For example, a closing
2608 double bar line is usually placed at the end of a piece:
2610 @lilypond[quote,relative=1,verbatim]
2614 It is not invalid if the final note in a measure does not
2615 end on the automatically entered bar line: the note is assumed
2616 to carry over into the next measure. But if a long sequence
2617 of such carry-over measures appears the music can appear compressed
2618 or even flowing off the page. This is because automatic line
2619 breaks happen only at the end of complete measures, i.e., where
2620 all notes end before the end of a measure.
2622 @warning{An incorrect duration can cause line breaks to be
2623 inhibited, leading to a line of highly compressed music or
2624 music which flows off the page.}
2627 @cindex bar lines, invisible
2628 @cindex measure lines, invisible
2630 Line breaks are also permitted at manually inserted bar lines
2631 even within incomplete measures. To allow a line break without
2632 printing a bar line, use the following:
2639 This will insert an invisible bar line and allow (but not
2640 force) a line break to occur at this point. The bar number
2641 counter is not increased. To force a line break see
2642 @ref{Line breaking}.
2644 @cindex manual bar lines
2645 @cindex manual measure lines
2646 @cindex bar lines, manual
2647 @cindex measure lines, manual
2649 This and other special bar lines may be inserted manually at any
2650 point. When they coincide with the end of a measure they replace
2651 the simple bar line which would have been inserted there
2652 automatically. When they do not coincide with the end of a measure
2653 the specified bar line is inserted at that point in the printed
2656 Note that manual bar lines are purely visual. They do not affect
2657 any of the properties that a normal bar line would affect, such as
2658 measure numbers, accidentals, line breaks, etc. They do not affect
2659 the calculation and placement of subsequent automatic bar lines.
2660 When a manual bar line is placed where a normal bar line already
2661 exists, the effects of the original bar line are not altered.
2663 Two types of simple bar lines and five types of double bar lines are
2664 available for manual insertion:
2666 @lilypond[quote,relative=1,verbatim]
2678 together with dotted and dashed bar lines:
2680 @lilypond[quote,relative=1,verbatim]
2687 and nine types of repeat bar lines:
2689 @lilypond[quote,relative=1,verbatim]
2702 Additionally, a bar line can be printed as a simple tick:
2703 @lilypond[quote,relative=1,verbatim]
2706 However, as such ticks are typically used in Gregorian chant, it is
2707 preferable to use @code{\divisioMinima} there instead, described in
2708 the section @ref{Divisiones} in Gregorian chant.
2710 Lilypond supports kievan notation and provides a special kievan
2712 @lilypond[quote,relative=1,verbatim]
2715 Further details of this notation are explained in
2716 @ref{Typesetting Kievan square notation}.
2720 For in-line segno signs, there are three types of bar lines which
2721 differ in their behavior at line breaks:
2723 @lilypond[quote,relative=2,verbatim]
2741 Although the bar line types signifying repeats may be inserted
2742 manually they do not in themselves cause LilyPond to recognize
2743 a repeated section. Such repeated sections are better entered
2744 using the various repeat commands (see @ref{Repeats}), which
2745 automatically print the appropriate bar lines.
2747 In addition, you can specify @code{".|:-||"}, which is equivalent to
2748 @code{".|:"} except at line breaks, where it gives a double bar
2749 line at the end of the line and a start repeat at the beginning of
2752 @lilypond[quote,relative=2,verbatim]
2760 For combinations of repeats with the segno sign, there are six different
2763 @lilypond[quote,relative=2,verbatim]
2791 Additionally there is an @code{\inStaffSegno} command which
2792 creates a segno bar, placed in cooperation
2793 with the @code{\repeat volta} command.
2795 @funindex \defineBarLine
2796 @funindex defineBarLine
2797 @cindex bar lines, defining
2798 @cindex defining bar lines
2800 New bar line types can be defined with @code{\defineBarLine}:
2803 \defineBarLine @var{bartype} #'(@var{end} @var{begin} @var{span})
2806 The @code{\defineBarline} variables can include the
2807 @q{empty} string @code{""}, which is equivalent to an invisible
2808 bar line being printed. Or they can be set to @code{#f} which
2809 prints no bar line at all.
2811 After the definiton, the new bar line can be used by
2812 @code{\bar} @var{bartype}.
2814 There are currently ten bar line elements available:
2816 @lilypond[quote,verbatim]
2817 \defineBarLine ":" #'("" ":" "")
2818 \defineBarLine "=" #'("=" "" "")
2819 \defineBarLine "[" #'("" "[" "")
2820 \defineBarLine "]" #'("]" "" "")
2837 The @code{"="} bar line provides the double span bar line, used
2838 in combination with the segno sign. Do not use it as a standalone
2839 double thin bar line; here, @code{\bar} @var{"||"} is
2842 The @code{"-"} sign starts annotations to bar lines which
2843 are useful to distinguish those with identical appearance
2844 but different behavior at line breaks and/or different span bars.
2845 The part following the @code{"-"} sign is not used for building up
2848 @lilypond[quote,relative=2,verbatim]
2849 \defineBarLine "||-dashedSpan" #'("||" "" "!!")
2854 c1 \bar "||-dashedSpan"
2865 Furthermore, the space character @code{" "} serves as a placeholder
2866 for defining span bars correctly aligned to the main bar lines:
2868 @lilypond[quote,relative=2,verbatim]
2869 \defineBarLine ":|.-wrong" #'(":|." "" "|.")
2870 \defineBarLine ":|.-right" #'(":|." "" " |.")
2886 If additional elements are needed, LilyPond provides a simple
2887 way to define them. For more informations on modifying or adding
2888 bar lines, see file @file{scm/bar-line.scm}.
2890 In scores with many staves, a @code{\bar} command in one staff is
2891 automatically applied to all staves. The resulting bar lines are
2892 connected between different staves of a @code{StaffGroup},
2893 @code{PianoStaff}, or @code{GrandStaff}.
2895 @lilypond[quote,relative=1,verbatim]
2903 \new Staff { \clef bass c4 g e g }
2905 \new Staff { \clef bass c2 c2 }
2910 @cindex default bar lines, changing
2911 @cindex bar lines, default, changing
2914 @funindex defaultBarType
2919 The command @samp{\bar @var{bartype}} is a shortcut for
2920 @samp{\set Timing.whichBar = @var{bartype}}. A bar line is
2921 created whenever the @code{whichBar} property is set.
2923 The default bar type used for automatically inserted bar lines is
2924 @code{"|"}. This may be changed at any time with
2925 @samp{\set Timing.defaultBarType = @var{bartype}}.
2929 @ref{Line breaking},
2931 @ref{Grouping staves}.
2934 @file{scm/bar-line.scm}.
2939 Internals Reference:
2940 @rinternals{BarLine} (created at @code{Staff} level),
2941 @rinternals{SpanBar} (across staves),
2942 @rinternals{Timing_translator} (for Timing properties).
2946 @unnumberedsubsubsec Bar numbers
2949 @cindex measure numbers
2950 @cindex numbers, bar
2951 @cindex numbers, measure
2953 @funindex currentBarNumber
2955 Bar numbers are typeset by default at the start of every line except
2956 the first line. The number itself is stored in the
2957 @code{currentBarNumber} property, which is normally updated
2958 automatically for every measure. It may also be set manually:
2960 @lilypond[verbatim,quote,relative=1]
2963 \set Score.currentBarNumber = #50
2967 @cindex bar numbers, regular spacing
2969 @funindex barNumberVisibility
2972 Bar numbers can be typeset at regular intervals instead of just at
2973 the beginning of every line. To do this the default behavior
2974 must be overridden to permit bar numbers to be printed at places
2975 other than the start of a line. This is controlled by the
2976 @code{break-visibility} property of @code{BarNumber}. This takes
2977 three values which may be set to @code{#t} or @code{#f} to specify
2978 whether the corresponding bar number is visible or not. The order
2979 of the three values is @code{end of line visible}, @code{middle of
2980 line visible}, @code{beginning of line visible}. In the following
2981 example bar numbers are printed at all possible places:
2983 @lilypond[verbatim,quote,relative=1]
2984 \override Score.BarNumber.break-visibility = ##(#t #t #t)
2985 \set Score.currentBarNumber = #11
2986 % Permit first bar number to be printed
2994 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2995 {printing-the-bar-number-for-the-first-measure.ly}
2997 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2998 {printing-bar-numbers-at-regular-intervals.ly}
3000 @cindex measure number, format
3001 @cindex bar number, format
3003 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3004 {printing-bar-numbers-inside-boxes-or-circles.ly}
3006 @cindex bar numbers, with letters
3007 @cindex bar numbers, with repeats
3009 @lilypondfile[verbatim,quote,texidoc,doctitle]
3010 {alternative-bar-numbering.ly}
3012 @cindex bar number alignment
3014 @lilypondfile[verbatim,quote,texidoc,doctitle]
3015 {aligning-bar-numbers.ly}
3017 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3018 {removing-bar-numbers-from-a-score.ly}
3024 Internals Reference:
3025 @rinternals{BarNumber},
3026 @rinternals{Bar_number_engraver}.
3028 @cindex bar number collision
3029 @cindex collision, bar number
3032 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
3033 if there is one. To solve this, the @code{padding} property of
3034 @code{BarNumber} can be used to position the number correctly. See
3035 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
3038 @node Bar and bar number checks
3039 @unnumberedsubsubsec Bar and bar number checks
3042 @cindex bar number check
3043 @cindex measure check
3044 @cindex measure number check
3046 @funindex barCheckSynchronize
3049 Bar checks help detect errors in the entered durations. A bar check
3050 may be entered using the bar symbol, @code{|}, at any place where a
3051 bar line is expected to fall. If bar check lines are encountered at
3052 other places, a list of warnings is printed in the log file, showing
3053 the line numbers and lines in which the bar checks failed. In the
3054 next example, the second bar check will signal an error.
3057 \time 3/4 c2 e4 | g2 |
3060 Bar checks can also be used in lyrics:
3065 Twin -- kle | Twin -- kle |
3069 An incorrect duration can result in a completely garbled score,
3070 especially if the score is polyphonic, so a good place to start
3071 correcting input is by scanning for failed bar checks and
3072 incorrect durations.
3074 If successive bar checks are off by the same musical interval,
3075 only the first warning message is displayed. This allows the
3076 warning to focus on the source of the timing error.
3080 @funindex pipeSymbol
3082 It is also possible to redefine the action taken when a bar check
3083 or pipe symbol, @code{|}, is encountered in the input, so that
3084 it does something other than a bar check. This is done by
3085 assigning a music expression to @code{pipeSymbol}.
3086 In the following example @code{|} is set to insert a double bar
3087 line wherever it appears in the input, rather than checking
3090 @lilypond[quote,verbatim]
3091 pipeSymbol = \bar "||"
3100 @funindex \barNumberCheck
3101 @funindex barNumberCheck
3103 When copying large pieces of music, it can be helpful to check that
3104 the LilyPond bar number corresponds to the original that you are
3105 entering from. This can be checked with @code{\barNumberCheck}, for
3109 \barNumberCheck #123
3113 will print a warning if the @code{currentBarNumber} is not 123
3114 when it is processed.
3121 @node Rehearsal marks
3122 @unnumberedsubsubsec Rehearsal marks
3124 @cindex rehearsal marks
3125 @cindex mark, rehearsal
3130 To print a rehearsal mark, use the @code{\mark} command.
3132 @lilypond[quote,verbatim,relative=2]
3140 The mark is incremented automatically if you use @code{\mark
3141 \default}, but you can also use an integer argument to set the
3142 mark manually. The value to use is stored in the property
3143 @code{rehearsalMark}.
3145 @lilypond[quote,verbatim,relative=2]
3154 The letter@tie{}@q{I} is skipped in accordance with engraving
3155 traditions. If you wish to include the letter @q{I}, then use one
3156 of the following commands, depending on which style of rehearsal mark
3157 you want (letters only, letters in a hollow box, or letters in a
3161 \set Score.markFormatter = #format-mark-alphabet
3162 \set Score.markFormatter = #format-mark-box-alphabet
3163 \set Score.markFormatter = #format-mark-circle-alphabet
3166 @lilypond[quote,verbatim,relative=2]
3167 \set Score.markFormatter = #format-mark-box-alphabet
3175 @cindex rehearsal mark format
3176 @cindex rehearsal mark style
3177 @cindex style, rehearsal mark
3178 @cindex format, rehearsal mark
3179 @cindex mark, rehearsal, style
3180 @cindex mark, rehearsal, format
3181 @cindex rehearsal mark, manual
3182 @cindex mark, rehearsal, manual
3183 @cindex custom rehearsal mark
3184 @cindex manual rehearsal mark
3186 The style is defined by the property @code{markFormatter}. It is
3187 a function taking the current mark (an integer) and the current
3188 context as argument. It should return a markup object. In the
3189 following example, @code{markFormatter} is set to a pre-defined
3190 procedure. After a few measures, it is set to a procedure that
3191 produces a boxed number.
3193 @lilypond[quote,verbatim,relative=2]
3194 \set Score.markFormatter = #format-mark-numbers
3197 \set Score.markFormatter = #format-mark-box-numbers
3199 \set Score.markFormatter = #format-mark-circle-numbers
3201 \set Score.markFormatter = #format-mark-circle-letters
3205 The file @file{scm/translation-functions.scm} contains the
3206 definitions of @code{format-mark-numbers} (the default format),
3207 @code{format-mark-box-numbers}, @code{format-mark-letters} and
3208 @code{format-mark-box-letters}. These can be used as inspiration
3209 for other formatting functions.
3211 You may use @code{format-mark-barnumbers},
3212 @code{format-mark-box-barnumbers}, and
3213 @code{format-mark-circle-barnumbers} to get bar numbers instead of
3214 incremented numbers or letters.
3216 Other styles of rehearsal mark can be specified manually:
3223 Note that @code{Score.markFormatter} does not affect marks specified
3224 in this manner. However, it is possible to apply a @code{\markup} to the
3228 \mark \markup@{ \box A1 @}
3233 @cindex D.S. al Fine
3235 @cindex music glyphs
3236 @cindex glyphs, music
3238 @funindex \musicglyph
3239 @funindex musicglyph
3241 Music glyphs (such as the segno sign) may be printed inside a
3244 @lilypond[quote,verbatim,relative=1]
3245 c1 \mark \markup { \musicglyph #"scripts.segno" }
3246 c1 \mark \markup { \musicglyph #"scripts.coda" }
3247 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
3252 See @ref{The Feta font}, for a list of symbols which may be
3253 printed with @code{\musicglyph}.
3255 For common tweaks to the positioning of rehearsal marks, see
3256 @ref{Formatting text}. For more precise control, see
3257 @code{break-alignable-interface} in @ref{Aligning objects}.
3259 The file @file{scm/translation-functions.scm} contains
3260 the definitions of @code{format-mark-numbers} and
3261 @code{format-mark-letters}. They can be used as inspiration for
3262 other formatting functions.
3266 @ref{The Feta font},
3267 @ref{Formatting text},
3268 @ref{Aligning objects}.
3271 @file{scm/translation-functions.scm}.
3276 Internals Reference:
3277 @rinternals{MarkEvent},
3278 @rinternals{Mark_engraver},
3279 @rinternals{RehearsalMark}.
3282 @node Special rhythmic concerns
3283 @subsection Special rhythmic concerns
3288 * Aligning to cadenzas::
3289 * Time administration::
3293 @unnumberedsubsubsec Grace notes
3297 @cindex appoggiatura
3298 @cindex acciaccatura
3301 @funindex \slashedGrace
3302 @funindex \acciaccatura
3303 @funindex \appoggiatura
3305 Grace notes are musical ornaments, printed in a smaller font, that take
3306 up no additional logical time in a measure.
3308 @lilypond[quote,relative=2,verbatim]
3310 \grace { b16[ c16] } a2)
3313 There are three other types of grace notes possible; the
3314 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
3315 note with a slashed stem -- and the @emph{appoggiatura}, which takes a
3316 fixed fraction of the main note it is attached to and prints without the
3317 slash. It is also possible to write a grace note with a slashed stem,
3318 like the @emph{acciaccatura} but without the slur, so as to place it
3319 between notes that are slurred themselves, using the
3320 @code{\slashedGrace} function.
3322 @lilypond[quote,relative=2,verbatim]
3325 \acciaccatura { g16[ f] } e2
3326 \slashedGrace a,8 g4
3327 \slashedGrace b16 a4(
3328 \slashedGrace b8 a2)
3331 The placement of grace notes is synchronized between different staves.
3332 In the following example, there are two sixteenth grace notes for every
3335 @lilypond[quote,relative=2,verbatim]
3337 \new Staff { e2 \grace { c16[ d e f] } e2 }
3338 \new Staff { c2 \grace { g8[ b] } c2 }
3342 @cindex grace notes, following
3344 @funindex \afterGrace
3345 @funindex afterGrace
3347 If you want to end a note with a grace, use the @code{\afterGrace}
3348 command. It takes two arguments: the main note, and the grace
3349 notes following the main note.
3351 @lilypond[quote,verbatim,relative=2]
3352 c1 \afterGrace d1 { c16[ d] } c1
3355 This will put the grace notes after a space lasting 3/4 of the
3356 length of the main note. The default fraction 3/4 can be changed by
3357 setting @code{afterGraceFraction}. The following example shows
3358 the results from setting the space at the default, at 15/16, and
3359 finally at 1/2 of the main note.
3361 @lilypond[quote,verbatim,relative=2]
3364 c1 \afterGrace d1 { c16[ d] } c1
3367 #(define afterGraceFraction (cons 15 16))
3368 c1 \afterGrace d1 { c16[ d] } c1
3371 #(define afterGraceFraction (cons 1 2))
3372 c1 \afterGrace d1 { c16[ d] } c1
3377 The space between the main note and the grace note may also be
3378 specified using spacers. The following example places the grace
3379 note after a space lasting 7/8 of the main note.
3381 @lilypond[quote,verbatim,relative=2]
3385 { s2 s4. \grace { c16[ d] } }
3391 @cindex tweaking grace notes
3392 @cindex grace notes, tweaking
3393 @cindex grace notes, changing layout settings
3395 A @code{\grace} music expression will introduce special
3396 typesetting settings, for example, to produce smaller type, and
3397 set directions. Hence, when introducing layout tweaks to
3398 override the special settings, they should be placed inside
3399 the grace expression. The overrides should also be reverted
3400 inside the grace expression. Here, the grace note's default stem
3401 direction is overridden and then reverted.
3403 @lilypond[quote,verbatim,relative=2]
3415 @cindex stem, with slash
3420 @lilypondfile[verbatim,quote,texidoc,doctitle]
3421 {using-grace-note-slashes-with-normal-heads.ly}
3423 @lilypondfile[verbatim,quote,texidoc,doctitle]
3424 {tweaking-grace-layout-within-music.ly}
3426 @lilypondfile[verbatim,quote,texidoc,doctitle]
3427 {redefining-grace-note-global-defaults.ly}
3429 @lilypondfile[verbatim,quote,texidoc,doctitle]
3430 {positioning-grace-notes-with-floating-space.ly}
3434 @rglos{grace notes},
3435 @rglos{acciaccatura},
3436 @rglos{appoggiatura}.
3439 @ref{Scaling durations},
3443 @file{ly/grace-init.ly}.
3448 Internals Reference:
3449 @rinternals{GraceMusic},
3450 @rinternals{Grace_beam_engraver},
3451 @rinternals{Grace_engraver},
3452 @rinternals{Grace_spacing_engraver}.
3456 @cindex acciaccatura, multi-note
3457 @cindex multi-note acciaccatura
3458 @cindex grace-note synchronization
3460 A multi-note beamed @i{acciaccatura} is printed without a slash,
3461 and looks exactly the same as a multi-note beamed
3464 @c TODO Add link to LSR snippet to add slash when available
3466 Grace note synchronization can also lead to surprises. Staff
3467 notation, such as key signatures, bar lines, etc., are also
3468 synchronized. Take care when you mix staves with grace notes and
3469 staves without, for example,
3471 @lilypond[quote,relative=2,verbatim]
3473 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3474 \new Staff { c4 \bar ".|:" d2. }
3479 This can be remedied by inserting grace skips of the corresponding
3480 durations in the other staves. For the above example
3482 @lilypond[quote,relative=2,verbatim]
3484 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3485 \new Staff { c4 \bar ".|:" \grace s16 d2. }
3489 The use of grace notes within voice contexts confuses the way the voice
3490 is typeset. This can be overcome by inserting a rest or note between the
3491 voice command and the grace note.
3493 @lilypond[quote,verbatim]
3495 \acciaccatura { f8 } e8 r8 \acciaccatura { f8 } e8 r4
3502 r8 r8 \voiceOne \accMusic \oneVoice r8 |
3503 r8 \voiceOne r8 \accMusic \oneVoice r8 |
3508 s8 s8 \voiceTwo \accMusic \oneVoice s8 |
3509 s8 \voiceTwo r8 \accMusic \oneVoice s8 |
3516 Grace sections should only be used within sequential music expressions.
3517 Nesting or juxtaposing grace sections is not supported, and might
3518 produce crashes or other errors.
3520 Each grace note in MIDI output has a length of 1/4 of its actual
3521 duration. If the combined length of the grace notes is greater than the
3522 length of the preceding note a @qq{@code{Going back in MIDI time}}
3523 error will be generated. Either make the grace notes shorter in
3524 duration, for example:
3527 c'8 \acciaccatura @{ c'8[ d' e' f' g'] @}
3533 c'8 \acciaccatura @{ c'16[ d' e' f' g'] @}
3536 Or explicitly change the musical duration:
3539 c'8 \acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
3542 See @ref{Scaling durations}.
3545 @node Aligning to cadenzas
3546 @unnumberedsubsubsec Aligning to cadenzas
3549 @cindex cadenza, aligning to
3550 @cindex aligning to cadenza
3552 In an orchestral context, cadenzas present a special problem: when
3553 constructing a score that includes a measured cadenza or other solo
3554 passage, all other instruments should skip just as many notes as the
3555 length of the cadenza, otherwise they will start too soon or too late.
3557 One solution to this problem is to use the functions
3558 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
3559 functions take a defined piece of music as an argument and generate a
3560 multi-measure rest or @code{\skip} exactly as long as the piece.
3562 @lilypond[verbatim,quote]
3563 MyCadenza = \relative c' {
3574 #(mmrest-of-length MyCadenza)
3576 #(skip-of-length MyCadenza)
3590 @node Time administration
3591 @unnumberedsubsubsec Time administration
3593 @cindex time administration
3594 @cindex timing (within the score)
3595 @cindex music, unmetered
3596 @cindex unmetered music
3598 @funindex currentBarNumber
3599 @funindex measurePosition
3600 @funindex measureLength
3602 Time is administered by the @code{Timing_translator}, which by
3603 default is to be found in the @code{Score} context. An alias,
3604 @code{Timing}, is added to the context in which the
3605 @code{Timing_translator} is placed. To ensure that the
3606 @code{Timing} alias is available, you may need to explicitly
3607 instantiate the containing context (such as @code{Voice} or
3610 The following properties of @code{Timing} are used
3611 to keep track of timing within the score.
3614 @cindex measure number
3617 @item currentBarNumber
3618 The current measure number. For an example showing the
3619 use of this property see @ref{Bar numbers}.
3622 The length of the measures in the current time signature. For a
3623 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
3624 determines when bar lines are inserted and how automatic beams
3625 should be generated.
3627 @item measurePosition
3628 The point within the measure where we currently are. This
3629 quantity is reset by subtracting @code{measureLength} whenever
3630 @code{measureLength} is reached or exceeded. When that happens,
3631 @code{currentBarNumber} is incremented.
3634 If set to true, the above variables are updated for every time
3635 step. When set to false, the engraver stays in the current
3636 measure indefinitely.
3640 Timing can be changed by setting any of these variables
3641 explicitly. In the next example, the default 4/4 time
3642 signature is printed, but @code{measureLength} is set to 5/4.
3643 At 4/8 through the third measure, the @code{measurePosition} is
3644 advanced by 1/8 to 5/8, shortening that bar by 1/8.
3645 The next bar line then falls at 9/8 rather than 5/4.
3647 @lilypond[quote,verbatim]
3648 \new Voice \relative c' {
3649 \set Timing.measureLength = #(ly:make-moment 5/4)
3653 \set Timing.measurePosition = #(ly:make-moment 5/8)
3660 As the example illustrates, @code{ly:make-moment n m} constructs a
3661 duration of n/m of a whole note. For example,
3662 @code{ly:make-moment 1 8} is an eighth note duration and
3663 @code{ly:make-moment 7 16} is the duration of seven sixteenths
3669 @ref{Unmetered music}.
3674 Internals Reference:
3675 @rinternals{Timing_translator},