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. See TRANSLATION for details.
14 @lilypondfile[quote]{rhythms-headword.ly}
16 This section discusses rhythms, rests, durations, beaming and bars.
21 * Displaying rhythms::
24 * Special rhythmic concerns::
29 @subsection Writing rhythms
39 @unnumberedsubsubsec Durations
41 @cindex durations, of notes
42 @cindex note durations
43 @cindex length of notes
53 Durations are designated by numbers and dots. Durations are entered
54 as their reciprocal values. For example, a quarter note is entered
55 using a @code{4} (since it is a 1/4 note), and a half note is entered
56 using a @code{2} (since it is a 1/2 note). For notes longer than a
57 whole you must use the @code{\longa} (a double breve) and
58 @code{\breve} commands. Durations as short as 128th notes may be
59 specified. Shorter values are possible, but only as beamed notes.
61 @c Two 64th notes are needed to obtain beams
62 @lilypond[quote,verbatim,relative=2]
65 c4 c8 c16 c32 c64 c128 c128
68 Here are the same durations with automatic beaming turned off.
70 @c not strictly "writing rhythms"; more of a "displaying" thing,
71 @c but it's ok here. -gp
72 @lilypond[quote,verbatim,relative=2]
76 c4 c8 c16 c32 c64 c128 c128
79 A note with the duration of a quadruple breve may be entered with
80 @code{\maxima}, but this is supported only within ancient music
81 notation. For details, see @ref{Ancient notation}.
83 @cindex duration, default
84 @cindex default note duration
85 @cindex note duration, default
87 If the duration is omitted, it is set to the previously
88 entered duration. The default for the first note is a quarter
91 @lilypond[quote,verbatim,relative=2]
97 @cindex notes, double-dotted
98 @cindex double-dotted notes
102 To obtain dotted note lengths, place a dot (@code{.}) after the
103 duration. Double-dotted notes are specified by appending two
106 @lilypond[quote,verbatim,relative=2]
107 a4 b c4. b8 a4. b4.. c8.
110 Some durations cannot be represented with just binary durations
111 and dots; they can be represented only by tying two or more
112 notes together. For details, see @ref{Ties}.
114 For ways of specifying durations for the syllables of lyrics and
115 ways of aligning lyrics to notes, see @ref{Vocal music}.
117 Optionally, notes can be spaced strictly proportionately to their
118 duration. For details of this and other settings which control
119 proportional notation, see @ref{Proportional notation}.
125 @funindex \dotsNeutral
126 @funindex dotsNeutral
128 Dots are normally moved up to avoid staff lines, except in
129 polyphonic situations. Dots may be manually placed above or below
130 the staff; see @ref{Direction and placement}.
148 @rglos{Duration names notes and rests}.
151 @ref{Automatic beams},
154 @ref{Writing rhythms},
157 @ref{Ancient notation},
158 @ref{Proportional notation}.
165 @rinternals{DotColumn}.
170 @c Deliberately duplicated in Durations and Rests. -gp
171 There is no fundamental limit to rest durations (both in terms of
172 longest and shortest), but the number of glyphs is limited:
173 rests from 128th to maxima (8 x whole) may be printed.
177 @unnumberedsubsubsec Tuplets
185 Tuplets are made from a music expression by multiplying all the
186 durations with a fraction:
189 \times @var{fraction} @{ @var{music} @}
193 The duration of @var{music} will be multiplied by the
194 fraction. The fraction's denominator will be printed over or
195 under the notes, optionally with a bracket. The most common
196 tuplet is the triplet in which 3 notes have the duration of 2, so
197 the notes are 2/3 of their written length.
199 @lilypond[quote,verbatim,relative=2]
200 a2 \times 2/3 { b4 b b }
201 c4 c \times 2/3 { b4 a g }
204 @cindex tuplet bracket placement
208 @funindex \tupletDown
210 @funindex \tupletNeutral
211 @funindex tupletNeutral
213 Tuplet brackets may be manually placed above or below the staff;
214 see @ref{Direction and placement}.
216 Tuplets may be nested:
218 @lilypond[quote,verbatim,relative=2]
220 c4 \times 4/5 { f8 e f \times 2/3 { e[ f g] } } f4 |
223 Modifying nested tuplets which begin at the same musical moment
224 must be done with @code{\tweak}.
226 To modify the duration of notes without printing a tuplet bracket,
227 see @ref{Scaling durations}.
233 @code{\tupletNeutral}.
239 @cindex tuplet formatting
240 @cindex triplet formatting
242 @funindex tupletNumberFormatFunction
243 @funindex tupletSpannerDuration
245 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
246 {entering-several-tuplets-using-only-one--times-command.ly}
248 @cindex Tuplet number changes
250 @funindex TupletNumber
252 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
253 {changing-the-tuplet-number.ly}
255 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
256 {non-default-tuplet-numbers.ly}
258 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
259 {permitting-line-breaks-within-beamed-tuplets.ly}
268 Learning Manual: @rlearning{Tweaking methods}.
271 @ref{Time administration},
272 @ref{Scaling durations},
273 @ref{The tweak command},
274 @ref{Polymetric notation}.
280 @rinternals{TupletBracket},
281 @rinternals{TupletNumber},
282 @rinternals{TimeScaledMusic}.
284 @cindex grace notes within tuplet brackets
287 When the first note on a staff is a grace note followed by a
288 tuplet the grace note must be placed before the @code{\times}
289 command to avoid errors. Anywhere else, grace notes may be
290 placed within tuplet brackets.
293 @node Scaling durations
294 @unnumberedsubsubsec Scaling durations
296 @cindex scaling durations
297 @cindex durations, scaling
299 You can alter the duration of single notes, rests or chords by a
300 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
301 is 1) to the duration. This will not affect the appearance of the
302 notes or rests produced, but the altered duration will be used in
303 calculating the position within the measure and setting the duration
304 in the MIDI output. Multiplying factors may be combined such as
307 In the following example, the first three notes take up exactly
308 two beats, but no triplet bracket is printed.
310 @lilypond[quote,relative=2,verbatim]
312 % Alter durations to triplets
313 a4*2/3 gis4*2/3 a4*2/3
316 % Double the duration of chord
318 % Duration of quarter, appears like sixteenth
322 The duration of skip or spacing notes may also be modified by
323 a multiplier. This is useful for skipping many measures, e.g.,
326 @cindex compressing music
327 @cindex expanding music
329 @funindex \scaleDurations
330 @funindex scaleDurations
332 Longer stretches of music may be compressed by a fraction in the
333 same way, as if every note, chord or rest had the fraction as a
334 multiplier. This leaves the appearance of the music unchanged but
335 the internal duration of the notes will be multiplied by the
336 fraction @emph{num}/@emph{den}. The spaces around the dot are
337 required. Here is an example showing how music can be compressed
340 @lilypond[quote,relative=2,verbatim]
344 % Scale music by *2/3
345 \scaleDurations #'(2 . 3) {
349 \scaleDurations #'(2 . 1) {
354 One application of this command is in polymetric
355 notation, see @ref{Polymetric notation}.
361 @ref{Invisible rests},
362 @ref{Polymetric notation}.
369 @unnumberedsubsubsec Ties
375 A tie connects two adjacent note heads of the same pitch. The tie
376 in effect extends the duration of a note.
378 @warning{Ties should not be confused with @emph{slurs}, which
379 indicate articulation, or @emph{phrasing slurs}, which indicate
380 musical phrasing. A tie is just a way of extending a note
381 duration, similar to the augmentation dot.}
383 A tie is entered using the tilde symbol (@code{~}).
385 @lilypond[quote,verbatim,relative=2]
389 Ties are used either when the note crosses a bar line, or when
390 dots cannot be used to denote the rhythm. Ties should also be
391 used when note values cross larger subdivisions of the measure:
393 @lilypond[verbatim,quote]
400 If you need to tie many notes across bar lines, it may be
401 easier to use automatic note splitting, see @ref{Automatic note
402 splitting}. This mechanism automatically splits long notes, and
403 ties them across bar lines.
405 @cindex ties and chords
406 @cindex chords and ties
408 When a tie is applied to a chord, all note heads whose pitches
409 match are connected. When no note heads match, no ties will be
410 created. Chords may be partially tied by placing the tie inside
413 @lilypond[quote,verbatim,relative=1]
415 <c~ e g~ b> <c e g b>
418 @cindex repeating ties
419 @cindex ties, repeating
420 @cindex volta brackets and ties
421 @cindex ties and volta brackets
426 When a second alternative of a repeat starts with a tied note, you
427 have to specify the repeated tie as follows:
429 @lilypond[quote,relative=2,verbatim]
430 \repeat volta 2 { c g <c e>2 ~ }
432 % First alternative: following note is tied normally
434 % Second alternative: following note has a repeated tie
435 { <c e>2\repeatTie d4 c } }
438 @cindex laissez vibrer
439 @cindex ties, laissez vibrer
441 @funindex \laissezVibrer
442 @funindex laissezVibrer
444 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
445 notes must not be damped at the end. It is used in notation for
446 piano, harp and other string and percussion instruments. They can
447 be entered as follows:
449 @lilypond[quote,verbatim,relative=1]
450 <c f g>1\laissezVibrer
453 @cindex ties, placement
459 @funindex \tieNeutral
462 Ties may be manually placed above or below the staff; see
463 @ref{Direction and placement}.
465 @cindex ties, appearance
478 Ties may be made dashed, dotted, or a combination of solid and
481 @lilypond[quote, verbatim, relative=1]
494 Custom dash patterns can be specified:
496 @lilypond[quote, verbatim, relative=1]
497 \tieDashPattern #0.3 #0.75
499 \tieDashPattern #0.7 #1.5
505 Dash pattern definitions for ties have the same structure as
506 dash pattern definitions for slurs.
507 For more information about complex dash patterns,
508 see the snippets under @ref{Slurs}.
516 @code{\tieDashPattern},
517 @code{\tieHalfDashed},
518 @code{\tieHalfSolid},
525 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
526 {using-ties-with-arpeggios.ly}
528 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
529 {engraving-ties-manually.ly}
535 @rglos{laissez vibrer}.
539 @ref{Automatic note splitting}.
545 @rinternals{LaissezVibrerTie},
546 @rinternals{LaissezVibrerTieColumn},
547 @rinternals{TieColumn},
553 Switching staves when a tie is active will not produce a slanted
556 Changing clefs or octavations during a tie is not really
557 well-defined. In these cases, a slur may be preferable.
562 @subsection Writing rests
564 Rests are entered as part of the music in music expressions.
569 * Full measure rests::
573 @unnumberedsubsubsec Rests
576 @cindex rest, entering durations
591 Rests are entered like notes with the note name @code{r}.
592 Durations longer than a whole rest use the predefined
595 @c \time 16/1 is used to avoid spurious bar lines
596 @c and long tracts of empty measures
597 @lilypond[fragment,quote,verbatim]
599 % These two lines are just to prettify this example
601 \override Staff.TimeSignature #'stencil = ##f
602 % Print a maxima rest, equal to four breves
604 % Print a longa rest, equal to two breves
608 r1 r2 r4 r8 r16 r32 r64 r128
612 @cindex rest, multi-measure
613 @cindex rest, whole-measure
615 Whole measure rests, centered in the middle of the measure, must be
616 entered as multi-measure rests. They can be used for a single
617 measure as well as many measures and are discussed in @ref{Full
620 @cindex rest, specifying vertical position
622 To explicitly specify a rest's vertical position, write a note
623 followed by @code{\rest}. A rest of the duration of the note will
624 be placed at the staff position where the note would appear. This
625 allows for precise manual formatting of polyphonic music, since the
626 automatic rest collision formatter will not move these rests.
628 @lilypond[quote,verbatim,relative=2]
634 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
645 @ref{Full measure rests}.
656 @c Deliberately duplicated in Durations and Rests. -gp
657 There is no fundamental limit to rest durations (both in terms of
658 longest and shortest), but the number of glyphs is limited: there
659 are rests from 128th to maxima (8 x whole).
662 @node Invisible rests
663 @unnumberedsubsubsec Invisible rests
666 @cindex invisible rest
667 @cindex rest, invisible
675 An invisible rest (also called a @q{spacer rest}) can be entered
676 like a note with the note name@tie{}@code{s}:
678 @lilypond[verbatim,quote,relative=2]
685 Spacer rests are available only in note mode and chord mode. In
686 other situations, for example, when entering lyrics, @code{\skip}
687 is used to skip a musical moment. @code{\skip} requires an
690 @lilypond[quote,verbatim,relative=2]
703 A spacer rest implicitly causes @code{Staff} and @code{Voice}
704 contexts to be created if none exist, just like notes and rests
707 @lilypond[quote,verbatim,fragment]
711 @code{\skip} simply skips musical time; it creates no output of
714 @lilypond[quote,verbatim,fragment]
715 % This is valid input, but does nothing
716 \skip 1 \skip1 \skip 1
722 @rlearning{Visibility and color of objects}.
726 @ref{Visibility of objects}.
732 @rinternals{SkipMusic}.
735 @node Full measure rests
736 @unnumberedsubsubsec Full measure rests
738 @cindex multi-measure rests
739 @cindex full-measure rests
740 @cindex rest, multi-measure
741 @cindex rest, full-measure
742 @cindex whole rest for a full measure
743 @cindex rest, whole for a full measure
747 Rests for one or more full measures are entered like notes with
748 the note name uppercase @code{R}:
750 @lilypond[quote,verbatim,relative=2]
751 % Rest measures contracted to single measure
752 \compressFullBarRests
759 The duration of full-measure rests is identical to the duration
760 notation used for notes. The duration in a multi-measure rest must
761 always be an integral number of measure-lengths, so augmentation dots
762 or fractions must often be used:
764 @lilypond[quote,fragment,verbatim]
765 \compressFullBarRests
771 R1*13/8 | R1*13/8*12 |
776 A full-measure rest is printed as either a whole or breve rest,
777 centered in the measure, depending on the time signature.
779 @lilypond[quote,verbatim,fragment]
788 @cindex multi-measure rest, expanding
789 @cindex multi-measure rest, contracting
791 @funindex \expandFullBarRests
792 @funindex expandFullBarRests
793 @funindex \compressFullBarRests
794 @funindex compressFullBarRests
796 By default a multi-measure rest is expanded in the printed score to
797 show all the rest measures explicitly. Alternatively, a multi-measure
798 rest can be shown as a single measure containing a multi-measure rest
799 symbol, with the number of measures of rest printed above the measure:
801 @lilypond[quote,fragment,verbatim]
803 \time 3/4 r2. | R2.*2 |
806 % Rest measures contracted to single measure
807 \compressFullBarRests
809 % Rest measures expanded
816 @cindex text on multi-measure rest
817 @cindex multi-measure rest, attaching text
818 @cindex script on multi-measure rest
819 @cindex multi-measure rest, script
820 @cindex fermata on multi-measure rest
821 @cindex multi-measure rest, attaching fermata
822 @cindex markup on multi-measure rest
823 @cindex multi-measure rest with markup
825 @funindex \fermataMarkup
826 @funindex fermataMarkup
827 @funindex MultiMeasureRestText
829 Markups can be added to multi-measure rests.
830 The predefined command @code{\fermataMarkup}
831 is provided for adding fermatas.
833 @lilypond[quote,verbatim,fragment]
834 \compressFullBarRests
836 R2.*10^\markup { \italic "ad lib." }
841 Markups attached to a multi-measure rest are
842 objects of type @code{MultiMeasureRestText}, not
843 @code{TextScript}. Overrides must be directed to the correct
844 object, or they will be ignored. See the following example.
847 @lilypond[quote,verbatim,fragment]
848 % This fails, as the wrong object name is specified
849 \override TextScript #'padding = #5
851 % This is correct and works
852 \override MultiMeasureRestText #'padding = #5
856 When a multi-measure rest immediately follows a @code{\partial}
857 setting, resulting bar-check warnings may not be displayed.
860 @funindex \textLengthOn
861 @funindex textLengthOn
862 @funindex \textLengthOff
863 @funindex textLenthOff
864 @funindex \fermataMarkup
865 @funindex fermataMarkup
866 @funindex \compressFullBarRests
867 @funindex compressFullBarRests
868 @funindex \expandFullBarRests
869 @funindex expandFullBarRests
872 @code{\textLengthOn},
873 @code{\textLengthOff},
874 @code{\fermataMarkup},
875 @code{\compressFullBarRests},
876 @code{\expandFullBarRests}.
884 @cindex kirchenpausen
886 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
887 {changing-form-of-multi-measure-rests.ly}
889 @cindex multi-measure rests, positioning
890 @cindex positioning multi-measure rests
892 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
893 {positioning-multi-measure-rests.ly}
895 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
896 {multi-measure-rest-markup.ly}
901 @rglos{multi-measure rest}.
906 @ref{Formatting text},
913 @rinternals{MultiMeasureRest},
914 @rinternals{MultiMeasureRestNumber},
915 @rinternals{MultiMeasureRestText}.
918 @cindex fingerings and multi-measure rests
919 @cindex multi-measure rests and fingerings
923 If an attempt is made to use fingerings (e.g.,
924 @code{R1*10-4}) to put numbers over multi-measure rests, the
925 fingering numeral (4) may collide with the bar counter
928 @cindex condensing rests
929 @cindex rest, condensing ordinary
931 There is no way to automatically condense multiple ordinary rests
932 into a single multi-measure rest.
934 @cindex rest, collisions of
936 Multi-measure rests do not take part in rest collisions.
938 @node Displaying rhythms
939 @subsection Displaying rhythms
945 * Polymetric notation::
946 * Automatic note splitting::
947 * Showing melody rhythms::
951 @unnumberedsubsubsec Time signature
953 @cindex time signature
959 The time signature is set as follows:
961 @lilypond[quote,verbatim,relative=2]
966 @cindex time signature, visibility of
968 Time signatures are printed at the beginning of a piece
969 and whenever the time signature changes. If a change takes place
970 at the end of a line a warning time signature sign is printed
971 there. This default behavior may be changed, see
972 @ref{Visibility of objects}.
974 @lilypond[quote,verbatim,relative=2]
984 @cindex time signature style
987 @funindex \numericTimeSignature
988 @funindex numericTimeSignature
989 @funindex \defaultTimeSignature
990 @funindex defaultTimeSignature
992 The time signature symbol that is used in 2/2 and 4/4 time can be
993 changed to a numeric style:
995 @lilypond[quote,verbatim,relative=2]
999 % Change to numeric style
1000 \numericTimeSignature
1003 % Revert to default style
1004 \defaultTimeSignature
1010 Mensural time signatures are covered in
1011 @ref{Mensural time signatures}.
1015 @code{\numericTimeSignature},
1016 @code{\defaultTimeSignature}.
1022 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1023 {changing-the-time-signature-without-affecting-the-beaming.ly}
1025 @cindex compound time signatures
1026 @cindex time signature, compound
1028 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1029 {compound-time-signatures.ly}
1031 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1032 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1037 @rglos{time signature}
1040 @ref{Mensural time signatures},
1041 @ref{Time administration}.
1046 Internals Reference:
1047 @rinternals{TimeSignature},
1048 @rinternals{Timing_translator}.
1052 @unnumberedsubsubsec Upbeats
1056 @cindex partial measure
1057 @cindex measure, partial
1058 @cindex pickup measure
1059 @cindex measure, change length
1061 @funindex measurePosition
1065 Partial or pick-up measures, such as an anacrusis or upbeat, are
1066 entered using the @code{\partial} command, with the syntax
1069 \partial @var{duration}
1073 where @code{duration} is the rhythmic length of the interval
1074 before the start of the first complete measure:
1076 @lilypond[quote,verbatim,relative=2]
1081 The partial measure can be any duration less than a full measure:
1083 @lilypond[quote,verbatim,relative=2]
1084 \partial 8*3 c8 d e |
1088 Internally, @code{\partial} is translated into
1091 \set Timing.measurePosition = -@var{duration}
1095 The property @code{measurePosition} contains a rational number
1096 indicating how much of the measure has passed at this point. Note
1097 that this is set to a negative number by the @code{\partial}
1098 command: i.e., @code{\partial 4} is internally translated to
1099 @code{-4}, meaning @qq{there is a quarter note left in the measure.}
1113 @rinternals{Timing_translator}.
1118 The @code{\partial} command is intended to be used only at the
1119 beginning of a piece. If you use it after the beginning, some
1120 odd warnings may occur.
1122 @node Unmetered music
1123 @unnumberedsubsubsec Unmetered music
1125 @cindex bar lines, turning off
1126 @cindex bar numbering, turning off
1128 @cindex unmetered music
1130 @funindex \cadenzaOn
1132 @funindex \cadenzaOff
1133 @funindex cadenzaOff
1135 Bar lines and bar numbers are calculated automatically. For
1136 unmetered music (some cadenzas, for example), this is not desirable.
1137 To turn off automatic calculation of bar lines and bar numbers,
1138 use the command @code{\cadenzaOn}, and use @code{\cadenzaOff}
1139 to turn them on again.
1141 @lilypond[verbatim,relative=2,fragment]
1150 Bar numbering is resumed at the end of the cadenza as if the
1151 cadenza were not there:
1153 @lilypond[verbatim,relative=2,fragment]
1154 % Show all bar numbers
1155 \override Score.BarNumber #'break-visibility = #all-visible
1176 @ref{Visibility of objects}.
1182 @cindex cadenza line breaks
1183 @cindex cadenza page breaks
1184 @cindex unmetered music, line breaks
1185 @cindex unmetered music, page breaks
1186 @cindex breaks in unmetered music
1187 @cindex line breaks in cadenzas
1188 @cindex page breaks in cadenzas
1189 @cindex line breaks in unmetered music
1190 @cindex page breaks in unmetered music
1194 LilyPond will insert line breaks and page breaks only at a
1195 bar line. Unless the unmetered music ends before the end of the
1196 staff line, you will need to insert invisible bar lines with
1203 to indicate where breaks can occur.
1206 @node Polymetric notation
1207 @unnumberedsubsubsec Polymetric notation
1209 @c This section necessarily uses \set
1210 @c This is acceptable -td
1212 @cindex double time signatures
1213 @cindex signatures, polymetric
1214 @cindex time signatures, polymetric
1215 @cindex time signatures, double
1216 @cindex polymetric signatures
1217 @cindex meter, polymetric
1219 @funindex timeSignatureFraction
1220 @funindex \scaleDurations
1221 @funindex scaleDurations
1225 Polymetric notation is supported, either explicitly or by modifying
1226 the visible time signature symbol and scaling the note durations.
1228 @strong{@i{Staves with different time signatures, equal measure lengths}}
1230 This notation can be created by setting a common time signature
1231 for each staff but replacing the symbol manually by setting
1232 @code{timeSignatureFraction} to the desired fraction and scaling
1233 the printed durations in each staff to the common time
1234 signature; see @ref{Time signature}. The scaling is done with
1235 @code{\scaleDurations}, which is used in a similar way to
1236 @code{\times}, but does not create a tuplet bracket; see
1237 @ref{Scaling durations}.
1239 @cindex beaming in polymetric music
1240 @cindex beaming in polymetric meter
1242 In this example, music with the time signatures of 3/4, 9/8, and
1243 10/8 are used in parallel. In the second staff, shown durations
1244 are multiplied by 2/3, as 2/3 * 9/8 = 3/4, and in the third
1245 staff, shown durations are multiplied by 3/5, as 3/5 * 10/8 = 3/4.
1246 It will often be necessary to insert beams manually, as the
1247 duration scaling affects the autobeaming rules.
1249 @lilypond[quote,verbatim,fragment]
1258 \set Staff.timeSignatureFraction = #'(9 . 8)
1259 \scaleDurations #'(2 . 3)
1260 \repeat unfold 6 { c8[ c c] }
1264 \set Staff.timeSignatureFraction = #'(10 . 8)
1265 \scaleDurations #'(3 . 5) {
1266 \repeat unfold 2 { c8[ c c] }
1267 \repeat unfold 2 { c8[ c] } |
1268 c4. c4. \times 2/3 { c8[ c c] } c4
1274 @strong{@i{Staves with different time signatures, unequal bar lengths}}
1276 Each staff can be given its own independent time signature by
1277 moving the @code{Timing_translator} and the
1278 @code{Default_bar_line_engraver} to the @code{Staff} context.
1280 @lilypond[quote,verbatim]
1284 \remove "Timing_translator"
1285 \remove "Default_bar_line_engraver"
1289 \consists "Timing_translator"
1290 \consists "Default_bar_line_engraver"
1294 % Now each staff has its own time signature.
1320 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1321 {compound-time-signatures.ly}
1327 @rglos{polymetric time signature},
1331 @ref{Time signature},
1332 @ref{Scaling durations}.
1337 Internals Reference:
1338 @rinternals{TimeSignature},
1339 @rinternals{Timing_translator},
1340 @rinternals{Default_bar_line_engraver},
1346 When using different time signatures in parallel, notes
1347 at the same moment will be be placed at the same horizontal
1348 location. However, the bar lines in the different staves
1349 will cause the note spacing to be less regular in each of the
1350 individual staves than would be normal without the different
1353 @node Automatic note splitting
1354 @unnumberedsubsubsec Automatic note splitting
1356 @cindex notes, splitting
1357 @cindex splitting notes
1359 @funindex Note_heads_engraver
1360 @funindex Completion_heads_engraver
1362 Long notes which overrun bar lines can be converted automatically
1363 to tied notes. This is done by replacing the
1364 @code{Note_heads_engraver} with the
1365 @code{Completion_heads_engraver}. In the following
1366 example, notes crossing the bar lines are split and tied.
1368 @lilypond[quote,verbatim,relative=1]
1370 \remove "Note_heads_engraver"
1371 \consists "Completion_heads_engraver"
1374 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 }
1377 This engraver splits all running notes at the bar line, and
1378 inserts ties. One of its uses is to debug complex scores: if the
1379 measures are not entirely filled, then the ties show exactly how
1380 much each measure is off.
1384 Music Glossary: @rglos{tie}
1387 @rlearning{Engravers explained},
1388 @rlearning{Adding and removing engravers}.
1393 Internals Reference:
1394 @rinternals{Note_heads_engraver},
1395 @rinternals{Completion_heads_engraver},
1396 @rinternals{Forbid_line_break_engraver}.
1401 Not all durations (especially those containing tuplets) can be
1402 represented exactly with normal notes and dots, but the
1403 @code{Completion_heads_engraver} will not insert tuplets.
1405 The @code{Completion_heads_engraver} only affects notes; it does not
1409 @node Showing melody rhythms
1410 @unnumberedsubsubsec Showing melody rhythms
1412 @cindex melody rhythms, showing
1413 @cindex rhythms, showing melody
1415 Sometimes you might want to show only the rhythm of a melody. This
1416 can be done with the rhythmic staff. All pitches of notes on such a
1417 staff are squashed, and the staff itself has a single line
1419 @lilypond[quote,relative=1,verbatim]
1421 \new RhythmicStaff {
1422 \new Voice = "myRhythm" {
1430 \lyricsto "myRhythm" {
1438 @cindex guitar chord charts
1439 @cindex strumming rhythms, showing
1440 @cindex guitar strumming rhythms, showing
1442 @funindex Pitch_squash_engraver
1443 @funindex \improvisationOn
1444 @funindex improvisationOn
1445 @funindex \improvisationOff
1446 @funindex improvisationOff
1448 Guitar chord charts often show the strumming rhythms. This can
1449 be done with the @code{Pitch_squash_engraver} and
1450 @code{\improvisationOn}.
1453 @lilypond[quote,verbatim]
1462 \consists Pitch_squash_engraver
1475 @code{\improvisationOn},
1476 @code{\improvisationOff}.
1482 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1483 {guitar-strum-rhythms.ly}
1490 Internals Reference:
1491 @rinternals{RhythmicStaff},
1492 @rinternals{Pitch_squash_engraver}.
1500 * Setting automatic beam behavior::
1505 @node Automatic beams
1506 @unnumberedsubsubsec Automatic beams
1508 By default, beams are inserted automatically:
1510 @cindex beams, manual
1511 @cindex manual beams
1512 @cindex beams, setting rules for
1513 @cindex beams, custom rules for
1515 @funindex \autoBeamOn
1516 @funindex autoBeamOn
1517 @funindex \autoBeamOff
1518 @funindex autoBeamOff
1520 @lilypond[quote,verbatim,relative=2]
1522 \time 6/8 c c c c8. c16 c8
1525 If these automatic decisions are not satisfactory, beaming can be
1526 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1527 entered manually if beams are to be extended over rests.
1529 If automatic beaming is not required, it may be turned off with
1530 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1532 @lilypond[quote,relative=1,verbatim]
1533 c4 c8 c8. c16 c8. c16 c8
1540 @cindex melismata, beams
1541 @cindex beams and melismata
1543 @warning{If beams are used to indicate melismata in songs, then
1544 automatic beaming should be switched off with @code{\autoBeamOff}
1545 and the beams indicated manually.}
1547 Beaming patterns that differ from the automatic defaults can be
1548 created; see @ref{Setting automatic beam behavior}.
1552 @code{\autoBeamOff},
1559 @cindex line breaks and beams
1560 @cindex beams and line breaks
1564 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1565 {beams-across-line-breaks.ly}
1567 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1568 {changing-beam-knee-gap.ly}
1574 @ref{Setting automatic beam behavior}.
1577 @file{scm/@/auto@/-beam@/.scm}.
1582 Internals Reference: @rinternals{Beam}.
1587 Beams can collide with note heads and accidentals in other voices.
1590 @node Setting automatic beam behavior
1591 @unnumberedsubsubsec Setting automatic beam behavior
1594 @cindex automatic beams, tuning
1595 @cindex tuning automatic beaming
1596 @cindex automatic beam generation
1598 @cindex lyrics and beaming
1600 @funindex autoBeaming
1601 @funindex beamSettings
1602 @funindex measureLength
1603 @funindex beatLength
1609 The placement of automatic beams is determined by the time signature.
1610 Three types of rules are used for determining the end of automatic
1611 beams: @emph{default} rules
1612 for the time signature, @emph{explicit} rules for the beam in the time
1613 signature, and the @emph{beatLength} for the time signature.
1615 The following rules, in order of priority, apply when determining
1616 the appearance of beams:
1620 @item If a manual beam is specified with @code{[..]} set the beam
1621 as specified, otherwise
1623 @item if @code{\autoBeamOff} is in force do not beam, otherwise
1625 @item if an explicit beam-ending rule is defined for the beam type
1626 in the time signature, use it to determine the valid
1627 places where beams may end, otherwise
1629 @item if a default beam-ending rule is defined in the time signature,
1630 use it to group notes with beams, otherwise
1632 @item use the value of @code{beatLength} to group notes with beams
1636 @i{@strong{Modifying the grouping of beats}}
1638 By default @code{beatLength} is
1639 derived from the time signature set by the @code{\time} command.
1640 The @code{beatLength} is set to be one over the denominator
1641 of the time signature.
1643 @code{beatLength} is a @i{moment},
1644 a unit of musical duration. A quantity of type @i{moment} is
1645 created by the scheme function @code{ly:make-moment}. For more
1646 information about this function, see @ref{Time administration}.
1648 Autobeam and beam subdivide settings are stored in the
1649 @code{beamSettings} property. Default values of @code{beamSettings}
1650 are determined in @file{scm/beam-settings.scm}. Entries in
1651 @code{beamSettings} are indexed by time signature and
1654 Time signature should be a scheme pair , e.g. @code{#'(4 . 4)}.
1656 Rule type should be @code{#'end} for beam ending and @code{#'subdivide} for
1659 The ending and subdivision rules consist of a scheme alist
1660 (or list of pairs) that
1661 indicates the beam type and the grouping to be applied to that
1665 #'((beam-type1 . grouping-1)
1666 (beam-type2 . grouping-2)
1667 (beam-type3 . grouping-3))
1670 Beam type is either a scheme pair indicating the duration
1671 of the beam, e.g. @code{(1 . 16)}, or @code{*} to indicate a
1672 default rule, which applies to all beams if no explicit rule is
1675 Grouping is a scheme list indicating the grouping to be applied to
1676 the beam. For default rules (where beam type is
1677 @code{*}, the grouping is in units of @code{beatLength}.
1678 For explicit rules, the grouping is in units of the beam type.
1680 Beam settings are changed with
1681 @code{\overrideBeamSettings} and @code{\revertBeamSettings}.
1683 @lilypond[quote,relative=2,verbatim]
1686 \overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (2 3)))
1688 \overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (3 2)))
1692 Beam setting changes can be limited to specific contexts. If no
1693 setting is included in a lower-level context, the setting of the
1694 enclosing context will apply.
1696 @lilypond[quote, verbatim,relative=1]
1701 \overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (2 3 2)))
1708 \overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (1 3 3)))
1715 When multiple voices are used the @code{Staff} context must be
1716 specified if the beaming is to be applied to all voices in the
1719 @lilypond[quote,verbatim,relative=2]
1722 % Context Voice specified -- does not work correctly
1723 % Because of autogenerated voices, all beating will
1724 % be at beatLength (1 . 8)
1725 \overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (3 1 1 2)))
1726 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
1728 % Works correctly with context Staff specified
1729 \overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (3 1 1 2)))
1730 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
1733 @funindex revertBeamSettings
1735 Beam settings can be reverted to get back to default behavior. This
1736 is accomplished by using @code{\revertBeamSettings}. The arguments
1737 are the same as for @code{\overrideBeamSettings}, except no value
1738 for @var{grouping} is given:
1741 \revertBeamSettings context time-signature rule-type
1745 @lilypond[quote,verbatim,relative=2]
1747 \repeat unfold 16 {a16}
1748 % set default rule for (1 1 1 1) grouping
1749 \overrideBeamSettings #'Score #'(4 . 4) #'end #'((* . (1 1 1 1)))
1750 \repeat unfold 16 {a16}
1751 % revert the new rule
1752 \revertBeamSettings #'Score #'(4 . 4) #'end
1753 \repeat unfold 16 {a16}
1758 @cindex beams, subdividing
1760 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1761 {sub-dividing-beams.ly}
1763 @cindex measure groupings
1764 @cindex beats, grouping
1765 @cindex grouping beats
1766 @cindex measure sub-grouping
1768 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1769 {conducting-signs,-measure-grouping-signs.ly}
1771 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1772 {beam-endings-in-score-context.ly}
1774 @cindex beam, last in score
1775 @cindex beam, last in polyphonic voice
1779 If a score ends while an automatic beam has not been ended and is
1780 still accepting notes, this last beam will not be typeset at all.
1781 The same holds for polyphonic voices, entered with @code{<<
1782 @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
1783 automatic beam is still accepting notes, it is not typeset.
1792 @unnumberedsubsubsec Manual beams
1794 @cindex beams, manual
1795 @cindex manual beams
1800 In some cases it may be necessary to override the automatic
1801 beaming algorithm. For example, the autobeamer will not put beams
1802 over rests or bar lines, and in choral scores the beaming is
1803 often set to follow the meter of the lyrics rather than the
1804 notes. Such beams can be specified manually by
1805 marking the begin and end point with @code{[} and @code{]}
1807 @lilypond[quote,relative=1,verbatim]
1809 r4 r8[ g' a r8] r8 g[ | a] r8
1817 Individual notes may be marked with @code{\noBeam} to prevent them
1820 @lilypond[quote,verbatim,relative=2]
1821 \time 2/4 c8 c\noBeam c c
1824 @funindex stemLeftBeamCount
1825 @funindex stemRightBeamCount
1827 Even more strict manual control with the beams can be achieved by
1828 setting the properties @code{stemLeftBeamCount} and
1829 @code{stemRightBeamCount}. They specify the number of beams to
1830 draw on the left and right side, respectively, of the next note.
1831 If either property is set, its value will be used only once, and
1832 then it is erased. In this example, the last @code{f} is printed
1833 with only one beam on the left side, i.e., the eighth-note beam of
1834 the group as a whole.
1836 @lilypond[quote,relative=2,verbatim]
1839 \set stemLeftBeamCount = #2
1840 \set stemRightBeamCount = #1
1842 \set stemLeftBeamCount = #1
1849 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1850 {flat-flags-and-beam-nibs.ly}
1852 @node Feathered beams
1853 @unnumberedsubsubsec Feathered beams
1855 @cindex beams, feathered
1856 @cindex feathered beams
1858 @funindex \featherDurations
1859 @funindex featherDurations
1860 @funindex grow-direction
1862 Feathered beams are used to indicate that a small group of notes
1863 should be played at an increasing (or decreasing) tempo, without
1864 changing the overall tempo of the piece. The extent of the
1865 feathered beam must be indicated manually using @code{[} and
1866 @code{]}, and the beam feathering is turned on by specifying a
1867 direction to the @code{Beam} property @code{grow-direction}.
1869 If the placement of the notes and the sound in the MIDI output is to
1870 reflect the ritardando or accelerando indicated by the feathered beam
1871 the notes must be grouped as a music expression delimited by braces
1872 and preceded by a @code{featherDurations} command which specifies
1873 the ratio between the durations of the first and last notes in the
1876 The square brackets show the extent of the beam and the braces show
1877 which notes are to have their durations modified. Normally these
1878 would delimit the same group of notes, but this is not required: the
1879 two commands are independent.
1881 In the following example the eight 16th notes occupy exactly the
1882 same time as a half note, but the first note is one half as long
1883 as the last one, with the intermediate notes gradually
1884 lengthening. The first four 32nd notes gradually speed up, while
1885 the last four 32nd notes are at a constant tempo.
1887 @lilypond[relative=1,verbatim,quote]
1888 \override Beam #'grow-direction = #LEFT
1889 \featherDurations #(ly:make-moment 2 1)
1890 { c16[ c c c c c c c] }
1891 \override Beam #'grow-direction = #RIGHT
1892 \featherDurations #(ly:make-moment 2 3)
1894 % revert to non-feathered beams
1895 \override Beam #'grow-direction = #'()
1900 The spacing in the printed output represents the
1901 note durations only approximately, but the MIDI output is exact.
1905 The @code{\featherDurations} command only works with very short
1906 music snippets, and when numbers in the fraction are small.
1921 * Bar and bar number checks::
1926 @unnumberedsubsubsec Bar lines
1929 @cindex measure lines
1930 @cindex closing bar lines
1931 @cindex bar lines, closing
1932 @cindex double bar lines
1933 @cindex bar lines, double
1939 Bar lines delimit measures, and are also used to indicate
1940 repeats. Normally, simple bar lines are automatically inserted
1941 into the printed output at places based on the current time
1944 The simple bar lines inserted automatically can be changed to
1945 other types with the @code{\bar} command. For example, a closing
1946 double bar line is usually placed at the end of a piece:
1948 @lilypond[quote,relative=1,verbatim]
1952 It is not invalid if the final note in a measure does not
1953 end on the automatically entered bar line: the note is assumed
1954 to carry over into the next measure. But if a long sequence
1955 of such carry-over measures appears the music can appear compressed
1956 or even flowing off the page. This is because automatic line
1957 breaks happen only at the end of complete measures, i.e., where
1958 all notes end before the end of a measure.
1960 @warning{An incorrect duration can cause line breaks to be
1961 inhibited, leading to a line of highly compressed music or
1962 music which flows off the page.}
1965 @cindex bar lines, invisible
1966 @cindex measure lines, invisible
1968 Line breaks are also permitted at manually inserted bar lines
1969 even within incomplete measures. To allow a line break without
1970 printing a bar line, use
1977 This will insert an invisible bar line and allow (but not
1978 force) a line break to occur at this point. The bar number
1979 counter is not increased. To force a line break see
1980 @ref{Line breaking}.
1982 @cindex manual bar lines
1983 @cindex manual measure lines
1984 @cindex bar lines, manual
1985 @cindex measure lines, manual
1987 This and other special bar lines may be inserted manually at any
1988 point. When they coincide with the end of a measure they replace the
1989 simple bar line which would have been inserted there automatically.
1990 When they do not coincide with the end of a measure the specified bar
1991 line is inserted at that point in the printed output. Such insertions
1992 do not affect the calculation and placement of subsequent automatic
1995 Two types of simple bar lines and five types of double bar lines are available
1996 for manual insertion:
1998 @lilypond[quote,relative=1,verbatim]
2010 together with dotted and dashed bar lines:
2012 @lilypond[quote,relative=1,verbatim]
2019 and five types of repeat bar line:
2021 @lilypond[quote,relative=1,verbatim]
2030 Additionally, a bar line can be printed as a simple tick:
2031 @lilypond[quote,relative=1,verbatim]
2034 However, as such ticks are typically used in Gregorian chant, it is preferable
2035 to use @code{\divisioMinima} there instead, described in the section
2036 @ref{Divisiones} in Gregorian chant.
2041 Although the bar line types signifying repeats may be inserted
2042 manually they do not in themselves cause LilyPond to recognize
2043 a repeated section. Such repeated sections are better entered
2044 using the various repeat commands (see @ref{Repeats}), which
2045 automatically print the appropriate bar lines.
2047 In addition, you can specify @code{"||:"}, which is equivalent to
2048 @code{"|:"} except at line breaks, where it gives a double bar
2049 line at the end of the line and a start repeat at the beginning of
2052 @lilypond[quote,relative=2,verbatim]
2060 In scores with many staves, a @code{\bar} command in one staff is
2061 automatically applied to all staves. The resulting bar lines are
2062 connected between different staves of a @code{StaffGroup},
2063 @code{PianoStaff}, or @code{GrandStaff}.
2065 @lilypond[quote,fragment,verbatim]
2073 \new Staff { \clef bass c4 g e g }
2075 \new Staff { \clef bass c2 c2 }
2080 @cindex default bar lines, changing
2081 @cindex bar lines, default, changing
2086 @funindex defaultBarType
2091 The command @code{\bar }@var{bartype} is a shortcut for
2092 @code{\set Timing.whichBar = }@var{bartype}. A bar line is
2093 created whenever the @code{whichBar} property is
2096 The default bar type used for automatically inserted bar lines is
2097 @code{"|"}. This may be changed at any time
2098 with @code{\set Timing.defaultBarType = }@var{bartype}.
2103 @ref{Line breaking},
2105 @ref{Grouping staves}.
2110 Internals Reference: @rinternals{BarLine} (created at
2111 @rinternals{Staff} level), @rinternals{SpanBar} (across
2112 staves), @rinternals{Timing_translator} (for Timing
2117 @unnumberedsubsubsec Bar numbers
2120 @cindex measure numbers
2121 @cindex numbers, bar
2122 @cindex numbers, measure
2124 @funindex currentBarNumber
2126 Bar numbers are typeset by default at the start of every line except
2127 the first line. The number itself is stored in the
2128 @code{currentBarNumber} property, which is normally updated
2129 automatically for every measure. It may also be set manually:
2131 @lilypond[verbatim,quote,fragment,relative=1]
2134 \set Score.currentBarNumber = #50
2138 @cindex bar numbers, regular spacing
2140 @funindex barNumberVisibility
2143 Bar numbers can be typeset at regular intervals instead of just at
2144 the beginning of every line. To do this the default behavior
2145 must be overridden to permit bar numbers to be printed at places
2146 other than the start of a line. This is controlled by the
2147 @code{break-visibility} property of @code{BarNumber}. This takes
2148 three values which may be set to @code{#t} or @code{#f} to specify
2149 whether the corresponding bar number is visible or not. The order
2150 of the three values is @code{end of line visible}, @code{middle of
2151 line visible}, @code{beginning of line visible}. In the following
2152 example bar numbers are printed at all possible places:
2154 @lilypond[verbatim,quote,relative=1]
2155 \override Score.BarNumber #'break-visibility = #'#(#t #t #t)
2156 \set Score.currentBarNumber = #11
2157 % Permit first bar number to be printed
2167 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2168 {printing-the-bar-number-for-the-first-measure.ly}
2170 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2171 {printing-bar-numbers-at-regular-intervals.ly}
2173 @cindex measure number, format
2174 @cindex bar number, format
2176 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2177 {printing-bar-numbers-inside-boxes-or-circles.ly}
2179 @cindex bar number alignment
2181 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2182 {aligning-bar-numbers.ly}
2184 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2185 {removing-bar-numbers-from-a-score.ly}
2192 Internals Reference: @rinternals{BarNumber}.
2195 @cindex bar number collision
2196 @cindex collision, bar number
2200 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
2201 if there is one. To solve this, the @code{padding} property of
2202 @code{BarNumber} can be used to position the number correctly. See
2203 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
2207 @node Bar and bar number checks
2208 @unnumberedsubsubsec Bar and bar number checks
2211 @cindex bar number check
2212 @cindex measure check
2213 @cindex measure number check
2215 @funindex barCheckSynchronize
2218 Bar checks help detect errors in the entered durations. A bar check
2219 may be entered using the bar symbol, @code{|}, at any place where a
2220 bar line is expected to fall. If bar check lines are encountered at
2221 other places, a list of warnings is printed in the log file, showing
2222 the line numbers and lines in which the bar checks failed. In the
2223 next example, the second bar check will signal an error.
2226 \time 3/4 c2 e4 | g2 |
2229 Bar checks can also be used in lyrics, for example
2234 Twin -- kle | Twin -- kle |
2238 An incorrect duration can result in a completely garbled score,
2239 especially if the score is polyphonic, so a good place to start
2240 correcting input is by scanning for failed bar checks and
2241 incorrect durations.
2243 If successive bar checks are off by the same musical interval,
2244 only the first warning message is displayed. This allows the
2245 warning to focus on the source of the timing error.
2249 @funindex pipeSymbol
2251 It is also possible to redefine the action taken when a bar check
2252 or pipe symbol, @code{|}, is encountered in the input, so that
2253 it does something other than a bar check. This is done by
2254 assigning a music expression to @code{pipeSymbol}.
2255 In the following example @code{|} is set to insert a double bar
2256 line wherever it appears in the input, rather than checking
2259 @lilypond[quote,verbatim]
2260 pipeSymbol = \bar "||"
2269 @funindex \barNumberCheck
2270 @funindex barNumberCheck
2272 When copying large pieces of music, it can be helpful to check that
2273 the LilyPond bar number corresponds to the original that you are
2274 entering from. This can be checked with @code{\barNumberCheck}, for
2278 \barNumberCheck #123
2282 will print a warning if the @code{currentBarNumber} is not 123
2283 when it is processed.
2291 @node Rehearsal marks
2292 @unnumberedsubsubsec Rehearsal marks
2294 @cindex rehearsal marks
2295 @cindex mark, rehearsal
2300 To print a rehearsal mark, use the @code{\mark} command.
2302 @lilypond[quote,verbatim,relative=2]
2311 The letter@tie{}@q{I} is skipped in accordance with engraving
2312 traditions. If you wish to include the letter @q{I}, then use
2315 \set Score.markFormatter = #format-mark-alphabet
2318 The mark is incremented automatically if you use @code{\mark
2319 \default}, but you can also use an integer argument to set the
2320 mark manually. The value to use is stored in the property
2321 @code{rehearsalMark}.
2323 @cindex rehearsal mark format
2324 @cindex rehearsal mark style
2325 @cindex style, rehearsal mark
2326 @cindex format, rehearsal mark
2327 @cindex mark, rehearsal, style
2328 @cindex mark, rehearsal, format
2329 @cindex rehearsal mark, manual
2330 @cindex mark, rehearsal, manual
2331 @cindex custom rehearsal mark
2332 @cindex manual rehearsal mark
2334 The style is defined by the property @code{markFormatter}. It is
2335 a function taking the current mark (an integer) and the current
2336 context as argument. It should return a markup object. In the
2337 following example, @code{markFormatter} is set to a pre-defined
2338 procedure. After a few measures, it is set to a procedure that
2339 produces a boxed number.
2341 @lilypond[quote,verbatim,relative=2]
2342 \set Score.markFormatter = #format-mark-numbers
2345 \set Score.markFormatter = #format-mark-box-numbers
2347 \set Score.markFormatter = #format-mark-circle-numbers
2349 \set Score.markFormatter = #format-mark-circle-letters
2353 The file @file{scm/@/translation@/-functions@/.scm} contains the
2354 definitions of @code{format-mark-numbers} (the default format),
2355 @code{format-mark-box-numbers}, @code{format-mark-letters} and
2356 @code{format-mark-box-letters}. These can be used as inspiration
2357 for other formatting functions.
2359 You may use @code{format-mark-barnumbers},
2360 @code{format-mark-box-barnumbers}, and
2361 @code{format-mark-circle-barnumbers} to get bar numbers instead of
2362 incremented numbers or letters.
2364 Other styles of rehearsal mark can be specified manually:
2371 Note that @code{Score.markFormatter} does not affect marks specified
2372 in this manner. However, it is possible to apply a @code{\markup} to the
2376 \mark \markup@{ \box A1 @}
2381 @cindex D.S. al Fine
2383 @cindex music glyphs
2384 @cindex glyphs, music
2386 @funindex \musicglyph
2387 @funindex musicglyph
2389 Music glyphs (such as the segno sign) may be printed inside a
2392 @lilypond[quote,verbatim,relative=1]
2393 c1 \mark \markup { \musicglyph #"scripts.segno" }
2394 c1 \mark \markup { \musicglyph #"scripts.coda" }
2395 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
2400 See @ref{The Feta font}, for a list of symbols which may be
2401 printed with @code{\musicglyph}.
2403 For common tweaks to the positioning of rehearsal marks, see
2404 @ref{Formatting text}.
2409 @ref{The Feta font},
2410 @ref{Formatting text}.
2413 @file{scm/@/translation@/-functions@/.scm} contains
2414 the definition of @code{format-mark-numbers} and
2415 @code{format-mark-letters}. They can be used as inspiration for
2416 other formatting functions.
2421 Internals Reference: @rinternals{RehearsalMark}.
2424 @node Special rhythmic concerns
2425 @subsection Special rhythmic concerns
2430 * Aligning to cadenzas::
2431 * Time administration::
2435 @unnumberedsubsubsec Grace notes
2439 @cindex appoggiatura
2440 @cindex acciaccatura
2445 Grace notes are ornaments that are written out. Grace notes
2446 are printed in a smaller font and take up no logical time
2449 @lilypond[quote,relative=2,verbatim]
2451 \grace { c16[ d16] } c2
2454 LilyPond also supports two special types of grace notes, the
2455 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
2456 small note with a slashed stem -- and the @emph{appoggiatura}, which
2457 takes a fixed fraction of the main note and appears in small print
2460 @lilypond[quote,relative=2,verbatim]
2464 \acciaccatura { g16[ f] } e4
2467 The placement of grace notes is synchronized between different
2468 staves. In the following example, there are two sixteenth grace
2469 notes for every eighth grace note
2471 @lilypond[quote,relative=2,verbatim]
2472 << \new Staff { e2 \grace { c16[ d e f] } e2 }
2473 \new Staff { c2 \grace { g8[ b] } c2 } >>
2476 @cindex grace notes, following
2478 @funindex \afterGrace
2479 @funindex afterGrace
2481 If you want to end a note with a grace, use the @code{\afterGrace}
2482 command. It takes two arguments: the main note, and the grace
2483 notes following the main note.
2485 @lilypond[quote,verbatim,relative=2]
2486 c1 \afterGrace d1 { c16[ d] } c1
2489 This will put the grace notes after a space lasting 3/4 of the
2490 length of the main note. The default fraction 3/4 can be changed by
2491 setting @code{afterGraceFraction}. The following example shows
2492 the results from setting the space at the default, at 15/16, and
2493 finally at 1/2 of the main note.
2495 @lilypond[quote,verbatim,relative=2]
2498 c1 \afterGrace d1 { c16[ d] } c1
2501 #(define afterGraceFraction (cons 15 16))
2502 c1 \afterGrace d1 { c16[ d] } c1
2505 #(define afterGraceFraction (cons 1 2))
2506 c1 \afterGrace d1 { c16[ d] } c1
2511 The space between the main note and the grace note may also be
2512 specified using spacers. The following example places the grace
2513 note after a space lasting 7/8 of the main note.
2515 @lilypond[quote,verbatim,relative=2]
2518 { s2 s4. \grace { c16[ d] } } >>
2523 @cindex tweaking grace notes
2524 @cindex grace notes, tweaking
2525 @cindex grace notes, changing layout settings
2527 A @code{\grace} music expression will introduce special
2528 typesetting settings, for example, to produce smaller type, and
2529 set directions. Hence, when introducing layout tweaks to
2530 override the special settings, they should be placed inside
2531 the grace expression. The overrides should also be reverted
2532 inside the grace expression. Here, the grace note's default stem
2533 direction is overridden and then reverted.
2535 @lilypond[quote,verbatim,relative=2]
2547 @cindex stem, with slash
2552 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2553 {using-grace-note-slashes-with-normal-heads.ly}
2555 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2556 {tweaking-grace-layout-within-music.ly}
2558 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2559 {redefining-grace-note-global-defaults.ly}
2561 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2562 {positioning-grace-notes-with-floating-space.ly}
2567 @rglos{grace notes},
2568 @rglos{acciaccatura},
2569 @rglos{appoggiatura}.
2571 Installed Files: @file{ly/@/grace@/-init@/.ly}.
2573 Snippets: @rlsr{Rhythms}.
2575 Internals Reference: @rinternals{GraceMusic}.
2580 @cindex acciaccatura, multi-note
2581 @cindex multi-note acciaccatura
2582 @cindex grace-note synchronization
2584 A multi-note beamed @i{acciaccatura} is printed without a slash,
2585 and looks exactly the same as a multi-note beamed
2588 @c TODO Add link to LSR snippet to add slash when available
2590 Grace note synchronization can also lead to surprises. Staff
2591 notation, such as key signatures, bar lines, etc., are also
2592 synchronized. Take care when you mix staves with grace notes and
2593 staves without, for example,
2595 @lilypond[quote,relative=2,verbatim]
2597 \new Staff { e4 \bar "|:" \grace c16 d2. }
2598 \new Staff { c4 \bar "|:" d2. }
2603 This can be remedied by inserting grace skips of the corresponding
2604 durations in the other staves. For the above example
2606 @lilypond[quote,relative=2,verbatim]
2608 \new Staff { e4 \bar "|:" \grace c16 d2. }
2609 \new Staff { c4 \bar "|:" \grace s16 d2. }
2613 Grace sections should only be used within sequential music
2614 expressions. Nesting or juxtaposing grace sections is not
2615 supported, and might produce crashes or other errors.
2617 @node Aligning to cadenzas
2618 @unnumberedsubsubsec Aligning to cadenzas
2621 @cindex cadenza, aligning to
2622 @cindex aligning to cadenza
2624 In an orchestral context, cadenzas present a special problem: when
2625 constructing a score that includes a measured cadenza or other solo
2626 passage, all other instruments should skip just as many notes as the
2627 length of the cadenza, otherwise they will start too soon or too late.
2629 One solution to this problem is to use the functions
2630 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
2631 functions take a defined piece of music as an argument and generate a
2632 multi-measure rest or @code{\skip} exactly as long as the piece.
2634 @lilypond[verbatim,quote]
2635 MyCadenza = \relative c' {
2646 #(ly:export (mmrest-of-length MyCadenza))
2648 #(ly:export (skip-of-length MyCadenza))
2663 @node Time administration
2664 @unnumberedsubsubsec Time administration
2666 @cindex time administration
2667 @cindex timing (within the score)
2668 @cindex music, unmetered
2669 @cindex unmetered music
2671 @funindex currentBarNumber
2672 @funindex measurePosition
2673 @funindex measureLength
2675 Time is administered by the @code{Timing_translator}, which by
2676 default is to be found in the @code{Score} context. An alias,
2677 @code{Timing}, is added to the context in which the
2678 @code{Timing_translator} is placed.
2680 The following properties of @code{Timing} are used
2681 to keep track of timing within the score.
2684 @cindex measure number
2687 @item currentBarNumber
2688 The current measure number. For an example showing the
2689 use of this property see @ref{Bar numbers}.
2692 The length of the measures in the current time signature. For a
2693 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
2694 determines when bar lines are inserted and how automatic beams
2695 should be generated.
2697 @item measurePosition
2698 The point within the measure where we currently are. This
2699 quantity is reset by subtracting @code{measureLength} whenever
2700 @code{measureLength} is reached or exceeded. When that happens,
2701 @code{currentBarNumber} is incremented.
2704 If set to true, the above variables are updated for every time
2705 step. When set to false, the engraver stays in the current
2706 measure indefinitely.
2710 Timing can be changed by setting any of these variables
2711 explicitly. In the next example, the default 4/4 time
2712 signature is printed, but @code{measureLength} is set to 5/4.
2713 At 4/8 through the third measure, the @code{measurePosition} is
2714 advanced by 1/8 to 5/8, shortening that bar by 1/8.
2715 The next bar line then falls at 9/8 rather than 5/4.
2717 @lilypond[quote,verbatim,relative=1]
2718 \set Score.measureLength = #(ly:make-moment 5 4)
2722 \set Score.measurePosition = #(ly:make-moment 5 8)
2728 As the example illustrates, @code{ly:make-moment n m} constructs a
2729 duration of n/m of a whole note. For example,
2730 @code{ly:make-moment 1 8} is an eighth note duration and
2731 @code{ly:make-moment 7 16} is the duration of seven sixteenths
2736 This manual: @ref{Bar numbers}, @ref{Unmetered music}
2741 Internals Reference: @rinternals{Timing_translator},