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]
96 Durations occuring on their own within a music sequence will take
97 their pitches from the preceding note or chord.
99 @lilypond[quote,verbatim,relative=2]
105 @cindex notes, dotted
107 @cindex notes, double-dotted
108 @cindex double-dotted notes
112 To obtain dotted note lengths, place a dot (@code{.}) after the
113 duration. Double-dotted notes are specified by appending two
116 @lilypond[quote,verbatim,relative=2]
117 a4 b c4. b8 a4. b4.. c8.
120 Some durations cannot be represented with just binary durations
121 and dots; they can be represented only by tying two or more
122 notes together. For details, see @ref{Ties}.
124 For ways of specifying durations for the syllables of lyrics and
125 ways of aligning lyrics to notes, see @ref{Vocal music}.
127 Optionally, notes can be spaced strictly proportionately to their
128 duration. For details of this and other settings which control
129 proportional notation, see @ref{Proportional notation}.
135 @funindex \dotsNeutral
136 @funindex dotsNeutral
138 Dots are normally moved up to avoid staff lines, except in
139 polyphonic situations. Dots may be manually placed above or below
140 the staff; see @ref{Direction and placement}.
154 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
155 {alternative-breve-notes.ly}
157 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
158 {changing-the-number-of-augmentation-dots-per-note.ly}
166 @rglos{Duration names notes and rests}.
169 @ref{Automatic beams},
172 @ref{Writing rhythms},
175 @ref{Ancient notation},
176 @ref{Proportional notation}.
183 @rinternals{DotColumn}.
186 @c Deliberately duplicated in Durations and Rests. -gp
187 There is no fundamental limit to rest durations (both in terms of
188 longest and shortest), but the number of glyphs is limited:
189 rests from 128th to maxima (8 x whole) may be printed.
193 @unnumberedsubsubsec Tuplets
201 Tuplets are made from a music expression with the @code{\tuplet}
202 command, multiplying the speed of the music expression by a fraction:
205 \tuplet @var{fraction} @{ @var{music} @}
209 The fraction's numerator will be printed over or under the notes,
210 optionally with a bracket. The most common tuplets are triplets
211 (3@tie{}notes sound within the duration normally allowed for@tie{}2).
213 @lilypond[quote,verbatim,relative=2]
214 a2 \tuplet 3/2 { b4 4 4 }
215 c4 c \tuplet 3/2 { b4 a g }
218 @cindex tuplet grouping
220 When entering long passages of tuplets, having to write a separate
221 @code{\tuplet} command for each group is inconvenient. It is possible
222 to specify the duration of one tuplet group directly before the music
223 in order to have the tuplets grouped automatically:
225 @lilypond[quote,verbatim,relative=2]
226 g2 r8 \tuplet 3/2 8 { cis16 d e e f g g f e }
229 @cindex tuplet bracket placement
233 @funindex \tupletDown
235 @funindex \tupletNeutral
236 @funindex tupletNeutral
238 Tuplet brackets may be manually placed above or below the staff:
240 @lilypond[quote,verbatim,relative=2]
241 \tupletUp \tuplet 3/2 { c8 d e }
242 \tupletNeutral \tuplet 3/2 { c8 d e }
243 \tupletDown \tuplet 3/2 { f,8 g a }
244 \tupletNeutral \tuplet 3/2 { f8 g a }
247 Tuplets may be nested:
249 @lilypond[quote,verbatim,relative=2]
251 c4 \tuplet 5/4 { f8 e f \tuplet 3/2 { e[ f g] } } f4
254 Modifying nested tuplets which begin at the same musical moment must be
255 done with @code{\tweak}.
257 To modify the duration of notes without printing a tuplet bracket, see
258 @ref{Scaling durations}.
263 @code{\tupletNeutral}.
269 @cindex tuplet formatting
270 @cindex triplet formatting
272 @funindex tupletNumberFormatFunction
273 @funindex tupletSpannerDuration
275 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
276 {entering-several-tuplets-using-only-one--times-command.ly}
278 @cindex Tuplet number changes
280 @funindex TupletNumber
282 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
283 {changing-the-tuplet-number.ly}
285 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
286 {non-default-tuplet-numbers.ly}
288 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
289 {controlling-tuplet-bracket-visibility.ly}
291 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
292 {permitting-line-breaks-within-beamed-tuplets.ly}
301 @rlearning{Tweaking methods}.
304 @ref{Direction and placement},
305 @ref{Time administration},
306 @ref{Scaling durations},
307 @ref{The tweak command},
308 @ref{Polymetric notation}.
314 @rinternals{TupletBracket},
315 @rinternals{TupletNumber},
316 @rinternals{TimeScaledMusic}.
318 @cindex grace notes within tuplet brackets
321 Grace notes may be placed within tuplet brackets, @emph{except} when a
322 staff begins with a grace note followed by a tuplet. In this
323 particular case, the grace note must be placed before the @code{\tuplet}
324 command to avoid errors.
326 @cindex tempo marks within tuplet brackets
328 When using a tuplet at the beginning of a piece with a @code{\tempo}
329 mark, the music must be explicitly entered in a @code{\new Voice} block,
330 as discussed in @rlearning{Voices contain music}.
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,relative=2,verbatim]
354 % Alter durations to triplets
358 % Double the duration of chord
360 % Duration of quarter, appears like sixteenth
364 The duration of spacer rests may also be modified by
365 a multiplier. This is useful for skipping many measures, e.g.,
368 @cindex compressing music
369 @cindex expanding music
371 @funindex \scaleDurations
372 @funindex scaleDurations
374 Longer stretches of music may be compressed by a fraction in the
375 same way, as if every note, chord or rest had the fraction as a
376 multiplier. This leaves the appearance of the music unchanged but
377 the internal duration of the notes will be multiplied by the
378 fraction @emph{num}/@emph{den}. Here is an example showing how music
379 can be compressed and expanded:
381 @lilypond[quote,relative=2,verbatim]
385 % Scale music by *2/3
386 \scaleDurations 2/3 {
390 \scaleDurations 2/1 {
395 One application of this command is in polymetric
396 notation, see @ref{Polymetric notation}.
401 @ref{Invisible rests},
402 @ref{Polymetric notation}.
408 The calculation of the position within a measure must take into
409 account all the scaling factors applied to the notes within that
410 measure and any fractional carry-out from earlier measures. This
411 calculation is carried out using rational numbers. If an intermediate
412 numerator or denominator in that calculation exceeds 2^30 the
413 execution and typesetting will stop at that point without indicating
418 @unnumberedsubsubsec Ties
424 A tie connects two adjacent note heads of the same pitch. The tie
425 in effect extends the duration of a note.
427 @warning{Ties should not be confused with @emph{slurs}, which
428 indicate articulation, or @emph{phrasing slurs}, which indicate
429 musical phrasing. A tie is just a way of extending a note
430 duration, similar to the augmentation dot.}
432 A tie is entered by appending a tilde symbol (@code{~}) to the first
433 of each pair of notes being tied. This indicates that the note
434 should be tied to the following note, which must be at the same pitch.
436 @lilypond[quote,verbatim,relative=2]
440 Ties can make use of the @q{last explicit pitch} interpretation of
443 @lilypond[quote,verbatim,relative=2]
447 Ties are used either when the note crosses a bar line, or when
448 dots cannot be used to denote the rhythm. Ties should also be
449 used when note values cross larger subdivisions of the measure:
451 @lilypond[verbatim,quote]
458 If you need to tie many notes across bar lines, it may be
459 easier to use automatic note splitting, see @ref{Automatic note
460 splitting}. This mechanism automatically splits long notes, and
461 ties them across bar lines.
463 @cindex ties and chords
464 @cindex chords and ties
466 When a tie is applied to a chord, all note heads whose pitches
467 match are connected. When no note heads match, no ties will be
468 created. Chords may be partially tied by placing the ties inside
471 @lilypond[quote,verbatim,relative=1]
474 <c~ e g~ b> <c e g b>
477 @cindex repeating ties
478 @cindex ties, repeating
479 @cindex volta brackets and ties
480 @cindex ties and volta brackets
485 When a second alternative of a repeat starts with a tied note, you
486 have to specify the repeated tie as follows:
488 @lilypond[quote,relative=2,verbatim]
489 \repeat volta 2 { c g <c e>2~ }
491 % First alternative: following note is tied normally
493 % Second alternative: following note has a repeated tie
494 { <c e>2\repeatTie d4 c } }
497 @cindex laissez vibrer
498 @cindex ties, laissez vibrer
500 @funindex \laissezVibrer
501 @funindex laissezVibrer
503 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
504 notes must not be damped at the end. It is used in notation for
505 piano, harp and other string and percussion instruments. They can
506 be entered as follows:
508 @lilypond[quote,verbatim,relative=1]
509 <c f g>1\laissezVibrer
512 @cindex ties, placement
518 @funindex \tieNeutral
521 Ties may be made to curve up or down manually; see
522 @ref{Direction and placement}.
524 @cindex ties, appearance
537 Ties may be made dashed, dotted, or a combination of solid and
540 @lilypond[quote, verbatim, relative=1]
553 Custom dash patterns can be specified:
555 @lilypond[quote, verbatim, relative=1]
556 \tieDashPattern #0.3 #0.75
558 \tieDashPattern #0.7 #1.5
564 Dash pattern definitions for ties have the same structure as dash
565 pattern definitions for slurs. For more information about complex dash
566 patterns, see @ref{Slurs}.
568 Override @var{whiteout} and @var{layer} layout properties for ties that
569 collide with other objects in a staff.
571 @lilypond[verbatim,quote,ragged-right,relative=2]
572 \override Tie.layer = #-2
573 \override Staff.TimeSignature.layer = #-1
574 \override Staff.KeySignature.layer = #-1
575 \override Staff.TimeSignature.whiteout = ##t
576 \override Staff.KeySignature.whiteout = ##t
589 @code{\tieDashPattern},
590 @code{\tieHalfDashed},
591 @code{\tieHalfSolid},
597 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
598 {using-ties-with-arpeggios.ly}
600 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
601 {engraving-ties-manually.ly}
606 @rglos{laissez vibrer}.
610 @ref{Automatic note splitting}.
613 @rlsr{Expressive marks},
617 @rinternals{LaissezVibrerTie},
618 @rinternals{LaissezVibrerTieColumn},
619 @rinternals{TieColumn},
623 Switching staves when a tie is active will not produce a slanted tie.
625 Changing clefs or ottavations during a tie is not really well-defined.
626 In these cases, a slur may be preferable.
630 @subsection Writing rests
632 Rests are entered as part of the music in music expressions.
637 * Full measure rests::
641 @unnumberedsubsubsec Rests
644 @cindex rest, entering durations
659 Rests are entered like notes with the note name @code{r}.
660 Durations longer than a whole rest use the following predefined
663 @c \time 16/1 is used to avoid spurious bar lines
664 @c and long tracts of empty measures
665 @lilypond[quote,verbatim,relative=2]
667 % These two lines are just to prettify this example
669 \omit Staff.TimeSignature
670 % Print a maxima rest, equal to four breves
672 % Print a longa rest, equal to two breves
676 r1 r2 r4 r8 r16 r32 r64 r128
680 @cindex rest, multi-measure
681 @cindex rest, whole-measure
683 Whole measure rests, centered in the middle of the measure, must be
684 entered as multi-measure rests. They can be used for a single
685 measure as well as many measures and are discussed in
686 @ref{Full measure rests}.
688 @cindex rest, specifying vertical position
690 To explicitly specify a rest's vertical position, write a note
691 followed by @code{\rest}. A rest of the duration of the note will
692 be placed at the staff position where the note would appear. This
693 allows for precise manual formatting of polyphonic music, since the
694 automatic rest collision formatter will not move these rests.
696 @lilypond[quote,verbatim,relative=2]
702 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
712 @ref{Full measure rests}.
721 @c Deliberately duplicated in Durations and Rests. -gp
722 There is no fundamental limit to rest durations (both in terms of
723 longest and shortest), but the number of glyphs is limited: there
724 are rests from 128th to maxima (8 x whole).
727 @node Invisible rests
728 @unnumberedsubsubsec Invisible rests
731 @cindex invisible rest
732 @cindex rest, invisible
740 An invisible rest (also called a @q{spacer rest}) can be entered
741 like a note with the note name@tie{}@code{s}:
743 @lilypond[verbatim,quote,relative=2]
750 Spacer rests are available only in note mode and chord mode. In
751 other situations, for example, when entering lyrics, the
752 command @code{\skip} is used to skip a musical moment.
753 @code{\skip} requires an explicit duration, but this is ignored if
754 the lyrics derive their durations from the notes in an associated
755 melody through @code{\addlyrics} or @code{\lyricsto}.
757 @lilypond[quote,verbatim,relative=2]
770 Because @code{\skip} is a command, it does not affect the default
771 durations of following notes, unlike@tie{}@code{s}.
773 @lilypond[quote,verbatim,relative=2]
776 \repeat unfold 8 { a4 }
786 A spacer rest implicitly causes @code{Staff} and @code{Voice}
787 contexts to be created if none exist, just like notes and rests
790 @lilypond[quote,verbatim,relative=2]
794 @code{\skip} simply skips musical time; it creates no output of
797 @lilypond[quote,verbatim,relative=2]
798 % This is valid input, but does nothing
799 \skip 1 \skip1 \skip 1
804 @rlearning{Visibility and color of objects}.
808 @ref{Visibility of objects}.
814 @rinternals{SkipMusic}.
817 @node Full measure rests
818 @unnumberedsubsubsec Full measure rests
820 @cindex multi-measure rests
821 @cindex full-measure rests
822 @cindex rest, multi-measure
823 @cindex rest, full-measure
824 @cindex whole rest for a full measure
825 @cindex rest, whole for a full measure
829 Rests for one or more full measures are entered like notes with
830 the note name uppercase @code{R}:
832 @lilypond[quote,verbatim,relative=2]
833 % Rest measures contracted to single measure
834 \compressFullBarRests
841 The duration of full-measure rests is identical to the duration
842 notation used for notes. The duration in a multi-measure rest must
843 always be an integral number of measure-lengths, so augmentation dots
844 or fractions must often be used:
846 @lilypond[quote,verbatim,relative=2]
847 \compressFullBarRests
853 R1*13/8 | R1*13/8*12 |
858 A full-measure rest is printed as either a whole or breve rest,
859 centered in the measure, depending on the time signature.
861 @lilypond[quote,verbatim,relative=2]
870 @cindex multi-measure rest, expanding
871 @cindex multi-measure rest, contracting
873 @funindex \expandFullBarRests
874 @funindex expandFullBarRests
875 @funindex \compressFullBarRests
876 @funindex compressFullBarRests
878 By default a multi-measure rest is expanded in the printed score to
879 show all the rest measures explicitly. Alternatively, a multi-measure
880 rest can be shown as a single measure containing a multi-measure rest
881 symbol, with the number of measures of rest printed above the measure:
883 @lilypond[quote,verbatim,relative=2]
885 \time 3/4 r2. | R2.*2 |
888 % Rest measures contracted to single measure
889 \compressFullBarRests
891 % Rest measures expanded
898 @cindex text on multi-measure rest
899 @cindex multi-measure rest, attaching text
900 @cindex script on multi-measure rest
901 @cindex multi-measure rest, script
902 @cindex fermata on multi-measure rest
903 @cindex multi-measure rest, attaching fermata
904 @cindex markup on multi-measure rest
905 @cindex multi-measure rest with markup
907 @funindex \fermataMarkup
908 @funindex fermataMarkup
909 @funindex MultiMeasureRestText
911 Markups can be added to multi-measure rests.
912 The predefined command @code{\fermataMarkup}
913 is provided for adding fermatas.
915 @lilypond[quote,verbatim,relative=2]
916 \compressFullBarRests
918 R2.*10^\markup { \italic "ad lib." }
922 @warning{Markups attached to a multi-measure rest are objects of type
923 @code{MultiMeasureRestText}, not @code{TextScript}. Overrides must
924 be directed to the correct object, or they will be ignored. See the
927 @lilypond[quote,verbatim,relative=2]
928 % This fails, as the wrong object name is specified
929 \override TextScript.padding = #5
931 % This is the correct object name to be specified
932 \override MultiMeasureRestText.padding = #5
936 When a multi-measure rest immediately follows a @code{\partial}
937 setting, resulting bar-check warnings may not be displayed.
940 @funindex \textLengthOn
941 @funindex textLengthOn
942 @funindex \textLengthOff
943 @funindex textLengthOff
944 @funindex \fermataMarkup
945 @funindex fermataMarkup
946 @funindex \compressFullBarRests
947 @funindex compressFullBarRests
948 @funindex \expandFullBarRests
949 @funindex expandFullBarRests
952 @code{\textLengthOn},
953 @code{\textLengthOff},
954 @code{\fermataMarkup},
955 @code{\compressFullBarRests},
956 @code{\expandFullBarRests}.
964 @cindex kirchenpausen
966 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
967 {changing-form-of-multi-measure-rests.ly}
969 @cindex multi-measure rests, positioning
970 @cindex positioning multi-measure rests
972 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
973 {positioning-multi-measure-rests.ly}
975 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
976 {multi-measure-rest-markup.ly}
980 @rglos{multi-measure rest}.
985 @ref{Formatting text},
992 @rinternals{MultiMeasureRest},
993 @rinternals{MultiMeasureRestNumber},
994 @rinternals{MultiMeasureRestText}.
996 @cindex fingerings and multi-measure rests
997 @cindex multi-measure rests and fingerings
1000 Fingerings over multi-measure rests (e.g. @code{R1*10-4}) may result
1001 in the fingering numeral colliding with the bar counter
1004 @cindex condensing rests
1005 @cindex rest, condensing ordinary
1007 There is no way to automatically condense multiple ordinary rests
1008 into a single multi-measure rest.
1010 @cindex rest, collisions of
1012 Multi-measure rests do not take part in rest collisions.
1015 @node Displaying rhythms
1016 @subsection Displaying rhythms
1023 * Polymetric notation::
1024 * Automatic note splitting::
1025 * Showing melody rhythms::
1028 @node Time signature
1029 @unnumberedsubsubsec Time signature
1031 @cindex time signature
1037 The time signature is set as follows:
1039 @lilypond[quote,verbatim,relative=2]
1044 @cindex time signature, visibility of
1046 Time signatures are printed at the beginning of a piece
1047 and whenever the time signature changes. If a change takes place
1048 at the end of a line a warning time signature sign is printed
1049 there. This default behavior may be changed, see
1050 @ref{Visibility of objects}.
1052 @lilypond[quote,verbatim,relative=2]
1062 @cindex time signature style
1065 @funindex \numericTimeSignature
1066 @funindex numericTimeSignature
1067 @funindex \defaultTimeSignature
1068 @funindex defaultTimeSignature
1070 The time signature symbol that is used in 2/2 and 4/4 time can be
1071 changed to a numeric style:
1073 @lilypond[quote,verbatim,relative=2]
1077 % Change to numeric style
1078 \numericTimeSignature
1081 % Revert to default style
1082 \defaultTimeSignature
1088 Mensural time signatures are covered in
1089 @ref{Mensural time signatures}.
1091 @cindex time signature default settings
1092 @cindex autobeaming properties for time signatures
1093 @cindex beaming, time signature default properties
1094 @funindex \overrideTimeSignatureSettings
1096 In addition to setting the printed time signature, the @code{\time}
1097 command also sets the values of the time-signature-based properties
1098 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
1099 The predefined default values for these properties can be found in
1100 @file{scm/time-signature-settings.scm}.
1102 The default value of @code{beatStructure} can be overridden in the
1103 @code{\time} command itself by supplying it as the optional first
1106 @lilypond[quote,verbatim]
1111 \repeat unfold 7 { c8 } |
1113 \repeat unfold 7 { c8 } |
1119 Alternatively, the default values of all these time-signature-based
1120 variables, including @code{baseMoment} and @code{beamExceptions},
1121 can be set together. The values can be set independently for several
1122 different time signatures. The new values take effect when a
1123 subsequent @code{\time} command with the same value of the time
1124 signature is executed:
1126 @lilypond[quote,verbatim]
1130 \overrideTimeSignatureSettings
1131 4/4 % timeSignatureFraction
1132 1/4 % baseMomentFraction
1133 #'(3 1) % beatStructure
1134 #'() % beamExceptions
1136 \repeat unfold 8 { c8 } |
1142 @code{\overrideTimeSignatureSettings} takes four arguments:
1147 @code{@var{timeSignatureFraction}}, a fraction describing the
1148 time signature to which these values apply.
1151 @code{@var{baseMomentFraction}}, a fraction containing the numerator
1152 and denominator of the basic timing unit for the time signature.
1155 @code{@var{beatStructure}}, a Scheme list indicating the structure
1156 of the beats in the measure, in units of the base moment.
1159 @code{@var{beamExceptions}}, an alist containing any beaming rules
1160 for the time signature that go beyond ending at every beat, as
1161 described in @ref{Setting automatic beam behavior}.
1165 @cindex time signature properties, restoring default values
1166 @cindex restoring default properties for time signatures
1167 @funindex \revertTimeSignatureSettings
1169 Changed values of default time signature properties can be restored
1170 to the original values:
1172 @lilypond[quote,verbatim]
1175 \repeat unfold 8 { c8 } |
1176 \overrideTimeSignatureSettings
1177 4/4 % timeSignatureFraction
1178 1/4 % baseMomentFraction
1179 #'(3 1) % beatStructure
1180 #'() % beamExceptions
1182 \repeat unfold 8 { c8 } |
1183 \revertTimeSignatureSettings 4/4
1185 \repeat unfold 8 { c8 } |
1190 Different values of default time signature properties can be established
1191 for different staves by moving the @code{Timing_translator} and the
1192 @code{Default_bar_line_engraver} from the @code{Score} context to the
1193 @code{Staff} context.
1195 @lilypond[quote, verbatim]
1199 \overrideTimeSignatureSettings
1200 4/4 % timeSignatureFraction
1201 1/4 % baseMomentFraction
1202 #'(3 1) % beatStructure
1203 #'() % beamExceptions
1205 \repeat unfold 8 {c''8}
1208 \overrideTimeSignatureSettings
1209 4/4 % timeSignatureFraction
1210 1/4 % baseMomentFraction
1211 #'(1 3) % beatStructure
1212 #'() % beamExceptions
1214 \repeat unfold 8 {c''8}
1220 \remove "Timing_translator"
1221 \remove "Default_bar_line_engraver"
1225 \consists "Timing_translator"
1226 \consists "Default_bar_line_engraver"
1232 A further method of changing these time-signature-related variables,
1233 which avoids reprinting the time signature at the time of the change,
1234 is shown in @ref{Setting automatic beam behavior}.
1237 @code{\numericTimeSignature},
1238 @code{\defaultTimeSignature}.
1243 @lilypondfile[verbatim,quote,texidoc,doctitle]
1244 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1248 @rglos{time signature}
1251 @ref{Mensural time signatures},
1252 @ref{Setting automatic beam behavior},
1253 @ref{Time administration}.
1256 @file{scm/time-signature-settings.scm}.
1261 Internals Reference:
1262 @rinternals{TimeSignature},
1263 @rinternals{Timing_translator}.
1266 @node Metronome marks
1267 @unnumberedsubsubsec Metronome marks
1270 @cindex beats per minute
1271 @cindex metronome mark
1272 @cindex metronome marking with text
1277 A basic metronome mark is simple to write:
1279 @lilypond[verbatim,quote,relative=1]
1285 Metronome marks may also be printed as a range of two numbers:
1287 @lilypond[verbatim,quote,relative=1]
1293 Tempo indications with text can be used instead:
1295 @lilypond[verbatim,quote,relative=2]
1301 Combining a metronome mark and text will automatically place the
1302 metronome mark within parentheses:
1304 @lilypond[verbatim,quote,relative=2]
1305 \tempo "Allegro" 4 = 160
1310 In general, the text can be any markup object:
1312 @lilypond[verbatim,quote,relative=2]
1313 \tempo \markup { \italic Faster } 4 = 132
1314 a8-. r8 b-. r gis-. r a-. r
1317 A parenthesized metronome mark with no textual indication may be
1318 written by including an empty string in the input:
1320 @lilypond[verbatim,quote,relative=2]
1325 @funindex \markLengthOn
1326 @funindex markLengthOn
1327 @funindex \markLengthOff
1328 @funindex markLengthOff
1330 In a part for an instrument with long periods of rests,
1331 tempo indications sometimes follow each other closely.
1332 The command @code{\markLengthOn} provides extra horizontal space
1333 to prevent tempo indications from overlapping, and @code{\markLengthOff}
1334 restores the default behavior of ignoring tempo marks
1335 for horizontal spacing.
1337 @lilypond[verbatim,quote,relative=0]
1338 \compressFullBarRests
1340 \tempo "Molto vivace"
1351 @lilypondfile[verbatim,quote,texidoc,doctitle]
1352 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
1354 @c perhaps also an example of how to move it horizontally?
1356 @lilypondfile[verbatim,quote,texidoc,doctitle]
1357 {changing-the-tempo-without-a-metronome-mark.ly}
1359 @lilypondfile[verbatim,quote,texidoc,doctitle]
1360 {creating-metronome-marks-in-markup-mode.ly}
1362 For more details, see @ref{Formatting text}.
1367 @rglos{metronomic indication},
1368 @rglos{tempo indication},
1369 @rglos{metronome mark}.
1372 @ref{Formatting text},
1376 @rlsr{Staff notation}.
1378 Internals Reference:
1379 @rinternals{MetronomeMark}.
1383 @unnumberedsubsubsec Upbeats
1387 @cindex partial measure
1388 @cindex measure, partial
1389 @cindex measure, pickup
1390 @cindex pickup measure
1392 @funindex measurePosition
1396 Partial or pick-up measures, such as an @emph{anacrusis} or an
1397 @emph{upbeat}, are entered using the @code{\partial} command,
1400 \partial @var{duration}
1404 where @code{@var{duration}} is the @emph{remaining} length of the
1405 partial measure @emph{before} the start of the next full measure.
1407 @lilypond[quote,verbatim,relative=1]
1413 The @var{duration} can be any value less than a full measure:
1415 @lilypond[quote,verbatim,relative=1]
1418 r4 e8 | a4 c8 b c4 |
1421 @code{\partial @var{duration}} can also be written as:
1424 \set Timing.measurePosition -@var{duration}
1427 So the first example above could be written:
1429 @lilypond[quote,verbatim,relative=1]
1431 \set Timing.measurePosition = #(ly:make-moment -1/8)
1435 The property @code{measurePosition} contains a rational number,
1436 which is usually positive and indicates how much of the measure
1437 has passed at this point. @code{\partial @var{duration}} is
1438 defined such that no numbered bar gets created: when used at the
1439 beginning of a score, @code{measurePosition} is set to a
1440 negative number, implying that the current bar will be
1441 @emph{preceded} by additional material. When used elsewhere, it
1442 moves the requested distance before the @emph{end} of the bar.
1444 @lilypond[quote,verbatim,relative=1]
1445 \set Score.barNumberVisibility = #all-bar-numbers-visible
1446 \override Score.BarNumber.break-visibility =
1447 #end-of-line-invisible
1450 e8 | a4 c8 b[ c b] |
1452 r8 e,8 | a4 \bar "||"
1470 @rinternals{Timing_translator}.
1473 @node Unmetered music
1474 @unnumberedsubsubsec Unmetered music
1477 @cindex cadenza, beams
1478 @cindex cadenza, accidentals
1479 @cindex cadenza, bar lines
1480 @cindex cadenza, bar numbers
1481 @cindex unmetered music
1482 @cindex unmetered music, beams
1483 @cindex unmetered music, accidentals
1484 @cindex unmetered music, bar lines
1485 @cindex unmetered music, bar numbers
1486 @cindex accidentals, cadenzas
1487 @cindex accidentals, unmetered music
1488 @cindex bar lines, cadenzas
1489 @cindex bar lines, unmetered music
1490 @cindex bar numbers, cadenzas
1491 @cindex bar numbers, unmetered music
1492 @cindex beams, cadenzas
1493 @cindex beams, unmetered music
1495 @funindex \cadenzaOn
1497 @funindex \cadenzaOff
1498 @funindex cadenzaOff
1500 In metered music bar lines are inserted and bar numbers are calculated
1501 automatically. In unmetered music (i.e. cadenzas), this is not
1502 desirable and can be @q{switched off} using the command
1503 @code{\cadenzaOn}, then @q{switched back on} at the appropriate place
1504 using @code{\cadenzaOff}.
1506 @lilypond[verbatim,relative=2,quote]
1509 c4 c d8[ d d] f4 g4.
1515 Bar numbering is resumed at the end of the cadenza.
1517 @lilypond[verbatim,relative=2,quote]
1518 % Show all bar numbers
1519 \override Score.BarNumber.break-visibility = #all-visible
1522 c4 c d8[ d d] f4 g4.
1528 Inserting a @code{\bar} command within a cadenza does not start a new
1529 measure, even if a bar line is printed. So any accidentals -- which
1530 are usually assumed to remain in force until the end of the measure --
1531 will still be valid after the bar line printed by @code{\bar}. If
1532 subsequent accidentals should be printed, forced accidentals or
1533 reminder accidentals need to be inserted manually, see
1536 @lilypond[verbatim,relative=2,quote]
1541 % First cis is printed without alteration even if it's after a \bar
1547 Automatic beaming is disabled by @code{\cadenzaOn}. Therefore, all
1548 beaming in cadenzas must be entered manually. See @ref{Manual beams}.
1550 @lilypond[verbatim,relative=2,quote]
1551 \repeat unfold 8 { c8 }
1557 \repeat unfold 8 { c8 }
1560 These predefined commands affect all staves in the score, even when
1561 placed in just one @code{Voice} context. To change this, move the
1562 @code{Timing_translator} from the @code{Score} context to the
1563 @code{Staff} context. See @ref{Polymetric notation}.
1575 @ref{Visibility of objects},
1576 @ref{Polymetric notation},
1583 @cindex cadenza, line breaks
1584 @cindex cadenza, page breaks
1585 @cindex unmetered music, line breaks
1586 @cindex unmetered music, page breaks
1587 @cindex breaks in unmetered music
1588 @cindex line breaks, cadenzas
1589 @cindex page breaks, cadenzas
1590 @cindex line breaks, unmetered music
1591 @cindex page breaks, unmetered music
1594 Automatic line and page breaks are inserted only at bar lines, so
1595 @q{invisible} bar lines will need to be inserted manually in long
1596 stretches of unmetered music to permit breaking:
1603 @node Polymetric notation
1604 @unnumberedsubsubsec Polymetric notation
1606 @c This section necessarily uses \set
1607 @c This is acceptable -td
1609 @cindex double time signatures
1610 @cindex signatures, polymetric
1611 @cindex time signatures, polymetric
1612 @cindex time signatures, double
1613 @cindex polymetric signatures
1614 @cindex meter, polymetric
1616 @funindex timeSignatureFraction
1617 @funindex \scaleDurations
1618 @funindex scaleDurations
1622 Polymetric notation is supported explicitly or by manually modifying the
1623 visible time signature symbol and/or scaling note durations.
1625 @subsubsubheading Different time signatures with equal-length measures
1627 Set a common time signature for each staff, and set the
1628 @code{timeSignatureFraction} to the desired fraction. Then use the
1629 @code{\scaleDurations} function to scale the durations of the notes in
1630 each staff to the common time signature.
1632 @cindex beams, with polymetric meters
1633 @cindex polymetric meters, with beams
1635 In the following example, music with the time signatures of 3/4, 9/8 and
1636 10/8 are used in parallel. In the second staff, shown durations are
1637 multiplied by 2/3 (because 2/3 * 9/8 = 3/4) and in the third staff, the
1638 shown durations are multiplied by 3/5 (because 3/5 * 10/8 = 3/4). It
1639 may be necessary to insert beams manually, as the duration scaling will
1640 affect the autobeaming rules.
1642 @lilypond[quote,verbatim]
1651 \set Staff.timeSignatureFraction = 9/8
1653 \repeat unfold 6 { c8[ c c] }
1657 \set Staff.timeSignatureFraction = 10/8
1658 \scaleDurations 3/5 {
1659 \repeat unfold 2 { c8[ c c] }
1660 \repeat unfold 2 { c8[ c] } |
1661 c4. c \tuplet 3/2 { c8[ c c] } c4
1667 @subsubsubheading Different time signatures with unequal-length measures
1669 Each staff can be given its own independent time signature by
1670 moving the @code{Timing_translator} and the
1671 @code{Default_bar_line_engraver} to the @code{Staff} context.
1673 @lilypond[quote,verbatim]
1677 \remove "Timing_translator"
1678 \remove "Default_bar_line_engraver"
1682 \consists "Timing_translator"
1683 \consists "Default_bar_line_engraver"
1687 % Now each staff has its own time signature.
1711 @funindex \compoundMeter
1712 @cindex compound time signatures
1713 @cindex time signature, compound
1715 @subsubsubheading Compound time signatures
1717 These are created using the @code{\compoundMeter} function. The syntax
1721 \compoundMeter #'@code{(list of lists)}
1724 The simplest construction is a single list, where the @emph{last} number
1725 indicates the bottom number of the time signature and those that come
1726 before it, the top numbers.
1728 @lilypond[quote,verbatim]
1730 \compoundMeter #'((2 2 2 8))
1731 \repeat unfold 6 c8 \repeat unfold 12 c16
1735 More complex meters can be constructed using additional lists. Also,
1736 automatic beaming settings will be adjusted depending on the values.
1738 @lilypond[quote,verbatim]
1740 \compoundMeter #'((1 4) (3 8))
1741 \repeat unfold 5 c8 \repeat unfold 10 c16
1745 \compoundMeter #'((1 2 3 8) (3 4))
1746 \repeat unfold 12 c8
1753 @rglos{polymetric time signature},
1757 @ref{Automatic beams},
1759 @ref{Time signature},
1760 @ref{Scaling durations}.
1765 Internals Reference:
1766 @rinternals{TimeSignature},
1767 @rinternals{Timing_translator},
1768 @rinternals{Default_bar_line_engraver},
1772 When using different time signatures in parallel, notes at the same
1773 moment will be placed at the same horizontal location. However, the bar
1774 lines in the different staves will cause the note spacing to be less
1775 regular in each of the individual staves than would be normal without
1776 the different time signatures.
1779 @node Automatic note splitting
1780 @unnumberedsubsubsec Automatic note splitting
1782 @cindex notes, splitting
1783 @cindex splitting notes
1784 @cindex rests, splitting
1785 @cindex splitting rests
1787 @funindex Note_heads_engraver
1788 @funindex Completion_heads_engraver
1789 @funindex Completion_rest_engraver
1791 Long notes which overrun bar lines can be converted automatically to
1792 tied notes. This is done by replacing the @code{Note_heads_engraver}
1793 with the @code{Completion_heads_engraver}. Similarly, long rests which
1794 overrun bar lines are split automatically by replacing the
1795 @code{Rest_engraver} with the @code{Completion_rest_engraver}. In the
1796 following example, notes and rests crossing the bar lines are split,
1797 notes are also tied.
1799 @lilypond[quote,verbatim,relative=1]
1801 \remove "Note_heads_engraver"
1802 \consists "Completion_heads_engraver"
1803 \remove "Rest_engraver"
1804 \consists "Completion_rest_engraver"
1807 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 r1*2 }
1810 These engravers split all running notes and rests at the bar line, and
1811 inserts ties for notes. One of its uses is to debug complex scores: if
1812 the measures are not entirely filled, then the ties show exactly how
1813 much each measure is off.
1815 The property @code{completionUnit} sets a preferred duration for
1818 @lilypond[quote,verbatim,relative=2]
1820 \remove "Note_heads_engraver"
1821 \consists "Completion_heads_engraver"
1823 \time 9/8 g\breve. d4. \bar "||"
1824 \set completionUnit = #(ly:make-moment 3 8)
1829 These engravers split notes with scaled duration, such as those in tuplets,
1830 into notes with the same scale-factor as in the input note.
1832 @lilypond[quote,verbatim,relative=2]
1834 \remove "Note_heads_engraver"
1835 \consists "Completion_heads_engraver"
1838 \tuplet 3/2 {g4 a b}
1839 \scaleDurations 2/3 {g a b}
1841 \tuplet 3/2 {g4 a b}
1851 @rlearning{Engravers explained},
1852 @rlearning{Adding and removing engravers}.
1857 Internals Reference:
1858 @rinternals{Note_heads_engraver},
1859 @rinternals{Completion_heads_engraver},
1860 @rinternals{Rest_engraver},
1861 @rinternals{Completion_rest_engraver},
1862 @rinternals{Forbid_line_break_engraver}.
1865 For consistency with previous behavior, notes and rests with
1866 duration longer than a measure, such as @code{c1*2}, are split into
1867 notes without any scale factor, @code{@{ c1 c1 @}}. The property
1868 @code{completionFactor} controls this behavior, and setting it to
1869 @code{#f} cause split notes and rest to have the scale factor
1870 of the input durations.
1873 @node Showing melody rhythms
1874 @unnumberedsubsubsec Showing melody rhythms
1876 @cindex melody rhythms, showing
1877 @cindex rhythms, showing melody
1879 Sometimes you might want to show only the rhythm of a melody. This
1880 can be done with the rhythmic staff. All pitches of notes on such a
1881 staff are squashed, and the staff itself has a single line
1883 @lilypond[quote,relative=1,verbatim]
1885 \new RhythmicStaff {
1886 \new Voice = "myRhythm" {
1894 \lyricsto "myRhythm" {
1902 @cindex guitar chord charts
1903 @cindex strumming rhythms, showing
1904 @cindex guitar strumming rhythms, showing
1906 @funindex Pitch_squash_engraver
1907 @funindex \improvisationOn
1908 @funindex improvisationOn
1909 @funindex \improvisationOff
1910 @funindex improvisationOff
1912 Guitar chord charts often show the strumming rhythms. This can
1913 be done with the @code{Pitch_squash_engraver} and
1914 @code{\improvisationOn}.
1917 @lilypond[quote,verbatim]
1925 \consists "Pitch_squash_engraver"
1938 @code{\improvisationOn},
1939 @code{\improvisationOff}.
1945 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1946 {guitar-strum-rhythms.ly}
1952 Internals Reference:
1953 @rinternals{RhythmicStaff},
1954 @rinternals{Pitch_squash_engraver}.
1962 * Setting automatic beam behavior::
1967 @node Automatic beams
1968 @unnumberedsubsubsec Automatic beams
1970 By default, beams are inserted automatically:
1972 @cindex beams, manual
1973 @cindex manual beams
1974 @cindex beams, customizing rules
1976 @funindex \autoBeamOn
1977 @funindex autoBeamOn
1978 @funindex \autoBeamOff
1979 @funindex autoBeamOff
1981 @lilypond[quote,verbatim,relative=2]
1983 \time 6/8 c8 c c c8. c16 c8
1986 If these automatic decisions are not satisfactory, beaming can be
1987 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1988 entered manually if beams are to be extended over rests.
1990 If automatic beaming is not required, it may be turned off with
1991 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1993 @lilypond[quote,relative=1,verbatim]
1994 c4 c8 c8. c16 c8. c16 c8
2001 @cindex melismata, with beams
2002 @cindex beams, with melismata
2004 @warning{If beams are used to indicate melismata in songs, then
2005 automatic beaming should be switched off with @code{@bs{}autoBeamOff}
2006 and the beams indicated manually. Using @code{@bs{}partcombine} with
2007 @code{@bs{}autoBeamOff} can produce unintended results. See the
2008 snippets for more information.}
2010 Beaming patterns that differ from the automatic defaults can be
2011 created; see @ref{Setting automatic beam behavior}.
2014 @code{\autoBeamOff},
2018 @cindex beams, line breaks
2019 @cindex line breaks, beams
2020 @cindex beams, with knee gap
2021 @cindex knee gap, with beams
2025 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2026 {beams-across-line-breaks.ly}
2028 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2029 {changing-beam-knee-gap.ly}
2031 @cindex beams, \partcombine with \autoBeamOff
2032 @cindex voices, \partcombine with \autoBeamOff
2034 @lilypondfile [verbatim, quote, ragged-right, texidoc, doctitle]
2035 {partcombine-and-autobeamoff.ly}
2040 @ref{Setting automatic beam behavior}.
2043 @file{scm/auto-beam.scm}.
2048 Internals Reference:
2049 @rinternals{Auto_beam_engraver},
2050 @rinternals{Beam_engraver},
2052 @rinternals{BeamEvent},
2053 @rinternals{BeamForbidEvent},
2054 @rinternals{beam-interface},
2055 @rinternals{unbreakable-spanner-interface}.
2058 The properties of a beam are determined at the @emph{start} of its
2059 construction and any additional beam-property changes that occur before
2060 the beam has been completed will not take effect until the @emph{next},
2064 @node Setting automatic beam behavior
2065 @unnumberedsubsubsec Setting automatic beam behavior
2067 @cindex beams, with lyrics
2068 @cindex lyrics, with beams
2070 @funindex autoBeaming
2071 @funindex baseMoment
2072 @funindex beamExceptions
2073 @funindex \beamExceptions
2074 @funindex beatStructure
2075 @funindex measureLength
2081 When automatic beaming is enabled, the placement of automatic beams
2082 is determined by three context properties:
2083 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2084 The default values of these variables may be overridden as described
2085 below, or alternatively the default values themselves may be changed
2086 as explained in @ref{Time signature}.
2088 If a @code{beamExceptions} rule is defined for the time signature in
2089 force, that rule alone is used to determine the beam placement; the
2090 values of @code{baseMoment} and @code{beatStructure} are ignored.
2092 If no @code{beamExceptions} rule is defined for the time signature
2093 in force, the beam placement is determined by the values of
2094 @code{baseMoment} and @code{beatStructure}.
2097 @subsubsubheading Beaming based on @code{baseMoment} and @code{beatStructure}
2099 By default, @code{beamExceptions} rules are defined for most common
2100 time signatures, so the @code{beamExceptions} rules must be disabled
2101 if automatic beaming is to be based on @code{baseMoment} and
2102 @code{beatStructure}. The @code{beamExceptions} rules are disabled
2106 \set Timing.beamExceptions = #'()
2109 When @code{beamExceptions} is set to @code{#'()}, either due to an
2110 explicit setting or because no @code{beamExceptions} rules are defined
2111 internally for the time signature in force, the ending points for
2112 beams are on beats as specified by the context properties
2113 @code{baseMoment} and @code{beatStructure}. @code{beatStructure} is
2114 a scheme list that defines the length of each beat in the measure in
2115 units of @code{baseMoment}. By default, @code{baseMoment} is one
2116 over the denominator of the time signature. By default, each unit of
2117 length @code{baseMoment} is a single beat.
2119 @lilypond[quote,relative=2,verbatim]
2121 c16^"default" c c c c |
2122 % beamExceptions are unlikely to be defined for 5/16 time,
2123 % but let's disable them anyway to be sure
2124 \set Timing.beamExceptions = #'()
2125 \set Timing.beatStructure = #'(2 3)
2126 c16^"(2+3)" c c c c |
2127 \set Timing.beatStructure = #'(3 2)
2128 c16^"(3+2)" c c c c |
2131 @lilypond[quote,relative=2,verbatim]
2133 a8^"default" a a a a a a a
2134 % Disable beamExceptions because they are definitely
2135 % defined for 4/4 time
2136 \set Timing.beamExceptions = #'()
2137 \set Timing.baseMoment = #(ly:make-moment 1/4)
2138 \set Timing.beatStructure = #'(1 1 1 1)
2139 a8^"changed" a a a a a a a
2142 Beam setting changes can be limited to specific contexts. If no
2143 setting is included in a lower-level context, the setting of the
2144 enclosing context will apply.
2146 @lilypond[quote, verbatim,relative=1]
2149 % No need to disable beamExceptions
2150 % as they are not defined for 7/8 time
2151 \set Staff.beatStructure = #'(2 3 2)
2161 \set Voice.beatStructure = #'(1 3 3)
2169 When multiple voices are used the @code{Staff} context must be
2170 specified if the beaming is to be applied to all voices in the
2173 @lilypond[quote,verbatim,relative=2]
2176 % Change applied to Voice by default -- does not work correctly
2177 % Because of autogenerated voices, all beating will
2178 % be at baseMoment (1 . 8)
2179 \set beatStructure = #'(3 1 1 2)
2180 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2182 % Works correctly with context Staff specified
2183 \set Staff.beatStructure = #'(3 1 1 2)
2184 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2187 The value of @code{baseMoment} can be adjusted to change
2188 the beaming behavior, if desired. When this is done,
2189 the value of @code{beatStructure} must be set to be
2190 compatible with the new value of @code{baseMoment}.
2192 @lilypond[quote,verbatim,relative=2]
2194 % No need to disable beamExceptions
2195 % as they are not defined for 5/8 time
2196 \set Timing.baseMoment = #(ly:make-moment 1/16)
2197 \set Timing.beatStructure = #'(7 3)
2198 \repeat unfold 10 { a16 }
2201 @code{baseMoment} is a @i{moment}; a unit of musical duration. A
2202 quantity of type @i{moment} is created by the scheme function
2203 @code{ly:make-moment}. For more information about this function,
2204 see @ref{Time administration}.
2206 By default @code{baseMoment} is set to one over the denominator of
2207 the time signature. Any exceptions to this default can be found in
2208 @file{scm/time-signature-settings.scm}.
2210 @subsubsubheading Beaming based on @code{beamExceptions}
2212 Special autobeaming rules (other than ending a beam on a beat)
2213 are defined in the @code{beamExceptions} property.
2215 The value for @code{beamExceptions}, a somewhat complex Scheme
2216 data structure, is easiest generated with the
2217 @code{\beamExceptions} function. This function is given one or
2218 more manually beamed measure-length rhythmic patterns (measures
2219 have to be separated by a bar check@tie{}@code{|} since the
2220 function has no other way to discern the measure length). Here is
2223 @lilypond[quote,relative=2,verbatim]
2225 \set Timing.beatStructure = #'(2 1)
2226 \set Timing.beamExceptions =
2227 \beamExceptions { 32[ 32] 32[ 32] 32[ 32] }
2229 \repeat unfold 6 { c32 } |
2232 @warning{A @code{beamExceptions} value must be @emph{complete}
2233 exceptions list. That is, every exception that should be applied
2234 must be included in the setting. It is not possible to add, remove,
2235 or change only one of the exceptions. While this may seem cumbersome,
2236 it means that the current beaming settings need not be known in order
2237 to specify a new beaming pattern.}
2239 When the time signature is changed, default values of
2240 @code{Timing.baseMoment}, @code{Timing.beatStructure},
2241 and @code{Timing.beamExceptions} are set. Setting the time signature
2242 will reset the automatic beaming settings for the @code{Timing}
2243 context to the default behavior.
2245 @lilypond[quote,verbatim,relative=2]
2247 \repeat unfold 6 { a8 }
2249 \set Timing.beatStructure = #'(4 2)
2250 \repeat unfold 6 { a8 }
2251 % go back to default behavior
2253 \repeat unfold 6 { a8 }
2256 The default automatic beaming settings for a time signature
2257 are determined in @file{scm/time-signature-settings.scm}.
2258 Changing the default automatic beaming settings
2259 for a time signature is described in @ref{Time signature}.
2261 Many automatic beaming settings for a time signature contain an
2262 entry for @code{beamExceptions}. For example, 4/4 time tries to
2263 beam the measure in two if there are only eighth notes. The
2264 @code{beamExceptions} rule can override the @code{beatStructure} setting
2265 if @code{beamExceptions} is not reset.
2267 @lilypond[quote,verbatim,relative=2]
2269 \set Timing.baseMoment = #(ly:make-moment 1/8)
2270 \set Timing.beatStructure = #'(3 3 2)
2271 % This won't beam (3 3 2) because of beamExceptions
2272 \repeat unfold 8 {c8} |
2273 % This will beam (3 3 2) because we clear beamExceptions
2274 \set Timing.beamExceptions = #'()
2275 \repeat unfold 8 {c8}
2278 In a similar fashion, eighth notes in 3/4 time are beamed as a full
2279 measure by default. To beam eighth notes in 3/4 time on the beat,
2280 reset @code{beamExceptions}.
2282 @lilypond[quote,verbatim,relative=2]
2284 % by default we beam in (6) due to beamExceptions
2285 \repeat unfold 6 {a8} |
2286 % This will beam (1 1 1) due to default baseMoment and beatStructure
2287 \set Timing.beamExceptions = #'()
2288 \repeat unfold 6 {a8}
2291 In engraving from the Romantic and Classical periods,
2292 beams often begin midway through the measure in 3/4 time,
2293 but modern practice is to avoid the false impression of 6/8 time
2294 (see Gould, p. 153). Similar situations arise in 3/8 time.
2295 This behavior is controlled by the context property @code{beamHalfMeasure},
2296 which has effect only in time signatures with 3 in the numerator:
2298 @lilypond[quote,verbatim,relative=2]
2301 \set Timing.beamHalfMeasure = ##f
2305 @subsubsubheading How automatic beaming works
2307 When automatic beaming is enabled, the placement of automatic beams
2308 is determined by the context properties
2309 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2311 The following rules, in order of priority, apply when determining
2312 the appearance of beams:
2316 If a manual beam is specified with @code{[@dots{}]} set the beam
2317 as specified, otherwise
2320 if a beam-ending rule is defined in @code{beamExceptions}
2321 for the beam-type, use it to determine the valid places where
2322 beams may end, otherwise
2325 if a beam-ending rule is defined in @code{beamExceptions}
2326 for a longer beam-type, use it to determine the valid places
2327 where beams may end, otherwise
2330 use the values of @code{baseMoment} and @code{beatStructure} to
2331 determine the ends of the beats in the measure, and
2332 end beams at the end of beats.
2336 In the rules above, the @emph{beam-type} is the duration of the
2337 shortest note in the beamed group.
2339 The default beaming rules can be found in
2340 @file{scm/time-signature-settings.scm}.
2344 @cindex beams, subdividing
2346 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2347 {subdividing-beams.ly}
2349 @cindex beamlets, orienting
2351 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2352 {strict-beat-beaming.ly}
2354 @cindex measure groupings
2355 @cindex beats, grouping
2356 @cindex grouping beats
2357 @cindex measure sub-grouping
2359 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2360 {conducting-signs,-measure-grouping-signs.ly}
2362 @cindex beam, endings in a score
2363 @cindex beam, endings with multiple voices
2365 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2366 {beam-endings-in-score-context.ly}
2370 @ref{Time signature}.
2373 @file{scm/time-signature-settings.scm}.
2378 Internals Reference:
2379 @rinternals{Auto_beam_engraver},
2381 @rinternals{BeamForbidEvent},
2382 @rinternals{beam-interface}.
2385 If a score ends while an automatic beam has not been ended and is
2386 still accepting notes, this last beam will not be typeset at all.
2387 The same holds for polyphonic voices, entered with
2388 @code{<< @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
2389 automatic beam is still accepting notes, it is not typeset.
2390 The workaround for these problems is to manually beam the last
2391 beam in the voice or score.
2393 By default, the @code{Timing} translator is aliased to the
2394 @code{Score} context. This means that setting the time signature
2395 in one staff will affect the beaming of the other staves as well.
2396 Thus, a time signature setting in a later staff will reset custom
2397 beaming that was set in an earlier staff.
2398 One way to avoid this problem is to set the time signature
2401 @lilypond[quote,verbatim,relative=2]
2405 \set Timing.baseMoment = #(ly:make-moment 1/8)
2406 \set Timing.beatStructure = #'(1 5)
2407 \repeat unfold 6 { a8 }
2410 \repeat unfold 6 { a8 }
2415 The default beam settings for the time signature can also be changed, so
2416 that the desired beaming will always be used. Changes in automatic
2417 beaming settings for a time signature are described in
2418 @ref{Time signature}.
2420 @lilypond[quote,verbatim,relative=2]
2423 \overrideTimeSignatureSettings
2424 3/4 % timeSignatureFraction
2425 1/8 % baseMomentFraction
2426 #'(1 5) % beatStructure
2427 #'() % beamExceptions
2429 \repeat unfold 6 { a8 }
2433 \repeat unfold 6 { a8 }
2440 @unnumberedsubsubsec Manual beams
2442 @cindex beams, manual
2443 @cindex manual beams
2448 In some cases it may be necessary to override the automatic
2449 beaming algorithm. For example, the autobeamer will not put beams
2450 over rests or bar lines, and in choral scores the beaming is
2451 often set to follow the meter of the lyrics rather than the
2452 notes. Such beams can be specified manually by
2453 marking the begin and end point with @code{[} and @code{]}.
2455 @lilypond[quote,relative=1,verbatim]
2456 r4 r8[ g' a r] r g[ | a] r
2459 @cindex manual beams, direction shorthand for
2460 @cindex manual beams, grace notes
2462 Beaming direction can be set manually using direction indicators:
2464 @lilypond[quote,relative=2,verbatim]
2465 c8^[ d e] c,_[ d e f g]
2471 Individual notes may be marked with @code{\noBeam} to prevent them
2474 @lilypond[quote,verbatim,relative=2]
2479 Grace note beams and normal note beams can occur simultaneously.
2480 Unbeamed grace notes are not put into normal note beams.
2482 @lilypond[quote,verbatim,relative=2]
2484 \grace { e32 d c d }
2490 @funindex stemLeftBeamCount
2491 @funindex stemRightBeamCount
2493 Even more strict manual control with the beams can be achieved by
2494 setting the properties @code{stemLeftBeamCount} and
2495 @code{stemRightBeamCount}. They specify the number of beams to
2496 draw on the left and right side, respectively, of the next note.
2497 If either property is set, its value will be used only once, and
2498 then it is erased. In this example, the last @code{f} is printed
2499 with only one beam on the left side, i.e., the eighth-note beam of
2500 the group as a whole.
2502 @lilypond[quote,relative=2,verbatim]
2505 \set stemLeftBeamCount = #2
2506 \set stemRightBeamCount = #1
2508 \set stemLeftBeamCount = #1
2520 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2521 {flat-flags-and-beam-nibs.ly}
2525 @ref{Direction and placement},
2531 Internals Reference:
2533 @rinternals{BeamEvent},
2534 @rinternals{Beam_engraver},
2535 @rinternals{beam-interface},
2536 @rinternals{Stem_engraver}.
2539 @node Feathered beams
2540 @unnumberedsubsubsec Feathered beams
2542 @cindex beams, feathered
2543 @cindex feathered beams
2545 @funindex \featherDurations
2546 @funindex featherDurations
2547 @funindex grow-direction
2549 Feathered beams are used to indicate that a small group of notes
2550 should be played at an increasing (or decreasing) tempo, without
2551 changing the overall tempo of the piece. The extent of the
2552 feathered beam must be indicated manually using @code{[} and
2553 @code{]}, and the beam feathering is turned on by specifying a
2554 direction to the @code{Beam} property @code{grow-direction}.
2556 If the placement of the notes and the sound in the MIDI output is to
2557 reflect the @emph{ritardando} or @emph{accelerando} indicated by the
2558 feathered beam the notes must be grouped as a music expression delimited
2559 by braces and preceded by a @code{featherDurations} command which specifies
2560 the ratio between the durations of the first and last notes in the
2563 The square brackets show the extent of the beam and the braces show
2564 which notes are to have their durations modified. Normally these
2565 would delimit the same group of notes, but this is not required: the
2566 two commands are independent.
2568 In the following example the eight 16th notes occupy exactly the
2569 same time as a half note, but the first note is one half as long
2570 as the last one, with the intermediate notes gradually
2571 lengthening. The first four 32nd notes gradually speed up, while
2572 the last four 32nd notes are at a constant tempo.
2574 @lilypond[relative=1,verbatim,quote]
2575 \override Beam.grow-direction = #LEFT
2576 \featherDurations #(ly:make-moment 2/1)
2577 { c16[ c c c c c c c] }
2578 \override Beam.grow-direction = #RIGHT
2579 \featherDurations #(ly:make-moment 2/3)
2581 % revert to non-feathered beams
2582 \override Beam.grow-direction = #'()
2587 The spacing in the printed output represents the
2588 note durations only approximately, but the MIDI output is exact.
2591 @code{\featherDurations}.
2599 The @code{\featherDurations} command only works with very short
2600 music snippets, and when numbers in the fraction are small.
2609 * Bar and bar number checks::
2614 @unnumberedsubsubsec Bar lines
2617 @cindex measure lines
2618 @cindex closing bar lines
2619 @cindex bar lines, closing
2620 @cindex double bar lines
2621 @cindex bar lines, double
2627 Bar lines delimit measures, and are also used to indicate
2628 repeats. Normally, simple bar lines are automatically inserted
2629 into the printed output at places based on the current time
2632 The simple bar lines inserted automatically can be changed to
2633 other types with the @code{\bar} command. For example, a closing
2634 double bar line is usually placed at the end of a piece:
2636 @lilypond[quote,relative=1,verbatim]
2640 It is not invalid if the final note in a measure does not
2641 end on the automatically entered bar line: the note is assumed
2642 to carry over into the next measure. But if a long sequence
2643 of such carry-over measures appears the music can appear compressed
2644 or even flowing off the page. This is because automatic line
2645 breaks happen only at the end of complete measures, i.e., where
2646 all notes end before the end of a measure.
2648 @warning{An incorrect duration can cause line breaks to be
2649 inhibited, leading to a line of highly compressed music or
2650 music which flows off the page.}
2653 @cindex bar lines, invisible
2654 @cindex measure lines, invisible
2656 Line breaks are also permitted at manually inserted bar lines
2657 even within incomplete measures. To allow a line break without
2658 printing a bar line, use the following:
2665 This will insert an invisible bar line and allow (but not
2666 force) a line break to occur at this point. The bar number
2667 counter is not increased. To force a line break see
2668 @ref{Line breaking}.
2670 @cindex manual bar lines
2671 @cindex manual measure lines
2672 @cindex bar lines, manual
2673 @cindex measure lines, manual
2675 This and other special bar lines may be inserted manually at any
2676 point. When they coincide with the end of a measure they replace
2677 the simple bar line which would have been inserted there
2678 automatically. When they do not coincide with the end of a measure
2679 the specified bar line is inserted at that point in the printed
2682 Note that manual bar lines are purely visual. They do not affect
2683 any of the properties that a normal bar line would affect, such as
2684 measure numbers, accidentals, line breaks, etc. They do not affect
2685 the calculation and placement of subsequent automatic bar lines.
2686 When a manual bar line is placed where a normal bar line already
2687 exists, the effects of the original bar line are not altered.
2689 Two types of simple bar lines and five types of double bar lines are
2690 available for manual insertion:
2692 @lilypond[quote,relative=1,verbatim]
2704 together with dotted and dashed bar lines:
2706 @lilypond[quote,relative=1,verbatim]
2713 and nine types of repeat bar lines:
2715 @lilypond[quote,relative=1,verbatim]
2728 Additionally, a bar line can be printed as a simple tick:
2729 @lilypond[quote,relative=1,verbatim]
2732 However, as such ticks are typically used in Gregorian chant, it is
2733 preferable to use @code{\divisioMinima} there instead, described in
2734 the section @ref{Divisiones} in Gregorian chant.
2736 Lilypond supports kievan notation and provides a special kievan
2738 @lilypond[quote,relative=1,verbatim]
2741 Further details of this notation are explained in
2742 @ref{Typesetting Kievan square notation}.
2746 For in-line segno signs, there are three types of bar lines which
2747 differ in their behavior at line breaks:
2749 @lilypond[quote,relative=2,verbatim]
2767 Although the bar line types signifying repeats may be inserted
2768 manually they do not in themselves cause LilyPond to recognize
2769 a repeated section. Such repeated sections are better entered
2770 using the various repeat commands (see @ref{Repeats}), which
2771 automatically print the appropriate bar lines.
2773 In addition, you can specify @code{".|:-||"}, which is equivalent to
2774 @code{".|:"} except at line breaks, where it gives a double bar
2775 line at the end of the line and a start repeat at the beginning of
2778 @lilypond[quote,relative=2,verbatim]
2786 For combinations of repeats with the segno sign, there are six different
2789 @lilypond[quote,relative=2,verbatim]
2817 Additionally there is an @code{\inStaffSegno} command which creates
2818 a segno bar line in conjunction with an appropriate repeat bar line
2819 when used with a @code{\repeat volta} command, see
2820 @ref{Normal repeats}.
2822 @funindex \defineBarLine
2823 @funindex defineBarLine
2824 @cindex bar lines, defining
2825 @cindex defining bar lines
2827 New bar line types can be defined with @code{\defineBarLine}:
2830 \defineBarLine @var{bartype} #'(@var{end} @var{begin} @var{span})
2833 The @code{\defineBarline} variables can include the
2834 @q{empty} string @code{""}, which is equivalent to an invisible
2835 bar line being printed. Or they can be set to @code{#f} which
2836 prints no bar line at all.
2838 After the definiton, the new bar line can be used by
2839 @code{\bar} @var{bartype}.
2841 There are currently ten bar line elements available:
2843 @lilypond[quote,verbatim]
2844 \defineBarLine ":" #'("" ":" "")
2845 \defineBarLine "=" #'("=" "" "")
2846 \defineBarLine "[" #'("" "[" "")
2847 \defineBarLine "]" #'("]" "" "")
2864 The @code{"="} bar line provides the double span bar line, used
2865 in combination with the segno sign. Do not use it as a standalone
2866 double thin bar line; here, @code{\bar} @var{"||"} is
2869 The @code{"-"} sign starts annotations to bar lines which
2870 are useful to distinguish those with identical appearance
2871 but different behavior at line breaks and/or different span bars.
2872 The part following the @code{"-"} sign is not used for building up
2875 @lilypond[quote,relative=2,verbatim]
2876 \defineBarLine "||-dashedSpan" #'("||" "" "!!")
2881 c1 \bar "||-dashedSpan"
2892 Furthermore, the space character @code{" "} serves as a placeholder
2893 for defining span bars correctly aligned to the main bar lines:
2895 @lilypond[quote,relative=2,verbatim]
2896 \defineBarLine ":|.-wrong" #'(":|." "" "|.")
2897 \defineBarLine ":|.-right" #'(":|." "" " |.")
2913 If additional elements are needed, LilyPond provides a simple
2914 way to define them. For more informations on modifying or adding
2915 bar lines, see file @file{scm/bar-line.scm}.
2917 In scores with many staves, a @code{\bar} command in one staff is
2918 automatically applied to all staves. The resulting bar lines are
2919 connected between different staves of a @code{StaffGroup},
2920 @code{PianoStaff}, or @code{GrandStaff}.
2922 @lilypond[quote,relative=1,verbatim]
2930 \new Staff { \clef bass c4 g e g }
2932 \new Staff { \clef bass c2 c2 }
2937 @cindex default bar lines, changing
2938 @cindex bar lines, default, changing
2941 @funindex defaultBarType
2946 The command @samp{\bar @var{bartype}} is a shortcut for
2947 @samp{\set Timing.whichBar = @var{bartype}}. A bar line is
2948 created whenever the @code{whichBar} property is set.
2950 The default bar type used for automatically inserted bar lines is
2951 @code{"|"}. This may be changed at any time with
2952 @samp{\set Timing.defaultBarType = @var{bartype}}.
2956 @ref{Line breaking},
2958 @ref{Grouping staves}.
2961 @file{scm/bar-line.scm}.
2966 Internals Reference:
2967 @rinternals{BarLine} (created at @code{Staff} level),
2968 @rinternals{SpanBar} (across staves),
2969 @rinternals{Timing_translator} (for Timing properties).
2973 @unnumberedsubsubsec Bar numbers
2976 @cindex measure numbers
2977 @cindex numbers, bar
2978 @cindex numbers, measure
2980 @funindex currentBarNumber
2982 Bar numbers are typeset by default at the start of every line except
2983 the first line. The number itself is stored in the
2984 @code{currentBarNumber} property, which is normally updated
2985 automatically for every measure. It may also be set manually:
2987 @lilypond[verbatim,quote,relative=1]
2990 \set Score.currentBarNumber = #50
2994 @cindex bar numbers, regular spacing
2996 @funindex barNumberVisibility
2999 Bar numbers can be typeset at regular intervals instead of just at
3000 the beginning of every line. To do this the default behavior
3001 must be overridden to permit bar numbers to be printed at places
3002 other than the start of a line. This is controlled by the
3003 @code{break-visibility} property of @code{BarNumber}. This takes
3004 three values which may be set to @code{#t} or @code{#f} to specify
3005 whether the corresponding bar number is visible or not. The order
3006 of the three values is @code{end of line visible}, @code{middle of
3007 line visible}, @code{beginning of line visible}. In the following
3008 example bar numbers are printed at all possible places:
3010 @lilypond[verbatim,quote,relative=1]
3011 \override Score.BarNumber.break-visibility = ##(#t #t #t)
3012 \set Score.currentBarNumber = #11
3013 % Permit first bar number to be printed
3021 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3022 {printing-the-bar-number-for-the-first-measure.ly}
3024 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3025 {printing-bar-numbers-at-regular-intervals.ly}
3027 @cindex measure number, format
3028 @cindex bar number, format
3030 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3031 {printing-bar-numbers-inside-boxes-or-circles.ly}
3033 @cindex bar numbers, with letters
3034 @cindex bar numbers, with repeats
3036 @lilypondfile[verbatim,quote,texidoc,doctitle]
3037 {alternative-bar-numbering.ly}
3039 @cindex bar number alignment
3041 @lilypondfile[verbatim,quote,texidoc,doctitle]
3042 {aligning-bar-numbers.ly}
3044 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3045 {removing-bar-numbers-from-a-score.ly}
3051 Internals Reference:
3052 @rinternals{BarNumber},
3053 @rinternals{Bar_number_engraver}.
3055 @cindex bar number collision
3056 @cindex collision, bar number
3059 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
3060 if there is one. To solve this, the @code{padding} property of
3061 @code{BarNumber} can be used to position the number correctly. See
3062 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
3065 @node Bar and bar number checks
3066 @unnumberedsubsubsec Bar and bar number checks
3069 @cindex bar number check
3070 @cindex measure check
3071 @cindex measure number check
3073 @funindex barCheckSynchronize
3076 Bar checks help detect errors in the entered durations. A bar check
3077 may be entered using the bar symbol, @code{|}, at any place where a
3078 bar line is expected to fall. If bar check lines are encountered at
3079 other places, a list of warnings is printed in the log file, showing
3080 the line numbers and lines in which the bar checks failed. In the
3081 next example, the second bar check will signal an error.
3084 \time 3/4 c2 e4 | g2 |
3087 Bar checks can also be used in lyrics:
3092 Twin -- kle | Twin -- kle |
3096 An incorrect duration can result in a completely garbled score,
3097 especially if the score is polyphonic, so a good place to start
3098 correcting input is by scanning for failed bar checks and
3099 incorrect durations.
3101 If successive bar checks are off by the same musical interval,
3102 only the first warning message is displayed. This allows the
3103 warning to focus on the source of the timing error.
3109 It is also possible to redefine the action taken when a bar check
3110 or pipe symbol, @code{|}, is encountered in the input, so that
3111 it does something other than a bar check. This is done by
3112 assigning a music expression to @code{"|"}.
3113 In the following example @code{|} is set to insert a double bar
3114 line wherever it appears in the input, rather than checking
3117 @lilypond[quote,verbatim]
3127 @funindex \barNumberCheck
3128 @funindex barNumberCheck
3130 When copying large pieces of music, it can be helpful to check that
3131 the LilyPond bar number corresponds to the original that you are
3132 entering from. This can be checked with @code{\barNumberCheck}, for
3136 \barNumberCheck #123
3140 will print a warning if the @code{currentBarNumber} is not 123
3141 when it is processed.
3148 @node Rehearsal marks
3149 @unnumberedsubsubsec Rehearsal marks
3151 @cindex rehearsal marks
3152 @cindex mark, rehearsal
3157 To print a rehearsal mark, use the @code{\mark} command.
3159 @lilypond[quote,verbatim,relative=2]
3167 The mark is incremented automatically if you use @code{\mark
3168 \default}, but you can also use an integer argument to set the
3169 mark manually. The value to use is stored in the property
3170 @code{rehearsalMark}.
3172 @lilypond[quote,verbatim,relative=2]
3181 The letter@tie{}@q{I} is skipped in accordance with engraving
3182 traditions. If you wish to include the letter @q{I}, then use one
3183 of the following commands, depending on which style of rehearsal mark
3184 you want (letters only, letters in a hollow box, or letters in a
3188 \set Score.markFormatter = #format-mark-alphabet
3189 \set Score.markFormatter = #format-mark-box-alphabet
3190 \set Score.markFormatter = #format-mark-circle-alphabet
3193 @lilypond[quote,verbatim,relative=2]
3194 \set Score.markFormatter = #format-mark-box-alphabet
3202 @cindex rehearsal mark format
3203 @cindex rehearsal mark style
3204 @cindex style, rehearsal mark
3205 @cindex format, rehearsal mark
3206 @cindex mark, rehearsal, style
3207 @cindex mark, rehearsal, format
3208 @cindex rehearsal mark, manual
3209 @cindex mark, rehearsal, manual
3210 @cindex custom rehearsal mark
3211 @cindex manual rehearsal mark
3213 The style is defined by the property @code{markFormatter}. It is
3214 a function taking the current mark (an integer) and the current
3215 context as argument. It should return a markup object. In the
3216 following example, @code{markFormatter} is set to a pre-defined
3217 procedure. After a few measures, it is set to a procedure that
3218 produces a boxed number.
3220 @lilypond[quote,verbatim,relative=2]
3221 \set Score.markFormatter = #format-mark-numbers
3224 \set Score.markFormatter = #format-mark-box-numbers
3226 \set Score.markFormatter = #format-mark-circle-numbers
3228 \set Score.markFormatter = #format-mark-circle-letters
3232 The file @file{scm/translation-functions.scm} contains the
3233 definitions of @code{format-mark-numbers} (the default format),
3234 @code{format-mark-box-numbers}, @code{format-mark-letters} and
3235 @code{format-mark-box-letters}. These can be used as inspiration
3236 for other formatting functions.
3238 You may use @code{format-mark-barnumbers},
3239 @code{format-mark-box-barnumbers}, and
3240 @code{format-mark-circle-barnumbers} to get bar numbers instead of
3241 incremented numbers or letters.
3243 Other styles of rehearsal mark can be specified manually:
3250 Note that @code{Score.markFormatter} does not affect marks specified
3251 in this manner. However, it is possible to apply a @code{\markup} to the
3255 \mark \markup@{ \box A1 @}
3260 @cindex D.S. al Fine
3262 @cindex music glyphs
3263 @cindex glyphs, music
3265 @funindex \musicglyph
3266 @funindex musicglyph
3268 Music glyphs (such as the segno sign) may be printed inside a
3271 @lilypond[quote,verbatim,relative=1]
3272 c1 \mark \markup { \musicglyph #"scripts.segno" }
3273 c1 \mark \markup { \musicglyph #"scripts.coda" }
3274 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
3279 See @ref{The Feta font}, for a list of symbols which may be
3280 printed with @code{\musicglyph}.
3282 For common tweaks to the positioning of rehearsal marks, see
3283 @ref{Formatting text}. For more precise control, see
3284 @code{break-alignable-interface} in @ref{Aligning objects}.
3286 The file @file{scm/translation-functions.scm} contains
3287 the definitions of @code{format-mark-numbers} and
3288 @code{format-mark-letters}. They can be used as inspiration for
3289 other formatting functions.
3293 @ref{The Feta font},
3294 @ref{Formatting text},
3295 @ref{Aligning objects}.
3298 @file{scm/translation-functions.scm}.
3303 Internals Reference:
3304 @rinternals{MarkEvent},
3305 @rinternals{Mark_engraver},
3306 @rinternals{RehearsalMark}.
3309 @node Special rhythmic concerns
3310 @subsection Special rhythmic concerns
3315 * Aligning to cadenzas::
3316 * Time administration::
3320 @unnumberedsubsubsec Grace notes
3324 @cindex appoggiatura
3325 @cindex acciaccatura
3328 @funindex \slashedGrace
3329 @funindex \acciaccatura
3330 @funindex \appoggiatura
3332 Grace notes are musical ornaments, printed in a smaller font, that take
3333 up no additional logical time in a measure.
3335 @lilypond[quote,relative=2,verbatim]
3337 \grace { b16 c16 } a2)
3340 There are three other types of grace notes possible; the
3341 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
3342 note with a slashed stem -- and the @emph{appoggiatura}, which takes a
3343 fixed fraction of the main note it is attached to and prints without the
3344 slash. It is also possible to write a grace note with a slashed stem,
3345 like the @emph{acciaccatura} but without the slur, so as to place it
3346 between notes that are slurred themselves, using the
3347 @code{\slashedGrace} function.
3349 @lilypond[quote,relative=2,verbatim]
3352 \acciaccatura { g16 f } e2
3353 \slashedGrace a,8 g4
3354 \slashedGrace b16 a4(
3355 \slashedGrace b8 a2)
3358 The placement of grace notes is synchronized between different staves.
3359 In the following example, there are two sixteenth grace notes for every
3362 @lilypond[quote,relative=2,verbatim]
3364 \new Staff { e2 \grace { c16 d e f } e2 }
3365 \new Staff { c2 \grace { g8 b } c2 }
3369 @cindex grace notes, following
3371 @funindex \afterGrace
3372 @funindex afterGrace
3374 If you want to end a note with a grace, use the @code{\afterGrace}
3375 command. It takes two arguments: the main note, and the grace
3376 notes following the main note.
3378 @lilypond[quote,verbatim,relative=2]
3379 c1 \afterGrace d1 { c16[ d] } c1
3382 This will put the grace notes after a space lasting 3/4 of the
3383 length of the main note. The default fraction 3/4 can be changed by
3384 setting @code{afterGraceFraction}. The following example shows
3385 the results from setting the space at the default, at 15/16, and
3386 finally at 1/2 of the main note.
3388 @lilypond[quote,verbatim,relative=2]
3391 c1 \afterGrace d1 { c16[ d] } c1
3394 #(define afterGraceFraction (cons 15 16))
3395 c1 \afterGrace d1 { c16[ d] } c1
3398 #(define afterGraceFraction (cons 1 2))
3399 c1 \afterGrace d1 { c16[ d] } c1
3404 The space between the main note and the grace note may also be
3405 specified using spacers. The following example places the grace
3406 note after a space lasting 7/8 of the main note.
3408 @lilypond[quote,verbatim,relative=2]
3412 { s2 s4. \grace { c16 d } }
3418 @cindex tweaking grace notes
3419 @cindex grace notes, tweaking
3420 @cindex grace notes, changing layout settings
3422 A @code{\grace} music expression will introduce special
3423 typesetting settings, for example, to produce smaller type, and
3424 set directions. Hence, when introducing layout tweaks to
3425 override the special settings, they should be placed inside
3426 the grace expression. The overrides should also be reverted
3427 inside the grace expression. Here, the grace note's default stem
3428 direction is overridden and then reverted.
3430 @lilypond[quote,verbatim,relative=2]
3442 @cindex stem, with slash
3447 @lilypondfile[verbatim,quote,texidoc,doctitle]
3448 {using-grace-note-slashes-with-normal-heads.ly}
3450 @lilypondfile[verbatim,quote,texidoc,doctitle]
3451 {tweaking-grace-layout-within-music.ly}
3453 @lilypondfile[verbatim,quote,texidoc,doctitle]
3454 {redefining-grace-note-global-defaults.ly}
3456 @lilypondfile[verbatim,quote,texidoc,doctitle]
3457 {positioning-grace-notes-with-floating-space.ly}
3461 @rglos{grace notes},
3462 @rglos{acciaccatura},
3463 @rglos{appoggiatura}.
3466 @ref{Scaling durations},
3470 @file{ly/grace-init.ly}.
3475 Internals Reference:
3476 @rinternals{GraceMusic},
3477 @rinternals{Grace_beam_engraver},
3478 @rinternals{Grace_auto_beam_engraver},
3479 @rinternals{Grace_engraver},
3480 @rinternals{Grace_spacing_engraver}.
3484 @cindex acciaccatura, multi-note
3485 @cindex multi-note acciaccatura
3486 @cindex grace-note synchronization
3488 A multi-note beamed @i{acciaccatura} is printed without a slash,
3489 and looks exactly the same as a multi-note beamed
3492 @c TODO Add link to LSR snippet to add slash when available
3494 Grace note synchronization can also lead to surprises. Staff
3495 notation, such as key signatures, bar lines, etc., are also
3496 synchronized. Take care when you mix staves with grace notes and
3497 staves without, for example,
3499 @lilypond[quote,relative=2,verbatim]
3501 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3502 \new Staff { c4 \bar ".|:" d2. }
3507 This can be remedied by inserting grace skips of the corresponding
3508 durations in the other staves. For the above example
3510 @lilypond[quote,relative=2,verbatim]
3512 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3513 \new Staff { c4 \bar ".|:" \grace s16 d2. }
3517 Please make sure that you use the @code{\grace} command for the
3518 spacer part, even if the visual part uses @code{\acciaccatura} or
3519 @code{\appoggiatura} because otherwise an ugly slur fragment will
3520 be printed, connecting the invisible grace note with the following
3523 The use of grace notes within voice contexts confuses the way the voice
3524 is typeset. This can be overcome by inserting a rest or note between the
3525 voice command and the grace note.
3527 @lilypond[quote,verbatim]
3529 \acciaccatura { f8 } e8 r8 \acciaccatura { f8 } e8 r4
3536 r8 r8 \voiceOne \accMusic \oneVoice r8 |
3537 r8 \voiceOne r8 \accMusic \oneVoice r8 |
3542 s8 s8 \voiceTwo \accMusic \oneVoice s8 |
3543 s8 \voiceTwo r8 \accMusic \oneVoice s8 |
3550 Grace sections should only be used within sequential music expressions.
3551 Nesting or juxtaposing grace sections is not supported, and might
3552 produce crashes or other errors.
3554 Each grace note in MIDI output has a length of 1/4 of its actual
3555 duration. If the combined length of the grace notes is greater than the
3556 length of the preceding note a @qq{@code{Going back in MIDI time}}
3557 error will be generated. Either make the grace notes shorter in
3558 duration, for example:
3561 c'8 \acciaccatura @{ c'8[ d' e' f' g'] @}
3567 c'8 \acciaccatura @{ c'16[ d' e' f' g'] @}
3570 Or explicitly change the musical duration:
3573 c'8 \acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
3576 See @ref{Scaling durations}.
3579 @node Aligning to cadenzas
3580 @unnumberedsubsubsec Aligning to cadenzas
3583 @cindex cadenza, aligning to
3584 @cindex aligning to cadenza
3586 In an orchestral context, cadenzas present a special problem: when
3587 constructing a score that includes a measured cadenza or other solo
3588 passage, all other instruments should skip just as many notes as the
3589 length of the cadenza, otherwise they will start too soon or too late.
3591 One solution to this problem is to use the functions
3592 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
3593 functions take a defined piece of music as an argument and generate a
3594 multi-measure rest or @code{\skip} exactly as long as the piece.
3596 @lilypond[verbatim,quote]
3597 MyCadenza = \relative c' {
3608 #(mmrest-of-length MyCadenza)
3610 #(skip-of-length MyCadenza)
3624 @node Time administration
3625 @unnumberedsubsubsec Time administration
3627 @cindex time administration
3628 @cindex timing (within the score)
3629 @cindex music, unmetered
3630 @cindex unmetered music
3632 @funindex currentBarNumber
3633 @funindex measurePosition
3634 @funindex measureLength
3636 Time is administered by the @code{Timing_translator}, which by
3637 default is to be found in the @code{Score} context. An alias,
3638 @code{Timing}, is added to the context in which the
3639 @code{Timing_translator} is placed. To ensure that the
3640 @code{Timing} alias is available, you may need to explicitly
3641 instantiate the containing context (such as @code{Voice} or
3644 The following properties of @code{Timing} are used
3645 to keep track of timing within the score.
3648 @cindex measure number
3651 @item currentBarNumber
3652 The current measure number. For an example showing the
3653 use of this property see @ref{Bar numbers}.
3656 The length of the measures in the current time signature. For a
3657 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
3658 determines when bar lines are inserted and how automatic beams
3659 should be generated.
3661 @item measurePosition
3662 The point within the measure where we currently are. This
3663 quantity is reset by subtracting @code{measureLength} whenever
3664 @code{measureLength} is reached or exceeded. When that happens,
3665 @code{currentBarNumber} is incremented.
3668 If set to true, the above variables are updated for every time
3669 step. When set to false, the engraver stays in the current
3670 measure indefinitely.
3674 Timing can be changed by setting any of these variables
3675 explicitly. In the next example, the default 4/4 time
3676 signature is printed, but @code{measureLength} is set to 5/4.
3677 At 4/8 through the third measure, the @code{measurePosition} is
3678 advanced by 1/8 to 5/8, shortening that bar by 1/8.
3679 The next bar line then falls at 9/8 rather than 5/4.
3681 @lilypond[quote,verbatim]
3682 \new Voice \relative c' {
3683 \set Timing.measureLength = #(ly:make-moment 5/4)
3687 \set Timing.measurePosition = #(ly:make-moment 5/8)
3694 As the example illustrates, @code{ly:make-moment n m} constructs a
3695 duration of n/m of a whole note. For example,
3696 @code{ly:make-moment 1 8} is an eighth note duration and
3697 @code{ly:make-moment 7 16} is the duration of seven sixteenths
3703 @ref{Unmetered music}.
3708 Internals Reference:
3709 @rinternals{Timing_translator},