1 @c -*- coding: utf-8; mode: texinfo; -*-
3 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 When revising a translation, copy the HEAD committish of the
6 version that you are working on. For details, see the Contributors'
7 Guide, node Updating translation committishes..
15 @lilypondfile[quote]{rhythms-headword.ly}
17 This section discusses rhythms, rests, durations, beaming and bars.
22 * Displaying rhythms::
25 * Special rhythmic concerns::
30 @subsection Writing rhythms
40 @unnumberedsubsubsec Durations
42 @cindex durations, of notes
43 @cindex note durations
44 @cindex length of notes
54 Durations are designated by numbers and dots. Durations are entered
55 as their reciprocal values. For example, a quarter note is entered
56 using a @code{4} (since it is a 1/4 note), and a half note is entered
57 using a @code{2} (since it is a 1/2 note). For notes longer than a
58 whole you must use the @code{\longa} (a double breve) and
59 @code{\breve} commands. Durations as short as 128th notes may be
60 specified. Shorter values are possible, but only as beamed notes.
62 @c Two 64th notes are needed to obtain beams
63 @lilypond[quote,verbatim,relative=2]
66 c4 c8 c16 c32 c64 c128 c128
69 Here are the same durations with automatic beaming turned off.
71 @c not strictly "writing rhythms"; more of a "displaying" thing,
72 @c but it's ok here. -gp
73 @lilypond[quote,verbatim,relative=2]
77 c4 c8 c16 c32 c64 c128 c128
80 A note with the duration of a quadruple breve may be entered with
81 @code{\maxima}, but this is supported only within ancient music
82 notation. For details, see @ref{Ancient notation}.
84 @cindex duration, default
85 @cindex default note duration
86 @cindex note duration, default
88 If the duration is omitted, it is set to the previously
89 entered duration. The default for the first note is a quarter
92 @lilypond[quote,verbatim,relative=2]
98 @cindex notes, double-dotted
99 @cindex double-dotted notes
103 To obtain dotted note lengths, place a dot (@code{.}) after the
104 duration. Double-dotted notes are specified by appending two
107 @lilypond[quote,verbatim,relative=2]
108 a4 b c4. b8 a4. b4.. c8.
111 Some durations cannot be represented with just binary durations
112 and dots; they can be represented only by tying two or more
113 notes together. For details, see @ref{Ties}.
115 For ways of specifying durations for the syllables of lyrics and
116 ways of aligning lyrics to notes, see @ref{Vocal music}.
118 Optionally, notes can be spaced strictly proportionately to their
119 duration. For details of this and other settings which control
120 proportional notation, see @ref{Proportional notation}.
126 @funindex \dotsNeutral
127 @funindex dotsNeutral
129 Dots are normally moved up to avoid staff lines, except in
130 polyphonic situations. Dots may be manually placed above or below
131 the staff; see @ref{Direction and placement}.
145 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
146 {alternative-breve-note.ly}
148 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
149 {changing-the-number-of-augmentation-dots-per-note.ly}
157 @rglos{Duration names notes and rests}.
160 @ref{Automatic beams},
163 @ref{Writing rhythms},
166 @ref{Ancient notation},
167 @ref{Proportional notation}.
174 @rinternals{DotColumn}.
177 @c Deliberately duplicated in Durations and Rests. -gp
178 There is no fundamental limit to rest durations (both in terms of
179 longest and shortest), but the number of glyphs is limited:
180 rests from 128th to maxima (8 x whole) may be printed.
184 @unnumberedsubsubsec Tuplets
192 Tuplets are made from a music expression with the @code{\tuplet}
193 command, multiplying the speed of the music expression by a
197 \tuplet @var{fraction} @{ @var{music} @}
201 The fraction's numerator will be printed over or
202 under the notes, optionally with a bracket. The most common
203 tuplets are triplets: 3@tie{}notes sound within the duration
204 normally allowed for@tie{}2:
206 @lilypond[quote,verbatim,relative=2]
207 a2 \tuplet 3/2 { b4 b b }
208 c4 c \tuplet 3/2 { b4 a g }
211 @cindex tuplet grouping
213 When entering long passages of tuplets, having to write a separate
214 @code{\tuplet} command for each group is inconvenient. It is
215 possible to specify the duration of one tuplet group directly
216 before the music in order to have the tuplets grouped
219 @lilypond[quote,verbatim,relative=2]
220 g2 r8 \tuplet 3/2 8 { cis16 d e e f g g f e }
223 @cindex tuplet bracket placement
227 @funindex \tupletDown
229 @funindex \tupletNeutral
230 @funindex tupletNeutral
232 Tuplet brackets may be manually placed above or below the staff;
233 see @ref{Direction and placement}.
235 Tuplets may be nested:
237 @lilypond[quote,verbatim,relative=2]
239 c4 \tuplet 5/4 { f8 e f \tuplet 3/2 { e[ f g] } } f4
242 Modifying nested tuplets which begin at the same musical moment
243 must be done with @code{\tweak}.
245 To modify the duration of notes without printing a tuplet bracket,
246 see @ref{Scaling durations}.
252 @code{\tupletNeutral}.
258 @cindex tuplet formatting
259 @cindex triplet formatting
261 @funindex tupletNumberFormatFunction
262 @funindex tupletSpannerDuration
264 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
265 {entering-several-tuplets-using-only-one--times-command.ly}
267 @cindex Tuplet number changes
269 @funindex TupletNumber
271 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
272 {changing-the-tuplet-number.ly}
274 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
275 {non-default-tuplet-numbers.ly}
277 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
278 {controlling-tuplet-bracket-visibility.ly}
280 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
281 {permitting-line-breaks-within-beamed-tuplets.ly}
290 @rlearning{Tweaking methods}.
293 @ref{Time administration},
294 @ref{Scaling durations},
295 @ref{The tweak command},
296 @ref{Polymetric notation}.
302 @rinternals{TupletBracket},
303 @rinternals{TupletNumber},
304 @rinternals{TimeScaledMusic}.
306 @cindex grace notes within tuplet brackets
309 Grace notes may be placed within tuplet brackets, @emph{except}
310 when a staff begins with a grace note followed by a tuplet. In this
311 particular case, the grace note must be placed before the @code{\tuplet}
312 command to avoid errors.
314 @cindex tempo marks within tuplet brackets
316 When using a tuplet at the beginning of a piece with a @code{\tempo}
317 mark, the music must be explicitly entered in a @code{\new Voice}
318 block, as discussed in @rlearning{Voices contain music}.
321 @node Scaling durations
322 @unnumberedsubsubsec Scaling durations
324 @cindex scaling durations
325 @cindex durations, scaling
327 The duration of single notes, rests or chords may be multiplied by a
328 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
329 is 1) to the duration. This will not affect the appearance of the
330 notes or rests produced, but the altered duration will be used in
331 calculating the position within the measure and setting the duration
332 in the MIDI output. Multiplying factors may be combined like
333 @code{*L*M/N}. Factors are part of the duration: if a duration is
334 not specified for subsequent notes, the default duration taken from
335 the preceding note will include any scaling factor.
337 In the following example, the first three notes take up exactly
338 two beats, but no triplet bracket is printed.
340 @lilypond[quote,relative=2,verbatim]
342 % Alter durations to triplets
346 % Double the duration of chord
348 % Duration of quarter, appears like sixteenth
352 The duration of spacer rests may also be modified by
353 a multiplier. This is useful for skipping many measures, e.g.,
356 @cindex compressing music
357 @cindex expanding music
359 @funindex \scaleDurations
360 @funindex scaleDurations
362 Longer stretches of music may be compressed by a fraction in the
363 same way, as if every note, chord or rest had the fraction as a
364 multiplier. This leaves the appearance of the music unchanged but
365 the internal duration of the notes will be multiplied by the
366 fraction @emph{num}/@emph{den}. Here is an example showing how music
367 can be compressed and expanded:
369 @lilypond[quote,relative=2,verbatim]
373 % Scale music by *2/3
374 \scaleDurations 2/3 {
378 \scaleDurations 2/1 {
383 One application of this command is in polymetric
384 notation, see @ref{Polymetric notation}.
389 @ref{Invisible rests},
390 @ref{Polymetric notation}.
396 The calculation of the position within a measure must take into
397 account all the scaling factors applied to the notes within that
398 measure and any fractional carry-out from earlier measures. This
399 calculation is carried out using rational numbers. If an intermediate
400 numerator or denominator in that calculation exceeds 2^30 the
401 execution and typesetting will stop at that point without indicating
406 @unnumberedsubsubsec Ties
412 A tie connects two adjacent note heads of the same pitch. The tie
413 in effect extends the duration of a note.
415 @warning{Ties should not be confused with @emph{slurs}, which
416 indicate articulation, or @emph{phrasing slurs}, which indicate
417 musical phrasing. A tie is just a way of extending a note
418 duration, similar to the augmentation dot.}
420 A tie is entered by appending a tilde symbol (@code{~}) to the first
421 of each pair of notes being tied. This indicates that the note
422 should be tied to the following note, which must be at the same pitch.
424 @lilypond[quote,verbatim,relative=2]
428 Ties are used either when the note crosses a bar line, or when
429 dots cannot be used to denote the rhythm. Ties should also be
430 used when note values cross larger subdivisions of the measure:
432 @lilypond[verbatim,quote]
439 If you need to tie many notes across bar lines, it may be
440 easier to use automatic note splitting, see @ref{Automatic note
441 splitting}. This mechanism automatically splits long notes, and
442 ties them across bar lines.
444 @cindex ties and chords
445 @cindex chords and ties
447 When a tie is applied to a chord, all note heads whose pitches
448 match are connected. When no note heads match, no ties will be
449 created. Chords may be partially tied by placing the ties inside
452 @lilypond[quote,verbatim,relative=1]
454 <c~ e g~ b> <c e g b>
457 @cindex repeating ties
458 @cindex ties, repeating
459 @cindex volta brackets and ties
460 @cindex ties and volta brackets
465 When a second alternative of a repeat starts with a tied note, you
466 have to specify the repeated tie as follows:
468 @lilypond[quote,relative=2,verbatim]
469 \repeat volta 2 { c g <c e>2~ }
471 % First alternative: following note is tied normally
473 % Second alternative: following note has a repeated tie
474 { <c e>2\repeatTie d4 c } }
477 @cindex laissez vibrer
478 @cindex ties, laissez vibrer
480 @funindex \laissezVibrer
481 @funindex laissezVibrer
483 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
484 notes must not be damped at the end. It is used in notation for
485 piano, harp and other string and percussion instruments. They can
486 be entered as follows:
488 @lilypond[quote,verbatim,relative=1]
489 <c f g>1\laissezVibrer
492 @cindex ties, placement
498 @funindex \tieNeutral
501 Ties may be made to curve up or down manually; see
502 @ref{Direction and placement}.
504 @cindex ties, appearance
517 Ties may be made dashed, dotted, or a combination of solid and
520 @lilypond[quote, verbatim, relative=1]
533 Custom dash patterns can be specified:
535 @lilypond[quote, verbatim, relative=1]
536 \tieDashPattern #0.3 #0.75
538 \tieDashPattern #0.7 #1.5
544 Dash pattern definitions for ties have the same structure as dash
545 pattern definitions for slurs. For more information about complex dash
546 patterns, see @ref{Slurs}.
548 Override @var{whiteout} and @var{layer} layout properties for ties that
549 collide with other objects in a staff.
551 @lilypond[verbatim,quote,ragged-right,relative=2]
552 \override Tie.layer = #-2
553 \override Staff.TimeSignature.layer = #-1
554 \override Staff.KeySignature.layer = #-1
555 \override Staff.TimeSignature.whiteout = ##t
556 \override Staff.KeySignature.whiteout = ##t
569 @code{\tieDashPattern},
570 @code{\tieHalfDashed},
571 @code{\tieHalfSolid},
577 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
578 {using-ties-with-arpeggios.ly}
580 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
581 {engraving-ties-manually.ly}
586 @rglos{laissez vibrer}.
590 @ref{Automatic note splitting}.
593 @rlsr{Expressive marks},
597 @rinternals{LaissezVibrerTie},
598 @rinternals{LaissezVibrerTieColumn},
599 @rinternals{TieColumn},
603 Switching staves when a tie is active will not produce a slanted tie.
605 Changing clefs or ottavations during a tie is not really well-defined.
606 In these cases, a slur may be preferable.
610 @subsection Writing rests
612 Rests are entered as part of the music in music expressions.
617 * Full measure rests::
621 @unnumberedsubsubsec Rests
624 @cindex rest, entering durations
639 Rests are entered like notes with the note name @code{r}.
640 Durations longer than a whole rest use the following predefined
643 @c \time 16/1 is used to avoid spurious bar lines
644 @c and long tracts of empty measures
645 @lilypond[quote,verbatim,relative=2]
647 % These two lines are just to prettify this example
649 \override Staff.TimeSignature.stencil = ##f
650 % Print a maxima rest, equal to four breves
652 % Print a longa rest, equal to two breves
656 r1 r2 r4 r8 r16 r32 r64 r128
660 @cindex rest, multi-measure
661 @cindex rest, whole-measure
663 Whole measure rests, centered in the middle of the measure, must be
664 entered as multi-measure rests. They can be used for a single
665 measure as well as many measures and are discussed in
666 @ref{Full measure rests}.
668 @cindex rest, specifying vertical position
670 To explicitly specify a rest's vertical position, write a note
671 followed by @code{\rest}. A rest of the duration of the note will
672 be placed at the staff position where the note would appear. This
673 allows for precise manual formatting of polyphonic music, since the
674 automatic rest collision formatter will not move these rests.
676 @lilypond[quote,verbatim,relative=2]
682 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
692 @ref{Full measure rests}.
701 @c Deliberately duplicated in Durations and Rests. -gp
702 There is no fundamental limit to rest durations (both in terms of
703 longest and shortest), but the number of glyphs is limited: there
704 are rests from 128th to maxima (8 x whole).
707 @node Invisible rests
708 @unnumberedsubsubsec Invisible rests
711 @cindex invisible rest
712 @cindex rest, invisible
720 An invisible rest (also called a @q{spacer rest}) can be entered
721 like a note with the note name@tie{}@code{s}:
723 @lilypond[verbatim,quote,relative=2]
730 Spacer rests are available only in note mode and chord mode. In
731 other situations, for example, when entering lyrics, the
732 command @code{\skip} is used to skip a musical moment.
733 @code{\skip} requires an explicit duration, but this is ignored if
734 the lyrics derive their durations from the notes in an associated
735 melody through @code{\addlyrics} or @code{\lyricsto}.
737 @lilypond[quote,verbatim,relative=2]
750 Because @code{\skip} is a command, it does not affect the default
751 durations of following notes, unlike@tie{}@code{s}.
753 @lilypond[quote,verbatim,relative=2]
756 \repeat unfold 8 { a4 }
766 A spacer rest implicitly causes @code{Staff} and @code{Voice}
767 contexts to be created if none exist, just like notes and rests
770 @lilypond[quote,verbatim,relative=2]
774 @code{\skip} simply skips musical time; it creates no output of
777 @lilypond[quote,verbatim,relative=2]
778 % This is valid input, but does nothing
779 \skip 1 \skip1 \skip 1
784 @rlearning{Visibility and color of objects}.
788 @ref{Visibility of objects}.
794 @rinternals{SkipMusic}.
797 @node Full measure rests
798 @unnumberedsubsubsec Full measure rests
800 @cindex multi-measure rests
801 @cindex full-measure rests
802 @cindex rest, multi-measure
803 @cindex rest, full-measure
804 @cindex whole rest for a full measure
805 @cindex rest, whole for a full measure
809 Rests for one or more full measures are entered like notes with
810 the note name uppercase @code{R}:
812 @lilypond[quote,verbatim,relative=2]
813 % Rest measures contracted to single measure
814 \compressFullBarRests
821 The duration of full-measure rests is identical to the duration
822 notation used for notes. The duration in a multi-measure rest must
823 always be an integral number of measure-lengths, so augmentation dots
824 or fractions must often be used:
826 @lilypond[quote,verbatim,relative=2]
827 \compressFullBarRests
833 R1*13/8 | R1*13/8*12 |
838 A full-measure rest is printed as either a whole or breve rest,
839 centered in the measure, depending on the time signature.
841 @lilypond[quote,verbatim,relative=2]
850 @cindex multi-measure rest, expanding
851 @cindex multi-measure rest, contracting
853 @funindex \expandFullBarRests
854 @funindex expandFullBarRests
855 @funindex \compressFullBarRests
856 @funindex compressFullBarRests
858 By default a multi-measure rest is expanded in the printed score to
859 show all the rest measures explicitly. Alternatively, a multi-measure
860 rest can be shown as a single measure containing a multi-measure rest
861 symbol, with the number of measures of rest printed above the measure:
863 @lilypond[quote,verbatim,relative=2]
865 \time 3/4 r2. | R2.*2 |
868 % Rest measures contracted to single measure
869 \compressFullBarRests
871 % Rest measures expanded
878 @cindex text on multi-measure rest
879 @cindex multi-measure rest, attaching text
880 @cindex script on multi-measure rest
881 @cindex multi-measure rest, script
882 @cindex fermata on multi-measure rest
883 @cindex multi-measure rest, attaching fermata
884 @cindex markup on multi-measure rest
885 @cindex multi-measure rest with markup
887 @funindex \fermataMarkup
888 @funindex fermataMarkup
889 @funindex MultiMeasureRestText
891 Markups can be added to multi-measure rests.
892 The predefined command @code{\fermataMarkup}
893 is provided for adding fermatas.
895 @lilypond[quote,verbatim,relative=2]
896 \compressFullBarRests
898 R2.*10^\markup { \italic "ad lib." }
902 @warning{Markups attached to a multi-measure rest are objects of type
903 @code{MultiMeasureRestText}, not @code{TextScript}. Overrides must
904 be directed to the correct object, or they will be ignored. See the
907 @lilypond[quote,verbatim,relative=2]
908 % This fails, as the wrong object name is specified
909 \override TextScript.padding = #5
911 % This is the correct object name to be specified
912 \override MultiMeasureRestText.padding = #5
916 When a multi-measure rest immediately follows a @code{\partial}
917 setting, resulting bar-check warnings may not be displayed.
920 @funindex \textLengthOn
921 @funindex textLengthOn
922 @funindex \textLengthOff
923 @funindex textLengthOff
924 @funindex \fermataMarkup
925 @funindex fermataMarkup
926 @funindex \compressFullBarRests
927 @funindex compressFullBarRests
928 @funindex \expandFullBarRests
929 @funindex expandFullBarRests
932 @code{\textLengthOn},
933 @code{\textLengthOff},
934 @code{\fermataMarkup},
935 @code{\compressFullBarRests},
936 @code{\expandFullBarRests}.
944 @cindex kirchenpausen
946 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
947 {changing-form-of-multi-measure-rests.ly}
949 @cindex multi-measure rests, positioning
950 @cindex positioning multi-measure rests
952 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
953 {positioning-multi-measure-rests.ly}
955 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
956 {multi-measure-rest-markup.ly}
960 @rglos{multi-measure rest}.
965 @ref{Formatting text},
972 @rinternals{MultiMeasureRest},
973 @rinternals{MultiMeasureRestNumber},
974 @rinternals{MultiMeasureRestText}.
976 @cindex fingerings and multi-measure rests
977 @cindex multi-measure rests and fingerings
980 Fingerings over multi-measure rests (e.g. @code{R1*10-4}) may result
981 in the fingering numeral colliding with the bar counter
984 @cindex condensing rests
985 @cindex rest, condensing ordinary
987 There is no way to automatically condense multiple ordinary rests
988 into a single multi-measure rest.
990 @cindex rest, collisions of
992 Multi-measure rests do not take part in rest collisions.
995 @node Displaying rhythms
996 @subsection Displaying rhythms
1003 * Polymetric notation::
1004 * Automatic note splitting::
1005 * Showing melody rhythms::
1008 @node Time signature
1009 @unnumberedsubsubsec Time signature
1011 @cindex time signature
1017 The time signature is set as follows:
1019 @lilypond[quote,verbatim,relative=2]
1024 @cindex time signature, visibility of
1026 Time signatures are printed at the beginning of a piece
1027 and whenever the time signature changes. If a change takes place
1028 at the end of a line a warning time signature sign is printed
1029 there. This default behavior may be changed, see
1030 @ref{Visibility of objects}.
1032 @lilypond[quote,verbatim,relative=2]
1042 @cindex time signature style
1045 @funindex \numericTimeSignature
1046 @funindex numericTimeSignature
1047 @funindex \defaultTimeSignature
1048 @funindex defaultTimeSignature
1050 The time signature symbol that is used in 2/2 and 4/4 time can be
1051 changed to a numeric style:
1053 @lilypond[quote,verbatim,relative=2]
1057 % Change to numeric style
1058 \numericTimeSignature
1061 % Revert to default style
1062 \defaultTimeSignature
1068 Mensural time signatures are covered in
1069 @ref{Mensural time signatures}.
1071 @cindex time signature default settings
1072 @cindex autobeaming properties for time signatures
1073 @cindex beaming, time signature default properties
1074 @funindex \overrideTimeSignatureSettings
1076 In addition to setting the printed time signature, the @code{\time}
1077 command also sets the values of the time-signature-based properties
1078 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
1079 The predefined default values for these properties can be found in
1080 @file{scm/time-signature-settings.scm}.
1082 The default value of @code{beatStructure} can be overridden in the
1083 @code{\time} command itself by supplying it as the optional first
1086 @lilypond[quote,verbatim]
1091 \repeat unfold 7 { c8 } |
1093 \repeat unfold 7 { c8 } |
1099 Alternatively, the default values of all these time-signature-based
1100 variables, including @code{baseMoment} and @code{beamExceptions},
1101 can be set together. The values can be set independently for several
1102 different time signatures. The new values take effect when a
1103 subsequent @code{\time} command with the same value of the time
1104 signature is executed:
1106 @lilypond[quote,verbatim]
1110 \overrideTimeSignatureSettings
1111 4/4 % timeSignatureFraction
1112 1/4 % baseMomentFraction
1113 #'(3 1) % beatStructure
1114 #'() % beamExceptions
1116 \repeat unfold 8 { c8 } |
1122 @code{\overrideTimeSignatureSettings} takes four arguments:
1127 @code{@var{timeSignatureFraction}}, a fraction describing the
1128 time signature to which these values apply.
1131 @code{@var{baseMomentFraction}}, a fraction containing the numerator
1132 and denominator of the basic timing unit for the time signature.
1135 @code{@var{beatStructure}}, a Scheme list indicating the structure
1136 of the beats in the measure, in units of the base moment.
1139 @code{@var{beamExceptions}}, an alist containing any beaming rules
1140 for the time signature that go beyond ending at every beat, as
1141 described in @ref{Setting automatic beam behavior}.
1144 The context containing @code{\overrideTimeSignatureSettings} must
1145 be instantiated before the @code{\overrideTimeSignatureSettings}
1146 call is executed. That means it must either be explicitly
1147 instantiated or there must be music in the context before the
1148 @code{\overrideTimeSignatureSettings} call:
1150 @lilypond[quote,verbatim]
1153 % This call will fail because the context isn't yet instantiated
1154 \overrideTimeSignatureSettings
1155 4/4 % timeSignatureFraction
1156 1/4 % baseMomentFraction
1157 #'(3 1) % beatStructure
1158 #'() % beamExceptions
1160 c8^\markup {"Beamed (2 2)"}
1161 \repeat unfold 7 { c8 } |
1162 % This call will succeed
1163 \overrideTimeSignatureSettings
1164 4/4 % timeSignatureFraction
1165 1/4 % baseMomentFraction
1166 #'(3 1) % beatStructure
1167 #'() % beamExceptions
1169 c8^\markup {"Beamed (3 1)"}
1170 \repeat unfold 7 { c8 } |
1176 @cindex time signature properties, restoring default values
1177 @cindex restoring default properties for time signatures
1178 @funindex \revertTimeSignatureSettings
1180 Changed values of default time signature properties can be restored
1181 to the original values:
1183 @lilypond[quote,verbatim]
1186 \repeat unfold 8 { c8 } |
1187 \overrideTimeSignatureSettings
1188 4/4 % timeSignatureFraction
1189 1/4 % baseMomentFraction
1190 #'(3 1) % beatStructure
1191 #'() % beamExceptions
1193 \repeat unfold 8 { c8 } |
1194 \revertTimeSignatureSettings 4/4
1196 \repeat unfold 8 { c8 } |
1201 Different values of default time signature properties can be established
1202 for different staves by moving the @code{Timing_translator} and the
1203 @code{Default_bar_line_engraver} from the @code{Score} context to the
1204 @code{Staff} context.
1206 @lilypond[quote, verbatim]
1210 \overrideTimeSignatureSettings
1211 4/4 % timeSignatureFraction
1212 1/4 % baseMomentFraction
1213 #'(3 1) % beatStructure
1214 #'() % beamExceptions
1216 \repeat unfold 8 {c''8}
1219 \overrideTimeSignatureSettings
1220 4/4 % timeSignatureFraction
1221 1/4 % baseMomentFraction
1222 #'(1 3) % beatStructure
1223 #'() % beamExceptions
1225 \repeat unfold 8 {c''8}
1231 \remove "Timing_translator"
1232 \remove "Default_bar_line_engraver"
1236 \consists "Timing_translator"
1237 \consists "Default_bar_line_engraver"
1243 A further method of changing these time-signature-related variables,
1244 which avoids reprinting the time signature at the time of the change,
1245 is shown in @ref{Setting automatic beam behavior}.
1248 @code{\numericTimeSignature},
1249 @code{\defaultTimeSignature}.
1254 @lilypondfile[verbatim,quote,texidoc,doctitle]
1255 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1259 @rglos{time signature}
1262 @ref{Mensural time signatures},
1263 @ref{Setting automatic beam behavior},
1264 @ref{Time administration}.
1267 @file{scm/time-signature-settings.scm}.
1272 Internals Reference:
1273 @rinternals{TimeSignature},
1274 @rinternals{Timing_translator}.
1277 @node Metronome marks
1278 @unnumberedsubsubsec Metronome marks
1281 @cindex beats per minute
1282 @cindex metronome mark
1283 @cindex metronome marking with text
1288 A basic metronome mark is simple to write:
1290 @lilypond[verbatim,quote,relative=1]
1296 Metronome marks may also be printed as a range of two numbers:
1298 @lilypond[verbatim,quote,relative=1]
1304 Tempo indications with text can be used instead:
1306 @lilypond[verbatim,quote,relative=2]
1312 Combining a metronome mark and text will automatically place the
1313 metronome mark within parentheses:
1315 @lilypond[verbatim,quote,relative=2]
1316 \tempo "Allegro" 4 = 160
1321 In general, the text can be any markup object:
1323 @lilypond[verbatim,quote,relative=2]
1324 \tempo \markup { \italic Faster } 4 = 132
1325 a8-. r8 b-. r gis-. r a-. r
1328 A parenthesized metronome mark with no textual indication may be
1329 written by including an empty string in the input:
1331 @lilypond[verbatim,quote,relative=2]
1339 @lilypondfile[verbatim,quote,texidoc,doctitle]
1340 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
1342 @c perhaps also an example of how to move it horizontally?
1344 @lilypondfile[verbatim,quote,texidoc,doctitle]
1345 {changing-the-tempo-without-a-metronome-mark.ly}
1347 @lilypondfile[verbatim,quote,texidoc,doctitle]
1348 {creating-metronome-marks-in-markup-mode.ly}
1350 For more details, see @ref{Formatting text}.
1355 @rglos{metronomic indication},
1356 @rglos{tempo indication},
1357 @rglos{metronome mark}.
1360 @ref{Formatting text},
1364 @rlsr{Staff notation}.
1366 Internals Reference:
1367 @rinternals{MetronomeMark}.
1371 @unnumberedsubsubsec Upbeats
1375 @cindex partial measure
1376 @cindex measure, partial
1377 @cindex measure, pickup
1378 @cindex pickup measure
1380 @funindex measurePosition
1384 Partial or pick-up measures, such as an @emph{anacrusis} or an
1385 @emph{upbeat}, are entered using the @code{\partial} command,
1388 \partial @var{duration}
1392 where @code{@var{duration}} is the @emph{remaining} length of the
1393 partial measure @emph{before} the start of the next full measure.
1395 @lilypond[quote,verbatim,relative=1]
1401 The @var{duration} can be any value less than a full measure:
1403 @lilypond[quote,verbatim,relative=1]
1406 r4 e8 | a4 c8 b c4 |
1409 @code{\partial @var{duration}} can also be written as:
1412 \set Timing.measurePosition -@var{duration}
1415 So the first example above could be written:
1417 @lilypond[quote,verbatim,relative=1]
1419 \set Timing.measurePosition = #(ly:make-moment -1/8)
1423 The property @code{measurePosition} contains a rational number, which
1424 is usually positive and indicates how much of the measure has passed
1425 at this point. The @code{\partial @var{duration}} command sets it to
1426 a negative number, when it has a different meaning: it then says that
1427 the current (first) bar will be @emph{preceded} by a bar 0 (the partial
1428 bar) with a duration given by @var{duration}.
1441 @rinternals{Timing_translator}.
1444 The @code{\partial} command should be used only at the beginning of a
1445 piece. If you use it after the beginning, warnings or problems may
1446 occur, so use @code{\set Timing.measurePosition} instead.
1448 @lilypond[quote,verbatim,relative=1]
1451 e8 | a4 c8 b[ c b] |
1452 \set Timing.measurePosition = #(ly:make-moment -1/4)
1453 r8 e,8 | a4 c8 b[ c b] |
1457 @node Unmetered music
1458 @unnumberedsubsubsec Unmetered music
1461 @cindex cadenza, beams
1462 @cindex cadenza, accidentals
1463 @cindex cadenza, bar lines
1464 @cindex cadenza, bar numbers
1465 @cindex unmetered music
1466 @cindex unmetered music, beams
1467 @cindex unmetered music, accidentals
1468 @cindex unmetered music, bar lines
1469 @cindex unmetered music, bar numbers
1470 @cindex accidentals, cadenzas
1471 @cindex accidentals, unmetered music
1472 @cindex bar lines, cadenzas
1473 @cindex bar lines, unmetered music
1474 @cindex bar numbers, cadenzas
1475 @cindex bar numbers, unmetered music
1476 @cindex beams, cadenzas
1477 @cindex beams, unmetered music
1479 @funindex \cadenzaOn
1481 @funindex \cadenzaOff
1482 @funindex cadenzaOff
1484 In metered music bar lines are inserted and bar numbers are calculated
1485 automatically. In unmetered music (i.e. cadenzas), this is not
1486 desirable and can be @q{switched off} using the command
1487 @code{\cadenzaOn}, then @q{switched back on} at the appropriate place
1488 using @code{\cadenzaOff}.
1490 @lilypond[verbatim,relative=2,quote]
1493 c4 c d8[ d d] f4 g4.
1499 Bar numbering is resumed at the end of the cadenza.
1501 @lilypond[verbatim,relative=2,quote]
1502 % Show all bar numbers
1503 \override Score.BarNumber.break-visibility = #all-visible
1506 c4 c d8[ d d] f4 g4.
1512 Inserting a @code{\bar} command within a cadenza does not start a new
1513 measure, even if a bar line is printed. So any accidentals -- which
1514 are usually assumed to remain in force until the end of the measure --
1515 will still be valid after the bar line printed by @code{\bar}. If
1516 subsequent accidentals should be printed, forced accidentals or
1517 reminder accidentals need to be inserted manually, see
1520 @lilypond[verbatim,relative=2,quote]
1525 % First cis is printed without alteration even if it's after a \bar
1531 Automatic beaming is disabled by @code{\cadenzaOn}. Therefore, all
1532 beaming in cadenzas must be entered manually. See @ref{Manual beams}.
1534 @lilypond[verbatim,relative=2,quote]
1535 \repeat unfold 8 { c8 }
1541 \repeat unfold 8 { c8 }
1544 These predefined commands affect all staves in the score, even when
1545 placed in just one @code{Voice} context. To change this, move the
1546 @code{Timing_translator} from the @code{Score} context to the
1547 @code{Staff} context. See @ref{Polymetric notation}.
1559 @ref{Visibility of objects},
1560 @ref{Polymetric notation},
1567 @cindex cadenza, line breaks
1568 @cindex cadenza, page breaks
1569 @cindex unmetered music, line breaks
1570 @cindex unmetered music, page breaks
1571 @cindex breaks in unmetered music
1572 @cindex line breaks, cadenzas
1573 @cindex page breaks, cadenzas
1574 @cindex line breaks, unmetered music
1575 @cindex page breaks, unmetered music
1578 Automatic line and page breaks are inserted only at bar lines, so
1579 @q{invisible} bar lines will need to be inserted manually in long
1580 stretches of unmetered music to permit breaking:
1586 Explicitly create a @code{Voice} context when starting a piece with
1587 @code{\cadenzaOn}, else unexpected errors may occur.
1593 c16[^"Solo Free Time" d e f] g2.
1601 @node Polymetric notation
1602 @unnumberedsubsubsec Polymetric notation
1604 @c This section necessarily uses \set
1605 @c This is acceptable -td
1607 @cindex double time signatures
1608 @cindex signatures, polymetric
1609 @cindex time signatures, polymetric
1610 @cindex time signatures, double
1611 @cindex polymetric signatures
1612 @cindex meter, polymetric
1614 @funindex timeSignatureFraction
1615 @funindex \scaleDurations
1616 @funindex scaleDurations
1620 Polymetric notation is supported explicitly or by manually modifying the
1621 visible time signature symbol and/or scaling note durations.
1623 @subsubsubheading Different time signatures with equal-length measures
1625 Set a common time signature for each staff, and set the
1626 @code{timeSignatureFraction} to the desired fraction. Then use the
1627 @code{\scaleDurations} function to scale the durations of the notes in
1628 each staff to the common time signature.
1630 @cindex beams, with polymetric meters
1631 @cindex polymetric meters, with beams
1633 In the following example, music with the time signatures of 3/4, 9/8 and
1634 10/8 are used in parallel. In the second staff, shown durations are
1635 multiplied by 2/3 (because 2/3 * 9/8 = 3/4) and in the third staff, the
1636 shown durations are multiplied by 3/5 (because 3/5 * 10/8 = 3/4). It
1637 may be necessary to insert beams manually, as the duration scaling will
1638 affect the autobeaming rules.
1640 @lilypond[quote,verbatim]
1649 \set Staff.timeSignatureFraction = 9/8
1651 \repeat unfold 6 { c8[ c c] }
1655 \set Staff.timeSignatureFraction = 10/8
1656 \scaleDurations 3/5 {
1657 \repeat unfold 2 { c8[ c c] }
1658 \repeat unfold 2 { c8[ c] } |
1659 c4. c \tuplet 3/2 { c8[ c c] } c4
1665 @subsubsubheading Different time signatures with unequal-length measures
1667 Each staff can be given its own independent time signature by
1668 moving the @code{Timing_translator} and the
1669 @code{Default_bar_line_engraver} to the @code{Staff} context.
1671 @lilypond[quote,verbatim]
1675 \remove "Timing_translator"
1676 \remove "Default_bar_line_engraver"
1680 \consists "Timing_translator"
1681 \consists "Default_bar_line_engraver"
1685 % Now each staff has its own time signature.
1709 @funindex \compoundMeter
1710 @cindex compound time signatures
1711 @cindex time signature, compound
1713 @subsubsubheading Compound time signatures
1715 These are created using the @code{\compoundMeter} function. The syntax
1719 \compoundMeter #'@code{(list of lists)}
1722 The simplest construction is a single list, where the @emph{last} number
1723 indicates the bottom number of the time signature and those that come
1724 before it, the top numbers.
1726 @lilypond[quote,verbatim]
1728 \compoundMeter #'((2 2 2 8))
1729 \repeat unfold 6 c8 \repeat unfold 12 c16
1733 More complex meters can be constructed using additional lists. Also,
1734 automatic beaming settings will be adjusted depending on the values.
1736 @lilypond[quote,verbatim]
1738 \compoundMeter #'((1 4) (3 8))
1739 \repeat unfold 5 c8 \repeat unfold 10 c16
1743 \compoundMeter #'((1 2 3 8) (3 4))
1744 \repeat unfold 12 c8
1751 @rglos{polymetric time signature},
1755 @ref{Automatic beams},
1757 @ref{Time signature},
1758 @ref{Scaling durations}.
1763 Internals Reference:
1764 @rinternals{TimeSignature},
1765 @rinternals{Timing_translator},
1766 @rinternals{Default_bar_line_engraver},
1770 When using different time signatures in parallel, notes at the same
1771 moment will be placed at the same horizontal location. However, the bar
1772 lines in the different staves will cause the note spacing to be less
1773 regular in each of the individual staves than would be normal without
1774 the different time signatures.
1777 @node Automatic note splitting
1778 @unnumberedsubsubsec Automatic note splitting
1780 @cindex notes, splitting
1781 @cindex splitting notes
1782 @cindex rests, splitting
1783 @cindex splitting rests
1785 @funindex Note_heads_engraver
1786 @funindex Completion_heads_engraver
1787 @funindex Completion_rest_engraver
1789 Long notes which overrun bar lines can be converted automatically to
1790 tied notes. This is done by replacing the @code{Note_heads_engraver}
1791 with the @code{Completion_heads_engraver}. Similarly, long rests which
1792 overrun bar lines are split automatically by replacing the
1793 @code{Rest_engraver} with the @code{Completion_rest_engraver}. In the
1794 following example, notes and rests crossing the bar lines are split,
1795 notes are also tied.
1797 @lilypond[quote,verbatim,relative=1]
1799 \remove "Note_heads_engraver"
1800 \consists "Completion_heads_engraver"
1801 \remove "Rest_engraver"
1802 \consists "Completion_rest_engraver"
1805 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 r1*2 }
1808 These engravers split all running notes and rests at the bar line, and
1809 inserts ties for notes. One of its uses is to debug complex scores: if
1810 the measures are not entirely filled, then the ties show exactly how
1811 much each measure is off.
1818 @rlearning{Engravers explained},
1819 @rlearning{Adding and removing engravers}.
1824 Internals Reference:
1825 @rinternals{Note_heads_engraver},
1826 @rinternals{Completion_heads_engraver},
1827 @rinternals{Rest_engraver},
1828 @rinternals{Completion_rest_engraver},
1829 @rinternals{Forbid_line_break_engraver}.
1832 Not all durations (especially those containing tuplets) can be
1833 represented exactly with normal notes and dots, but the
1834 @code{Completion_heads_engraver} will not insert tuplets.
1836 The @code{Completion_heads_engraver} only affects notes; it does not
1840 @node Showing melody rhythms
1841 @unnumberedsubsubsec Showing melody rhythms
1843 @cindex melody rhythms, showing
1844 @cindex rhythms, showing melody
1846 Sometimes you might want to show only the rhythm of a melody. This
1847 can be done with the rhythmic staff. All pitches of notes on such a
1848 staff are squashed, and the staff itself has a single line
1850 @lilypond[quote,relative=1,verbatim]
1852 \new RhythmicStaff {
1853 \new Voice = "myRhythm" {
1861 \lyricsto "myRhythm" {
1869 @cindex guitar chord charts
1870 @cindex strumming rhythms, showing
1871 @cindex guitar strumming rhythms, showing
1873 @funindex Pitch_squash_engraver
1874 @funindex \improvisationOn
1875 @funindex improvisationOn
1876 @funindex \improvisationOff
1877 @funindex improvisationOff
1879 Guitar chord charts often show the strumming rhythms. This can
1880 be done with the @code{Pitch_squash_engraver} and
1881 @code{\improvisationOn}.
1884 @lilypond[quote,verbatim]
1892 \consists "Pitch_squash_engraver"
1905 @code{\improvisationOn},
1906 @code{\improvisationOff}.
1912 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1913 {guitar-strum-rhythms.ly}
1919 Internals Reference:
1920 @rinternals{RhythmicStaff},
1921 @rinternals{Pitch_squash_engraver}.
1929 * Setting automatic beam behavior::
1934 @node Automatic beams
1935 @unnumberedsubsubsec Automatic beams
1937 By default, beams are inserted automatically:
1939 @cindex beams, manual
1940 @cindex manual beams
1941 @cindex beams, customizing rules
1943 @funindex \autoBeamOn
1944 @funindex autoBeamOn
1945 @funindex \autoBeamOff
1946 @funindex autoBeamOff
1948 @lilypond[quote,verbatim,relative=2]
1950 \time 6/8 c8 c c c8. c16 c8
1953 If these automatic decisions are not satisfactory, beaming can be
1954 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1955 entered manually if beams are to be extended over rests.
1957 If automatic beaming is not required, it may be turned off with
1958 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1960 @lilypond[quote,relative=1,verbatim]
1961 c4 c8 c8. c16 c8. c16 c8
1968 @cindex melismata, with beams
1969 @cindex beams, with melismata
1971 @warning{If beams are used to indicate melismata in songs, then
1972 automatic beaming should be switched off with @code{@bs{}autoBeamOff}
1973 and the beams indicated manually. Using @code{@bs{}partcombine} with
1974 @code{@bs{}autoBeamOff} can produce unintended results. See the
1975 snippets for more information.}
1977 Beaming patterns that differ from the automatic defaults can be
1978 created; see @ref{Setting automatic beam behavior}.
1981 @code{\autoBeamOff},
1985 @cindex beams, line breaks
1986 @cindex line breaks, beams
1987 @cindex beams, with knee gap
1988 @cindex knee gap, with beams
1992 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1993 {beams-across-line-breaks.ly}
1995 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1996 {changing-beam-knee-gap.ly}
1998 @cindex beams, \partcombine with \autoBeamOff
1999 @cindex voices, \partcombine with \autoBeamOff
2001 @lilypondfile [verbatim, quote, ragged-right, texidoc, doctitle]
2002 {partcombine-and-autobeamoff.ly}
2007 @ref{Setting automatic beam behavior}.
2010 @file{scm/auto-beam.scm}.
2015 Internals Reference:
2016 @rinternals{Auto_beam_engraver},
2017 @rinternals{Beam_engraver},
2019 @rinternals{BeamEvent},
2020 @rinternals{BeamForbidEvent},
2021 @rinternals{beam-interface},
2022 @rinternals{unbreakable-spanner-interface}.
2025 The properties of a beam are determined at the @emph{start} of its
2026 construction and any additional beam-property changes that occur before
2027 the beam has been completed will not take effect until the @emph{next},
2031 @node Setting automatic beam behavior
2032 @unnumberedsubsubsec Setting automatic beam behavior
2034 @cindex beams, with lyrics
2035 @cindex lyrics, with beams
2037 @funindex autoBeaming
2038 @funindex baseMoment
2039 @funindex beamExceptions
2040 @funindex beatStructure
2041 @funindex measureLength
2047 When automatic beaming is enabled, the placement of automatic beams
2048 is determined by three context properties:
2049 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2050 The default values of these variables may be overridden as described
2051 below, or alternatively the default values themselves may be changed
2052 as explained in @ref{Time signature}.
2054 If a @code{beamExceptions} rule is defined for the time signature in
2055 force, that rule alone is used to determine the beam placement; the
2056 values of @code{baseMoment} and @code{beatStructure} are ignored.
2058 If no @code{beamExceptions} rule is defined for the time signature
2059 in force, the beam placement is determined by the values of
2060 @code{baseMoment} and @code{beatStructure}.
2063 @subsubsubheading Beaming based on @code{baseMoment} and @code{beatStructure}
2065 By default, @code{beamExceptions} rules are defined for most common
2066 time signatures, so the @code{beamExceptions} rules must be disabled
2067 if automatic beaming is to be based on @code{baseMoment} and
2068 @code{beatStructure}. The @code{beamExceptions} rules are disabled
2072 \set Timing.beamExceptions = #'()
2075 When @code{beamExceptions} is set to @code{#'()}, either due to an
2076 explicit setting or because no @code{beamExceptions} rules are defined
2077 internally for the time signature in force, the ending points for
2078 beams are on beats as specified by the context properties
2079 @code{baseMoment} and @code{beatStructure}. @code{beatStructure} is
2080 a scheme list that defines the length of each beat in the measure in
2081 units of @code{baseMoment}. By default, @code{baseMoment} is one
2082 over the denominator of the time signature. By default, each unit of
2083 length @code{baseMoment} is a single beat.
2085 @lilypond[quote,relative=2,verbatim]
2087 c16^"default" c c c c |
2088 % beamExceptions are unlikely to be defined for 5/16 time,
2089 % but let's disable them anyway to be sure
2090 \set Timing.beamExceptions = #'()
2091 \set Timing.beatStructure = #'(2 3)
2092 c16^"(2+3)" c c c c |
2093 \set Timing.beatStructure = #'(3 2)
2094 c16^"(3+2)" c c c c |
2097 @lilypond[quote,relative=2,verbatim]
2099 a8^"default" a a a a a a a
2100 % Disable beamExceptions because they are definitely
2101 % defined for 4/4 time
2102 \set Timing.beamExceptions = #'()
2103 \set Timing.baseMoment = #(ly:make-moment 1/4)
2104 \set Timing.beatStructure = #'(1 1 1 1)
2105 a8^"changed" a a a a a a a
2108 Beam setting changes can be limited to specific contexts. If no
2109 setting is included in a lower-level context, the setting of the
2110 enclosing context will apply.
2112 @lilypond[quote, verbatim,relative=1]
2115 % No need to disable beamExceptions as they are not defined for 7/8 time
2116 \set Staff.beatStructure = #'(2 3 2)
2126 \set Voice.beatStructure = #'(1 3 3)
2134 When multiple voices are used the @code{Staff} context must be
2135 specified if the beaming is to be applied to all voices in the
2138 @lilypond[quote,verbatim,relative=2]
2141 % Change applied to Voice by default -- does not work correctly
2142 % Because of autogenerated voices, all beating will
2143 % be at baseMoment (1 . 8)
2144 \set beatStructure = #'(3 1 1 2)
2145 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2147 % Works correctly with context Staff specified
2148 \set Staff.beatStructure = #'(3 1 1 2)
2149 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2152 The value of @code{baseMoment} can be adjusted to change
2153 the beaming behavior, if desired. When this is done,
2154 the value of @code{beatStructure} must be set to be
2155 compatible with the new value of @code{baseMoment}.
2157 @lilypond[quote,verbatim,relative=2]
2159 % No need to disable beamExceptions as they are not defined for 5/8 time
2160 \set Timing.baseMoment = #(ly:make-moment 1/16)
2161 \set Timing.beatStructure = #'(7 3)
2162 \repeat unfold 10 { a16 }
2165 @code{baseMoment} is a @i{moment}; a unit of musical duration. A
2166 quantity of type @i{moment} is created by the scheme function
2167 @code{ly:make-moment}. For more information about this function,
2168 see @ref{Time administration}.
2170 By default @code{baseMoment} is set to one over the denominator of
2171 the time signature. Any exceptions to this default can be found in
2172 @file{scm/time-signature-settings.scm}.
2174 @subsubsubheading Beaming based on @code{beamExceptions}
2176 Special autobeaming rules (other than ending a beam on a beat)
2177 are defined in the @code{beamExceptions} property.
2179 @lilypond[quote,relative=2,verbatim]
2181 \set Timing.beatStructure = #'(2 1)
2182 \set Timing.beamExceptions =
2184 (end . ;entry for end of beams
2185 ( ;start of alist of end points
2186 ((1 . 32) . (2 2 2)) ;rule for 1/32 beams -- end each 1/16
2187 ))) %close all entries
2189 \repeat unfold 6 { c32 } |
2192 @code{beamExceptions} is an alist with a key of rule-type and a value
2195 At this time the only available value of rule-type is
2196 @code{'end} for beam ending.
2198 Beaming-rules is a scheme alist (or list of pairs) that indicates the
2199 beam type and the grouping to be applied to beams containing notes with
2200 a shortest duration of that beam type.
2203 #'((beam-type1 . grouping-1)
2204 (beam-type2 . grouping-2)
2205 (beam-type3 . grouping-3))
2208 Beam type is a scheme pair indicating the duration of the beam,
2209 e.g., @code{(1 . 16)}.
2211 Grouping is a scheme list indicating the grouping to be applied to
2212 the beam. The grouping is in units of the beam type.
2214 @warning{ A @code{beamExceptions} value must be @emph{complete}
2215 exceptions list. That is, every exception that should be applied
2216 must be included in the setting. It is not possible to add, remove,
2217 or change only one of the exceptions. While this may seem cumbersome,
2218 it means that the current beaming settings need not be known in order
2219 to specify a new beaming pattern.}
2221 When the time signature is changed, default values of
2222 @code{Timing.baseMoment}, @code{Timing.beatStructure},
2223 and @code{Timing.beamExceptions} are set. Setting the time signature
2224 will reset the automatic beaming settings for the @code{Timing}
2225 context to the default behavior.
2227 @lilypond[quote,verbatim,relative=2]
2229 \repeat unfold 6 { a8 }
2231 \set Timing.beatStructure = #'(4 2)
2232 \repeat unfold 6 { a8 }
2233 % go back to default behavior
2235 \repeat unfold 6 { a8 }
2238 The default automatic beaming settings for a time signature
2239 are determined in @file{scm/time-signature-settings.scm}.
2240 Changing the default automatic beaming settings
2241 for a time signature is described in @ref{Time signature}.
2243 Many automatic beaming settings for a time signature contain an
2244 entry for @code{beamExceptions}. For example, 4/4 time tries to
2245 beam the measure in two if there are only eighth notes. The
2246 @code{beamExceptions} rule can override the @code{beatStructure} setting
2247 if @code{beamExceptions} is not reset.
2249 @lilypond[quote,verbatim,relative=2]
2251 \set Timing.baseMoment = #(ly:make-moment 1/8)
2252 \set Timing.beatStructure = #'(3 3 2)
2253 % This won't beam (3 3 2) because of beamExceptions
2254 \repeat unfold 8 {c8} |
2255 % This will beam (3 3 2) because we clear beamExceptions
2256 \set Timing.beamExceptions = #'()
2257 \repeat unfold 8 {c8}
2260 In a similar fashion, eighth notes in 3/4 time are beamed as a full
2261 measure by default. To beam eighth notes in 3/4 time on the beat,
2262 reset @code{beamExceptions}.
2264 @lilypond[quote,verbatim,relative=2]
2266 % by default we beam in (6) due to beamExceptions
2267 \repeat unfold 6 {a8} |
2268 % This will beam (1 1 1) due to default baseMoment and beatStructure
2269 \set Timing.beamExceptions = #'()
2270 \repeat unfold 6 {a8}
2273 In engraving from the Romantic and Classical periods,
2274 beams often begin midway through the measure in 3/4 time,
2275 but modern practice is to avoid the false impression of 6/8 time
2276 (see Gould, p. 153). Similar situations arise in 3/8 time.
2277 This behavior is controlled by the context property @code{beamHalfMeasure},
2278 which has effect only in time signatures with 3 in the numerator:
2280 @lilypond[quote,verbatim,relative=2]
2283 \set Timing.beamHalfMeasure = ##f
2287 @subsubsubheading How automatic beaming works
2289 When automatic beaming is enabled, the placement of automatic beams
2290 is determined by the context properties
2291 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2293 The following rules, in order of priority, apply when determining
2294 the appearance of beams:
2298 If a manual beam is specified with @code{[..]} set the beam
2299 as specified, otherwise
2302 if a beam-ending rule is defined in @code{beamExceptions}
2303 for the beam-type, use it to determine the valid places where
2304 beams may end, otherwise
2307 if a beam-ending rule is defined in @code{beamExceptions}
2308 for a longer beam-type, use it to determine the valid places
2309 where beams may end, otherwise
2312 use the values of @code{baseMoment} and @code{beatStructure} to
2313 determine the ends of the beats in the measure, and
2314 end beams at the end of beats.
2318 In the rules above, the @emph{beam-type} is the duration of the
2319 shortest note in the beamed group.
2321 The default beaming rules can be found in
2322 @file{scm/time-signature-settings.scm}.
2326 @cindex beams, subdividing
2328 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2329 {subdividing-beams.ly}
2331 @cindex beamlets, orienting
2333 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2334 {strict-beat-beaming.ly}
2336 @cindex measure groupings
2337 @cindex beats, grouping
2338 @cindex grouping beats
2339 @cindex measure sub-grouping
2341 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2342 {conducting-signs,-measure-grouping-signs.ly}
2344 @cindex beam, endings in a score
2345 @cindex beam, endings with multiple voices
2347 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2348 {beam-endings-in-score-context.ly}
2352 @ref{Time signature}.
2355 @file{scm/time-signature-settings.scm}.
2360 Internals Reference:
2361 @rinternals{Auto_beam_engraver},
2363 @rinternals{BeamForbidEvent},
2364 @rinternals{beam-interface}.
2367 If a score ends while an automatic beam has not been ended and is
2368 still accepting notes, this last beam will not be typeset at all.
2369 The same holds for polyphonic voices, entered with
2370 @code{<< @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
2371 automatic beam is still accepting notes, it is not typeset.
2372 The workaround for these problems is to manually beam the last
2373 beam in the voice or score.
2375 By default, the @code{Timing} translator is aliased to the
2376 @code{Score} context. This means that setting the time signature
2377 in one staff will affect the beaming of the other staves as well.
2378 Thus, a time signature setting in a later staff will reset custom
2379 beaming that was set in an earlier staff.
2380 One way to avoid this problem is to set the time signature
2383 @lilypond[quote,verbatim,relative=2]
2387 \set Timing.baseMoment = #(ly:make-moment 1/8)
2388 \set Timing.beatStructure = #'(1 5)
2389 \repeat unfold 6 { a8 }
2392 \repeat unfold 6 { a8 }
2397 The default beam settings for the time signature can also be changed, so
2398 that the desired beaming will always be used. Changes in automatic
2399 beaming settings for a time signature are described in
2400 @ref{Time signature}.
2402 @lilypond[quote,verbatim,relative=2]
2405 \overrideTimeSignatureSettings
2406 3/4 % timeSignatureFraction
2407 1/8 % baseMomentFraction
2408 #'(1 5) % beatStructure
2409 #'() % beamExceptions
2411 \repeat unfold 6 { a8 }
2415 \repeat unfold 6 { a8 }
2422 @unnumberedsubsubsec Manual beams
2424 @cindex beams, manual
2425 @cindex manual beams
2430 In some cases it may be necessary to override the automatic
2431 beaming algorithm. For example, the autobeamer will not put beams
2432 over rests or bar lines, and in choral scores the beaming is
2433 often set to follow the meter of the lyrics rather than the
2434 notes. Such beams can be specified manually by
2435 marking the begin and end point with @code{[} and @code{]}.
2437 @lilypond[quote,relative=1,verbatim]
2438 r4 r8[ g' a r] r g[ | a] r
2441 @cindex manual beams, direction shorthand for
2442 @cindex manual beams, grace notes
2444 Beaming direction can be set manually using direction indicators:
2446 @lilypond[quote,relative=2,verbatim]
2447 c8^[ d e] c,_[ d e f g]
2453 Individual notes may be marked with @code{\noBeam} to prevent them
2456 @lilypond[quote,verbatim,relative=2]
2461 Grace note beams and normal note beams can occur simultaneously.
2462 Unbeamed grace notes are not put into normal note beams.
2464 @lilypond[quote,verbatim,relative=2]
2466 \grace { e32[ d c d] }
2472 @funindex stemLeftBeamCount
2473 @funindex stemRightBeamCount
2475 Even more strict manual control with the beams can be achieved by
2476 setting the properties @code{stemLeftBeamCount} and
2477 @code{stemRightBeamCount}. They specify the number of beams to
2478 draw on the left and right side, respectively, of the next note.
2479 If either property is set, its value will be used only once, and
2480 then it is erased. In this example, the last @code{f} is printed
2481 with only one beam on the left side, i.e., the eighth-note beam of
2482 the group as a whole.
2484 @lilypond[quote,relative=2,verbatim]
2487 \set stemLeftBeamCount = #2
2488 \set stemRightBeamCount = #1
2490 \set stemLeftBeamCount = #1
2502 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2503 {flat-flags-and-beam-nibs.ly}
2507 @ref{Direction and placement},
2513 Internals Reference:
2515 @rinternals{BeamEvent},
2516 @rinternals{Beam_engraver},
2517 @rinternals{beam-interface},
2518 @rinternals{Stem_engraver}.
2521 @node Feathered beams
2522 @unnumberedsubsubsec Feathered beams
2524 @cindex beams, feathered
2525 @cindex feathered beams
2527 @funindex \featherDurations
2528 @funindex featherDurations
2529 @funindex grow-direction
2531 Feathered beams are used to indicate that a small group of notes
2532 should be played at an increasing (or decreasing) tempo, without
2533 changing the overall tempo of the piece. The extent of the
2534 feathered beam must be indicated manually using @code{[} and
2535 @code{]}, and the beam feathering is turned on by specifying a
2536 direction to the @code{Beam} property @code{grow-direction}.
2538 If the placement of the notes and the sound in the MIDI output is to
2539 reflect the @emph{ritardando} or @emph{accelerando} indicated by the
2540 feathered beam the notes must be grouped as a music expression delimited
2541 by braces and preceded by a @code{featherDurations} command which specifies
2542 the ratio between the durations of the first and last notes in the
2545 The square brackets show the extent of the beam and the braces show
2546 which notes are to have their durations modified. Normally these
2547 would delimit the same group of notes, but this is not required: the
2548 two commands are independent.
2550 In the following example the eight 16th notes occupy exactly the
2551 same time as a half note, but the first note is one half as long
2552 as the last one, with the intermediate notes gradually
2553 lengthening. The first four 32nd notes gradually speed up, while
2554 the last four 32nd notes are at a constant tempo.
2556 @lilypond[relative=1,verbatim,quote]
2557 \override Beam.grow-direction = #LEFT
2558 \featherDurations #(ly:make-moment 2/1)
2559 { c16[ c c c c c c c] }
2560 \override Beam.grow-direction = #RIGHT
2561 \featherDurations #(ly:make-moment 2/3)
2563 % revert to non-feathered beams
2564 \override Beam.grow-direction = #'()
2569 The spacing in the printed output represents the
2570 note durations only approximately, but the MIDI output is exact.
2573 @code{\featherDurations}.
2581 The @code{\featherDurations} command only works with very short
2582 music snippets, and when numbers in the fraction are small.
2591 * Bar and bar number checks::
2596 @unnumberedsubsubsec Bar lines
2599 @cindex measure lines
2600 @cindex closing bar lines
2601 @cindex bar lines, closing
2602 @cindex double bar lines
2603 @cindex bar lines, double
2609 Bar lines delimit measures, and are also used to indicate
2610 repeats. Normally, simple bar lines are automatically inserted
2611 into the printed output at places based on the current time
2614 The simple bar lines inserted automatically can be changed to
2615 other types with the @code{\bar} command. For example, a closing
2616 double bar line is usually placed at the end of a piece:
2618 @lilypond[quote,relative=1,verbatim]
2622 It is not invalid if the final note in a measure does not
2623 end on the automatically entered bar line: the note is assumed
2624 to carry over into the next measure. But if a long sequence
2625 of such carry-over measures appears the music can appear compressed
2626 or even flowing off the page. This is because automatic line
2627 breaks happen only at the end of complete measures, i.e., where
2628 all notes end before the end of a measure.
2630 @warning{An incorrect duration can cause line breaks to be
2631 inhibited, leading to a line of highly compressed music or
2632 music which flows off the page.}
2635 @cindex bar lines, invisible
2636 @cindex measure lines, invisible
2638 Line breaks are also permitted at manually inserted bar lines
2639 even within incomplete measures. To allow a line break without
2640 printing a bar line, use the following:
2647 This will insert an invisible bar line and allow (but not
2648 force) a line break to occur at this point. The bar number
2649 counter is not increased. To force a line break see
2650 @ref{Line breaking}.
2652 @cindex manual bar lines
2653 @cindex manual measure lines
2654 @cindex bar lines, manual
2655 @cindex measure lines, manual
2657 This and other special bar lines may be inserted manually at any
2658 point. When they coincide with the end of a measure they replace
2659 the simple bar line which would have been inserted there
2660 automatically. When they do not coincide with the end of a measure
2661 the specified bar line is inserted at that point in the printed
2664 Note that manual bar lines are purely visual. They do not affect
2665 any of the properties that a normal bar line would affect, such as
2666 measure numbers, accidentals, line breaks, etc. They do not affect
2667 the calculation and placement of subsequent automatic bar lines.
2668 When a manual bar line is placed where a normal bar line already
2669 exists, the effects of the original bar line are not altered.
2671 Two types of simple bar lines and five types of double bar lines are
2672 available for manual insertion:
2674 @lilypond[quote,relative=1,verbatim]
2686 together with dotted and dashed bar lines:
2688 @lilypond[quote,relative=1,verbatim]
2695 and nine types of repeat bar lines:
2697 @lilypond[quote,relative=1,verbatim]
2710 Additionally, a bar line can be printed as a simple tick:
2711 @lilypond[quote,relative=1,verbatim]
2714 However, as such ticks are typically used in Gregorian chant, it is
2715 preferable to use @code{\divisioMinima} there instead, described in
2716 the section @ref{Divisiones} in Gregorian chant.
2718 Lilypond supports kievan notation and provides a special kievan
2720 @lilypond[quote,relative=1,verbatim]
2723 Further details of this notation are explained in
2724 @ref{Typesetting Kievan square notation}.
2728 For in-line segno signs, there are three types of bar lines which
2729 differ in their behavior at line breaks:
2731 @lilypond[quote,relative=2,verbatim]
2749 Although the bar line types signifying repeats may be inserted
2750 manually they do not in themselves cause LilyPond to recognize
2751 a repeated section. Such repeated sections are better entered
2752 using the various repeat commands (see @ref{Repeats}), which
2753 automatically print the appropriate bar lines.
2755 In addition, you can specify @code{".|:-||"}, which is equivalent to
2756 @code{".|:"} except at line breaks, where it gives a double bar
2757 line at the end of the line and a start repeat at the beginning of
2760 @lilypond[quote,relative=2,verbatim]
2768 For combinations of repeats with the segno sign, there are six different
2771 @lilypond[quote,relative=2,verbatim]
2799 Additionally there is an @code{\inStaffSegno} command which
2800 creates a segno bar, placed in cooperation
2801 with the @code{\repeat volta} command.
2803 @funindex \defineBarLine
2804 @funindex defineBarLine
2805 @cindex bar lines, defining
2806 @cindex defining bar lines
2808 New bar line types can be defined with @code{\defineBarLine}:
2811 \defineBarLine @var{bartype} #'(@var{end} @var{begin} @var{span})
2814 The @code{\defineBarline} variables can include the
2815 @q{empty} string @code{""}, which is equivalent to an invisible
2816 bar line being printed. Or they can be set to @code{#f} which
2817 prints no bar line at all.
2819 After the definiton, the new bar line can be used by
2820 @code{\bar} @var{bartype}.
2822 There are currently ten bar line elements available:
2824 @lilypond[quote,verbatim]
2825 \defineBarLine ":" #'("" ":" "")
2826 \defineBarLine "=" #'("=" "" "")
2827 \defineBarLine "[" #'("" "[" "")
2828 \defineBarLine "]" #'("]" "" "")
2845 The @code{"="} bar line provides the double span bar line, used
2846 in combination with the segno sign. Do not use it as a standalone
2847 double thin bar line; here, @code{\bar} @var{"||"} is
2850 The @code{"-"} sign starts annotations to bar lines which
2851 are useful to distinguish those with identical appearance
2852 but different behavior at line breaks and/or different span bars.
2853 The part following the @code{"-"} sign is not used for building up
2856 @lilypond[quote,relative=2,verbatim]
2857 \defineBarLine "||-dashedSpan" #'("||" "" "!!")
2862 c1 \bar "||-dashedSpan"
2873 Furthermore, the space character @code{" "} serves as a placeholder
2874 for defining span bars correctly aligned to the main bar lines:
2876 @lilypond[quote,relative=2,verbatim]
2877 \defineBarLine ":|.-wrong" #'(":|." "" "|.")
2878 \defineBarLine ":|.-right" #'(":|." "" " |.")
2894 If additional elements are needed, LilyPond provides a simple
2895 way to define them. For more informations on modifying or adding
2896 bar lines, see file @file{scm/bar-line.scm}.
2898 In scores with many staves, a @code{\bar} command in one staff is
2899 automatically applied to all staves. The resulting bar lines are
2900 connected between different staves of a @code{StaffGroup},
2901 @code{PianoStaff}, or @code{GrandStaff}.
2903 @lilypond[quote,relative=1,verbatim]
2911 \new Staff { \clef bass c4 g e g }
2913 \new Staff { \clef bass c2 c2 }
2918 @cindex default bar lines, changing
2919 @cindex bar lines, default, changing
2922 @funindex defaultBarType
2927 The command @samp{\bar @var{bartype}} is a shortcut for
2928 @samp{\set Timing.whichBar = @var{bartype}}. A bar line is
2929 created whenever the @code{whichBar} property is set.
2931 The default bar type used for automatically inserted bar lines is
2932 @code{"|"}. This may be changed at any time with
2933 @samp{\set Timing.defaultBarType = @var{bartype}}.
2937 @ref{Line breaking},
2939 @ref{Grouping staves}.
2942 @file{scm/bar-line.scm}.
2947 Internals Reference:
2948 @rinternals{BarLine} (created at @code{Staff} level),
2949 @rinternals{SpanBar} (across staves),
2950 @rinternals{Timing_translator} (for Timing properties).
2954 @unnumberedsubsubsec Bar numbers
2957 @cindex measure numbers
2958 @cindex numbers, bar
2959 @cindex numbers, measure
2961 @funindex currentBarNumber
2963 Bar numbers are typeset by default at the start of every line except
2964 the first line. The number itself is stored in the
2965 @code{currentBarNumber} property, which is normally updated
2966 automatically for every measure. It may also be set manually:
2968 @lilypond[verbatim,quote,relative=1]
2971 \set Score.currentBarNumber = #50
2975 @cindex bar numbers, regular spacing
2977 @funindex barNumberVisibility
2980 Bar numbers can be typeset at regular intervals instead of just at
2981 the beginning of every line. To do this the default behavior
2982 must be overridden to permit bar numbers to be printed at places
2983 other than the start of a line. This is controlled by the
2984 @code{break-visibility} property of @code{BarNumber}. This takes
2985 three values which may be set to @code{#t} or @code{#f} to specify
2986 whether the corresponding bar number is visible or not. The order
2987 of the three values is @code{end of line visible}, @code{middle of
2988 line visible}, @code{beginning of line visible}. In the following
2989 example bar numbers are printed at all possible places:
2991 @lilypond[verbatim,quote,relative=1]
2992 \override Score.BarNumber.break-visibility = ##(#t #t #t)
2993 \set Score.currentBarNumber = #11
2994 % Permit first bar number to be printed
3002 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3003 {printing-the-bar-number-for-the-first-measure.ly}
3005 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3006 {printing-bar-numbers-at-regular-intervals.ly}
3008 @cindex measure number, format
3009 @cindex bar number, format
3011 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3012 {printing-bar-numbers-inside-boxes-or-circles.ly}
3014 @cindex bar numbers, with letters
3015 @cindex bar numbers, with repeats
3017 @lilypondfile[verbatim,quote,texidoc,doctitle]
3018 {alternative-bar-numbering.ly}
3020 @cindex bar number alignment
3022 @lilypondfile[verbatim,quote,texidoc,doctitle]
3023 {aligning-bar-numbers.ly}
3025 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3026 {removing-bar-numbers-from-a-score.ly}
3032 Internals Reference:
3033 @rinternals{BarNumber},
3034 @rinternals{Bar_number_engraver}.
3036 @cindex bar number collision
3037 @cindex collision, bar number
3040 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
3041 if there is one. To solve this, the @code{padding} property of
3042 @code{BarNumber} can be used to position the number correctly. See
3043 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
3046 @node Bar and bar number checks
3047 @unnumberedsubsubsec Bar and bar number checks
3050 @cindex bar number check
3051 @cindex measure check
3052 @cindex measure number check
3054 @funindex barCheckSynchronize
3057 Bar checks help detect errors in the entered durations. A bar check
3058 may be entered using the bar symbol, @code{|}, at any place where a
3059 bar line is expected to fall. If bar check lines are encountered at
3060 other places, a list of warnings is printed in the log file, showing
3061 the line numbers and lines in which the bar checks failed. In the
3062 next example, the second bar check will signal an error.
3065 \time 3/4 c2 e4 | g2 |
3068 Bar checks can also be used in lyrics:
3073 Twin -- kle | Twin -- kle |
3077 An incorrect duration can result in a completely garbled score,
3078 especially if the score is polyphonic, so a good place to start
3079 correcting input is by scanning for failed bar checks and
3080 incorrect durations.
3082 If successive bar checks are off by the same musical interval,
3083 only the first warning message is displayed. This allows the
3084 warning to focus on the source of the timing error.
3088 @funindex pipeSymbol
3090 It is also possible to redefine the action taken when a bar check
3091 or pipe symbol, @code{|}, is encountered in the input, so that
3092 it does something other than a bar check. This is done by
3093 assigning a music expression to @code{pipeSymbol}.
3094 In the following example @code{|} is set to insert a double bar
3095 line wherever it appears in the input, rather than checking
3098 @lilypond[quote,verbatim]
3099 pipeSymbol = \bar "||"
3108 @funindex \barNumberCheck
3109 @funindex barNumberCheck
3111 When copying large pieces of music, it can be helpful to check that
3112 the LilyPond bar number corresponds to the original that you are
3113 entering from. This can be checked with @code{\barNumberCheck}, for
3117 \barNumberCheck #123
3121 will print a warning if the @code{currentBarNumber} is not 123
3122 when it is processed.
3129 @node Rehearsal marks
3130 @unnumberedsubsubsec Rehearsal marks
3132 @cindex rehearsal marks
3133 @cindex mark, rehearsal
3138 To print a rehearsal mark, use the @code{\mark} command.
3140 @lilypond[quote,verbatim,relative=2]
3148 The mark is incremented automatically if you use @code{\mark
3149 \default}, but you can also use an integer argument to set the
3150 mark manually. The value to use is stored in the property
3151 @code{rehearsalMark}.
3153 @lilypond[quote,verbatim,relative=2]
3162 The letter@tie{}@q{I} is skipped in accordance with engraving
3163 traditions. If you wish to include the letter @q{I}, then use one
3164 of the following commands, depending on which style of rehearsal mark
3165 you want (letters only, letters in a hollow box, or letters in a
3169 \set Score.markFormatter = #format-mark-alphabet
3170 \set Score.markFormatter = #format-mark-box-alphabet
3171 \set Score.markFormatter = #format-mark-circle-alphabet
3174 @lilypond[quote,verbatim,relative=2]
3175 \set Score.markFormatter = #format-mark-box-alphabet
3183 @cindex rehearsal mark format
3184 @cindex rehearsal mark style
3185 @cindex style, rehearsal mark
3186 @cindex format, rehearsal mark
3187 @cindex mark, rehearsal, style
3188 @cindex mark, rehearsal, format
3189 @cindex rehearsal mark, manual
3190 @cindex mark, rehearsal, manual
3191 @cindex custom rehearsal mark
3192 @cindex manual rehearsal mark
3194 The style is defined by the property @code{markFormatter}. It is
3195 a function taking the current mark (an integer) and the current
3196 context as argument. It should return a markup object. In the
3197 following example, @code{markFormatter} is set to a pre-defined
3198 procedure. After a few measures, it is set to a procedure that
3199 produces a boxed number.
3201 @lilypond[quote,verbatim,relative=2]
3202 \set Score.markFormatter = #format-mark-numbers
3205 \set Score.markFormatter = #format-mark-box-numbers
3207 \set Score.markFormatter = #format-mark-circle-numbers
3209 \set Score.markFormatter = #format-mark-circle-letters
3213 The file @file{scm/translation-functions.scm} contains the
3214 definitions of @code{format-mark-numbers} (the default format),
3215 @code{format-mark-box-numbers}, @code{format-mark-letters} and
3216 @code{format-mark-box-letters}. These can be used as inspiration
3217 for other formatting functions.
3219 You may use @code{format-mark-barnumbers},
3220 @code{format-mark-box-barnumbers}, and
3221 @code{format-mark-circle-barnumbers} to get bar numbers instead of
3222 incremented numbers or letters.
3224 Other styles of rehearsal mark can be specified manually:
3231 Note that @code{Score.markFormatter} does not affect marks specified
3232 in this manner. However, it is possible to apply a @code{\markup} to the
3236 \mark \markup@{ \box A1 @}
3241 @cindex D.S. al Fine
3243 @cindex music glyphs
3244 @cindex glyphs, music
3246 @funindex \musicglyph
3247 @funindex musicglyph
3249 Music glyphs (such as the segno sign) may be printed inside a
3252 @lilypond[quote,verbatim,relative=1]
3253 c1 \mark \markup { \musicglyph #"scripts.segno" }
3254 c1 \mark \markup { \musicglyph #"scripts.coda" }
3255 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
3260 See @ref{The Feta font}, for a list of symbols which may be
3261 printed with @code{\musicglyph}.
3263 For common tweaks to the positioning of rehearsal marks, see
3264 @ref{Formatting text}. For more precise control, see
3265 @code{break-alignable-interface} in @ref{Aligning objects}.
3267 The file @file{scm/translation-functions.scm} contains
3268 the definitions of @code{format-mark-numbers} and
3269 @code{format-mark-letters}. They can be used as inspiration for
3270 other formatting functions.
3274 @ref{The Feta font},
3275 @ref{Formatting text},
3276 @ref{Aligning objects}.
3279 @file{scm/translation-functions.scm}.
3284 Internals Reference:
3285 @rinternals{MarkEvent},
3286 @rinternals{Mark_engraver},
3287 @rinternals{RehearsalMark}.
3290 @node Special rhythmic concerns
3291 @subsection Special rhythmic concerns
3296 * Aligning to cadenzas::
3297 * Time administration::
3301 @unnumberedsubsubsec Grace notes
3305 @cindex appoggiatura
3306 @cindex acciaccatura
3309 @funindex \slashedGrace
3310 @funindex \acciaccatura
3311 @funindex \appoggiatura
3313 Grace notes are musical ornaments, printed in a smaller font, that take
3314 up no additional logical time in a measure.
3316 @lilypond[quote,relative=2,verbatim]
3318 \grace { b16[ c16] } a2)
3321 There are three other types of grace notes possible; the
3322 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
3323 note with a slashed stem -- and the @emph{appoggiatura}, which takes a
3324 fixed fraction of the main note it is attached to and prints without the
3325 slash. It is also possible to write a grace note with a slashed stem,
3326 like the @emph{acciaccatura} but without the slur, so as to place it
3327 between notes that are slurred themselves, using the
3328 @code{\slashedGrace} function.
3330 @lilypond[quote,relative=2,verbatim]
3333 \acciaccatura { g16[ f] } e2
3334 \slashedGrace a,8 g4
3335 \slashedGrace b16 a4(
3336 \slashedGrace b8 a2)
3339 The placement of grace notes is synchronized between different staves.
3340 In the following example, there are two sixteenth grace notes for every
3343 @lilypond[quote,relative=2,verbatim]
3345 \new Staff { e2 \grace { c16[ d e f] } e2 }
3346 \new Staff { c2 \grace { g8[ b] } c2 }
3350 @cindex grace notes, following
3352 @funindex \afterGrace
3353 @funindex afterGrace
3355 If you want to end a note with a grace, use the @code{\afterGrace}
3356 command. It takes two arguments: the main note, and the grace
3357 notes following the main note.
3359 @lilypond[quote,verbatim,relative=2]
3360 c1 \afterGrace d1 { c16[ d] } c1
3363 This will put the grace notes after a space lasting 3/4 of the
3364 length of the main note. The default fraction 3/4 can be changed by
3365 setting @code{afterGraceFraction}. The following example shows
3366 the results from setting the space at the default, at 15/16, and
3367 finally at 1/2 of the main note.
3369 @lilypond[quote,verbatim,relative=2]
3372 c1 \afterGrace d1 { c16[ d] } c1
3375 #(define afterGraceFraction (cons 15 16))
3376 c1 \afterGrace d1 { c16[ d] } c1
3379 #(define afterGraceFraction (cons 1 2))
3380 c1 \afterGrace d1 { c16[ d] } c1
3385 The space between the main note and the grace note may also be
3386 specified using spacers. The following example places the grace
3387 note after a space lasting 7/8 of the main note.
3389 @lilypond[quote,verbatim,relative=2]
3393 { s2 s4. \grace { c16[ d] } }
3399 @cindex tweaking grace notes
3400 @cindex grace notes, tweaking
3401 @cindex grace notes, changing layout settings
3403 A @code{\grace} music expression will introduce special
3404 typesetting settings, for example, to produce smaller type, and
3405 set directions. Hence, when introducing layout tweaks to
3406 override the special settings, they should be placed inside
3407 the grace expression. The overrides should also be reverted
3408 inside the grace expression. Here, the grace note's default stem
3409 direction is overridden and then reverted.
3411 @lilypond[quote,verbatim,relative=2]
3423 @cindex stem, with slash
3428 @lilypondfile[verbatim,quote,texidoc,doctitle]
3429 {using-grace-note-slashes-with-normal-heads.ly}
3431 @lilypondfile[verbatim,quote,texidoc,doctitle]
3432 {tweaking-grace-layout-within-music.ly}
3434 @lilypondfile[verbatim,quote,texidoc,doctitle]
3435 {redefining-grace-note-global-defaults.ly}
3437 @lilypondfile[verbatim,quote,texidoc,doctitle]
3438 {positioning-grace-notes-with-floating-space.ly}
3442 @rglos{grace notes},
3443 @rglos{acciaccatura},
3444 @rglos{appoggiatura}.
3447 @ref{Scaling durations},
3451 @file{ly/grace-init.ly}.
3456 Internals Reference:
3457 @rinternals{GraceMusic},
3458 @rinternals{Grace_beam_engraver},
3459 @rinternals{Grace_engraver},
3460 @rinternals{Grace_spacing_engraver}.
3464 @cindex acciaccatura, multi-note
3465 @cindex multi-note acciaccatura
3466 @cindex grace-note synchronization
3468 A multi-note beamed @i{acciaccatura} is printed without a slash,
3469 and looks exactly the same as a multi-note beamed
3472 @c TODO Add link to LSR snippet to add slash when available
3474 Grace note synchronization can also lead to surprises. Staff
3475 notation, such as key signatures, bar lines, etc., are also
3476 synchronized. Take care when you mix staves with grace notes and
3477 staves without, for example,
3479 @lilypond[quote,relative=2,verbatim]
3481 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3482 \new Staff { c4 \bar ".|:" d2. }
3487 This can be remedied by inserting grace skips of the corresponding
3488 durations in the other staves. For the above example
3490 @lilypond[quote,relative=2,verbatim]
3492 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3493 \new Staff { c4 \bar ".|:" \grace s16 d2. }
3497 The use of grace notes within voice contexts confuses the way the voice
3498 is typeset. This can be overcome by inserting a rest or note between the
3499 voice command and the grace note.
3501 @lilypond[quote,verbatim]
3503 \acciaccatura { f8 } e8 r8 \acciaccatura { f8 } e8 r4
3510 r8 r8 \voiceOne \accMusic \oneVoice r8 |
3511 r8 \voiceOne r8 \accMusic \oneVoice r8 |
3516 s8 s8 \voiceTwo \accMusic \oneVoice s8 |
3517 s8 \voiceTwo r8 \accMusic \oneVoice s8 |
3524 Grace sections should only be used within sequential music expressions.
3525 Nesting or juxtaposing grace sections is not supported, and might
3526 produce crashes or other errors.
3528 Each grace note in MIDI output has a length of 1/4 of its actual
3529 duration. If the combined length of the grace notes is greater than the
3530 length of the preceding note a @qq{@code{Going back in MIDI time}}
3531 error will be generated. Either make the grace notes shorter in
3532 duration, for example:
3535 c'8 \acciaccatura @{ c'8[ d' e' f' g'] @}
3541 c'8 \acciaccatura @{ c'16[ d' e' f' g'] @}
3544 Or explicitly change the musical duration:
3547 c'8 \acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
3550 See @ref{Scaling durations}.
3553 @node Aligning to cadenzas
3554 @unnumberedsubsubsec Aligning to cadenzas
3557 @cindex cadenza, aligning to
3558 @cindex aligning to cadenza
3560 In an orchestral context, cadenzas present a special problem: when
3561 constructing a score that includes a measured cadenza or other solo
3562 passage, all other instruments should skip just as many notes as the
3563 length of the cadenza, otherwise they will start too soon or too late.
3565 One solution to this problem is to use the functions
3566 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
3567 functions take a defined piece of music as an argument and generate a
3568 multi-measure rest or @code{\skip} exactly as long as the piece.
3570 @lilypond[verbatim,quote]
3571 MyCadenza = \relative c' {
3582 #(mmrest-of-length MyCadenza)
3584 #(skip-of-length MyCadenza)
3598 @node Time administration
3599 @unnumberedsubsubsec Time administration
3601 @cindex time administration
3602 @cindex timing (within the score)
3603 @cindex music, unmetered
3604 @cindex unmetered music
3606 @funindex currentBarNumber
3607 @funindex measurePosition
3608 @funindex measureLength
3610 Time is administered by the @code{Timing_translator}, which by
3611 default is to be found in the @code{Score} context. An alias,
3612 @code{Timing}, is added to the context in which the
3613 @code{Timing_translator} is placed. To ensure that the
3614 @code{Timing} alias is available, you may need to explicitly
3615 instantiate the containing context (such as @code{Voice} or
3618 The following properties of @code{Timing} are used
3619 to keep track of timing within the score.
3622 @cindex measure number
3625 @item currentBarNumber
3626 The current measure number. For an example showing the
3627 use of this property see @ref{Bar numbers}.
3630 The length of the measures in the current time signature. For a
3631 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
3632 determines when bar lines are inserted and how automatic beams
3633 should be generated.
3635 @item measurePosition
3636 The point within the measure where we currently are. This
3637 quantity is reset by subtracting @code{measureLength} whenever
3638 @code{measureLength} is reached or exceeded. When that happens,
3639 @code{currentBarNumber} is incremented.
3642 If set to true, the above variables are updated for every time
3643 step. When set to false, the engraver stays in the current
3644 measure indefinitely.
3648 Timing can be changed by setting any of these variables
3649 explicitly. In the next example, the default 4/4 time
3650 signature is printed, but @code{measureLength} is set to 5/4.
3651 At 4/8 through the third measure, the @code{measurePosition} is
3652 advanced by 1/8 to 5/8, shortening that bar by 1/8.
3653 The next bar line then falls at 9/8 rather than 5/4.
3655 @lilypond[quote,verbatim]
3656 \new Voice \relative c' {
3657 \set Timing.measureLength = #(ly:make-moment 5/4)
3661 \set Timing.measurePosition = #(ly:make-moment 5/8)
3668 As the example illustrates, @code{ly:make-moment n m} constructs a
3669 duration of n/m of a whole note. For example,
3670 @code{ly:make-moment 1 8} is an eighth note duration and
3671 @code{ly:make-moment 7 16} is the duration of seven sixteenths
3677 @ref{Unmetered music}.
3682 Internals Reference:
3683 @rinternals{Timing_translator},