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]
66 c''\longa c\breve c1 c2
67 c4 c8 c16 c32 c64 c128 c128
71 Here are the same durations with automatic beaming turned off.
73 @c not strictly "writing rhythms"; more of a "displaying" thing,
74 @c but it's ok here. -gp
75 @lilypond[quote,verbatim]
79 c''\longa c\breve c1 c2
80 c4 c8 c16 c32 c64 c128 c128
84 A note with the duration of a quadruple breve may be entered with
85 @code{\maxima}, but this is supported only within ancient music
86 notation. For details, see @ref{Ancient notation}.
88 @cindex duration, default
89 @cindex default note duration
90 @cindex note duration, default
92 If the duration is omitted, it is set to the previously
93 entered duration. The default for the first note is a quarter
96 @lilypond[quote,verbatim]
97 \relative { a' a a2 a a4 a a1 a }
100 Durations occuring on their own within a music sequence will take
101 their pitches from the preceding note or chord.
103 @lilypond[quote,verbatim]
106 c'' \longa \breve 1 2
111 @cindex notes, dotted
113 @cindex notes, double-dotted
114 @cindex double-dotted notes
118 To obtain dotted note lengths, place a dot (@code{.}) after the
119 duration. Double-dotted notes are specified by appending two
122 @lilypond[quote,verbatim]
123 \relative { a'4 b c4. b8 a4. b4.. c8. }
126 Some durations cannot be represented with just binary durations
127 and dots; they can be represented only by tying two or more
128 notes together. For details, see @ref{Ties}.
130 For ways of specifying durations for the syllables of lyrics and
131 ways of aligning lyrics to notes, see @ref{Vocal music}.
133 Optionally, notes can be spaced strictly proportionately to their
134 duration. For details of this and other settings which control
135 proportional notation, see @ref{Proportional notation}.
141 @funindex \dotsNeutral
142 @funindex dotsNeutral
144 Dots are normally moved up to avoid staff lines, except in
145 polyphonic situations. Dots may be manually placed above or below
146 the staff; see @ref{Direction and placement}.
160 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
161 {alternative-breve-notes.ly}
163 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
164 {changing-the-number-of-augmentation-dots-per-note.ly}
172 @rglos{Duration names notes and rests}.
175 @ref{Automatic beams},
178 @ref{Writing rhythms},
181 @ref{Ancient notation},
182 @ref{Proportional notation}.
189 @rinternals{DotColumn}.
192 @c Deliberately duplicated in Durations and Rests. -gp
193 There is no fundamental limit to rest durations (both in terms of
194 longest and shortest), but the number of glyphs is limited:
195 rests from 128th to maxima (8 x whole) may be printed.
199 @unnumberedsubsubsec Tuplets
207 Tuplets are made from a music expression with the @code{\tuplet}
208 command, multiplying the speed of the music expression by a fraction:
211 \tuplet @var{fraction} @{ @var{music} @}
215 The fraction's numerator will be printed over or under the notes,
216 optionally with a bracket. The most common tuplets are triplets
217 (3@tie{}notes sound within the duration normally allowed for@tie{}2).
219 @lilypond[quote,verbatim]
221 a'2 \tuplet 3/2 { b4 4 4 }
222 c4 c \tuplet 3/2 { b4 a g }
226 @cindex tuplet grouping
228 When entering long passages of tuplets, having to write a separate
229 @code{\tuplet} command for each group is inconvenient. It is possible
230 to specify the duration of one tuplet group directly before the music
231 in order to have the tuplets grouped automatically:
233 @lilypond[quote,verbatim]
235 g'2 r8 \tuplet 3/2 8 { cis16 d e e f g g f e }
239 @cindex tuplet bracket placement
243 @funindex \tupletDown
245 @funindex \tupletNeutral
246 @funindex tupletNeutral
248 Tuplet brackets may be manually placed above or below the staff:
250 @lilypond[quote,verbatim]
252 \tupletUp \tuplet 3/2 { c''8 d e }
253 \tupletNeutral \tuplet 3/2 { c8 d e }
254 \tupletDown \tuplet 3/2 { f,8 g a }
255 \tupletNeutral \tuplet 3/2 { f8 g a }
259 Tuplets may be nested:
261 @lilypond[quote,verbatim]
264 c''4 \tuplet 5/4 { f8 e f \tuplet 3/2 { e[ f g] } } f4
268 Modifying nested tuplets which begin at the same musical moment must be
269 done with @code{\tweak}.
271 To modify the duration of notes without printing a tuplet bracket, see
272 @ref{Scaling durations}.
277 @code{\tupletNeutral}.
283 @cindex tuplet formatting
284 @cindex triplet formatting
286 @funindex tupletNumberFormatFunction
287 @funindex tupletSpannerDuration
289 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
290 {entering-several-tuplets-using-only-one--tuplet-command.ly}
292 @cindex Tuplet number changes
294 @funindex TupletNumber
296 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
297 {changing-the-tuplet-number.ly}
299 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
300 {non-default-tuplet-numbers.ly}
302 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
303 {controlling-tuplet-bracket-visibility.ly}
305 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
306 {permitting-line-breaks-within-beamed-tuplets.ly}
315 @rlearning{Tweaking methods}.
318 @ref{Direction and placement},
319 @ref{Time administration},
320 @ref{Scaling durations},
321 @ref{The tweak command},
322 @ref{Polymetric notation}.
328 @rinternals{TupletBracket},
329 @rinternals{TupletNumber},
330 @rinternals{TimeScaledMusic}.
333 @node Scaling durations
334 @unnumberedsubsubsec Scaling durations
336 @cindex scaling durations
337 @cindex durations, scaling
339 The duration of single notes, rests or chords may be multiplied by a
340 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
341 is 1) to the duration. This will not affect the appearance of the
342 notes or rests produced, but the altered duration will be used in
343 calculating the position within the measure and setting the duration
344 in the MIDI output. Multiplying factors may be combined like
345 @code{*L*M/N}. Factors are part of the duration: if a duration is
346 not specified for subsequent notes, the default duration taken from
347 the preceding note will include any scaling factor.
349 In the following example, the first three notes take up exactly
350 two beats, but no triplet bracket is printed.
352 @lilypond[quote,verbatim]
355 % Alter durations to triplets
359 % Double the duration of chord
361 % Duration of quarter, appears like sixteenth
366 The duration of spacer rests may also be modified by
367 a multiplier. This is useful for skipping many measures, e.g.,
370 @cindex compressing music
371 @cindex expanding music
373 @funindex \scaleDurations
374 @funindex scaleDurations
376 Longer stretches of music may be compressed by a fraction in the
377 same way, as if every note, chord or rest had the fraction as a
378 multiplier. This leaves the appearance of the music unchanged but
379 the internal duration of the notes will be multiplied by the
380 fraction @emph{num}/@emph{den}. Here is an example showing how music
381 can be compressed and expanded:
383 @lilypond[quote,verbatim]
388 % Scale music by *2/3
389 \scaleDurations 2/3 {
393 \scaleDurations 2/1 {
399 One application of this command is in polymetric
400 notation, see @ref{Polymetric notation}.
405 @ref{Invisible rests},
406 @ref{Polymetric notation}.
412 The calculation of the position within a measure must take into
413 account all the scaling factors applied to the notes within that
414 measure and any fractional carry-out from earlier measures. This
415 calculation is carried out using rational numbers. If an intermediate
416 numerator or denominator in that calculation exceeds 2^30 the
417 execution and typesetting will stop at that point without indicating
422 @unnumberedsubsubsec Ties
428 A tie connects two adjacent note heads of the same pitch. The tie
429 in effect extends the duration of a note.
431 @warning{Ties should not be confused with @emph{slurs}, which
432 indicate articulation, or @emph{phrasing slurs}, which indicate
433 musical phrasing. A tie is just a way of extending a note
434 duration, similar to the augmentation dot.}
436 A tie is entered by appending a tilde symbol (@code{~}) to the first
437 of each pair of notes being tied. This indicates that the note
438 should be tied to the following note, which must be at the same pitch.
440 @lilypond[quote,verbatim]
444 Ties can make use of the @q{last explicit pitch} interpretation of
447 @lilypond[quote,verbatim]
451 Ties are used either when the note crosses a bar line, or when
452 dots cannot be used to denote the rhythm. Ties should also be
453 used when note values cross larger subdivisions of the measure:
455 @lilypond[verbatim,quote]
462 If you need to tie many notes across bar lines, it may be
463 easier to use automatic note splitting, see @ref{Automatic note
464 splitting}. This mechanism automatically splits long notes, and
465 ties them across bar lines.
467 @cindex ties and chords
468 @cindex chords and ties
470 When a tie is applied to a chord, all note heads whose pitches
471 match are connected. When no note heads match, no ties will be
472 created. Chords may be partially tied by placing the ties inside
475 @lilypond[quote,verbatim]
479 <c~ e g~ b> <c e g b> |
483 @cindex repeating ties
484 @cindex ties, repeating
485 @cindex volta brackets and ties
486 @cindex ties and volta brackets
491 When a second alternative of a repeat starts with a tied note, you
492 have to specify the repeated tie as follows:
494 @lilypond[quote,verbatim]
496 \repeat volta 2 { c'' g <c e>2~ }
498 % First alternative: following note is tied normally
500 % Second alternative: following note has a repeated tie
501 { <c e>2\repeatTie d4 c }
506 @cindex laissez vibrer
507 @cindex ties, laissez vibrer
509 @funindex \laissezVibrer
510 @funindex laissezVibrer
512 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
513 notes must not be damped at the end. It is used in notation for
514 piano, harp and other string and percussion instruments. They can
515 be entered as follows:
517 @lilypond[quote,verbatim,fragment]
518 <c' f' g'>1\laissezVibrer
521 @cindex ties, placement
527 @funindex \tieNeutral
530 Ties may be made to curve up or down manually; see
531 @ref{Direction and placement}.
533 @cindex ties, appearance
546 Ties may be made dashed, dotted, or a combination of solid and
549 @lilypond[quote, verbatim]
564 Custom dash patterns can be specified:
566 @lilypond[quote, verbatim]
568 \tieDashPattern #0.3 #0.75
570 \tieDashPattern #0.7 #1.5
577 Dash pattern definitions for ties have the same structure as dash
578 pattern definitions for slurs. For more information about complex dash
579 patterns, see @ref{Slurs}.
581 Override @var{whiteout-box} and @var{layer} layout properties of objects
582 that should cause a gap in ties.
584 @lilypond[verbatim,quote,ragged-right]
586 \override Tie.layer = #-2
587 \override Staff.TimeSignature.layer = #-1
588 \override Staff.KeySignature.layer = #-1
589 \override Staff.TimeSignature.whiteout = ##t
590 \override Staff.KeySignature.whiteout = ##t
604 @code{\tieDashPattern},
605 @code{\tieHalfDashed},
606 @code{\tieHalfSolid},
612 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
613 {using-ties-with-arpeggios.ly}
615 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
616 {engraving-ties-manually.ly}
621 @rglos{laissez vibrer}.
625 @ref{Automatic note splitting}.
628 @rlsr{Expressive marks},
632 @rinternals{LaissezVibrerTie},
633 @rinternals{LaissezVibrerTieColumn},
634 @rinternals{TieColumn},
638 Switching staves when a tie is active will not produce a slanted tie.
640 Changing clefs or ottavations during a tie is not really well-defined.
641 In these cases, a slur may be preferable.
645 @subsection Writing rests
647 Rests are entered as part of the music in music expressions.
652 * Full measure rests::
656 @unnumberedsubsubsec Rests
659 @cindex rest, entering durations
674 Rests are entered like notes with the note name @code{r}.
675 Durations longer than a whole rest use the following predefined
678 @c \time 16/1 is used to avoid spurious bar lines
679 @c and long tracts of empty measures
680 @lilypond[quote,verbatim]
682 % These two lines are just to prettify this example
684 \omit Staff.TimeSignature
685 % Print a maxima rest, equal to four breves
687 % Print a longa rest, equal to two breves
691 r1 r2 r4 r8 r16 r32 r64 r128
695 @cindex rest, multi-measure
696 @cindex rest, whole-measure
698 Whole measure rests, centered in the middle of the measure, must be
699 entered as multi-measure rests. They can be used for a single
700 measure as well as many measures and are discussed in
701 @ref{Full measure rests}.
703 @cindex rest, specifying vertical position
705 To explicitly specify a rest's vertical position, write a note
706 followed by @code{\rest}. A rest of the duration of the note will
707 be placed at the staff position where the note would appear. This
708 allows for precise manual formatting of polyphonic music, since the
709 automatic rest collision formatter will not move these rests.
711 @lilypond[quote,verbatim]
712 \relative { a'4\rest d4\rest }
717 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
727 @ref{Full measure rests}.
736 @c Deliberately duplicated in Durations and Rests. -gp
737 There is no fundamental limit to rest durations (both in terms of
738 longest and shortest), but the number of glyphs is limited: there
739 are rests from 128th to maxima (8 x whole).
742 @node Invisible rests
743 @unnumberedsubsubsec Invisible rests
746 @cindex invisible rest
747 @cindex rest, invisible
755 An invisible rest (also called a @q{spacer rest}) can be entered
756 like a note with the note name@tie{}@code{s}:
758 @lilypond[verbatim,quote]
767 Spacer rests are available only in note mode and chord mode. In
768 other situations, for example, when entering lyrics, the
769 command @code{\skip} is used to skip a musical moment.
770 @code{\skip} requires an explicit duration, but this is ignored if
771 the lyrics derive their durations from the notes in an associated
772 melody through @code{\addlyrics} or @code{\lyricsto}.
774 @lilypond[quote,verbatim]
787 Because @code{\skip} is a command, it does not affect the default
788 durations of following notes, unlike@tie{}@code{s}.
790 @lilypond[quote,verbatim]
793 \repeat unfold 8 { a'4 }
803 A spacer rest implicitly causes @code{Staff} and @code{Voice}
804 contexts to be created if none exist, just like notes and rests
807 @lilypond[quote,verbatim]
811 @code{\skip} simply skips musical time; it creates no output of
814 @lilypond[quote,verbatim]
815 % This is valid input, but does nothing
816 { \skip 1 \skip1 \skip 1 }
821 @rlearning{Visibility and color of objects}.
825 @ref{Visibility of objects}.
831 @rinternals{SkipMusic}.
834 @node Full measure rests
835 @unnumberedsubsubsec Full measure rests
837 @cindex multi-measure rests
838 @cindex full-measure rests
839 @cindex rest, multi-measure
840 @cindex rest, full-measure
841 @cindex whole rest for a full measure
842 @cindex rest, whole for a full measure
844 @funindex compressMMRests
845 @funindex \compressMMRests
848 Rests for one or more full measures are entered like notes with
849 the note name uppercase @code{R}:
851 @lilypond[quote,verbatim]
852 % Rest measures contracted to single measure
861 The duration of full-measure rests is identical to the duration
862 notation used for notes. The duration in a multi-measure rest must
863 always be an integral number of measure-lengths, so augmentation dots
864 or fractions must often be used:
866 @lilypond[quote,verbatim]
873 R1*13/8 | R1*13/8*12 |
879 A full-measure rest is printed as either a whole or breve rest,
880 centered in the measure, depending on the time signature.
882 @lilypond[quote,verbatim,fragment]
891 @cindex multi-measure rest, expanding
892 @cindex multi-measure rest, contracting
894 By default a multi-measure rest is expanded in the printed score to
895 show all the rest measures explicitly. Alternatively, a multi-measure
896 rest can be shown as a single measure containing a multi-measure rest
897 symbol, with the number of measures of rest printed above the measure:
899 @lilypond[quote,verbatim,fragment]
901 \time 3/4 r2. | R2.*2 |
904 % Rest measures contracted to single measure
908 % Rest measures expanded again
914 @cindex text on multi-measure rest
915 @cindex multi-measure rest, attaching text
916 @cindex script on multi-measure rest
917 @cindex multi-measure rest, script
918 @cindex fermata on multi-measure rest
919 @cindex multi-measure rest, attaching fermata
920 @cindex markup on multi-measure rest
921 @cindex multi-measure rest with markup
923 @funindex \fermataMarkup
924 @funindex fermataMarkup
925 @funindex MultiMeasureRestText
927 Markups can be added to multi-measure rests.
928 The predefined command @code{\fermataMarkup}
929 is provided for adding fermatas.
931 @lilypond[quote,verbatim]
934 R2.*10^\markup { \italic "ad lib." }
939 @warning{Markups attached to a multi-measure rest are objects of type
940 @code{MultiMeasureRestText}, not @code{TextScript}. Overrides must
941 be directed to the correct object, or they will be ignored. See the
944 @lilypond[quote,verbatim,fragment]
945 % This fails, as the wrong object name is specified
946 \override TextScript.padding = #5
948 % This is the correct object name to be specified
949 \override MultiMeasureRestText.padding = #5
953 When a multi-measure rest immediately follows a @code{\partial}
954 setting, resulting bar-check warnings may not be displayed.
957 @funindex \textLengthOn
958 @funindex textLengthOn
959 @funindex \textLengthOff
960 @funindex textLengthOff
961 @funindex \fermataMarkup
962 @funindex fermataMarkup
963 @funindex \compressMMRests
964 @funindex compressMMRests
967 @code{\textLengthOn},
968 @code{\textLengthOff},
969 @code{\fermataMarkup},
970 @code{\compressMMRests}.
978 @cindex kirchenpausen
980 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
981 {changing-form-of-multi-measure-rests.ly}
983 @cindex multi-measure rests, positioning
984 @cindex positioning multi-measure rests
986 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
987 {positioning-multi-measure-rests.ly}
989 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
990 {multi-measure-rest-markup.ly}
994 @rglos{multi-measure rest}.
999 @ref{Formatting text},
1005 Internals Reference:
1006 @rinternals{MultiMeasureRest},
1007 @rinternals{MultiMeasureRestNumber},
1008 @rinternals{MultiMeasureRestText}.
1010 @cindex fingerings and multi-measure rests
1011 @cindex multi-measure rests and fingerings
1014 Fingerings over multi-measure rests (e.g. @code{R1*10-4}) may result
1015 in the fingering numeral colliding with the bar counter
1018 @cindex condensing rests
1019 @cindex rest, condensing ordinary
1021 There is no way to automatically condense multiple ordinary rests
1022 into a single multi-measure rest.
1024 @cindex rest, collisions of
1026 Multi-measure rests do not take part in rest collisions.
1029 @node Displaying rhythms
1030 @subsection Displaying rhythms
1037 * Polymetric notation::
1038 * Automatic note splitting::
1039 * Showing melody rhythms::
1042 @node Time signature
1043 @unnumberedsubsubsec Time signature
1045 @cindex time signature
1051 The time signature is set as follows:
1053 @lilypond[quote,verbatim,fragment]
1058 Mid-measure time signature changes are covered in @ref{Upbeats}.
1060 @cindex time signature visibility
1062 Time signatures are printed at the beginning of a piece
1063 and whenever the time signature changes. If a change takes place
1064 at the end of a line a warning time signature sign is printed
1065 there. This default behavior may be changed, see
1066 @ref{Visibility of objects}.
1068 @lilypond[quote,verbatim]
1080 @cindex time signature style
1083 @funindex \numericTimeSignature
1084 @funindex numericTimeSignature
1085 @funindex \defaultTimeSignature
1086 @funindex defaultTimeSignature
1088 The time signature symbol that is used in 2/2 and 4/4 time can be
1089 changed to a numeric style:
1091 @lilypond[quote,verbatim]
1096 % Change to numeric style
1097 \numericTimeSignature
1100 % Revert to default style
1101 \defaultTimeSignature
1108 Mensural time signatures are covered in
1109 @ref{Mensural time signatures}.
1111 @cindex time signature default settings
1112 @cindex autobeaming properties for time signatures
1113 @cindex beaming, time signature default properties
1114 @funindex \overrideTimeSignatureSettings
1116 In addition to setting the printed time signature, the @code{\time}
1117 command also sets the values of the time-signature-based properties
1118 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
1119 The predefined default values for these properties can be found in
1120 @file{scm/time-signature-settings.scm}.
1122 The default value of @code{beatStructure} can be overridden in the
1123 @code{\time} command itself by supplying it as the optional first
1126 @lilypond[quote,verbatim]
1131 \repeat unfold 7 { c'8 } |
1133 \repeat unfold 7 { c8 } |
1139 Alternatively, the default values of all these time-signature-based
1140 variables, including @code{baseMoment} and @code{beamExceptions},
1141 can be set together. The values can be set independently for several
1142 different time signatures. The new values take effect when a
1143 subsequent @code{\time} command with the same value of the time
1144 signature is executed:
1146 @lilypond[quote,verbatim]
1150 \overrideTimeSignatureSettings
1151 4/4 % timeSignatureFraction
1152 1/4 % baseMomentFraction
1153 #'(3 1) % beatStructure
1154 #'() % beamExceptions
1156 \repeat unfold 8 { c8 } |
1162 @code{\overrideTimeSignatureSettings} takes four arguments:
1167 @code{@var{timeSignatureFraction}}, a fraction describing the
1168 time signature to which these values apply.
1171 @code{@var{baseMomentFraction}}, a fraction containing the numerator
1172 and denominator of the basic timing unit for the time signature.
1175 @code{@var{beatStructure}}, a Scheme list indicating the structure
1176 of the beats in the measure, in units of the base moment.
1179 @code{@var{beamExceptions}}, an alist containing any beaming rules
1180 for the time signature that go beyond ending at every beat, as
1181 described in @ref{Setting automatic beam behavior}.
1185 @cindex time signature properties, restoring default values
1186 @cindex restoring default properties for time signatures
1187 @funindex \revertTimeSignatureSettings
1189 Changed values of default time signature properties can be restored
1190 to the original values:
1192 @lilypond[quote,verbatim]
1195 \repeat unfold 8 { c'8 } |
1196 \overrideTimeSignatureSettings
1197 4/4 % timeSignatureFraction
1198 1/4 % baseMomentFraction
1199 #'(3 1) % beatStructure
1200 #'() % beamExceptions
1202 \repeat unfold 8 { c8 } |
1203 \revertTimeSignatureSettings 4/4
1205 \repeat unfold 8 { c8 } |
1210 Different values of default time signature properties can be established
1211 for different staves by moving the @code{Timing_translator} and the
1212 @code{Default_bar_line_engraver} from the @code{Score} context to the
1213 @code{Staff} context.
1215 @lilypond[quote, verbatim]
1219 \overrideTimeSignatureSettings
1220 4/4 % timeSignatureFraction
1221 1/4 % baseMomentFraction
1222 #'(3 1) % beatStructure
1223 #'() % beamExceptions
1225 \repeat unfold 8 {c''8}
1228 \overrideTimeSignatureSettings
1229 4/4 % timeSignatureFraction
1230 1/4 % baseMomentFraction
1231 #'(1 3) % beatStructure
1232 #'() % beamExceptions
1234 \repeat unfold 8 {c''8}
1240 \remove "Timing_translator"
1241 \remove "Default_bar_line_engraver"
1245 \consists "Timing_translator"
1246 \consists "Default_bar_line_engraver"
1252 A further method of changing these time-signature-related variables,
1253 which avoids reprinting the time signature at the time of the change,
1254 is shown in @ref{Setting automatic beam behavior}.
1257 @code{\numericTimeSignature},
1258 @code{\defaultTimeSignature}.
1263 @lilypondfile[verbatim,quote,texidoc,doctitle]
1264 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1268 @rglos{time signature}
1271 @ref{Mensural time signatures},
1272 @ref{Setting automatic beam behavior},
1273 @ref{Time administration}.
1276 @file{scm/time-signature-settings.scm}.
1281 Internals Reference:
1282 @rinternals{TimeSignature},
1283 @rinternals{Timing_translator}.
1286 @node Metronome marks
1287 @unnumberedsubsubsec Metronome marks
1290 @cindex beats per minute
1291 @cindex metronome mark
1292 @cindex metronome marking with text
1297 A basic metronome mark is simple to write:
1299 @lilypond[verbatim,quote]
1307 Metronome marks may also be printed as a range of two numbers:
1309 @lilypond[verbatim,quote]
1317 Tempo indications with text can be used instead:
1319 @lilypond[verbatim,quote]
1327 Combining a metronome mark and text will automatically place the
1328 metronome mark within parentheses:
1330 @lilypond[verbatim,quote]
1332 \tempo "Allegro" 4 = 160
1338 In general, the text can be any markup object:
1340 @lilypond[verbatim,quote]
1342 \tempo \markup { \italic Faster } 4 = 132
1343 a'8-. r8 b-. r gis-. r a-. r
1347 A parenthesized metronome mark with no textual indication may be
1348 written by including an empty string in the input:
1350 @lilypond[verbatim,quote]
1357 @funindex \markLengthOn
1358 @funindex markLengthOn
1359 @funindex \markLengthOff
1360 @funindex markLengthOff
1362 In a part for an instrument with long periods of rests,
1363 tempo indications sometimes follow each other closely.
1364 The command @code{\markLengthOn} provides extra horizontal space
1365 to prevent tempo indications from overlapping, and @code{\markLengthOff}
1366 restores the default behavior of ignoring tempo marks
1367 for horizontal spacing.
1369 @lilypond[verbatim,quote]
1372 \tempo "Molto vivace"
1384 @lilypondfile[verbatim,quote,texidoc,doctitle]
1385 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
1387 @c perhaps also an example of how to move it horizontally?
1389 @lilypondfile[verbatim,quote,texidoc,doctitle]
1390 {changing-the-tempo-without-a-metronome-mark.ly}
1392 @lilypondfile[verbatim,quote,texidoc,doctitle]
1393 {creating-metronome-marks-in-markup-mode.ly}
1395 For more details, see @ref{Formatting text}.
1400 @rglos{metronomic indication},
1401 @rglos{tempo indication},
1402 @rglos{metronome mark}.
1405 @ref{Formatting text},
1406 @ref{Creating MIDI output}.
1409 @rlsr{Staff notation}.
1411 Internals Reference:
1412 @rinternals{MetronomeMark}.
1416 @unnumberedsubsubsec Upbeats
1420 @cindex partial measure
1421 @cindex measure, partial
1422 @cindex measure, pickup
1423 @cindex pickup measure
1424 @cindex time signature, mid-measure
1426 @funindex measurePosition
1430 Partial or pick-up measures, such as an @emph{anacrusis} or an
1431 @emph{upbeat}, are entered using the @code{\partial} command:
1434 \partial @var{duration}
1437 When @code{\partial} is used at the beginning of a score,
1438 @code{@var{duration}} is the length of the music preceding the
1441 @lilypond[quote,verbatim]
1445 r4 e'8 | a4 c8 b c4 |
1449 When @code{\partial} is used after the beginning of a score,
1450 @code{@var{duration}} is the @emph{remaining} length of the
1451 current measure. It does not create a new numbered bar.
1453 @lilypond[quote,verbatim]
1455 \set Score.barNumberVisibility = #all-bar-numbers-visible
1456 \override Score.BarNumber.break-visibility =
1457 #end-of-line-invisible
1459 d''4.~ 4 d8 d( c) b | c4.~ 4. \bar "||"
1462 c8( d) e | f2.~ 4 f8 a,( c) f |
1466 The @code{\partial} command is @emph{required} when the time
1467 signature changes in mid measure, but it may also be used alone.
1469 @lilypond[quote,verbatim]
1471 \set Score.barNumberVisibility = #all-bar-numbers-visible
1472 \override Score.BarNumber.break-visibility =
1473 #end-of-line-invisible
1476 e'8 | a4 c8 b[ c b] |
1478 r8 e,8 | a4 \bar "||"
1485 The @code{\partial} command sets the @code{Timing.measurePosition}
1486 property, which is a rational number that indicates how much of
1487 the measure has passed.
1500 @rinternals{Timing_translator}.
1503 @node Unmetered music
1504 @unnumberedsubsubsec Unmetered music
1507 @cindex cadenza, beams
1508 @cindex cadenza, accidentals
1509 @cindex cadenza, bar lines
1510 @cindex cadenza, bar numbers
1511 @cindex unmetered music
1512 @cindex unmetered music, beams
1513 @cindex unmetered music, accidentals
1514 @cindex unmetered music, bar lines
1515 @cindex unmetered music, bar numbers
1516 @cindex accidentals, cadenzas
1517 @cindex accidentals, unmetered music
1518 @cindex bar lines, cadenzas
1519 @cindex bar lines, unmetered music
1520 @cindex bar numbers, cadenzas
1521 @cindex bar numbers, unmetered music
1522 @cindex beams, cadenzas
1523 @cindex beams, unmetered music
1525 @funindex \cadenzaOn
1527 @funindex \cadenzaOff
1528 @funindex cadenzaOff
1530 In metered music bar lines are inserted and bar numbers are calculated
1531 automatically. In unmetered music (i.e. cadenzas), this is not
1532 desirable and can be @q{switched off} using the command
1533 @code{\cadenzaOn}, then @q{switched back on} at the appropriate place
1534 using @code{\cadenzaOff}.
1536 @lilypond[verbatim,quote]
1540 c4 c d8[ d d] f4 g4.
1547 Bar numbering is resumed at the end of the cadenza.
1549 @lilypond[verbatim,quote]
1551 % Show all bar numbers
1552 \override Score.BarNumber.break-visibility = #all-visible
1555 c4 c d8[ d d] f4 g4.
1562 Inserting a @code{\bar} command within a cadenza does not start a new
1563 measure, even if a bar line is printed. So any accidentals -- which
1564 are usually assumed to remain in force until the end of the measure --
1565 will still be valid after the bar line printed by @code{\bar}. If
1566 subsequent accidentals should be printed, forced accidentals or
1567 reminder accidentals need to be inserted manually, see
1570 @lilypond[verbatim,quote]
1576 % First cis is printed without alteration even if it's after a \bar
1583 Automatic beaming is disabled by @code{\cadenzaOn}. Therefore, all
1584 beaming in cadenzas must be entered manually. See @ref{Manual beams}.
1586 @lilypond[verbatim,quote]
1588 \repeat unfold 8 { c''8 }
1594 \repeat unfold 8 { c8 }
1598 These predefined commands affect all staves in the score, even when
1599 placed in just one @code{Voice} context. To change this, move the
1600 @code{Timing_translator} from the @code{Score} context to the
1601 @code{Staff} context. See @ref{Polymetric notation}.
1613 @ref{Visibility of objects},
1614 @ref{Polymetric notation},
1621 @cindex cadenza, line breaks
1622 @cindex cadenza, page breaks
1623 @cindex unmetered music, line breaks
1624 @cindex unmetered music, page breaks
1625 @cindex breaks in unmetered music
1626 @cindex line breaks, cadenzas
1627 @cindex page breaks, cadenzas
1628 @cindex line breaks, unmetered music
1629 @cindex page breaks, unmetered music
1632 Automatic line and page breaks are inserted only at bar lines, so
1633 @q{invisible} bar lines will need to be inserted manually in long
1634 stretches of unmetered music to permit breaking:
1641 @node Polymetric notation
1642 @unnumberedsubsubsec Polymetric notation
1644 @c This section necessarily uses \set
1645 @c This is acceptable -td
1647 @cindex double time signatures
1648 @cindex signatures, polymetric
1649 @cindex time signature, polymetric
1650 @cindex time signature, double
1651 @cindex polymetric signatures
1652 @cindex meter, polymetric
1654 @funindex timeSignatureFraction
1655 @funindex \scaleDurations
1656 @funindex scaleDurations
1660 Polymetric notation is supported explicitly or by manually modifying the
1661 visible time signature symbol and/or scaling note durations.
1663 @subsubsubheading Different time signatures with equal-length measures
1665 Set a common time signature for each staff, and set the
1666 @code{timeSignatureFraction} to the desired fraction. Then use the
1667 @code{\scaleDurations} function to scale the durations of the notes in
1668 each staff to the common time signature.
1670 @cindex beams, with polymetric meters
1671 @cindex polymetric meters, with beams
1673 In the following example, music with the time signatures of 3/4, 9/8 and
1674 10/8 are used in parallel. In the second staff, shown durations are
1675 multiplied by 2/3 (because 2/3 * 9/8 = 3/4) and in the third staff, the
1676 shown durations are multiplied by 3/5 (because 3/5 * 10/8 = 3/4). It
1677 may be necessary to insert beams manually, as the duration scaling will
1678 affect the autobeaming rules.
1680 @lilypond[quote,verbatim]
1689 \set Staff.timeSignatureFraction = 9/8
1691 \repeat unfold 6 { c8[ c c] }
1695 \set Staff.timeSignatureFraction = 10/8
1696 \scaleDurations 3/5 {
1697 \repeat unfold 2 { c8[ c c] }
1698 \repeat unfold 2 { c8[ c] } |
1699 c4. c \tuplet 3/2 { c8[ c c] } c4
1705 @subsubsubheading Different time signatures with unequal-length measures
1707 Each staff can be given its own independent time signature by
1708 moving the @code{Timing_translator} and the
1709 @code{Default_bar_line_engraver} to the @code{Staff} context.
1711 @lilypond[quote,verbatim]
1715 \remove "Timing_translator"
1716 \remove "Default_bar_line_engraver"
1720 \consists "Timing_translator"
1721 \consists "Default_bar_line_engraver"
1725 % Now each staff has its own time signature.
1749 @funindex \compoundMeter
1750 @cindex compound time signatures
1751 @cindex time signature, compound
1753 @subsubsubheading Compound time signatures
1755 These are created using the @code{\compoundMeter} function. The syntax
1759 \compoundMeter #'@code{(list of lists)}
1762 The simplest construction is a single list, where the @emph{last} number
1763 indicates the bottom number of the time signature and those that come
1764 before it, the top numbers.
1766 @lilypond[quote,verbatim]
1768 \compoundMeter #'((2 2 2 8))
1769 \repeat unfold 6 c'8 \repeat unfold 12 c16
1773 More complex meters can be constructed using additional lists. Also,
1774 automatic beaming settings will be adjusted depending on the values.
1776 @lilypond[quote,verbatim]
1778 \compoundMeter #'((1 4) (3 8))
1779 \repeat unfold 5 c'8 \repeat unfold 10 c16
1783 \compoundMeter #'((1 2 3 8) (3 4))
1784 \repeat unfold 12 c'8
1791 @rglos{polymetric time signature},
1795 @ref{Automatic beams},
1797 @ref{Time signature},
1798 @ref{Scaling durations}.
1803 Internals Reference:
1804 @rinternals{TimeSignature},
1805 @rinternals{Timing_translator},
1806 @rinternals{Default_bar_line_engraver},
1810 When using different time signatures in parallel, notes at the same
1811 moment will be placed at the same horizontal location. However, the bar
1812 lines in the different staves will cause the note spacing to be less
1813 regular in each of the individual staves than would be normal without
1814 the different time signatures.
1817 @node Automatic note splitting
1818 @unnumberedsubsubsec Automatic note splitting
1820 @cindex notes, splitting
1821 @cindex splitting notes
1822 @cindex rests, splitting
1823 @cindex splitting rests
1825 @funindex Note_heads_engraver
1826 @funindex Completion_heads_engraver
1827 @funindex Completion_rest_engraver
1829 Long notes which overrun bar lines can be converted automatically to
1830 tied notes. This is done by replacing the @code{Note_heads_engraver}
1831 with the @code{Completion_heads_engraver}. Similarly, long rests which
1832 overrun bar lines are split automatically by replacing the
1833 @code{Rest_engraver} with the @code{Completion_rest_engraver}. In the
1834 following example, notes and rests crossing the bar lines are split,
1835 notes are also tied.
1837 @lilypond[quote,verbatim]
1839 \remove "Note_heads_engraver"
1840 \consists "Completion_heads_engraver"
1841 \remove "Rest_engraver"
1842 \consists "Completion_rest_engraver"
1845 c'2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 r1*2
1849 These engravers split all running notes and rests at the bar line, and
1850 inserts ties for notes. One of its uses is to debug complex scores: if
1851 the measures are not entirely filled, then the ties show exactly how
1852 much each measure is off.
1854 The property @code{completionUnit} sets a preferred duration for
1857 @lilypond[quote,verbatim]
1859 \remove "Note_heads_engraver"
1860 \consists "Completion_heads_engraver"
1862 \time 9/8 g\breve. d''4. \bar "||"
1863 \set completionUnit = #(ly:make-moment 3 8)
1868 These engravers split notes with scaled duration, such as those in tuplets,
1869 into notes with the same scale-factor as in the input note.
1871 @lilypond[quote,verbatim]
1873 \remove "Note_heads_engraver"
1874 \consists "Completion_heads_engraver"
1877 \tuplet 3/2 {g'4 a b}
1878 \scaleDurations 2/3 {g a b}
1880 \tuplet 3/2 {g4 a b}
1890 @rlearning{Engravers explained},
1891 @rlearning{Adding and removing engravers}.
1896 Internals Reference:
1897 @rinternals{Note_heads_engraver},
1898 @rinternals{Completion_heads_engraver},
1899 @rinternals{Rest_engraver},
1900 @rinternals{Completion_rest_engraver},
1901 @rinternals{Forbid_line_break_engraver}.
1904 For consistency with previous behavior, notes and rests with
1905 duration longer than a measure, such as @code{c1*2}, are split into
1906 notes without any scale factor, @code{@{ c1 c1 @}}. The property
1907 @code{completionFactor} controls this behavior, and setting it to
1908 @code{#f} cause split notes and rest to have the scale factor
1909 of the input durations.
1912 @node Showing melody rhythms
1913 @unnumberedsubsubsec Showing melody rhythms
1915 @cindex melody rhythms, showing
1916 @cindex rhythms, showing melody
1918 Sometimes you might want to show only the rhythm of a melody. This
1919 can be done with the rhythmic staff. All pitches of notes on such a
1920 staff are squashed, and the staff itself has a single line
1922 @lilypond[quote,verbatim]
1924 \new RhythmicStaff {
1925 \new Voice = "myRhythm" \relative {
1933 \lyricsto "myRhythm" {
1941 @cindex guitar chord charts
1942 @cindex strumming rhythms, showing
1943 @cindex guitar strumming rhythms, showing
1945 @funindex Pitch_squash_engraver
1946 @funindex \improvisationOn
1947 @funindex improvisationOn
1948 @funindex \improvisationOff
1949 @funindex improvisationOff
1951 Guitar chord charts often show the strumming rhythms. This can
1952 be done with the @code{Pitch_squash_engraver} and
1953 @code{\improvisationOn}.
1956 @lilypond[quote,verbatim]
1964 \consists "Pitch_squash_engraver"
1977 @code{\improvisationOn},
1978 @code{\improvisationOff}.
1984 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1985 {guitar-strum-rhythms.ly}
1991 Internals Reference:
1992 @rinternals{RhythmicStaff},
1993 @rinternals{Pitch_squash_engraver}.
2001 * Setting automatic beam behavior::
2006 @node Automatic beams
2007 @unnumberedsubsubsec Automatic beams
2009 By default, beams are inserted automatically:
2011 @cindex beams, manual
2012 @cindex manual beams
2013 @cindex beams, customizing rules
2015 @funindex \autoBeamOn
2016 @funindex autoBeamOn
2017 @funindex \autoBeamOff
2018 @funindex autoBeamOff
2020 @lilypond[quote,verbatim]
2023 \time 6/8 c8 c c c8. c16 c8
2027 If these automatic decisions are not satisfactory, beaming can be
2028 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
2029 entered manually if beams are to be extended over rests.
2031 If automatic beaming is not required, it may be turned off with
2032 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
2034 @lilypond[quote,verbatim]
2036 c4 c8 c8. c16 c8. c16 c8
2044 @cindex melismata, with beams
2045 @cindex beams, with melismata
2047 @warning{If beams are used to indicate melismata in songs, then
2048 automatic beaming should be switched off with @code{@bs{}autoBeamOff}
2049 and the beams indicated manually. Using @code{@bs{}partcombine} with
2050 @code{@bs{}autoBeamOff} can produce unintended results. See the
2051 snippets for more information.}
2053 Beaming patterns that differ from the automatic defaults can be
2054 created; see @ref{Setting automatic beam behavior}.
2057 @code{\autoBeamOff},
2061 @cindex beams, line breaks
2062 @cindex line breaks, beams
2063 @cindex beams, with knee gap
2064 @cindex knee gap, with beams
2068 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2069 {beams-across-line-breaks.ly}
2071 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2072 {changing-beam-knee-gap.ly}
2074 @cindex beams, \partcombine with \autoBeamOff
2075 @cindex voices, \partcombine with \autoBeamOff
2077 @lilypondfile [verbatim, quote, ragged-right, texidoc, doctitle]
2078 {partcombine-and-autobeamoff.ly}
2083 @ref{Setting automatic beam behavior}.
2086 @file{scm/auto-beam.scm}.
2091 Internals Reference:
2092 @rinternals{Auto_beam_engraver},
2093 @rinternals{Beam_engraver},
2095 @rinternals{BeamEvent},
2096 @rinternals{BeamForbidEvent},
2097 @rinternals{beam-interface},
2098 @rinternals{unbreakable-spanner-interface}.
2101 The properties of a beam are determined at the @emph{start} of its
2102 construction and any additional beam-property changes that occur before
2103 the beam has been completed will not take effect until the @emph{next},
2107 @node Setting automatic beam behavior
2108 @unnumberedsubsubsec Setting automatic beam behavior
2110 @cindex beams, with lyrics
2111 @cindex lyrics, with beams
2113 @funindex autoBeaming
2114 @funindex baseMoment
2115 @funindex beamExceptions
2116 @funindex \beamExceptions
2117 @funindex beatStructure
2118 @funindex measureLength
2124 When automatic beaming is enabled, the placement of automatic beams
2125 is determined by three context properties:
2126 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2127 The default values of these variables may be overridden as described
2128 below, or alternatively the default values themselves may be changed
2129 as explained in @ref{Time signature}.
2131 If a @code{beamExceptions} rule is defined for the time signature in
2132 force, that rule alone is used to determine the beam placement; the
2133 values of @code{baseMoment} and @code{beatStructure} are ignored.
2135 If no @code{beamExceptions} rule is defined for the time signature
2136 in force, the beam placement is determined by the values of
2137 @code{baseMoment} and @code{beatStructure}.
2140 @subsubsubheading Beaming based on @code{baseMoment} and @code{beatStructure}
2142 By default, @code{beamExceptions} rules are defined for most common
2143 time signatures, so the @code{beamExceptions} rules must be disabled
2144 if automatic beaming is to be based on @code{baseMoment} and
2145 @code{beatStructure}. The @code{beamExceptions} rules are disabled
2149 \set Timing.beamExceptions = #'()
2152 When @code{beamExceptions} is set to @code{#'()}, either due to an
2153 explicit setting or because no @code{beamExceptions} rules are defined
2154 internally for the time signature in force, the ending points for
2155 beams are on beats as specified by the context properties
2156 @code{baseMoment} and @code{beatStructure}. @code{beatStructure} is
2157 a scheme list that defines the length of each beat in the measure in
2158 units of @code{baseMoment}. By default, @code{baseMoment} is one
2159 over the denominator of the time signature. By default, each unit of
2160 length @code{baseMoment} is a single beat.
2162 Note that there are separate @code{beatStructure} and @code{baseMoment}
2163 values for each time signature. Changes to these variables apply only
2164 to the time signature that is currently in force, hence those changes
2165 must be placed after the @code{\time} command which starts a new time
2166 signature section, not before it. New values given to a particular
2167 time signature are retained and reinstated whenever that time signature
2170 @lilypond[quote,verbatim]
2173 c16^"default" c c c c |
2174 % beamExceptions are unlikely to be defined for 5/16 time,
2175 % but let's disable them anyway to be sure
2176 \set Timing.beamExceptions = #'()
2177 \set Timing.beatStructure = #'(2 3)
2178 c16^"(2+3)" c c c c |
2179 \set Timing.beatStructure = #'(3 2)
2180 c16^"(3+2)" c c c c |
2184 @lilypond[quote,verbatim]
2187 a'8^"default" a a a a a a a
2188 % Disable beamExceptions because they are definitely
2189 % defined for 4/4 time
2190 \set Timing.beamExceptions = #'()
2191 \set Timing.baseMoment = #(ly:make-moment 1/4)
2192 \set Timing.beatStructure = #'(1 1 1 1)
2193 a8^"changed" a a a a a a a
2197 Beam setting changes can be limited to specific contexts. If no
2198 setting is included in a lower-level context, the setting of the
2199 enclosing context will apply.
2201 @lilypond[quote, verbatim]
2204 % No need to disable beamExceptions
2205 % as they are not defined for 7/8 time
2206 \set Staff.beatStructure = #'(2 3 2)
2216 \set Voice.beatStructure = #'(1 3 3)
2224 When multiple voices are used the @code{Staff} context must be
2225 specified if the beaming is to be applied to all voices in the
2228 @lilypond[quote,verbatim,fragment]
2231 % Change applied to Voice by default -- does not work correctly
2232 % Because of autogenerated voices, all beating will
2233 % be at baseMoment (1 . 8)
2234 \set beatStructure = #'(3 1 1 2)
2235 << \relative {a'8 a a a16 a a a a8 a} \\ \relative {f'4. f8 f f f} >>
2237 % Works correctly with context Staff specified
2238 \set Staff.beatStructure = #'(3 1 1 2)
2239 << \relative {a'8 a a a16 a a a a8 a} \\ \relative {f'4. f8 f f f} >>
2242 The value of @code{baseMoment} can be adjusted to change
2243 the beaming behavior, if desired. When this is done,
2244 the value of @code{beatStructure} must be set to be
2245 compatible with the new value of @code{baseMoment}.
2247 @lilypond[quote,verbatim,fragment]
2249 % No need to disable beamExceptions
2250 % as they are not defined for 5/8 time
2251 \set Timing.baseMoment = #(ly:make-moment 1/16)
2252 \set Timing.beatStructure = #'(7 3)
2253 \repeat unfold 10 { a'16 }
2256 @code{baseMoment} is a @i{moment}; a unit of musical duration. A
2257 quantity of type @i{moment} is created by the scheme function
2258 @code{ly:make-moment}. For more information about this function,
2259 see @ref{Time administration}.
2261 By default @code{baseMoment} is set to one over the denominator of
2262 the time signature. Any exceptions to this default can be found in
2263 @file{scm/time-signature-settings.scm}.
2265 @subsubsubheading Beaming based on @code{beamExceptions}
2267 Special autobeaming rules (other than ending a beam on a beat)
2268 are defined in the @code{beamExceptions} property.
2270 The value for @code{beamExceptions}, a somewhat complex Scheme
2271 data structure, is easiest generated with the
2272 @code{\beamExceptions} function. This function is given one or
2273 more manually beamed measure-length rhythmic patterns (measures
2274 have to be separated by a bar check@tie{}@code{|} since the
2275 function has no other way to discern the measure length). Here is
2278 @lilypond[quote,verbatim]
2281 \set Timing.beatStructure = #'(2 1)
2282 \set Timing.beamExceptions =
2283 \beamExceptions { 32[ 32] 32[ 32] 32[ 32] }
2285 \repeat unfold 6 { c32 } |
2289 @warning{A @code{beamExceptions} value must be @emph{complete}
2290 exceptions list. That is, every exception that should be applied
2291 must be included in the setting. It is not possible to add, remove,
2292 or change only one of the exceptions. While this may seem cumbersome,
2293 it means that the current beaming settings need not be known in order
2294 to specify a new beaming pattern.}
2296 When the time signature is changed, default values of
2297 @code{Timing.baseMoment}, @code{Timing.beatStructure},
2298 and @code{Timing.beamExceptions} are set. Setting the time signature
2299 will reset the automatic beaming settings for the @code{Timing}
2300 context to the default behavior.
2302 @lilypond[quote,verbatim]
2305 \repeat unfold 6 { a8 }
2307 \set Timing.beatStructure = #'(4 2)
2308 \repeat unfold 6 { a8 }
2309 % go back to default behavior
2311 \repeat unfold 6 { a8 }
2315 The default automatic beaming settings for a time signature
2316 are determined in @file{scm/time-signature-settings.scm}.
2317 Changing the default automatic beaming settings
2318 for a time signature is described in @ref{Time signature}.
2320 Many automatic beaming settings for a time signature contain an
2321 entry for @code{beamExceptions}. For example, 4/4 time tries to
2322 beam the measure in two if there are only eighth notes. The
2323 @code{beamExceptions} rule can override the @code{beatStructure} setting
2324 if @code{beamExceptions} is not reset.
2326 @lilypond[quote,verbatim,fragment]
2328 \set Timing.baseMoment = #(ly:make-moment 1/8)
2329 \set Timing.beatStructure = #'(3 3 2)
2330 % This won't beam (3 3 2) because of beamExceptions
2331 \repeat unfold 8 {c''8} |
2332 % This will beam (3 3 2) because we clear beamExceptions
2333 \set Timing.beamExceptions = #'()
2334 \repeat unfold 8 {c''8}
2337 In a similar fashion, eighth notes in 3/4 time are beamed as a full
2338 measure by default. To beam eighth notes in 3/4 time on the beat,
2339 reset @code{beamExceptions}.
2341 @lilypond[quote,verbatim,fragment]
2343 % by default we beam in (6) due to beamExceptions
2344 \repeat unfold 6 {a'8} |
2345 % This will beam (1 1 1) due to default baseMoment and beatStructure
2346 \set Timing.beamExceptions = #'()
2347 \repeat unfold 6 {a'8}
2350 In engraving from the Romantic and Classical periods,
2351 beams often begin midway through the measure in 3/4 time,
2352 but modern practice is to avoid the false impression of 6/8 time
2353 (see Gould, p. 153). Similar situations arise in 3/8 time.
2354 This behavior is controlled by the context property @code{beamHalfMeasure},
2355 which has effect only in time signatures with 3 in the numerator:
2357 @lilypond[quote,verbatim]
2361 \set Timing.beamHalfMeasure = ##f
2366 @subsubsubheading How automatic beaming works
2368 When automatic beaming is enabled, the placement of automatic beams
2369 is determined by the context properties
2370 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2372 The following rules, in order of priority, apply when determining
2373 the appearance of beams:
2377 If a manual beam is specified with @code{[@dots{}]} set the beam
2378 as specified, otherwise
2381 if a beam-ending rule is defined in @code{beamExceptions}
2382 for the beam-type, use it to determine the valid places where
2383 beams may end, otherwise
2386 if a beam-ending rule is defined in @code{beamExceptions}
2387 for a longer beam-type, use it to determine the valid places
2388 where beams may end, otherwise
2391 use the values of @code{baseMoment} and @code{beatStructure} to
2392 determine the ends of the beats in the measure, and
2393 end beams at the end of beats.
2397 In the rules above, the @emph{beam-type} is the duration of the
2398 shortest note in the beamed group.
2400 The default beaming rules can be found in
2401 @file{scm/time-signature-settings.scm}.
2405 @cindex beams, subdividing
2407 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2408 {subdividing-beams.ly}
2410 @cindex beamlets, orienting
2412 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2413 {strict-beat-beaming.ly}
2415 @cindex measure groupings
2416 @cindex beats, grouping
2417 @cindex grouping beats
2418 @cindex measure sub-grouping
2420 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2421 {conducting-signs,-measure-grouping-signs.ly}
2423 @cindex beam, endings in a score
2424 @cindex beam, endings with multiple voices
2426 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2427 {beam-endings-in-score-context.ly}
2431 @ref{Time signature}.
2434 @file{scm/time-signature-settings.scm}.
2439 Internals Reference:
2440 @rinternals{Auto_beam_engraver},
2442 @rinternals{BeamForbidEvent},
2443 @rinternals{beam-interface}.
2446 If a score ends while an automatic beam has not been ended and is
2447 still accepting notes, this last beam will not be typeset at all.
2448 The same holds for polyphonic voices, entered with
2449 @code{<< @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
2450 automatic beam is still accepting notes, it is not typeset.
2451 The workaround for these problems is to manually beam the last
2452 beam in the voice or score.
2454 By default, the @code{Timing} translator is aliased to the
2455 @code{Score} context. This means that setting the time signature
2456 in one staff will affect the beaming of the other staves as well.
2457 Thus, a time signature setting in a later staff will reset custom
2458 beaming that was set in an earlier staff.
2459 One way to avoid this problem is to set the time signature
2462 @lilypond[quote,verbatim]
2466 \set Timing.baseMoment = #(ly:make-moment 1/8)
2467 \set Timing.beatStructure = #'(1 5)
2468 \set Timing.beamExceptions = #'()
2469 \repeat unfold 6 { a'8 }
2472 \repeat unfold 6 { a'8 }
2477 The default beam settings for the time signature can also be changed, so
2478 that the desired beaming will always be used. Changes in automatic
2479 beaming settings for a time signature are described in
2480 @ref{Time signature}.
2482 @lilypond[quote,verbatim]
2485 \overrideTimeSignatureSettings
2486 3/4 % timeSignatureFraction
2487 1/8 % baseMomentFraction
2488 #'(1 5) % beatStructure
2489 #'() % beamExceptions
2491 \repeat unfold 6 { a'8 }
2495 \repeat unfold 6 { a'8 }
2502 @unnumberedsubsubsec Manual beams
2504 @cindex beams, manual
2505 @cindex manual beams
2510 In some cases it may be necessary to override the automatic
2511 beaming algorithm. For example, the autobeamer will not put beams
2512 over rests or bar lines, and in choral scores the beaming is
2513 often set to follow the meter of the lyrics rather than the
2514 notes. Such beams can be specified manually by
2515 marking the begin and end point with @code{[} and @code{]}.
2517 @lilypond[quote,verbatim]
2518 \relative { r4 r8[ g' a r] r g[ | a] r }
2521 @cindex manual beams, direction shorthand for
2522 @cindex manual beams, grace notes
2524 Beaming direction can be set manually using direction indicators:
2526 @lilypond[quote,verbatim]
2527 \relative { c''8^[ d e] c,_[ d e f g] }
2533 Individual notes may be marked with @code{\noBeam} to prevent them
2536 @lilypond[quote,verbatim]
2543 Grace note beams and normal note beams can occur simultaneously.
2544 Unbeamed grace notes are not put into normal note beams.
2546 @lilypond[quote,verbatim]
2549 \grace { e32 d c d }
2556 @funindex stemLeftBeamCount
2557 @funindex stemRightBeamCount
2559 Even more strict manual control with the beams can be achieved by
2560 setting the properties @code{stemLeftBeamCount} and
2561 @code{stemRightBeamCount}. They specify the number of beams to
2562 draw on the left and right side, respectively, of the next note.
2563 If either property is set, its value will be used only once, and
2564 then it is erased. In this example, the last @code{f} is printed
2565 with only one beam on the left side, i.e., the eighth-note beam of
2566 the group as a whole.
2568 @lilypond[quote,verbatim]
2572 \set stemLeftBeamCount = #2
2573 \set stemRightBeamCount = #1
2575 \set stemLeftBeamCount = #1
2588 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2589 {flat-flags-and-beam-nibs.ly}
2593 @ref{Direction and placement},
2599 Internals Reference:
2601 @rinternals{BeamEvent},
2602 @rinternals{Beam_engraver},
2603 @rinternals{beam-interface},
2604 @rinternals{Stem_engraver}.
2607 @node Feathered beams
2608 @unnumberedsubsubsec Feathered beams
2610 @cindex beams, feathered
2611 @cindex feathered beams
2613 @funindex \featherDurations
2614 @funindex featherDurations
2615 @funindex grow-direction
2617 Feathered beams are used to indicate that a small group of notes
2618 should be played at an increasing (or decreasing) tempo, without
2619 changing the overall tempo of the piece. The extent of the
2620 feathered beam must be indicated manually using @code{[} and
2621 @code{]}, and the beam feathering is turned on by specifying a
2622 direction to the @code{Beam} property @code{grow-direction}.
2624 If the placement of the notes and the sound in the MIDI output is to
2625 reflect the @emph{ritardando} or @emph{accelerando} indicated by the
2626 feathered beam the notes must be grouped as a music expression delimited
2627 by braces and preceded by a @code{featherDurations} command which specifies
2628 the ratio between the durations of the first and last notes in the
2631 The square brackets show the extent of the beam and the braces show
2632 which notes are to have their durations modified. Normally these
2633 would delimit the same group of notes, but this is not required: the
2634 two commands are independent.
2636 In the following example the eight 16th notes occupy exactly the
2637 same time as a half note, but the first note is one half as long
2638 as the last one, with the intermediate notes gradually
2639 lengthening. The first four 32nd notes gradually speed up, while
2640 the last four 32nd notes are at a constant tempo.
2642 @lilypond[verbatim,quote]
2644 \override Beam.grow-direction = #LEFT
2645 \featherDurations #(ly:make-moment 2/1)
2646 { c16[ c c c c c c c] }
2647 \override Beam.grow-direction = #RIGHT
2648 \featherDurations #(ly:make-moment 2/3)
2650 % revert to non-feathered beams
2651 \override Beam.grow-direction = #'()
2657 The spacing in the printed output represents the
2658 note durations only approximately, but the MIDI output is exact.
2661 @code{\featherDurations}.
2669 The @code{\featherDurations} command only works with very short
2670 music snippets, and when numbers in the fraction are small.
2679 * Bar and bar number checks::
2684 @unnumberedsubsubsec Bar lines
2687 @cindex measure lines
2688 @cindex closing bar lines
2689 @cindex bar lines, closing
2690 @cindex double bar lines
2691 @cindex bar lines, double
2697 Bar lines delimit measures, and are also used to indicate
2698 repeats. Normally, simple bar lines are automatically inserted
2699 into the printed output at places based on the current time
2702 The simple bar lines inserted automatically can be changed to
2703 other types with the @code{\bar} command. For example, a closing
2704 double bar line is usually placed at the end of a piece:
2706 @lilypond[quote,verbatim]
2707 \relative { e'4 d c2 \bar "|." }
2710 It is not invalid if the final note in a measure does not
2711 end on the automatically entered bar line: the note is assumed
2712 to carry over into the next measure. But if a long sequence
2713 of such carry-over measures appears the music can appear compressed
2714 or even flowing off the page. This is because automatic line
2715 breaks happen only at the end of complete measures, i.e., where
2716 all notes end before the end of a measure.
2718 @warning{An incorrect duration can cause line breaks to be
2719 inhibited, leading to a line of highly compressed music or
2720 music which flows off the page.}
2723 @cindex bar lines, invisible
2724 @cindex measure lines, invisible
2726 Line breaks are also permitted at manually inserted bar lines
2727 even within incomplete measures. To allow a line break without
2728 printing a bar line, use the following:
2735 This will insert an invisible bar line and allow (but not
2736 force) a line break to occur at this point. The bar number
2737 counter is not increased. To force a line break see
2738 @ref{Line breaking}.
2740 @cindex manual bar lines
2741 @cindex manual measure lines
2742 @cindex bar lines, manual
2743 @cindex measure lines, manual
2745 This and other special bar lines may be inserted manually at any
2746 point. When they coincide with the end of a measure they replace
2747 the simple bar line which would have been inserted there
2748 automatically. When they do not coincide with the end of a measure
2749 the specified bar line is inserted at that point in the printed
2752 Note that manual bar lines are purely visual. They do not affect
2753 any of the properties that a normal bar line would affect, such as
2754 measure numbers, accidentals, line breaks, etc. They do not affect
2755 the calculation and placement of subsequent automatic bar lines.
2756 When a manual bar line is placed where a normal bar line already
2757 exists, the effects of the original bar line are not altered.
2759 Two types of simple bar lines and five types of double bar lines are
2760 available for manual insertion:
2762 @lilypond[quote,verbatim]
2776 together with dotted and dashed bar lines:
2778 @lilypond[quote,verbatim]
2787 and nine types of repeat bar lines:
2789 @lilypond[quote,verbatim]
2804 Additionally, a bar line can be printed as a simple tick:
2805 @lilypond[quote,fragment,verbatim]
2808 However, as such ticks are typically used in Gregorian chant, it is
2809 preferable to use @code{\divisioMinima} there instead, described in
2810 the section @ref{Divisiones} in Gregorian chant.
2812 Lilypond supports kievan notation and provides a special kievan
2814 @lilypond[quote,fragment,verbatim]
2817 Further details of this notation are explained in
2818 @ref{Typesetting Kievan square notation}.
2822 For in-line segno signs, there are three types of bar lines which
2823 differ in their behavior at line breaks:
2825 @lilypond[quote,verbatim]
2845 Although the bar line types signifying repeats may be inserted
2846 manually they do not in themselves cause LilyPond to recognize
2847 a repeated section. Such repeated sections are better entered
2848 using the various repeat commands (see @ref{Repeats}), which
2849 automatically print the appropriate bar lines.
2851 In addition, you can specify @code{".|:-||"}, which is equivalent to
2852 @code{".|:"} except at line breaks, where it gives a double bar
2853 line at the end of the line and a start repeat at the beginning of
2856 @lilypond[quote,verbatim]
2866 For combinations of repeats with the segno sign, there are six different
2869 @lilypond[quote,verbatim]
2899 Additionally there is an @code{\inStaffSegno} command which creates
2900 a segno bar line in conjunction with an appropriate repeat bar line
2901 when used with a @code{\repeat volta} command, see
2902 @ref{Normal repeats}.
2904 @funindex \defineBarLine
2905 @funindex defineBarLine
2906 @cindex bar lines, defining
2907 @cindex defining bar lines
2909 New bar line types can be defined with @code{\defineBarLine}:
2912 \defineBarLine @var{bartype} #'(@var{end} @var{begin} @var{span})
2915 The @code{\defineBarline} variables can include the
2916 @q{empty} string @code{""}, which is equivalent to an invisible
2917 bar line being printed. Or they can be set to @code{#f} which
2918 prints no bar line at all.
2920 After the definiton, the new bar line can be used by
2921 @code{\bar} @var{bartype}.
2923 There are currently ten bar line elements available:
2925 @lilypond[quote,verbatim]
2926 \defineBarLine ":" #'("" ":" "")
2927 \defineBarLine "=" #'("=" "" "")
2928 \defineBarLine "[" #'("" "[" "")
2929 \defineBarLine "]" #'("]" "" "")
2946 The @code{"="} bar line provides the double span bar line, used
2947 in combination with the segno sign. Do not use it as a standalone
2948 double thin bar line; here, @code{\bar} @var{"||"} is
2951 The @code{"-"} sign starts annotations to bar lines which
2952 are useful to distinguish those with identical appearance
2953 but different behavior at line breaks and/or different span bars.
2954 The part following the @code{"-"} sign is not used for building up
2957 @lilypond[quote,verbatim]
2958 \defineBarLine "||-dashedSpan" #'("||" "" "!!")
2961 \new Staff \relative c'' {
2963 c1 \bar "||-dashedSpan"
2966 \new Staff \relative c'' {
2974 Furthermore, the space character @code{" "} serves as a placeholder
2975 for defining span bars correctly aligned to the main bar lines:
2977 @lilypond[quote,verbatim]
2978 \defineBarLine ":|.-wrong" #'(":|." "" "|.")
2979 \defineBarLine ":|.-right" #'(":|." "" " |.")
2982 \new Staff \relative c'' {
2987 \new Staff \relative c'' {
2995 If additional elements are needed, LilyPond provides a simple
2996 way to define them. For more informations on modifying or adding
2997 bar lines, see file @file{scm/bar-line.scm}.
2999 In scores with many staves, a @code{\bar} command in one staff is
3000 automatically applied to all staves. The resulting bar lines are
3001 connected between different staves of a @code{StaffGroup},
3002 @code{PianoStaff}, or @code{GrandStaff}.
3004 @lilypond[quote,verbatim]
3007 \new Staff \relative {
3012 \new Staff \relative { \clef bass c'4 g e g }
3014 \new Staff \relative { \clef bass c'2 c2 }
3019 @cindex default bar lines, changing
3020 @cindex bar lines, default, changing
3023 @funindex defaultBarType
3028 The command @samp{\bar @var{bartype}} is a shortcut for
3029 @samp{\set Timing.whichBar = @var{bartype}}. A bar line is
3030 created whenever the @code{whichBar} property is set.
3032 The default bar type used for automatically inserted bar lines is
3033 @code{"|"}. This may be changed at any time with
3034 @samp{\set Timing.defaultBarType = @var{bartype}}.
3038 @ref{Line breaking},
3040 @ref{Grouping staves}.
3043 @file{scm/bar-line.scm}.
3048 Internals Reference:
3049 @rinternals{BarLine} (created at @code{Staff} level),
3050 @rinternals{SpanBar} (across staves),
3051 @rinternals{Timing_translator} (for Timing properties).
3055 @unnumberedsubsubsec Bar numbers
3058 @cindex measure numbers
3059 @cindex numbers, bar
3060 @cindex numbers, measure
3062 @funindex currentBarNumber
3064 Bar numbers are typeset by default at the start of every line except
3065 the first line. The number itself is stored in the
3066 @code{currentBarNumber} property, which is normally updated
3067 automatically for every measure. It may also be set manually:
3069 @lilypond[verbatim,quote]
3073 \set Score.currentBarNumber = #50
3078 @cindex bar numbers, regular spacing
3080 @funindex barNumberVisibility
3083 Bar numbers can be typeset at regular intervals instead of just at the
3084 beginning of every line. To do this the default behavior must be
3085 overridden to permit bar numbers to be printed at places other than the
3086 start of a line. This is controlled by the @code{break-visibility}
3087 property of @code{BarNumber}. This takes three values which may be set
3088 to @code{#t} or @code{#f} to specify whether the corresponding bar
3089 number is visible or not. The order of the three values is
3090 @code{end of line visible}, @code{middle of line visible},
3091 @code{beginning of line visible}. In the following example bar numbers
3092 are printed at all possible places:
3094 @lilypond[verbatim,quote]
3096 \override Score.BarNumber.break-visibility = ##(#t #t #t)
3097 \set Score.currentBarNumber = #11
3098 % Permit first bar number to be printed
3107 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3108 {printing-the-bar-number-for-the-first-measure.ly}
3110 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3111 {printing-bar-numbers-at-regular-intervals.ly}
3113 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3114 {printing-bar-numbers-with-changing-regular-intervals.ly}
3116 @cindex measure number, format
3117 @cindex bar number, format
3119 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3120 {printing-bar-numbers-inside-boxes-or-circles.ly}
3122 @cindex bar numbers, with letters
3123 @cindex bar numbers, with repeats
3125 @lilypondfile[verbatim,quote,texidoc,doctitle]
3126 {alternative-bar-numbering.ly}
3128 @cindex bar number alignment
3130 @lilypondfile[verbatim,quote,texidoc,doctitle]
3131 {aligning-bar-numbers.ly}
3133 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3134 {removing-bar-numbers-from-a-score.ly}
3140 Internals Reference:
3141 @rinternals{BarNumber},
3142 @rinternals{Bar_number_engraver}.
3144 @cindex bar number collision
3145 @cindex collision, bar number
3148 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
3149 if there is one. To solve this, the @code{padding} property of
3150 @code{BarNumber} can be used to position the number correctly. See
3151 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
3154 @node Bar and bar number checks
3155 @unnumberedsubsubsec Bar and bar number checks
3158 @cindex bar number check
3159 @cindex measure check
3160 @cindex measure number check
3162 @funindex barCheckSynchronize
3165 Bar checks help detect errors in the entered durations. A bar check
3166 may be entered using the bar symbol, @code{|}, at any place where a
3167 bar line is expected to fall. If bar check lines are encountered at
3168 other places, a list of warnings is printed in the log file, showing
3169 the line numbers and lines in which the bar checks failed. In the
3170 next example, the second bar check will signal an error.
3173 \time 3/4 c2 e4 | g2 |
3176 An incorrect duration can result in a completely garbled score,
3177 especially if the score is polyphonic, so a good place to start
3178 correcting input is by scanning for failed bar checks and
3179 incorrect durations.
3181 If successive bar checks are off by the same musical interval,
3182 only the first warning message is displayed. This allows the
3183 warning to focus on the source of the timing error.
3185 Bar checks can also be inserted in lyrics:
3190 Twin -- kle | Twin -- kle |
3194 Note that bar check marks in lyrics are evaluated at the musical
3195 moment when the syllable @emph{following} the check mark is processed.
3196 If the lyrics are associated with the notes of a voice which has a
3197 rest at the beginning of a bar, then no syllable can be located at the
3198 start of that bar and a warning will be issued if a bar check mark is
3199 placed in the lyrics at that position.
3205 It is also possible to redefine the action taken when a bar check
3206 or pipe symbol, @code{|}, is encountered in the input, so that
3207 it does something other than a bar check. This is done by
3208 assigning a music expression to @code{"|"}.
3209 In the following example @code{|} is set to insert a double bar
3210 line wherever it appears in the input, rather than checking
3213 @lilypond[quote,verbatim]
3223 @funindex \barNumberCheck
3224 @funindex barNumberCheck
3226 When copying large pieces of music, it can be helpful to check that
3227 the LilyPond bar number corresponds to the original that you are
3228 entering from. This can be checked with @code{\barNumberCheck}, for
3232 \barNumberCheck #123
3236 will print a warning if the @code{currentBarNumber} is not 123
3237 when it is processed.
3244 @node Rehearsal marks
3245 @unnumberedsubsubsec Rehearsal marks
3247 @cindex rehearsal marks
3248 @cindex mark, rehearsal
3253 To print a rehearsal mark, use the @code{\mark} command.
3255 @lilypond[quote,verbatim]
3265 The mark is incremented automatically if you use @code{\mark
3266 \default}, but you can also use an integer argument to set the
3267 mark manually. The value to use is stored in the property
3268 @code{rehearsalMark}.
3270 @lilypond[quote,verbatim]
3281 The letter@tie{}@q{I} is skipped in accordance with engraving
3282 traditions. If you wish to include the letter @q{I}, then use one
3283 of the following commands, depending on which style of rehearsal mark
3284 you want (letters only, letters in a hollow box, or letters in a
3288 \set Score.markFormatter = #format-mark-alphabet
3289 \set Score.markFormatter = #format-mark-box-alphabet
3290 \set Score.markFormatter = #format-mark-circle-alphabet
3293 @lilypond[quote,verbatim]
3295 \set Score.markFormatter = #format-mark-box-alphabet
3304 @cindex rehearsal mark format
3305 @cindex rehearsal mark style
3306 @cindex style, rehearsal mark
3307 @cindex format, rehearsal mark
3308 @cindex mark, rehearsal, style
3309 @cindex mark, rehearsal, format
3310 @cindex rehearsal mark, manual
3311 @cindex mark, rehearsal, manual
3312 @cindex custom rehearsal mark
3313 @cindex manual rehearsal mark
3315 The style is defined by the property @code{markFormatter}. It is
3316 a function taking the current mark (an integer) and the current
3317 context as argument. It should return a markup object. In the
3318 following example, @code{markFormatter} is set to a pre-defined
3319 procedure. After a few measures, it is set to a procedure that
3320 produces a boxed number.
3322 @lilypond[quote,verbatim]
3324 \set Score.markFormatter = #format-mark-numbers
3327 \set Score.markFormatter = #format-mark-box-numbers
3329 \set Score.markFormatter = #format-mark-circle-numbers
3331 \set Score.markFormatter = #format-mark-circle-letters
3336 The file @file{scm/translation-functions.scm} contains the
3337 definitions of @code{format-mark-numbers} (the default format),
3338 @code{format-mark-box-numbers}, @code{format-mark-letters} and
3339 @code{format-mark-box-letters}. These can be used as inspiration
3340 for other formatting functions.
3342 You may use @code{format-mark-barnumbers},
3343 @code{format-mark-box-barnumbers}, and
3344 @code{format-mark-circle-barnumbers} to get bar numbers instead of
3345 incremented numbers or letters.
3347 Other styles of rehearsal mark can be specified manually:
3354 Note that @code{Score.markFormatter} does not affect marks specified
3355 in this manner. However, it is possible to apply a @code{\markup} to the
3359 \mark \markup@{ \box A1 @}
3364 @cindex D.S. al Fine
3366 @cindex music glyphs
3367 @cindex glyphs, music
3369 @funindex \musicglyph
3370 @funindex musicglyph
3372 Music glyphs (such as the segno sign) may be printed inside a
3375 @lilypond[quote,verbatim]
3377 c1 \mark \markup { \musicglyph #"scripts.segno" }
3378 c1 \mark \markup { \musicglyph #"scripts.coda" }
3379 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
3385 See @ref{The Feta font}, for a list of symbols which may be
3386 printed with @code{\musicglyph}.
3388 For common tweaks to the positioning of rehearsal marks, see
3389 @ref{Formatting text}. For more precise control, see
3390 @code{break-alignable-interface} in @ref{Aligning objects}.
3392 The file @file{scm/translation-functions.scm} contains
3393 the definitions of @code{format-mark-numbers} and
3394 @code{format-mark-letters}. They can be used as inspiration for
3395 other formatting functions.
3399 @ref{The Feta font},
3400 @ref{Formatting text},
3401 @ref{Aligning objects}.
3404 @file{scm/translation-functions.scm}.
3409 Internals Reference:
3410 @rinternals{MarkEvent},
3411 @rinternals{Mark_engraver},
3412 @rinternals{RehearsalMark}.
3415 @node Special rhythmic concerns
3416 @subsection Special rhythmic concerns
3421 * Aligning to cadenzas::
3422 * Time administration::
3426 @unnumberedsubsubsec Grace notes
3430 @cindex appoggiatura
3431 @cindex acciaccatura
3434 @funindex \slashedGrace
3435 @funindex \acciaccatura
3436 @funindex \appoggiatura
3438 Grace notes are musical ornaments, printed in a smaller font, that take
3439 up no additional logical time in a measure.
3441 @lilypond[quote,verbatim]
3444 \grace { b16 c16 } a2)
3448 There are three other types of grace notes possible; the
3449 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
3450 note with a slashed stem -- and the @emph{appoggiatura}, which takes a
3451 fixed fraction of the main note it is attached to and prints without the
3452 slash. It is also possible to write a grace note with a slashed stem,
3453 like the @emph{acciaccatura} but without the slur, so as to place it
3454 between notes that are slurred themselves, using the
3455 @code{\slashedGrace} function.
3457 @lilypond[quote,verbatim]
3459 \acciaccatura d''8 c4
3461 \acciaccatura { g16 f } e2
3462 \slashedGrace a,8 g4
3463 \slashedGrace b16 a4(
3464 \slashedGrace b8 a2)
3468 The placement of grace notes is synchronized between different staves.
3469 In the following example, there are two sixteenth grace notes for every
3472 @lilypond[quote,verbatim]
3474 \new Staff \relative { e''2 \grace { c16 d e f } e2 }
3475 \new Staff \relative { c''2 \grace { g8 b } c2 }
3479 @cindex grace notes, following
3481 @funindex \afterGrace
3482 @funindex afterGrace
3484 If you want to end a note with a grace, use the @code{\afterGrace}
3485 command. It takes two arguments: the main note, and the grace
3486 notes following the main note.
3488 @lilypond[quote,verbatim]
3489 \relative { c''1 \afterGrace d1 { c16[ d] } c1 }
3492 This will put the grace notes after a space lasting 3/4 of the
3493 length of the main note. The default fraction 3/4 can be changed by
3494 setting @code{afterGraceFraction}. The following example shows
3495 the results from setting the space at the default, at 15/16, and
3496 finally at 1/2 of the main note.
3498 @lilypond[quote,verbatim]
3500 \new Staff \relative {
3501 c''1 \afterGrace d1 { c16[ d] } c1
3503 \new Staff \relative {
3504 #(define afterGraceFraction (cons 15 16))
3505 c''1 \afterGrace d1 { c16[ d] } c1
3507 \new Staff \relative {
3508 #(define afterGraceFraction (cons 1 2))
3509 c''1 \afterGrace d1 { c16[ d] } c1
3514 The space between the main note and the grace note may also be
3515 specified using spacers. The following example places the grace
3516 note after a space lasting 7/8 of the main note.
3518 @lilypond[quote,verbatim]
3519 \new Voice \relative {
3522 { s2 s4. \grace { c16 d } }
3528 @cindex tweaking grace notes
3529 @cindex grace notes, tweaking
3530 @cindex grace notes, changing layout settings
3532 A @code{\grace} music expression will introduce special
3533 typesetting settings, for example, to produce smaller type, and
3534 set directions. Hence, when introducing layout tweaks to
3535 override the special settings, they should be placed inside
3536 the grace expression. The overrides should also be reverted
3537 inside the grace expression. Here, the grace note's default stem
3538 direction is overridden and then reverted.
3540 @lilypond[quote,verbatim]
3541 \new Voice \relative {
3552 @cindex stem, with slash
3557 @lilypondfile[verbatim,quote,texidoc,doctitle]
3558 {using-grace-note-slashes-with-normal-heads.ly}
3560 @lilypondfile[verbatim,quote,texidoc,doctitle]
3561 {tweaking-grace-layout-within-music.ly}
3563 @lilypondfile[verbatim,quote,texidoc,doctitle]
3564 {redefining-grace-note-global-defaults.ly}
3566 @lilypondfile[verbatim,quote,texidoc,doctitle]
3567 {positioning-grace-notes-with-floating-space.ly}
3571 @rglos{grace notes},
3572 @rglos{acciaccatura},
3573 @rglos{appoggiatura}.
3576 @ref{Scaling durations},
3580 @file{ly/grace-init.ly}.
3585 Internals Reference:
3586 @rinternals{GraceMusic},
3587 @rinternals{Grace_beam_engraver},
3588 @rinternals{Grace_auto_beam_engraver},
3589 @rinternals{Grace_engraver},
3590 @rinternals{Grace_spacing_engraver}.
3594 @cindex acciaccatura, multi-note
3595 @cindex multi-note acciaccatura
3596 @cindex grace-note synchronization
3598 A multi-note beamed @i{acciaccatura} is printed without a slash,
3599 and looks exactly the same as a multi-note beamed
3602 @c TODO Add link to LSR snippet to add slash when available
3604 Grace note synchronization can also lead to surprises. Staff
3605 notation, such as key signatures, bar lines, etc., are also
3606 synchronized. Take care when you mix staves with grace notes and
3607 staves without, for example,
3609 @lilypond[quote,verbatim]
3611 \new Staff \relative { e''4 \bar ".|:" \grace c16 d2. }
3612 \new Staff \relative { c''4 \bar ".|:" d2. }
3617 This can be remedied by inserting grace skips of the corresponding
3618 durations in the other staves. For the above example
3620 @lilypond[quote,verbatim]
3622 \new Staff \relative { e''4 \bar ".|:" \grace c16 d2. }
3623 \new Staff \relative { c''4 \bar ".|:" \grace s16 d2. }
3627 Please make sure that you use the @code{\grace} command for the
3628 spacer part, even if the visual part uses @code{\acciaccatura} or
3629 @code{\appoggiatura} because otherwise an ugly slur fragment will
3630 be printed, connecting the invisible grace note with the following
3633 Grace sections should only be used within sequential music expressions.
3634 Nesting or juxtaposing grace sections is not supported, and might
3635 produce crashes or other errors.
3637 Each grace note in MIDI output has a length of 1/4 of its actual
3638 duration. If the combined length of the grace notes is greater than the
3639 length of the preceding note a @qq{@code{Going back in MIDI time}}
3640 error will be generated. Either make the grace notes shorter in
3641 duration, for example:
3644 c'8 \acciaccatura @{ c'8[ d' e' f' g'] @}
3650 c'8 \acciaccatura @{ c'16[ d' e' f' g'] @}
3653 Or explicitly change the musical duration:
3656 c'8 \acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
3659 See @ref{Scaling durations}.
3662 @node Aligning to cadenzas
3663 @unnumberedsubsubsec Aligning to cadenzas
3666 @cindex cadenza, aligning to
3667 @cindex aligning to cadenza
3669 In an orchestral context, cadenzas present a special problem: when
3670 constructing a score that includes a measured cadenza or other solo
3671 passage, all other instruments should skip just as many notes as the
3672 length of the cadenza, otherwise they will start too soon or too late.
3674 One solution to this problem is to use the functions
3675 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
3676 functions take a defined piece of music as an argument and generate a
3677 multi-measure rest or @code{\skip} exactly as long as the piece.
3679 @lilypond[verbatim,quote]
3680 MyCadenza = \relative {
3691 #(mmrest-of-length MyCadenza)
3693 #(skip-of-length MyCadenza)
3707 @node Time administration
3708 @unnumberedsubsubsec Time administration
3710 @cindex time administration
3711 @cindex timing (within the score)
3712 @cindex music, unmetered
3713 @cindex unmetered music
3715 @funindex currentBarNumber
3716 @funindex measurePosition
3717 @funindex measureLength
3719 Time is administered by the @code{Timing_translator}, which by
3720 default is to be found in the @code{Score} context. An alias,
3721 @code{Timing}, is added to the context in which the
3722 @code{Timing_translator} is placed. To ensure that the
3723 @code{Timing} alias is available, you may need to explicitly
3724 instantiate the containing context (such as @code{Voice} or
3727 The following properties of @code{Timing} are used
3728 to keep track of timing within the score.
3731 @cindex measure number
3734 @item currentBarNumber
3735 The current measure number. For an example showing the
3736 use of this property see @ref{Bar numbers}.
3739 The length of the measures in the current time signature. For a
3740 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
3741 determines when bar lines are inserted and how automatic beams
3742 should be generated.
3744 @item measurePosition
3745 The point within the measure where we currently are. This
3746 quantity is reset by subtracting @code{measureLength} whenever
3747 @code{measureLength} is reached or exceeded. When that happens,
3748 @code{currentBarNumber} is incremented.
3751 If set to true, the above variables are updated for every time
3752 step. When set to false, the engraver stays in the current
3753 measure indefinitely.
3757 Timing can be changed by setting any of these variables
3758 explicitly. In the next example, the default 4/4 time
3759 signature is printed, but @code{measureLength} is set to 5/4.
3760 At 4/8 through the third measure, the @code{measurePosition} is
3761 advanced by 1/8 to 5/8, shortening that bar by 1/8.
3762 The next bar line then falls at 9/8 rather than 5/4.
3764 @lilypond[quote,verbatim]
3765 \new Voice \relative {
3766 \set Timing.measureLength = #(ly:make-moment 5/4)
3770 \set Timing.measurePosition = #(ly:make-moment 5/8)
3777 As the example illustrates, @code{ly:make-moment n m} constructs a
3778 duration of n/m of a whole note. For example,
3779 @code{ly:make-moment 1 8} is an eighth note duration and
3780 @code{ly:make-moment 7 16} is the duration of seven sixteenths
3786 @ref{Unmetered music}.
3791 Internals Reference:
3792 @rinternals{Timing_translator},