1 @c -*- coding: utf-8; mode: texinfo; -*-
3 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 When revising a translation, copy the HEAD committish of the
6 version that you are working on. For details, see the Contributors'
7 Guide, node Updating translation committishes..
15 @lilypondfile[quote]{rhythms-headword.ly}
17 This section discusses rhythms, rests, durations, beaming and bars.
22 * Displaying rhythms::
25 * Special rhythmic concerns::
30 @subsection Writing rhythms
40 @unnumberedsubsubsec Durations
42 @cindex durations, of notes
43 @cindex note durations
44 @cindex length of notes
54 Durations are designated by numbers and dots. Durations are entered
55 as their reciprocal values. For example, a quarter note is entered
56 using a @code{4} (since it is a 1/4 note), and a half note is entered
57 using a @code{2} (since it is a 1/2 note). For notes longer than a
58 whole you must use the @code{\longa} (a double breve) and
59 @code{\breve} commands. Durations as short as 128th notes may be
60 specified. Shorter values are possible, but only as beamed notes.
62 @c Two 64th notes are needed to obtain beams
63 @lilypond[quote,verbatim,relative=2]
66 c4 c8 c16 c32 c64 c128 c128
69 Here are the same durations with automatic beaming turned off.
71 @c not strictly "writing rhythms"; more of a "displaying" thing,
72 @c but it's ok here. -gp
73 @lilypond[quote,verbatim,relative=2]
77 c4 c8 c16 c32 c64 c128 c128
80 A note with the duration of a quadruple breve may be entered with
81 @code{\maxima}, but this is supported only within ancient music
82 notation. For details, see @ref{Ancient notation}.
84 @cindex duration, default
85 @cindex default note duration
86 @cindex note duration, default
88 If the duration is omitted, it is set to the previously
89 entered duration. The default for the first note is a quarter
92 @lilypond[quote,verbatim,relative=2]
98 @cindex notes, double-dotted
99 @cindex double-dotted notes
103 To obtain dotted note lengths, place a dot (@code{.}) after the
104 duration. Double-dotted notes are specified by appending two
107 @lilypond[quote,verbatim,relative=2]
108 a4 b c4. b8 a4. b4.. c8.
111 Some durations cannot be represented with just binary durations
112 and dots; they can be represented only by tying two or more
113 notes together. For details, see @ref{Ties}.
115 For ways of specifying durations for the syllables of lyrics and
116 ways of aligning lyrics to notes, see @ref{Vocal music}.
118 Optionally, notes can be spaced strictly proportionately to their
119 duration. For details of this and other settings which control
120 proportional notation, see @ref{Proportional notation}.
126 @funindex \dotsNeutral
127 @funindex dotsNeutral
129 Dots are normally moved up to avoid staff lines, except in
130 polyphonic situations. Dots may be manually placed above or below
131 the staff; see @ref{Direction and placement}.
145 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
146 {alternative-breve-note.ly}
148 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
149 {changing-the-number-of-augmentation-dots-per-note.ly}
157 @rglos{Duration names notes and rests}.
160 @ref{Automatic beams},
163 @ref{Writing rhythms},
166 @ref{Ancient notation},
167 @ref{Proportional notation}.
174 @rinternals{DotColumn}.
177 @c Deliberately duplicated in Durations and Rests. -gp
178 There is no fundamental limit to rest durations (both in terms of
179 longest and shortest), but the number of glyphs is limited:
180 rests from 128th to maxima (8 x whole) may be printed.
184 @unnumberedsubsubsec Tuplets
192 Tuplets are made from a music expression by multiplying all the
193 durations with a fraction:
196 \times @var{fraction} @{ @var{music} @}
200 The duration of @code{@var{music}} will be multiplied by the
201 fraction. The fraction's denominator will be printed over or
202 under the notes, optionally with a bracket. The most common
203 tuplet is the triplet in which 3 notes have the duration of 2, so
204 the notes are 2/3 of their written length.
206 @lilypond[quote,verbatim,relative=2]
207 a2 \times 2/3 { b4 b b }
208 c4 c \times 2/3 { b4 a g }
211 @cindex tuplet bracket placement
215 @funindex \tupletDown
217 @funindex \tupletNeutral
218 @funindex tupletNeutral
220 Tuplet brackets may be manually placed above or below the staff;
221 see @ref{Direction and placement}.
223 Tuplets may be nested:
225 @lilypond[quote,verbatim,relative=2]
227 c4 \times 4/5 { f8 e f \times 2/3 { e[ f g] } } f4
230 Modifying nested tuplets which begin at the same musical moment
231 must be done with @code{\tweak}.
233 To modify the duration of notes without printing a tuplet bracket,
234 see @ref{Scaling durations}.
240 @code{\tupletNeutral}.
246 @cindex tuplet formatting
247 @cindex triplet formatting
249 @funindex tupletNumberFormatFunction
250 @funindex tupletSpannerDuration
252 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
253 {entering-several-tuplets-using-only-one--times-command.ly}
255 @cindex Tuplet number changes
257 @funindex TupletNumber
259 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
260 {changing-the-tuplet-number.ly}
262 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
263 {non-default-tuplet-numbers.ly}
265 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
266 {controlling-tuplet-bracket-visibility.ly}
268 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
269 {permitting-line-breaks-within-beamed-tuplets.ly}
278 @rlearning{Tweaking methods}.
281 @ref{Time administration},
282 @ref{Scaling durations},
283 @ref{The tweak command},
284 @ref{Polymetric notation}.
290 @rinternals{TupletBracket},
291 @rinternals{TupletNumber},
292 @rinternals{TimeScaledMusic}.
294 @cindex grace notes within tuplet brackets
297 Grace notes may be placed within tuplet brackets, @emph{except}
298 when a staff begins with a grace note followed by a tuplet. In this
299 particular case, the grace note must be placed before the @code{\times}
300 command to avoid errors.
302 @cindex tempo marks within tuplet brackets
304 When using a tuplet at the beginning of a piece with a @code{\tempo}
305 mark, the music must be explicitly entered in a @code{\new Voice}
306 block, as discussed in @rlearning{Voices contain music}.
309 @node Scaling durations
310 @unnumberedsubsubsec Scaling durations
312 @cindex scaling durations
313 @cindex durations, scaling
315 You can alter the duration of single notes, rests or chords by a
316 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
317 is 1) to the duration. This will not affect the appearance of the
318 notes or rests produced, but the altered duration will be used in
319 calculating the position within the measure and setting the duration
320 in the MIDI output. Multiplying factors may be combined like
321 @code{*L*M/N}. Factors are part of the duration: if
322 you don't specify a duration for subsequent notes, the default
323 duration taken from the preceding note includes any scaling factor.
325 In the following example, the first three notes take up exactly
326 two beats, but no triplet bracket is printed.
328 @lilypond[quote,relative=2,verbatim]
330 % Alter durations to triplets
334 % Double the duration of chord
336 % Duration of quarter, appears like sixteenth
340 The duration of spacer rests may also be modified by
341 a multiplier. This is useful for skipping many measures, e.g.,
344 @cindex compressing music
345 @cindex expanding music
347 @funindex \scaleDurations
348 @funindex scaleDurations
350 Longer stretches of music may be compressed by a fraction in the
351 same way, as if every note, chord or rest had the fraction as a
352 multiplier. This leaves the appearance of the music unchanged but
353 the internal duration of the notes will be multiplied by the
354 fraction @emph{num}/@emph{den}. Here is an example showing how music
355 can be compressed and expanded:
357 @lilypond[quote,relative=2,verbatim]
361 % Scale music by *2/3
362 \scaleDurations 2/3 {
366 \scaleDurations 2/1 {
371 One application of this command is in polymetric
372 notation, see @ref{Polymetric notation}.
377 @ref{Invisible rests},
378 @ref{Polymetric notation}.
385 @unnumberedsubsubsec Ties
391 A tie connects two adjacent note heads of the same pitch. The tie
392 in effect extends the duration of a note.
394 @warning{Ties should not be confused with @emph{slurs}, which
395 indicate articulation, or @emph{phrasing slurs}, which indicate
396 musical phrasing. A tie is just a way of extending a note
397 duration, similar to the augmentation dot.}
399 A tie is entered using the tilde symbol (@code{~}).
401 @lilypond[quote,verbatim,relative=2]
405 Ties are used either when the note crosses a bar line, or when
406 dots cannot be used to denote the rhythm. Ties should also be
407 used when note values cross larger subdivisions of the measure:
409 @lilypond[verbatim,quote]
416 If you need to tie many notes across bar lines, it may be
417 easier to use automatic note splitting, see @ref{Automatic note
418 splitting}. This mechanism automatically splits long notes, and
419 ties them across bar lines.
421 @cindex ties and chords
422 @cindex chords and ties
424 When a tie is applied to a chord, all note heads whose pitches
425 match are connected. When no note heads match, no ties will be
426 created. Chords may be partially tied by placing the tie inside
429 @lilypond[quote,verbatim,relative=1]
431 <c~ e g~ b> <c e g b>
434 @cindex repeating ties
435 @cindex ties, repeating
436 @cindex volta brackets and ties
437 @cindex ties and volta brackets
442 When a second alternative of a repeat starts with a tied note, you
443 have to specify the repeated tie as follows:
445 @lilypond[quote,relative=2,verbatim]
446 \repeat volta 2 { c g <c e>2 ~ }
448 % First alternative: following note is tied normally
450 % Second alternative: following note has a repeated tie
451 { <c e>2\repeatTie d4 c } }
454 @cindex laissez vibrer
455 @cindex ties, laissez vibrer
457 @funindex \laissezVibrer
458 @funindex laissezVibrer
460 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
461 notes must not be damped at the end. It is used in notation for
462 piano, harp and other string and percussion instruments. They can
463 be entered as follows:
465 @lilypond[quote,verbatim,relative=1]
466 <c f g>1\laissezVibrer
469 @cindex ties, placement
475 @funindex \tieNeutral
478 Ties may be manually placed above or below the staff; see
479 @ref{Direction and placement}.
481 @cindex ties, appearance
494 Ties may be made dashed, dotted, or a combination of solid and
497 @lilypond[quote, verbatim, relative=1]
510 Custom dash patterns can be specified:
512 @lilypond[quote, verbatim, relative=1]
513 \tieDashPattern #0.3 #0.75
515 \tieDashPattern #0.7 #1.5
521 Dash pattern definitions for ties have the same structure as dash
522 pattern definitions for slurs. For more information about complex dash
523 patterns, see @ref{Slurs}.
525 Override @var{whiteout} and @var{layer} layout properties for ties that
526 collide with other objects in a staff.
528 @lilypond[verbatim,quote,ragged-right,relative=2]
529 \override Tie #'layer = #-2
530 \override Staff.TimeSignature #'layer = #-1
531 \override Staff.KeySignature #'layer = #-1
532 \override Staff.TimeSignature #'whiteout = ##t
533 \override Staff.KeySignature #'whiteout = ##t
546 @code{\tieDashPattern},
547 @code{\tieHalfDashed},
548 @code{\tieHalfSolid},
554 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
555 {using-ties-with-arpeggios.ly}
557 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
558 {engraving-ties-manually.ly}
563 @rglos{laissez vibrer}.
567 @ref{Automatic note splitting}.
570 @rlsr{Expressive marks},
574 @rinternals{LaissezVibrerTie},
575 @rinternals{LaissezVibrerTieColumn},
576 @rinternals{TieColumn},
580 Switching staves when a tie is active will not produce a slanted tie.
582 Changing clefs or ottavations during a tie is not really well-defined.
583 In these cases, a slur may be preferable.
587 @subsection Writing rests
589 Rests are entered as part of the music in music expressions.
594 * Full measure rests::
598 @unnumberedsubsubsec Rests
601 @cindex rest, entering durations
616 Rests are entered like notes with the note name @code{r}.
617 Durations longer than a whole rest use the following predefined
620 @c \time 16/1 is used to avoid spurious bar lines
621 @c and long tracts of empty measures
622 @lilypond[quote,verbatim,relative=2]
624 % These two lines are just to prettify this example
626 \override Staff.TimeSignature #'stencil = ##f
627 % Print a maxima rest, equal to four breves
629 % Print a longa rest, equal to two breves
633 r1 r2 r4 r8 r16 r32 r64 r128
637 @cindex rest, multi-measure
638 @cindex rest, whole-measure
640 Whole measure rests, centered in the middle of the measure, must be
641 entered as multi-measure rests. They can be used for a single
642 measure as well as many measures and are discussed in
643 @ref{Full measure rests}.
645 @cindex rest, specifying vertical position
647 To explicitly specify a rest's vertical position, write a note
648 followed by @code{\rest}. A rest of the duration of the note will
649 be placed at the staff position where the note would appear. This
650 allows for precise manual formatting of polyphonic music, since the
651 automatic rest collision formatter will not move these rests.
653 @lilypond[quote,verbatim,relative=2]
659 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
669 @ref{Full measure rests}.
678 @c Deliberately duplicated in Durations and Rests. -gp
679 There is no fundamental limit to rest durations (both in terms of
680 longest and shortest), but the number of glyphs is limited: there
681 are rests from 128th to maxima (8 x whole).
684 @node Invisible rests
685 @unnumberedsubsubsec Invisible rests
688 @cindex invisible rest
689 @cindex rest, invisible
697 An invisible rest (also called a @q{spacer rest}) can be entered
698 like a note with the note name@tie{}@code{s}:
700 @lilypond[verbatim,quote,relative=2]
707 Spacer rests are available only in note mode and chord mode. In
708 other situations, for example, when entering lyrics, the
709 command @code{\skip} is used to skip a musical moment.
710 @code{\skip} requires an explicit duration, but this is ignored if
711 the lyrics derive their durations from the notes in an associated
712 melody through @code{\addlyrics} or @code{\lyricsto}.
714 @lilypond[quote,verbatim,relative=2]
727 Because @code{\skip} is a command, it does not affect the default
728 durations of following notes, unlike@tie{}@code{s}.
730 @lilypond[quote,verbatim,relative=2]
733 \repeat unfold 8 { a4 }
743 A spacer rest implicitly causes @code{Staff} and @code{Voice}
744 contexts to be created if none exist, just like notes and rests
747 @lilypond[quote,verbatim,relative=2]
751 @code{\skip} simply skips musical time; it creates no output of
754 @lilypond[quote,verbatim,relative=2]
755 % This is valid input, but does nothing
756 \skip 1 \skip1 \skip 1
761 @rlearning{Visibility and color of objects}.
765 @ref{Visibility of objects}.
771 @rinternals{SkipMusic}.
774 @node Full measure rests
775 @unnumberedsubsubsec Full measure rests
777 @cindex multi-measure rests
778 @cindex full-measure rests
779 @cindex rest, multi-measure
780 @cindex rest, full-measure
781 @cindex whole rest for a full measure
782 @cindex rest, whole for a full measure
786 Rests for one or more full measures are entered like notes with
787 the note name uppercase @code{R}:
789 @lilypond[quote,verbatim,relative=2]
790 % Rest measures contracted to single measure
791 \compressFullBarRests
798 The duration of full-measure rests is identical to the duration
799 notation used for notes. The duration in a multi-measure rest must
800 always be an integral number of measure-lengths, so augmentation dots
801 or fractions must often be used:
803 @lilypond[quote,verbatim,relative=2]
804 \compressFullBarRests
810 R1*13/8 | R1*13/8*12 |
815 A full-measure rest is printed as either a whole or breve rest,
816 centered in the measure, depending on the time signature.
818 @lilypond[quote,verbatim,relative=2]
827 @cindex multi-measure rest, expanding
828 @cindex multi-measure rest, contracting
830 @funindex \expandFullBarRests
831 @funindex expandFullBarRests
832 @funindex \compressFullBarRests
833 @funindex compressFullBarRests
835 By default a multi-measure rest is expanded in the printed score to
836 show all the rest measures explicitly. Alternatively, a multi-measure
837 rest can be shown as a single measure containing a multi-measure rest
838 symbol, with the number of measures of rest printed above the measure:
840 @lilypond[quote,verbatim,relative=2]
842 \time 3/4 r2. | R2.*2 |
845 % Rest measures contracted to single measure
846 \compressFullBarRests
848 % Rest measures expanded
855 @cindex text on multi-measure rest
856 @cindex multi-measure rest, attaching text
857 @cindex script on multi-measure rest
858 @cindex multi-measure rest, script
859 @cindex fermata on multi-measure rest
860 @cindex multi-measure rest, attaching fermata
861 @cindex markup on multi-measure rest
862 @cindex multi-measure rest with markup
864 @funindex \fermataMarkup
865 @funindex fermataMarkup
866 @funindex MultiMeasureRestText
868 Markups can be added to multi-measure rests.
869 The predefined command @code{\fermataMarkup}
870 is provided for adding fermatas.
872 @lilypond[quote,verbatim,relative=2]
873 \compressFullBarRests
875 R2.*10^\markup { \italic "ad lib." }
879 @warning{Markups attached to a multi-measure rest are objects of type
880 @code{MultiMeasureRestText}, not @code{TextScript}. Overrides must
881 be directed to the correct object, or they will be ignored. See the
884 @lilypond[quote,verbatim,relative=2]
885 % This fails, as the wrong object name is specified
886 \override TextScript #'padding = #5
888 % This is the correct object name to be specified
889 \override MultiMeasureRestText #'padding = #5
893 When a multi-measure rest immediately follows a @code{\partial}
894 setting, resulting bar-check warnings may not be displayed.
897 @funindex \textLengthOn
898 @funindex textLengthOn
899 @funindex \textLengthOff
900 @funindex textLengthOff
901 @funindex \fermataMarkup
902 @funindex fermataMarkup
903 @funindex \compressFullBarRests
904 @funindex compressFullBarRests
905 @funindex \expandFullBarRests
906 @funindex expandFullBarRests
909 @code{\textLengthOn},
910 @code{\textLengthOff},
911 @code{\fermataMarkup},
912 @code{\compressFullBarRests},
913 @code{\expandFullBarRests}.
921 @cindex kirchenpausen
923 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
924 {changing-form-of-multi-measure-rests.ly}
926 @cindex multi-measure rests, positioning
927 @cindex positioning multi-measure rests
929 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
930 {positioning-multi-measure-rests.ly}
932 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
933 {multi-measure-rest-markup.ly}
937 @rglos{multi-measure rest}.
942 @ref{Formatting text},
949 @rinternals{MultiMeasureRest},
950 @rinternals{MultiMeasureRestNumber},
951 @rinternals{MultiMeasureRestText}.
953 @cindex fingerings and multi-measure rests
954 @cindex multi-measure rests and fingerings
957 Fingerings over multi-measure rests (e.g. @code{R1*10-4}) may result
958 in the fingering numeral colliding with the bar counter
961 @cindex condensing rests
962 @cindex rest, condensing ordinary
964 There is no way to automatically condense multiple ordinary rests
965 into a single multi-measure rest.
967 @cindex rest, collisions of
969 Multi-measure rests do not take part in rest collisions.
972 @node Displaying rhythms
973 @subsection Displaying rhythms
980 * Polymetric notation::
981 * Automatic note splitting::
982 * Showing melody rhythms::
986 @unnumberedsubsubsec Time signature
988 @cindex time signature
994 The time signature is set as follows:
996 @lilypond[quote,verbatim,relative=2]
1001 @cindex time signature, visibility of
1003 Time signatures are printed at the beginning of a piece
1004 and whenever the time signature changes. If a change takes place
1005 at the end of a line a warning time signature sign is printed
1006 there. This default behavior may be changed, see
1007 @ref{Visibility of objects}.
1009 @lilypond[quote,verbatim,relative=2]
1019 @cindex time signature style
1022 @funindex \numericTimeSignature
1023 @funindex numericTimeSignature
1024 @funindex \defaultTimeSignature
1025 @funindex defaultTimeSignature
1027 The time signature symbol that is used in 2/2 and 4/4 time can be
1028 changed to a numeric style:
1030 @lilypond[quote,verbatim,relative=2]
1034 % Change to numeric style
1035 \numericTimeSignature
1038 % Revert to default style
1039 \defaultTimeSignature
1045 Mensural time signatures are covered in
1046 @ref{Mensural time signatures}.
1048 @cindex time signature default settings
1049 @cindex autobeaming properties for time signatures
1050 @cindex beaming, time signature default properties
1051 @funindex \overrideTimeSignatureSettings
1053 In addition to setting the printed time signature, the @code{\time}
1054 command also sets time-signature-based default values for the properties
1055 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}. The
1056 predefined default values for these properties can be found in
1057 @file{scm/time-signature-settings.scm}. The existing default values can
1058 be changed, or new default values can be added:
1060 @lilypond[quote,verbatim]
1064 \overrideTimeSignatureSettings
1065 4/4 % timeSignatureFraction
1066 1/4 % baseMomentFraction
1067 #'(3 1) % beatStructure
1068 #'() % beamExceptions
1070 \repeat unfold 8 { c8 } |
1076 @code{\overrideTimeSignatureSettings} takes four arguments:
1081 @code{@var{timeSignatureFraction}}, a fraction describing the
1085 @code{@var{baseMomentFraction}}, a fraction containing the numerator
1086 and denominator of the basic timing unit for the time signature.
1089 @code{@var{beatStructure}}, a Scheme list indicating the structure
1090 of the beats in the measure, in units of the base moment.
1093 @code{@var{beamExceptions}}, an alist containing any beaming rules
1094 for the time signature that go beyond ending at every beat, as
1095 described in @ref{Setting automatic beam behavior}.
1098 The context containing @code{\overrideTimeSignatureSettings} must
1099 be instantiated before the @code{\overrideTimeSignatureSettings}
1100 call is executed. That means it must either be explicitly
1101 instantiated or there must be music in the context before the
1102 @code{\overrideTimeSignatureSettings} call:
1104 @lilypond[quote,verbatim]
1107 % This call will fail because the context isn't yet instantiated
1108 \overrideTimeSignatureSettings
1109 4/4 % timeSignatureFraction
1110 1/4 % baseMomentFraction
1111 #'(3 1) % beatStructure
1112 #'() % beamExceptions
1114 c8^\markup {"Beamed (2 2)"}
1115 \repeat unfold 7 { c8 } |
1116 % This call will succeed
1117 \overrideTimeSignatureSettings
1118 4/4 % timeSignatureFraction
1119 1/4 % baseMomentFraction
1120 #'(3 1) % beatStructure
1121 #'() % beamExceptions
1123 c8^\markup {"Beamed (3 1)"}
1124 \repeat unfold 7 { c8 } |
1130 @cindex time signature properties, restoring default values
1131 @cindex restoring default properties for time signatures
1132 @funindex \revertTimeSignatureSettings
1134 Changed values of default time signature properties can be restored
1135 to the original values:
1137 @lilypond[quote,verbatim]
1140 \repeat unfold 8 { c8 } |
1141 \overrideTimeSignatureSettings
1142 4/4 % timeSignatureFraction
1143 1/4 % baseMomentFraction
1144 #'(3 1) % beatStructure
1145 #'() % beamExceptions
1147 \repeat unfold 8 { c8 } |
1148 \revertTimeSignatureSettings 4/4
1150 \repeat unfold 8 { c8 } |
1155 Different values of default time signature properties can be established
1156 for different staves by moving the @code{Timing_translator} and the
1157 @code{Default_bar_line_engraver} from the @code{Score} context to the
1158 @code{Staff} context.
1160 @lilypond[quote, verbatim]
1164 \overrideTimeSignatureSettings
1165 4/4 % timeSignatureFraction
1166 1/4 % baseMomentFraction
1167 #'(3 1) % beatStructure
1168 #'() % beamExceptions
1170 \repeat unfold 8 {c''8}
1173 \overrideTimeSignatureSettings
1174 4/4 % timeSignatureFraction
1175 1/4 % baseMomentFraction
1176 #'(1 3) % beatStructure
1177 #'() % beamExceptions
1179 \repeat unfold 8 {c''8}
1185 \remove "Timing_translator"
1186 \remove "Default_bar_line_engraver"
1190 \consists "Timing_translator"
1191 \consists "Default_bar_line_engraver"
1198 @code{\numericTimeSignature},
1199 @code{\defaultTimeSignature}.
1204 @lilypondfile[verbatim,quote,texidoc,doctitle]
1205 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1209 @rglos{time signature}
1212 @ref{Mensural time signatures},
1213 @ref{Time administration}.
1218 Internals Reference:
1219 @rinternals{TimeSignature},
1220 @rinternals{Timing_translator}.
1223 @node Metronome marks
1224 @unnumberedsubsubsec Metronome marks
1227 @cindex beats per minute
1228 @cindex metronome mark
1229 @cindex metronome marking with text
1234 A basic metronome mark is simple to write:
1236 @lilypond[verbatim,quote,relative=1]
1242 Metronome marks may also be printed as a range of two numbers:
1244 @lilypond[verbatim,quote,relative=1]
1250 Tempo indications with text can be used instead:
1252 @lilypond[verbatim,quote,relative=2]
1258 Combining a metronome mark and text will automatically place the
1259 metronome mark within parentheses:
1261 @lilypond[verbatim,quote,relative=2]
1262 \tempo "Allegro" 4 = 160
1267 In general, the text can be any markup object:
1269 @lilypond[verbatim,quote,relative=2]
1270 \tempo \markup { \italic Faster } 4 = 132
1271 a8-. r8 b-. r gis-. r a-. r
1274 A parenthesized metronome mark with no textual indication may be
1275 written by including an empty string in the input:
1277 @lilypond[verbatim,quote,relative=2]
1285 @lilypondfile[verbatim,quote,texidoc,doctitle]
1286 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
1288 @c perhaps also an example of how to move it horizontally?
1290 @lilypondfile[verbatim,quote,texidoc,doctitle]
1291 {changing-the-tempo-without-a-metronome-mark.ly}
1293 @lilypondfile[verbatim,quote,texidoc,doctitle]
1294 {creating-metronome-marks-in-markup-mode.ly}
1296 For more details, see @ref{Formatting text}.
1301 @rglos{metronomic indication},
1302 @rglos{tempo indication},
1303 @rglos{metronome mark}.
1306 @ref{Formatting text},
1310 @rlsr{Staff notation}.
1312 Internals Reference:
1313 @rinternals{MetronomeMark}.
1317 @unnumberedsubsubsec Upbeats
1321 @cindex partial measure
1322 @cindex measure, partial
1323 @cindex measure, pickup
1324 @cindex pickup measure
1326 @funindex measurePosition
1330 Partial or pick-up measures, such as an @emph{anacrusis} or an
1331 @emph{upbeat}, are entered using the @code{\partial} command,
1334 \partial @var{duration}
1338 where @code{@var{duration}} is the @emph{remaining} length of the
1339 partial measure @emph{before} the start of the next full measure.
1341 @lilypond[quote,verbatim,relative=1]
1347 The @var{duration} can be any value less than a full measure:
1349 @lilypond[quote,verbatim,relative=1]
1352 r4 e8 | a4 c8 b c4 |
1355 The @code{\partial @var{duration}} can also be written as;
1358 \set Timing.measurePosition -@var{duration}
1361 So @code{\partial 8} becomes:
1363 @lilypond[quote,verbatim,relative=1]
1365 \set Timing.measurePosition = #(ly:make-moment -1 8)
1369 The property @code{measurePosition} contains a rational number
1370 indicating how much of the measure has passed at this point. Note
1371 that this is set to a negative number by the @code{\partial} command:
1372 i.e., @code{\partial 4} is internally translated to @w{@code{-4}},
1373 meaning @qq{there is a quarter note left in the measure.}
1386 @rinternals{Timing_translator}.
1389 The @code{\partial} command should be used only at the beginning of a
1390 piece. If you use it after the beginning, warnings or problems may
1391 occur, so use @code{\set Timing.measurePosition} instead.
1393 @lilypond[quote,verbatim,relative=1]
1396 e8 | a4 c8 b[ c b] |
1397 \set Timing.measurePosition = #(ly:make-moment -1 4)
1398 r8 e,8 | a4 c8 b[ c b] |
1402 @node Unmetered music
1403 @unnumberedsubsubsec Unmetered music
1406 @cindex cadenza, beams
1407 @cindex cadenza, accidentals
1408 @cindex cadenza, bar lines
1409 @cindex cadenza, bar numbers
1410 @cindex unmetered music
1411 @cindex unmetered music, beams
1412 @cindex unmetered music, accidentals
1413 @cindex unmetered music, bar lines
1414 @cindex unmetered music, bar numbers
1415 @cindex accidentals, cadenzas
1416 @cindex accidentals, unmetered music
1417 @cindex bar lines, cadenzas
1418 @cindex bar lines, unmetered music
1419 @cindex bar numbers, cadenzas
1420 @cindex bar numbers, unmetered music
1421 @cindex beams, cadenzas
1422 @cindex beams, unmetered music
1424 @funindex \cadenzaOn
1426 @funindex \cadenzaOff
1427 @funindex cadenzaOff
1429 In metered music bar lines are inserted and bar numbers are calculated
1430 automatically. In unmetered music (i.e. cadenzas), this is not
1431 desirable and can be @q{switched off} using the command
1432 @code{\cadenzaOn}, then @q{switched back on} at the appropriate place
1433 using @code{\cadenzaOff}.
1435 @lilypond[verbatim,relative=2,quote]
1438 c4 c d8[ d d] f4 g4.
1444 Bar numbering is resumed at the end of the cadenza.
1446 @lilypond[verbatim,relative=2,quote]
1447 % Show all bar numbers
1448 \override Score.BarNumber #'break-visibility = #all-visible
1451 c4 c d8[ d d] f4 g4.
1457 A new bar is never started within a cadenza, even if one or more
1458 @code{\bar} commands are inserted within it. Therefore, reminder
1459 accidentals will need to be added manually. See @ref{Accidentals}.
1461 @lilypond[verbatim,relative=2,quote]
1471 Automatic beaming is disabled by @code{\cadenzaOn}. Therefore, all
1472 beaming in cadenzas must be entered manually. See @ref{Manual beams}.
1474 @lilypond[verbatim,relative=2,quote]
1475 \repeat unfold 8 { c8 }
1481 \repeat unfold 8 { c8 }
1484 These predefined commands affect all staves in the score, even when
1485 placed in just one @code{Voice} context. To change this, move the
1486 @code{Timing_translator} from the @code{Score} context to the
1487 @code{Staff} context. See @ref{Polymetric notation}.
1499 @ref{Visibility of objects},
1500 @ref{Polymetric notation},
1507 @cindex cadenza, line breaks
1508 @cindex cadenza, page breaks
1509 @cindex unmetered music, line breaks
1510 @cindex unmetered music, page breaks
1511 @cindex breaks in unmetered music
1512 @cindex line breaks, cadenzas
1513 @cindex page breaks, cadenzas
1514 @cindex line breaks, unmetered music
1515 @cindex page breaks, unmetered music
1518 Automatic line and page breaks are inserted only at bar lines, so
1519 @q{invisible} bar lines will need to be inserted manually in long
1520 stretches of unmetered music to permit breaking:
1526 Explicitly create a @code{Voice} context when starting a piece with
1527 @code{\cadenzaOn}, else unexpected errors may occur.
1533 c16[^"Solo Free Time" d e f] g2.
1541 @node Polymetric notation
1542 @unnumberedsubsubsec Polymetric notation
1544 @c This section necessarily uses \set
1545 @c This is acceptable -td
1547 @cindex double time signatures
1548 @cindex signatures, polymetric
1549 @cindex time signatures, polymetric
1550 @cindex time signatures, double
1551 @cindex polymetric signatures
1552 @cindex meter, polymetric
1554 @funindex timeSignatureFraction
1555 @funindex \scaleDurations
1556 @funindex scaleDurations
1560 Polymetric notation is supported explicitly or by manually modifying the
1561 visible time signature symbol and/or scaling note durations.
1563 @subsubheading Different time signatures with equal-length measures
1565 Set a common time signature for each staff, and set the
1566 @code{timeSignatureFraction} to the desired fraction. Then use the
1567 @code{\scaleDurations} function to scale the durations of the notes in
1568 each staff to the common time signature.
1570 @cindex beams, with polymetric meters
1571 @cindex polymetric meters, with beams
1573 In the following example, music with the time signatures of 3/4, 9/8 and
1574 10/8 are used in parallel. In the second staff, shown durations are
1575 multiplied by 2/3 (because 2/3 * 9/8 = 3/4) and in the third staff, the
1576 shown durations are multiplied by 3/5 (because 3/5 * 10/8 = 3/4). It
1577 may be necessary to insert beams manually, as the duration scaling will
1578 affect the autobeaming rules.
1580 @lilypond[quote,verbatim]
1589 \set Staff.timeSignatureFraction = 9/8
1591 \repeat unfold 6 { c8[ c c] }
1595 \set Staff.timeSignatureFraction = 10/8
1596 \scaleDurations 3/5 {
1597 \repeat unfold 2 { c8[ c c] }
1598 \repeat unfold 2 { c8[ c] } |
1599 c4. c \times 2/3 { c8[ c c] } c4
1605 @subsubheading Different time signatures with unequal-length measures
1607 Each staff can be given its own independent time signature by
1608 moving the @code{Timing_translator} and the
1609 @code{Default_bar_line_engraver} to the @code{Staff} context.
1611 @lilypond[quote,verbatim]
1615 \remove "Timing_translator"
1616 \remove "Default_bar_line_engraver"
1620 \consists "Timing_translator"
1621 \consists "Default_bar_line_engraver"
1625 % Now each staff has its own time signature.
1649 @funindex \compoundMeter
1650 @cindex compound time signatures
1651 @cindex time signature, compound
1653 @subsubheading Compound time signatures
1655 These are created using the @code{\compoundMeter} function. The syntax
1659 \compoundMeter #'@code{(list of lists)}
1662 The simplest construction is a single list, where the @emph{last} number
1663 indicates the bottom number of the time signature and those that come
1664 before it, the top numbers.
1666 @lilypond[quote,verbatim]
1668 \compoundMeter #'((2 2 2 8))
1669 \repeat unfold 6 c8 \repeat unfold 12 c16
1673 More complex meters can be constructed using additional lists. Also,
1674 automatic beaming settings will be adjusted depending on the values.
1676 @lilypond[quote,verbatim]
1678 \compoundMeter #'((1 4) (3 8))
1679 \repeat unfold 5 c8 \repeat unfold 10 c16
1683 \compoundMeter #'((1 2 3 8) (3 4))
1684 \repeat unfold 12 c8
1691 @rglos{polymetric time signature},
1695 @ref{Automatic beams},
1697 @ref{Time signature},
1698 @ref{Scaling durations}.
1703 Internals Reference:
1704 @rinternals{TimeSignature},
1705 @rinternals{Timing_translator},
1706 @rinternals{Default_bar_line_engraver},
1710 When using different time signatures in parallel, notes at the same
1711 moment will be placed at the same horizontal location. However, the bar
1712 lines in the different staves will cause the note spacing to be less
1713 regular in each of the individual staves than would be normal without
1714 the different time signatures.
1717 @node Automatic note splitting
1718 @unnumberedsubsubsec Automatic note splitting
1720 @cindex notes, splitting
1721 @cindex splitting notes
1722 @cindex rests, splitting
1723 @cindex splitting rests
1725 @funindex Note_heads_engraver
1726 @funindex Completion_heads_engraver
1727 @funindex Completion_rest_engraver
1729 Long notes which overrun bar lines can be converted automatically to
1730 tied notes. This is done by replacing the @code{Note_heads_engraver}
1731 with the @code{Completion_heads_engraver}. Similarly, long rests which
1732 overrun bar lines are split automatically by replacing the
1733 @code{Rest_engraver} with the @code{Completion_rest_engraver}. In the
1734 following example, notes and rests crossing the bar lines are split,
1735 notes are also tied.
1737 @lilypond[quote,verbatim,relative=1]
1739 \remove "Note_heads_engraver"
1740 \consists "Completion_heads_engraver"
1741 \remove "Rest_engraver"
1742 \consists "Completion_rest_engraver"
1745 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 r1*2 }
1748 These engravers split all running notes and rests at the bar line, and
1749 inserts ties for notes. One of its uses is to debug complex scores: if
1750 the measures are not entirely filled, then the ties show exactly how
1751 much each measure is off.
1758 @rlearning{Engravers explained},
1759 @rlearning{Adding and removing engravers}.
1764 Internals Reference:
1765 @rinternals{Note_heads_engraver},
1766 @rinternals{Completion_heads_engraver},
1767 @rinternals{Rest_engraver},
1768 @rinternals{Completion_rest_engraver},
1769 @rinternals{Forbid_line_break_engraver}.
1772 Not all durations (especially those containing tuplets) can be
1773 represented exactly with normal notes and dots, but the
1774 @code{Completion_heads_engraver} will not insert tuplets.
1776 The @code{Completion_heads_engraver} only affects notes; it does not
1780 @node Showing melody rhythms
1781 @unnumberedsubsubsec Showing melody rhythms
1783 @cindex melody rhythms, showing
1784 @cindex rhythms, showing melody
1786 Sometimes you might want to show only the rhythm of a melody. This
1787 can be done with the rhythmic staff. All pitches of notes on such a
1788 staff are squashed, and the staff itself has a single line
1790 @lilypond[quote,relative=1,verbatim]
1792 \new RhythmicStaff {
1793 \new Voice = "myRhythm" {
1801 \lyricsto "myRhythm" {
1809 @cindex guitar chord charts
1810 @cindex strumming rhythms, showing
1811 @cindex guitar strumming rhythms, showing
1813 @funindex Pitch_squash_engraver
1814 @funindex \improvisationOn
1815 @funindex improvisationOn
1816 @funindex \improvisationOff
1817 @funindex improvisationOff
1819 Guitar chord charts often show the strumming rhythms. This can
1820 be done with the @code{Pitch_squash_engraver} and
1821 @code{\improvisationOn}.
1824 @lilypond[quote,verbatim]
1832 \consists Pitch_squash_engraver
1845 @code{\improvisationOn},
1846 @code{\improvisationOff}.
1852 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1853 {guitar-strum-rhythms.ly}
1859 Internals Reference:
1860 @rinternals{RhythmicStaff},
1861 @rinternals{Pitch_squash_engraver}.
1869 * Setting automatic beam behavior::
1874 @node Automatic beams
1875 @unnumberedsubsubsec Automatic beams
1877 By default, beams are inserted automatically:
1879 @cindex beams, manual
1880 @cindex manual beams
1881 @cindex beams, customizing rules
1883 @funindex \autoBeamOn
1884 @funindex autoBeamOn
1885 @funindex \autoBeamOff
1886 @funindex autoBeamOff
1888 @lilypond[quote,verbatim,relative=2]
1890 \time 6/8 c8 c c c8. c16 c8
1893 If these automatic decisions are not satisfactory, beaming can be
1894 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1895 entered manually if beams are to be extended over rests.
1897 If automatic beaming is not required, it may be turned off with
1898 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1900 @lilypond[quote,relative=1,verbatim]
1901 c4 c8 c8. c16 c8. c16 c8
1908 @cindex melismata, with beams
1909 @cindex beams, with melismata
1911 @warning{If beams are used to indicate melismata in songs, then
1912 automatic beaming should be switched off with @code{\autoBeamOff}
1913 and the beams indicated manually. Using @code{@bs{}partcombine} with
1914 @code{@bs{}autoBeamOff} can produce unintended results. See the
1915 snippets for more information.}
1917 Beaming patterns that differ from the automatic defaults can be
1918 created; see @ref{Setting automatic beam behavior}.
1921 @code{\autoBeamOff},
1925 @cindex beams, line breaks
1926 @cindex line breaks, beams
1927 @cindex beams, with knee gap
1928 @cindex knee gap, with beams
1932 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1933 {beams-across-line-breaks.ly}
1935 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1936 {changing-beam-knee-gap.ly}
1938 @cindex beams, \partcombine with \autoBeamOff
1939 @cindex voices, \partcombine with \autoBeamOff
1941 @lilypondfile [verbatim, quote, ragged-right, texidoc, doctitle]
1942 {partcombine-and-autobeamoff.ly}
1947 @ref{Setting automatic beam behavior}.
1950 @file{scm/auto-beam.scm}.
1955 Internals Reference:
1956 @rinternals{Auto_beam_engraver},
1957 @rinternals{Beam_engraver},
1959 @rinternals{BeamEvent},
1960 @rinternals{BeamForbidEvent},
1961 @rinternals{beam-interface},
1962 @rinternals{unbreakable-spanner-interface}.
1965 The properties of a beam are determined at the @emph{start} of its
1966 construction and any additional beam-property changes that occur before
1967 the beam has been completed will not take effect until the @emph{next},
1971 @node Setting automatic beam behavior
1972 @unnumberedsubsubsec Setting automatic beam behavior
1974 @cindex beams, with lyrics
1975 @cindex lyrics, with beams
1977 @funindex autoBeaming
1978 @funindex baseMoment
1979 @funindex beamExceptions
1980 @funindex beatStructure
1981 @funindex measureLength
1987 In most instances, automatic beams will end at the end of a beat.
1988 The ending points for beats are determined by the context properties
1989 @code{baseMoment} and @code{beatStructure}. @code{beatStructure}
1990 is a scheme list that defines the length of each beat in the measure
1991 in units of @code{baseMoment}. By default, @code{baseMoment} is
1992 the one over numerator of the time signature. By default,
1993 each unit of length @code{baseMoment} is a single beat.
1995 @lilypond[quote,relative=2,verbatim]
1997 c16^"default" c c c c |
1998 \set Timing.beatStructure = #'(2 3)
1999 c16^"(2+3)" c c c c |
2000 \set Timing.beatStructure = #'(3 2)
2001 c16^"(3+2)" c c c c |
2004 Beam setting changes can be limited to specific contexts. If no
2005 setting is included in a lower-level context, the setting of the
2006 enclosing context will apply.
2008 @lilypond[quote, verbatim,relative=1]
2011 \set Staff.beatStructure = #'(2 3 2)
2021 \set Voice.beatStructure = #'(1 3 3)
2029 When multiple voices are used the @code{Staff} context must be
2030 specified if the beaming is to be applied to all voices in the
2033 @lilypond[quote,verbatim,relative=2]
2036 % Change applied to Voice by default -- does not work correctly
2037 % Because of autogenerated voices, all beating will
2038 % be at baseMoment (1 . 8)
2039 \set beatStructure = #'(3 1 1 2)
2040 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2042 % Works correctly with context Staff specified
2043 \set Staff.beatStructure = #'(3 1 1 2)
2044 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2047 The value of @code{baseMoment} can be adjusted to change
2048 the beaming behavior, if desired. When this is done,
2049 the value of @code{beatStructure} must be set to be
2050 compatible with the new value of @code{baseMoment}.
2052 @lilypond[quote,verbatim,relative=2]
2054 \set Timing.baseMoment = #(ly:make-moment 1 16)
2055 \set Timing.beatStructure = #'(7 3)
2056 \repeat unfold 10 { a16 }
2059 @code{baseMoment} is a @i{moment}; a unit of musical duration. A
2060 quantity of type @i{moment} is created by the scheme function
2061 @code{ly:make-moment}. For more information about this function,
2062 see @ref{Time administration}.
2064 By default @code{baseMoment} is set to one over the denominator of
2065 the time signature. Any exceptions to this default can be found in
2066 @file{scm/time-signature-settings.scm}.
2068 Special autobeaming rules (other than ending a beam on a beat)
2069 are defined in the @code{beamExceptions} property.
2071 @lilypond[quote,relative=2,verbatim]
2073 \set Timing.beatStructure = #'(2 1)
2074 \set Timing.beamExceptions =
2076 (end . ;entry for end of beams
2077 ( ;start of alist of end points
2078 ((1 . 32) . (2 2 2)) ;rule for 1/32 beams -- end each 1/16
2079 ))) %close all entries
2081 \repeat unfold 6 { c32 } |
2084 @code{beamExceptions} is an alist with a key of rule-type and a value
2087 At this time the only available value of rule-type is
2088 @code{'end} for beam ending.
2090 Beaming-rules is a scheme alist (or list of pairs) that indicates the
2091 beam type and the grouping to be applied to beams containing notes with
2092 a shortest duration of that beam type.
2095 #'((beam-type1 . grouping-1)
2096 (beam-type2 . grouping-2)
2097 (beam-type3 . grouping-3))
2100 Beam type is a scheme pair indicating the duration of the beam,
2101 e.g., @code{(1 . 16)}.
2103 Grouping is a scheme list indicating the grouping to be applied to
2104 the beam. The grouping is in units of the beam type.
2106 @warning{ A @code{beamExceptions} value must be @emph{complete}
2107 exceptions list. That is, every exception that should be applied
2108 must be included in the setting. It is not possible to add, remove,
2109 or change only one of the exceptions. While this may seem cumbersome,
2110 it means that the current beaming settings need not be known in order
2111 to specify a new beaming pattern.}
2113 When the time signature is changed, default values of
2114 @code{Timing.baseMoment}, @code{Timing.beatStructure},
2115 and @code{Timing.beamExceptions} are set. Setting the time signature
2116 will reset the automatic beaming settings for the @code{Timing}
2117 context to the default behavior.
2119 @lilypond[quote,verbatim,relative=2]
2121 \repeat unfold 6 { a8 }
2123 \set Timing.beatStructure = #'(4 2)
2124 \repeat unfold 6 { a8 }
2125 % go back to default behavior
2127 \repeat unfold 6 { a8 }
2130 The default automatic beaming settings for a time signature
2131 are determined in @file{scm/time-signature-settings.scm}.
2132 Changing the default automatic beaming settings
2133 for a time signature is described in @ref{Time signature}.
2135 Many automatic beaming settings for a time signature contain an
2136 entry for @code{beamExceptions}. For example, 4/4 time tries to
2137 beam the measure in two if there are only eighth notes. The
2138 @code{beamExceptions} rule can override the @code{beatStructure} setting
2139 if @code{beamExceptions} is not reset.
2141 @lilypond[quote,verbatim,relative=2]
2143 \set Timing.baseMoment = #(ly:make-moment 1 8)
2144 \set Timing.beatStructure = #'(3 3 2)
2145 % This won't beam (3 3 2) because of beamExceptions
2146 \repeat unfold 8 {c8} |
2147 % This will beam (3 3 2) because we clear beamExceptions
2148 \set Timing.beamExceptions = #'()
2149 \repeat unfold 8 {c8}
2152 In traditional engraving, eighth notes can have special beaming rules.
2153 A measure consisting of only eighth notes can be beamed in one. This rule is
2154 controlled by the context property @code{beamWholeMeasure}:
2156 @lilypond[quote,verbatim,relative=2]
2158 % By default we beam in one
2159 \repeat unfold 6 { a8 }
2160 % We can avoid beaming in one
2161 \set Timing.beamWholeMeasure = ##f
2162 \repeat unfold 6 { a8 }
2165 In some engraving from the Romantic and Classical periods,
2166 a half-measure of eighth notes can be beamed
2167 together even though this violates the general rule (see Gould, p. 153).
2168 This behavior is controlled by the context property @code{beamHalfMeasure}:
2170 @lilypond[quote,verbatim,relative=2]
2172 % By default we avoid half-measure beams
2174 % We can allow half-measure beams
2175 \set Timing.beamHalfMeasure = ##t
2179 @i{@strong{How automatic beaming works}}
2181 When automatic beaming is enabled, the placement of automatic beams
2182 is determined by the context properties
2183 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2185 The following rules, in order of priority, apply when determining
2186 the appearance of beams:
2190 If a manual beam is specified with @code{[..]} set the beam
2191 as specified, otherwise
2194 if a beam-ending rule is defined in @code{beamExceptions}
2195 for the beam-type, use it to determine the valid places where
2196 beams may end, otherwise
2199 if a beam-ending rule is defined in @code{beamExceptions}
2200 for a longer beam-type, use it to determined the valid places
2201 where beams may end, otherwise
2204 use the values of @code{baseMoment} and @code{beatStructure} to
2205 determine the ends of the beats in the measure, and
2206 end beams at the end of beats.
2210 In the rules above, the @emph{beam-type} is the duration of the
2211 shortest note in the beamed group.
2213 The default beaming rules can be found in
2214 @file{scm/time-signature-settings.scm}.
2218 @cindex beams, subdividing
2220 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2221 {subdividing-beams.ly}
2223 @cindex beamlets, orienting
2225 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2226 {strict-beat-beaming.ly}
2228 @cindex measure groupings
2229 @cindex beats, grouping
2230 @cindex grouping beats
2231 @cindex measure sub-grouping
2233 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2234 {conducting-signs,-measure-grouping-signs.ly}
2236 @cindex beam, endings in a score
2237 @cindex beam, endings with multiple voices
2239 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2240 {beam-endings-in-score-context.ly}
2244 @file{scm/beam-settings.scm}.
2249 Internals Reference:
2250 @rinternals{Auto_beam_engraver},
2252 @rinternals{BeamForbidEvent},
2253 @rinternals{beam-interface}.
2256 If a score ends while an automatic beam has not been ended and is
2257 still accepting notes, this last beam will not be typeset at all.
2258 The same holds for polyphonic voices, entered with
2259 @code{<< @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
2260 automatic beam is still accepting notes, it is not typeset.
2261 The workaround for these problems is to manually beam the last
2262 beam in the voice or score.
2264 By default, the @code{Timing} translator is aliased to the
2265 @code{Score} context. This means that setting the time signature
2266 in one staff will affect the beaming of the other staves as well.
2267 Thus, a time signature setting in a later staff will reset custom
2268 beaming that was set in an earlier staff.
2269 One way to avoid this problem is to set the time signature
2272 @lilypond[quote,verbatim,relative=2]
2276 \set Timing.baseMoment = #(ly:make-moment 1 8)
2277 \set Timing.beatStructure = #'(1 5)
2278 \repeat unfold 6 { a8 }
2281 \repeat unfold 6 { a8 }
2286 The default beam settings for the time signature can also be changed, so
2287 that the desired beaming will always be used. Changes in automatic
2288 beaming settings for a time signature are described in
2289 @ref{Time signature}.
2291 @lilypond[quote,verbatim,relative=2]
2294 \overrideTimeSignatureSettings
2295 3/4 % timeSignatureFraction
2296 1/8 % baseMomentFraction
2297 #'(1 5) % beatStructure
2298 #'() % beamExceptions
2300 \repeat unfold 6 { a8 }
2304 \repeat unfold 6 { a8 }
2311 @unnumberedsubsubsec Manual beams
2313 @cindex beams, manual
2314 @cindex manual beams
2319 In some cases it may be necessary to override the automatic
2320 beaming algorithm. For example, the autobeamer will not put beams
2321 over rests or bar lines, and in choral scores the beaming is
2322 often set to follow the meter of the lyrics rather than the
2323 notes. Such beams can be specified manually by
2324 marking the begin and end point with @code{[} and @code{]}.
2326 @lilypond[quote,relative=1,verbatim]
2327 r4 r8[ g' a r] r g[ | a] r
2330 @cindex manual beams, direction shorthand for
2331 @cindex manual beams, grace notes
2333 Beaming direction can be set manually using direction indicators:
2335 @lilypond[quote,relative=2,verbatim]
2336 c8^[ d e] c,_[ d e f g]
2342 Individual notes may be marked with @code{\noBeam} to prevent them
2345 @lilypond[quote,verbatim,relative=2]
2350 Grace note beams and normal note beams can occur simultaneously.
2351 Unbeamed grace notes are not put into normal note beams.
2353 @lilypond[quote,verbatim,relative=2]
2355 \grace { e32[ d c d] }
2361 @funindex stemLeftBeamCount
2362 @funindex stemRightBeamCount
2364 Even more strict manual control with the beams can be achieved by
2365 setting the properties @code{stemLeftBeamCount} and
2366 @code{stemRightBeamCount}. They specify the number of beams to
2367 draw on the left and right side, respectively, of the next note.
2368 If either property is set, its value will be used only once, and
2369 then it is erased. In this example, the last @code{f} is printed
2370 with only one beam on the left side, i.e., the eighth-note beam of
2371 the group as a whole.
2373 @lilypond[quote,relative=2,verbatim]
2376 \set stemLeftBeamCount = #2
2377 \set stemRightBeamCount = #1
2379 \set stemLeftBeamCount = #1
2391 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2392 {flat-flags-and-beam-nibs.ly}
2396 @ref{Direction and placement},
2402 Internals Reference:
2404 @rinternals{BeamEvent},
2405 @rinternals{Beam_engraver},
2406 @rinternals{beam-interface},
2407 @rinternals{Stem_engraver}.
2410 @node Feathered beams
2411 @unnumberedsubsubsec Feathered beams
2413 @cindex beams, feathered
2414 @cindex feathered beams
2416 @funindex \featherDurations
2417 @funindex featherDurations
2418 @funindex grow-direction
2420 Feathered beams are used to indicate that a small group of notes
2421 should be played at an increasing (or decreasing) tempo, without
2422 changing the overall tempo of the piece. The extent of the
2423 feathered beam must be indicated manually using @code{[} and
2424 @code{]}, and the beam feathering is turned on by specifying a
2425 direction to the @code{Beam} property @code{grow-direction}.
2427 If the placement of the notes and the sound in the MIDI output is to
2428 reflect the @emph{ritardando} or @emph{accelerando} indicated by the
2429 feathered beam the notes must be grouped as a music expression delimited
2430 by braces and preceded by a @code{featherDurations} command which specifies
2431 the ratio between the durations of the first and last notes in the
2434 The square brackets show the extent of the beam and the braces show
2435 which notes are to have their durations modified. Normally these
2436 would delimit the same group of notes, but this is not required: the
2437 two commands are independent.
2439 In the following example the eight 16th notes occupy exactly the
2440 same time as a half note, but the first note is one half as long
2441 as the last one, with the intermediate notes gradually
2442 lengthening. The first four 32nd notes gradually speed up, while
2443 the last four 32nd notes are at a constant tempo.
2445 @lilypond[relative=1,verbatim,quote]
2446 \override Beam #'grow-direction = #LEFT
2447 \featherDurations #(ly:make-moment 2 1)
2448 { c16[ c c c c c c c] }
2449 \override Beam #'grow-direction = #RIGHT
2450 \featherDurations #(ly:make-moment 2 3)
2452 % revert to non-feathered beams
2453 \override Beam #'grow-direction = #'()
2458 The spacing in the printed output represents the
2459 note durations only approximately, but the MIDI output is exact.
2462 @code{\featherDurations}.
2470 The @code{\featherDurations} command only works with very short
2471 music snippets, and when numbers in the fraction are small.
2480 * Bar and bar number checks::
2485 @unnumberedsubsubsec Bar lines
2488 @cindex measure lines
2489 @cindex closing bar lines
2490 @cindex bar lines, closing
2491 @cindex double bar lines
2492 @cindex bar lines, double
2498 Bar lines delimit measures, and are also used to indicate
2499 repeats. Normally, simple bar lines are automatically inserted
2500 into the printed output at places based on the current time
2503 The simple bar lines inserted automatically can be changed to
2504 other types with the @code{\bar} command. For example, a closing
2505 double bar line is usually placed at the end of a piece:
2507 @lilypond[quote,relative=1,verbatim]
2511 It is not invalid if the final note in a measure does not
2512 end on the automatically entered bar line: the note is assumed
2513 to carry over into the next measure. But if a long sequence
2514 of such carry-over measures appears the music can appear compressed
2515 or even flowing off the page. This is because automatic line
2516 breaks happen only at the end of complete measures, i.e., where
2517 all notes end before the end of a measure.
2519 @warning{An incorrect duration can cause line breaks to be
2520 inhibited, leading to a line of highly compressed music or
2521 music which flows off the page.}
2524 @cindex bar lines, invisible
2525 @cindex measure lines, invisible
2527 Line breaks are also permitted at manually inserted bar lines
2528 even within incomplete measures. To allow a line break without
2529 printing a bar line, use the following:
2536 This will insert an invisible bar line and allow (but not
2537 force) a line break to occur at this point. The bar number
2538 counter is not increased. To force a line break see
2539 @ref{Line breaking}.
2541 @cindex manual bar lines
2542 @cindex manual measure lines
2543 @cindex bar lines, manual
2544 @cindex measure lines, manual
2546 This and other special bar lines may be inserted manually at any
2547 point. When they coincide with the end of a measure they replace
2548 the simple bar line which would have been inserted there
2549 automatically. When they do not coincide with the end of a measure
2550 the specified bar line is inserted at that point in the printed
2553 Note that manual bar lines are purely visual. They do not affect
2554 any of the properties that a normal bar line would affect, such as
2555 measure numbers, accidentals, line breaks, etc. They do not affect
2556 the calculation and placement of subsequent automatic bar lines.
2557 When a manual bar line is placed where a normal bar line already
2558 exists, the effects of the original bar line are not altered.
2560 Two types of simple bar lines and five types of double bar lines are
2561 available for manual insertion:
2563 @lilypond[quote,relative=1,verbatim]
2575 together with dotted and dashed bar lines:
2577 @lilypond[quote,relative=1,verbatim]
2584 and five types of repeat bar line:
2586 @lilypond[quote,relative=1,verbatim]
2595 Additionally, a bar line can be printed as a simple tick:
2596 @lilypond[quote,relative=1,verbatim]
2599 However, as such ticks are typically used in Gregorian chant, it is
2600 preferable to use @code{\divisioMinima} there instead, described in
2601 the section @ref{Divisiones} in Gregorian chant.
2605 For in-line segno signs, there are three types of bar lines which
2606 differ in their behavior at line breaks:
2608 @lilypond[quote,relative=2,verbatim]
2626 Although the bar line types signifying repeats may be inserted
2627 manually they do not in themselves cause LilyPond to recognize
2628 a repeated section. Such repeated sections are better entered
2629 using the various repeat commands (see @ref{Repeats}), which
2630 automatically print the appropriate bar lines.
2632 In addition, you can specify @code{"||:"}, which is equivalent to
2633 @code{"|:"} except at line breaks, where it gives a double bar
2634 line at the end of the line and a start repeat at the beginning of
2637 @lilypond[quote,relative=2,verbatim]
2645 For combinations of repeats with the segno sign, there are six different
2648 @lilypond[quote,relative=2,verbatim]
2677 In scores with many staves, a @code{\bar} command in one staff is
2678 automatically applied to all staves. The resulting bar lines are
2679 connected between different staves of a @code{StaffGroup},
2680 @code{PianoStaff}, or @code{GrandStaff}.
2682 @lilypond[quote,relative=1,verbatim]
2690 \new Staff { \clef bass c4 g e g }
2692 \new Staff { \clef bass c2 c2 }
2697 @cindex default bar lines, changing
2698 @cindex bar lines, default, changing
2703 @funindex defaultBarType
2708 The command @samp{\bar @var{bartype}} is a shortcut for
2709 @samp{\set Timing.whichBar = @var{bartype}}. A bar line is
2710 created whenever the @code{whichBar} property is set.
2712 The default bar type used for automatically inserted bar lines is
2713 @code{"|"}. This may be changed at any time with
2714 @samp{\set Timing.defaultBarType = @var{bartype}}.
2718 @ref{Line breaking},
2720 @ref{Grouping staves}.
2725 Internals Reference:
2726 @rinternals{BarLine} (created at @code{Staff} level),
2727 @rinternals{SpanBar} (across staves),
2728 @rinternals{Timing_translator} (for Timing properties).
2732 @unnumberedsubsubsec Bar numbers
2735 @cindex measure numbers
2736 @cindex numbers, bar
2737 @cindex numbers, measure
2739 @funindex currentBarNumber
2741 Bar numbers are typeset by default at the start of every line except
2742 the first line. The number itself is stored in the
2743 @code{currentBarNumber} property, which is normally updated
2744 automatically for every measure. It may also be set manually:
2746 @lilypond[verbatim,quote,relative=1]
2749 \set Score.currentBarNumber = #50
2753 @cindex bar numbers, regular spacing
2755 @funindex barNumberVisibility
2758 Bar numbers can be typeset at regular intervals instead of just at
2759 the beginning of every line. To do this the default behavior
2760 must be overridden to permit bar numbers to be printed at places
2761 other than the start of a line. This is controlled by the
2762 @code{break-visibility} property of @code{BarNumber}. This takes
2763 three values which may be set to @code{#t} or @code{#f} to specify
2764 whether the corresponding bar number is visible or not. The order
2765 of the three values is @code{end of line visible}, @code{middle of
2766 line visible}, @code{beginning of line visible}. In the following
2767 example bar numbers are printed at all possible places:
2769 @lilypond[verbatim,quote,relative=1]
2770 \override Score.BarNumber #'break-visibility = #'#(#t #t #t)
2771 \set Score.currentBarNumber = #11
2772 % Permit first bar number to be printed
2780 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2781 {printing-the-bar-number-for-the-first-measure.ly}
2783 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2784 {printing-bar-numbers-at-regular-intervals.ly}
2786 @cindex measure number, format
2787 @cindex bar number, format
2789 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2790 {printing-bar-numbers-inside-boxes-or-circles.ly}
2792 @cindex bar numbers, with letters
2793 @cindex bar numbers, with repeats
2795 @lilypondfile[verbatim,quote,texidoc,doctitle]
2796 {alternative-bar-numbering.ly}
2798 @cindex bar number alignment
2800 @lilypondfile[verbatim,quote,texidoc,doctitle]
2801 {aligning-bar-numbers.ly}
2803 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2804 {removing-bar-numbers-from-a-score.ly}
2810 Internals Reference:
2811 @rinternals{BarNumber},
2812 @rinternals{Bar_number_engraver}.
2814 @cindex bar number collision
2815 @cindex collision, bar number
2818 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
2819 if there is one. To solve this, the @code{padding} property of
2820 @code{BarNumber} can be used to position the number correctly. See
2821 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
2824 @node Bar and bar number checks
2825 @unnumberedsubsubsec Bar and bar number checks
2828 @cindex bar number check
2829 @cindex measure check
2830 @cindex measure number check
2832 @funindex barCheckSynchronize
2835 Bar checks help detect errors in the entered durations. A bar check
2836 may be entered using the bar symbol, @code{|}, at any place where a
2837 bar line is expected to fall. If bar check lines are encountered at
2838 other places, a list of warnings is printed in the log file, showing
2839 the line numbers and lines in which the bar checks failed. In the
2840 next example, the second bar check will signal an error.
2843 \time 3/4 c2 e4 | g2 |
2846 Bar checks can also be used in lyrics:
2851 Twin -- kle | Twin -- kle |
2855 An incorrect duration can result in a completely garbled score,
2856 especially if the score is polyphonic, so a good place to start
2857 correcting input is by scanning for failed bar checks and
2858 incorrect durations.
2860 If successive bar checks are off by the same musical interval,
2861 only the first warning message is displayed. This allows the
2862 warning to focus on the source of the timing error.
2866 @funindex pipeSymbol
2868 It is also possible to redefine the action taken when a bar check
2869 or pipe symbol, @code{|}, is encountered in the input, so that
2870 it does something other than a bar check. This is done by
2871 assigning a music expression to @code{pipeSymbol}.
2872 In the following example @code{|} is set to insert a double bar
2873 line wherever it appears in the input, rather than checking
2876 @lilypond[quote,verbatim]
2877 pipeSymbol = \bar "||"
2886 @funindex \barNumberCheck
2887 @funindex barNumberCheck
2889 When copying large pieces of music, it can be helpful to check that
2890 the LilyPond bar number corresponds to the original that you are
2891 entering from. This can be checked with @code{\barNumberCheck}, for
2895 \barNumberCheck #123
2899 will print a warning if the @code{currentBarNumber} is not 123
2900 when it is processed.
2907 @node Rehearsal marks
2908 @unnumberedsubsubsec Rehearsal marks
2910 @cindex rehearsal marks
2911 @cindex mark, rehearsal
2916 To print a rehearsal mark, use the @code{\mark} command.
2918 @lilypond[quote,verbatim,relative=2]
2926 The mark is incremented automatically if you use @code{\mark
2927 \default}, but you can also use an integer argument to set the
2928 mark manually. The value to use is stored in the property
2929 @code{rehearsalMark}.
2931 @lilypond[quote,verbatim,relative=2]
2940 The letter@tie{}@q{I} is skipped in accordance with engraving
2941 traditions. If you wish to include the letter @q{I}, then use one
2942 of the following commands, depending on which style of rehearsal mark
2943 you want (letters only, letters in a hollow box, or letters in a
2947 \set Score.markFormatter = #format-mark-alphabet
2948 \set Score.markFormatter = #format-mark-box-alphabet
2949 \set Score.markFormatter = #format-mark-circle-alphabet
2952 @lilypond[quote,verbatim,relative=2]
2953 \set Score.markFormatter = #format-mark-box-alphabet
2961 @cindex rehearsal mark format
2962 @cindex rehearsal mark style
2963 @cindex style, rehearsal mark
2964 @cindex format, rehearsal mark
2965 @cindex mark, rehearsal, style
2966 @cindex mark, rehearsal, format
2967 @cindex rehearsal mark, manual
2968 @cindex mark, rehearsal, manual
2969 @cindex custom rehearsal mark
2970 @cindex manual rehearsal mark
2972 The style is defined by the property @code{markFormatter}. It is
2973 a function taking the current mark (an integer) and the current
2974 context as argument. It should return a markup object. In the
2975 following example, @code{markFormatter} is set to a pre-defined
2976 procedure. After a few measures, it is set to a procedure that
2977 produces a boxed number.
2979 @lilypond[quote,verbatim,relative=2]
2980 \set Score.markFormatter = #format-mark-numbers
2983 \set Score.markFormatter = #format-mark-box-numbers
2985 \set Score.markFormatter = #format-mark-circle-numbers
2987 \set Score.markFormatter = #format-mark-circle-letters
2991 The file @file{scm/translation-functions.scm} contains the
2992 definitions of @code{format-mark-numbers} (the default format),
2993 @code{format-mark-box-numbers}, @code{format-mark-letters} and
2994 @code{format-mark-box-letters}. These can be used as inspiration
2995 for other formatting functions.
2997 You may use @code{format-mark-barnumbers},
2998 @code{format-mark-box-barnumbers}, and
2999 @code{format-mark-circle-barnumbers} to get bar numbers instead of
3000 incremented numbers or letters.
3002 Other styles of rehearsal mark can be specified manually:
3009 Note that @code{Score.markFormatter} does not affect marks specified
3010 in this manner. However, it is possible to apply a @code{\markup} to the
3014 \mark \markup@{ \box A1 @}
3019 @cindex D.S. al Fine
3021 @cindex music glyphs
3022 @cindex glyphs, music
3024 @funindex \musicglyph
3025 @funindex musicglyph
3027 Music glyphs (such as the segno sign) may be printed inside a
3030 @lilypond[quote,verbatim,relative=1]
3031 c1 \mark \markup { \musicglyph #"scripts.segno" }
3032 c1 \mark \markup { \musicglyph #"scripts.coda" }
3033 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
3038 See @ref{The Feta font}, for a list of symbols which may be
3039 printed with @code{\musicglyph}.
3041 For common tweaks to the positioning of rehearsal marks, see
3042 @ref{Formatting text}. For more precise control, see
3043 @code{break-alignable-interface} in @ref{Aligning objects}.
3045 The file @file{scm/translation-functions.scm} contains
3046 the definitions of @code{format-mark-numbers} and
3047 @code{format-mark-letters}. They can be used as inspiration for
3048 other formatting functions.
3052 @ref{The Feta font},
3053 @ref{Formatting text},
3054 @ref{Aligning objects}.
3057 @file{scm/translation-functions.scm}.
3062 Internals Reference:
3063 @rinternals{MarkEvent},
3064 @rinternals{Mark_engraver},
3065 @rinternals{RehearsalMark}.
3068 @node Special rhythmic concerns
3069 @subsection Special rhythmic concerns
3074 * Aligning to cadenzas::
3075 * Time administration::
3079 @unnumberedsubsubsec Grace notes
3083 @cindex appoggiatura
3084 @cindex acciaccatura
3087 @funindex \slashedGrace
3088 @funindex \acciaccatura
3089 @funindex \appoggiatura
3091 Grace notes are musical ornaments, printed in a smaller font, that take
3092 up no additional logical time in a measure.
3094 @lilypond[quote,relative=2,verbatim]
3096 \grace { b16[ c16] } a2)
3099 There are three other types of grace notes possible; the
3100 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
3101 note with a slashed stem -- and the @emph{appoggiatura}, which takes a
3102 fixed fraction of the main note it is attached to and prints without the
3103 slash. It is also possible to write a grace note with a slashed stem,
3104 like the @emph{acciaccatura} but without the slur, so as to place it
3105 between notes that are slurred themselves, using the
3106 @code{\slashedGrace} function.
3108 @lilypond[quote,relative=2,verbatim]
3111 \acciaccatura { g16[ f] } e2
3112 \slashedGrace a,8 g4
3113 \slashedGrace b16 a4(
3114 \slashedGrace b8 a2)
3117 The placement of grace notes is synchronized between different staves.
3118 In the following example, there are two sixteenth grace notes for every
3121 @lilypond[quote,relative=2,verbatim]
3123 \new Staff { e2 \grace { c16[ d e f] } e2 }
3124 \new Staff { c2 \grace { g8[ b] } c2 }
3128 @cindex grace notes, following
3130 @funindex \afterGrace
3131 @funindex afterGrace
3133 If you want to end a note with a grace, use the @code{\afterGrace}
3134 command. It takes two arguments: the main note, and the grace
3135 notes following the main note.
3137 @lilypond[quote,verbatim,relative=2]
3138 c1 \afterGrace d1 { c16[ d] } c1
3141 This will put the grace notes after a space lasting 3/4 of the
3142 length of the main note. The default fraction 3/4 can be changed by
3143 setting @code{afterGraceFraction}. The following example shows
3144 the results from setting the space at the default, at 15/16, and
3145 finally at 1/2 of the main note.
3147 @lilypond[quote,verbatim,relative=2]
3150 c1 \afterGrace d1 { c16[ d] } c1
3153 #(define afterGraceFraction (cons 15 16))
3154 c1 \afterGrace d1 { c16[ d] } c1
3157 #(define afterGraceFraction (cons 1 2))
3158 c1 \afterGrace d1 { c16[ d] } c1
3163 The space between the main note and the grace note may also be
3164 specified using spacers. The following example places the grace
3165 note after a space lasting 7/8 of the main note.
3167 @lilypond[quote,verbatim,relative=2]
3171 { s2 s4. \grace { c16[ d] } }
3177 @cindex tweaking grace notes
3178 @cindex grace notes, tweaking
3179 @cindex grace notes, changing layout settings
3181 A @code{\grace} music expression will introduce special
3182 typesetting settings, for example, to produce smaller type, and
3183 set directions. Hence, when introducing layout tweaks to
3184 override the special settings, they should be placed inside
3185 the grace expression. The overrides should also be reverted
3186 inside the grace expression. Here, the grace note's default stem
3187 direction is overridden and then reverted.
3189 @lilypond[quote,verbatim,relative=2]
3201 @cindex stem, with slash
3206 @lilypondfile[verbatim,quote,texidoc,doctitle]
3207 {using-grace-note-slashes-with-normal-heads.ly}
3209 @lilypondfile[verbatim,quote,texidoc,doctitle]
3210 {tweaking-grace-layout-within-music.ly}
3212 @lilypondfile[verbatim,quote,texidoc,doctitle]
3213 {redefining-grace-note-global-defaults.ly}
3215 @lilypondfile[verbatim,quote,texidoc,doctitle]
3216 {positioning-grace-notes-with-floating-space.ly}
3220 @rglos{grace notes},
3221 @rglos{acciaccatura},
3222 @rglos{appoggiatura}.
3225 @ref{Scaling durations},
3229 @file{ly/grace-init.ly}.
3234 Internals Reference:
3235 @rinternals{GraceMusic},
3236 @rinternals{Grace_beam_engraver},
3237 @rinternals{Grace_engraver},
3238 @rinternals{Grace_spacing_engraver}.
3242 @cindex acciaccatura, multi-note
3243 @cindex multi-note acciaccatura
3244 @cindex grace-note synchronization
3246 A multi-note beamed @i{acciaccatura} is printed without a slash,
3247 and looks exactly the same as a multi-note beamed
3250 @c TODO Add link to LSR snippet to add slash when available
3252 Grace note synchronization can also lead to surprises. Staff
3253 notation, such as key signatures, bar lines, etc., are also
3254 synchronized. Take care when you mix staves with grace notes and
3255 staves without, for example,
3257 @lilypond[quote,relative=2,verbatim]
3259 \new Staff { e4 \bar "|:" \grace c16 d2. }
3260 \new Staff { c4 \bar "|:" d2. }
3265 This can be remedied by inserting grace skips of the corresponding
3266 durations in the other staves. For the above example
3268 @lilypond[quote,relative=2,verbatim]
3270 \new Staff { e4 \bar "|:" \grace c16 d2. }
3271 \new Staff { c4 \bar "|:" \grace s16 d2. }
3275 The use of grace notes within voice contexts confuses the way the voice
3276 is typeset. This can be overcome by inserting a rest or note between the
3277 voice command and the grace note.
3279 @lilypond[quote,verbatim]
3281 \acciaccatura { f8 } e8 r8 \acciaccatura { f8 } e8 r4
3288 r8 r8 \voiceOne \accMusic \oneVoice r8 |
3289 r8 \voiceOne r8 \accMusic \oneVoice r8 |
3294 s8 s8 \voiceTwo \accMusic \oneVoice s8 |
3295 s8 \voiceTwo r8 \accMusic \oneVoice s8 |
3302 Grace sections should only be used within sequential music expressions.
3303 Nesting or juxtaposing grace sections is not supported, and might
3304 produce crashes or other errors.
3306 Each grace note in MIDI output has a length of 1/4 of its actual
3307 duration. If the combined length of the grace notes is greater than the
3308 length of the preceding note a @qq{@code{Going back in MIDI time}}
3309 error will be generated. Either make the grace notes shorter in
3310 duration, for example:
3313 \acciaccatura @{ c'8[ d' e' f' g'] @}
3319 \acciaccatura @{ c'16[ d' e' f' g'] @}
3322 Or explicitly change the musical duration:
3325 \acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
3328 See @ref{Scaling durations}.
3331 @node Aligning to cadenzas
3332 @unnumberedsubsubsec Aligning to cadenzas
3335 @cindex cadenza, aligning to
3336 @cindex aligning to cadenza
3338 In an orchestral context, cadenzas present a special problem: when
3339 constructing a score that includes a measured cadenza or other solo
3340 passage, all other instruments should skip just as many notes as the
3341 length of the cadenza, otherwise they will start too soon or too late.
3343 One solution to this problem is to use the functions
3344 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
3345 functions take a defined piece of music as an argument and generate a
3346 multi-measure rest or @code{\skip} exactly as long as the piece.
3348 @lilypond[verbatim,quote]
3349 MyCadenza = \relative c' {
3360 $(mmrest-of-length MyCadenza)
3362 $(skip-of-length MyCadenza)
3376 @node Time administration
3377 @unnumberedsubsubsec Time administration
3379 @cindex time administration
3380 @cindex timing (within the score)
3381 @cindex music, unmetered
3382 @cindex unmetered music
3384 @funindex currentBarNumber
3385 @funindex measurePosition
3386 @funindex measureLength
3388 Time is administered by the @code{Timing_translator}, which by
3389 default is to be found in the @code{Score} context. An alias,
3390 @code{Timing}, is added to the context in which the
3391 @code{Timing_translator} is placed. To ensure that the
3392 @code{Timing} alias is available, you may need to explicitly
3393 instantiate the containing context (such as @code{Voice} or
3396 The following properties of @code{Timing} are used
3397 to keep track of timing within the score.
3400 @cindex measure number
3403 @item currentBarNumber
3404 The current measure number. For an example showing the
3405 use of this property see @ref{Bar numbers}.
3408 The length of the measures in the current time signature. For a
3409 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
3410 determines when bar lines are inserted and how automatic beams
3411 should be generated.
3413 @item measurePosition
3414 The point within the measure where we currently are. This
3415 quantity is reset by subtracting @code{measureLength} whenever
3416 @code{measureLength} is reached or exceeded. When that happens,
3417 @code{currentBarNumber} is incremented.
3420 If set to true, the above variables are updated for every time
3421 step. When set to false, the engraver stays in the current
3422 measure indefinitely.
3426 Timing can be changed by setting any of these variables
3427 explicitly. In the next example, the default 4/4 time
3428 signature is printed, but @code{measureLength} is set to 5/4.
3429 At 4/8 through the third measure, the @code{measurePosition} is
3430 advanced by 1/8 to 5/8, shortening that bar by 1/8.
3431 The next bar line then falls at 9/8 rather than 5/4.
3433 @lilypond[quote,verbatim]
3434 \new Voice \relative c' {
3435 \set Timing.measureLength = #(ly:make-moment 5 4)
3439 \set Timing.measurePosition = #(ly:make-moment 5 8)
3446 As the example illustrates, @code{ly:make-moment n m} constructs a
3447 duration of n/m of a whole note. For example,
3448 @code{ly:make-moment 1 8} is an eighth note duration and
3449 @code{ly:make-moment 7 16} is the duration of seven sixteenths
3455 @ref{Unmetered music}.
3460 Internals Reference:
3461 @rinternals{Timing_translator},