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
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}.
149 @rglos{Duration names notes and rests}.
152 @ref{Automatic beams},
155 @ref{Writing rhythms},
158 @ref{Ancient notation},
159 @ref{Proportional notation}.
166 @rinternals{DotColumn}.
171 @c Deliberately duplicated in Durations and Rests. -gp
172 There is no fundamental limit to rest durations (both in terms of
173 longest and shortest), but the number of glyphs is limited:
174 rests from 128th to maxima (8 x whole) may be printed.
178 @unnumberedsubsubsec Tuplets
186 Tuplets are made from a music expression by multiplying all the
187 durations with a fraction:
190 \times @var{fraction} @{ @var{music} @}
194 The duration of @var{music} will be multiplied by the
195 fraction. The fraction's denominator will be printed over or
196 under the notes, optionally with a bracket. The most common
197 tuplet is the triplet in which 3 notes have the duration of 2, so
198 the notes are 2/3 of their written length.
200 @lilypond[quote,verbatim,relative=2]
201 a2 \times 2/3 { b4 b b }
202 c4 c \times 2/3 { b4 a g }
205 @cindex tuplet bracket placement
209 @funindex \tupletDown
211 @funindex \tupletNeutral
212 @funindex tupletNeutral
214 Tuplet brackets may be manually placed above or below the staff;
215 see @ref{Direction and placement}.
217 Tuplets may be nested:
219 @lilypond[quote,verbatim,relative=2]
221 c4 \times 4/5 { f8 e f \times 2/3 { e[ f g] } } f4 |
224 Modifying nested tuplets which begin at the same musical moment
225 must be done with @code{\tweak}.
227 To modify the duration of notes without printing a tuplet bracket,
228 see @ref{Scaling durations}.
234 @code{\tupletNeutral}.
240 @cindex tuplet formatting
241 @cindex triplet formatting
243 @funindex tupletNumberFormatFunction
244 @funindex tupletSpannerDuration
246 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
247 {entering-several-tuplets-using-only-one--times-command.ly}
249 @cindex Tuplet number changes
251 @funindex TupletNumber
253 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
254 {changing-the-tuplet-number.ly}
256 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
257 {non-default-tuplet-numbers.ly}
259 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
260 {permitting-line-breaks-within-beamed-tuplets.ly}
269 Learning Manual: @rlearning{Tweaking methods}.
272 @ref{Time administration},
273 @ref{Scaling durations},
274 @ref{The tweak command},
275 @ref{Polymetric notation}.
281 @rinternals{TupletBracket},
282 @rinternals{TupletNumber},
283 @rinternals{TimeScaledMusic}.
285 @cindex grace notes within tuplet brackets
288 When the first note on a staff is a grace note followed by a
289 tuplet the grace note must be placed before the @code{\times}
290 command to avoid errors. Anywhere else, grace notes may be
291 placed within tuplet brackets.
294 @node Scaling durations
295 @unnumberedsubsubsec Scaling durations
297 @cindex scaling durations
298 @cindex durations, scaling
300 You can alter the duration of single notes, rests or chords by a
301 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
302 is 1) to the duration. This will not affect the appearance of the
303 notes or rests produced, but the altered duration will be used in
304 calculating the position within the measure and setting the duration
305 in the MIDI output. Multiplying factors may be combined such as
308 In the following example, the first three notes take up exactly
309 two beats, but no triplet bracket is printed.
311 @lilypond[quote,relative=2,verbatim]
313 % Alter durations to triplets
314 a4*2/3 gis4*2/3 a4*2/3
317 % Double the duration of chord
319 % Duration of quarter, appears like sixteenth
323 The duration of skip or spacing notes may also be modified by
324 a multiplier. This is useful for skipping many measures, e.g.,
327 @cindex compressing music
328 @cindex expanding music
330 @funindex \scaleDurations
331 @funindex scaleDurations
333 Longer stretches of music may be compressed by a fraction in the
334 same way, as if every note, chord or rest had the fraction as a
335 multiplier. This leaves the appearance of the music unchanged but
336 the internal duration of the notes will be multiplied by the
337 fraction @emph{num}/@emph{den}. The spaces around the dot are
338 required. Here is an example showing how music can be compressed
341 @lilypond[quote,relative=2,verbatim]
345 % Scale music by *2/3
346 \scaleDurations #'(2 . 3) {
350 \scaleDurations #'(2 . 1) {
356 One application of this command is in polymetric
357 notation, see @ref{Polymetric notation}.
363 @ref{Invisible rests},
364 @ref{Polymetric notation}.
371 @unnumberedsubsubsec Ties
377 A tie connects two adjacent note heads of the same pitch. The tie
378 in effect extends the duration of a note.
380 @warning{Ties should not be confused with @emph{slurs}, which
381 indicate articulation, or @emph{phrasing slurs}, which indicate
382 musical phrasing. A tie is just a way of extending a note
383 duration, similar to the augmentation dot.}
385 A tie is entered using the tilde symbol (@code{~}).
387 @lilypond[quote,verbatim,relative=2]
393 Ties are used either when the note crosses a bar line, or when
394 dots cannot be used to denote the rhythm. Ties should also be
395 used when note values cross larger subdivisions of the measure:
397 @lilypond[verbatim,quote]
404 If you need to tie many notes across bar lines, it may be
405 easier to use automatic note splitting, see @ref{Automatic note
406 splitting}. This mechanism automatically splits long notes, and
407 ties them across bar lines.
409 @cindex ties and chords
410 @cindex chords and ties
412 When a tie is applied to a chord, all note heads whose pitches
413 match are connected. When no note heads match, no ties will be
414 created. Chords may be partially tied by placing the tie inside
417 @lilypond[quote,verbatim,relative=1]
419 <c~ e g~ b> <c e g b>
422 @cindex repeating ties
423 @cindex ties, repeating
424 @cindex volta brackets and ties
425 @cindex ties and volta brackets
430 When a second alternative of a repeat starts with a tied note, you
431 have to specify the repeated tie as follows:
433 @lilypond[quote,relative=2,verbatim]
434 \repeat volta 2 { c g <c e>2 ~ }
436 % First alternative: following note is tied normally
438 % Second alternative: following note has a repeated tie
439 { <c e>2\repeatTie d4 c } }
442 @cindex laissez vibrer
443 @cindex ties, laissez vibrer
445 @funindex \laissezVibrer
446 @funindex laissezVibrer
448 @notation{L.v.} ties (@notation{laissez vibrer}) indicate that
449 notes must not be damped at the end. It is used in notation for
450 piano, harp and other string and percussion instruments. They can
451 be entered as follows:
453 @lilypond[quote,verbatim,relative=1]
454 <c f g>1\laissezVibrer
457 @cindex ties, placement
463 @funindex \tieNeutral
466 Ties may be manually placed above or below the staff; see
467 @ref{Direction and placement}.
469 @cindex ties, appearance
482 Ties may be made dashed, dotted, or a combination of solid and
485 @lilypond[quote, verbatim, relative=1]
498 Custom dash patterns can be specified:
500 @lilypond[quote, verbatim, relative=1]
501 \tieDashPattern #0.3 #0.75
503 \tieDashPattern #0.7 #1.5
509 Dash pattern definitions for ties have the same structure as
510 dash pattern definitions for slurs.
511 For more information about complex dash patterns,
512 see the snippets under @ref{Slurs}.
520 @code{\tieDashPattern},
521 @code{\tieHalfDashed},
522 @code{\tieHalfSolid},
529 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
530 {using-ties-with-arpeggios.ly}
532 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
533 {engraving-ties-manually.ly}
539 @rglos{laissez vibrer}.
543 @ref{Automatic note splitting}.
549 @rinternals{LaissezVibrerTie},
550 @rinternals{LaissezVibrerTieColumn},
551 @rinternals{TieColumn},
557 Switching staves when a tie is active will not produce a slanted
560 Changing clefs or octavations during a tie is not really
561 well-defined. In these cases, a slur may be preferable.
566 @subsection Writing rests
568 Rests are entered as part of the music in music expressions.
573 * Full measure rests::
577 @unnumberedsubsubsec Rests
580 @cindex rest, entering durations
595 Rests are entered like notes with the note name @code{r}.
596 Durations longer than a whole rest use the predefined
599 @c \time 16/1 is used to avoid spurious bar lines
600 @c and long tracts of empty measures
601 @lilypond[fragment,quote,verbatim]
603 % These two lines are just to prettify this example
605 \override Staff.TimeSignature #'stencil = ##f
606 % Print a maxima rest, equal to four breves
608 % Print a longa rest, equal to two breves
612 r1 r2 r4 r8 r16 r32 r64 r128
616 @cindex rest, multi-measure
617 @cindex rest, whole-measure
619 Whole measure rests, centered in the middle of the measure, must be
620 entered as multi-measure rests. They can be used for a single
621 measure as well as many measures and are discussed in @ref{Full
624 @cindex rest, specifying vertical position
626 To explicitly specify a rest's vertical position, write a note
627 followed by @code{\rest}. A rest of the duration of the note will
628 be placed at the staff position where the note would appear. This
629 allows for precise manual formatting of polyphonic music, since the
630 automatic rest collision formatter will not move these rests.
632 @lilypond[quote,verbatim,relative=2]
638 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
649 @ref{Full measure rests}.
660 @c Deliberately duplicated in Durations and Rests. -gp
661 There is no fundamental limit to rest durations (both in terms of
662 longest and shortest), but the number of glyphs is limited: there
663 are rests from 128th to maxima (8 x whole).
666 @node Invisible rests
667 @unnumberedsubsubsec Invisible rests
670 @cindex invisible rest
671 @cindex rest, invisible
679 An invisible rest (also called a @q{spacer rest}) can be entered
680 like a note with the note name@tie{}@code{s}:
682 @lilypond[verbatim,quote,relative=2]
689 Spacer rests are available only in note mode and chord mode. In
690 other situations, for example, when entering lyrics, @code{\skip}
691 is used to skip a musical moment. @code{\skip} requires an
694 @lilypond[quote,verbatim,relative=2]
707 A spacer rest implicitly causes @code{Staff} and @code{Voice}
708 contexts to be created if none exist, just like notes and rests
711 @lilypond[quote,verbatim,fragment]
715 @code{\skip} simply skips musical time; it creates no output of
718 @lilypond[quote,verbatim,fragment]
719 % This is valid input, but does nothing
720 \skip 1 \skip1 \skip 1
726 @rlearning{Visibility and color of objects}.
730 @ref{Visibility of objects}.
736 @rinternals{SkipMusic}.
739 @node Full measure rests
740 @unnumberedsubsubsec Full measure rests
742 @cindex multi-measure rests
743 @cindex full-measure rests
744 @cindex rest, multi-measure
745 @cindex rest, full-measure
746 @cindex whole rest for a full measure
747 @cindex rest, whole for a full measure
751 Rests for one or more full measures are entered like notes with
752 the note name uppercase @code{R}:
754 @lilypond[quote,verbatim,relative=2]
755 % Rest measures contracted to single measure
756 \compressFullBarRests
763 The duration of full-measure rests is identical to the duration
764 notation used for notes. The duration in a multi-measure rest must
765 always be an integral number of measure-lengths, so augmentation dots
766 or fractions must often be used:
768 @lilypond[quote,fragment,verbatim]
769 \compressFullBarRests
775 R1*13/8 | R1*13/8*12 |
780 A full-measure rest is printed as either a whole or breve rest,
781 centered in the measure, depending on the time signature.
783 @lilypond[quote,verbatim,fragment]
792 @cindex multi-measure rest, expanding
793 @cindex multi-measure rest, contracting
795 @funindex \expandFullBarRests
796 @funindex expandFullBarRests
797 @funindex \compressFullBarRests
798 @funindex compressFullBarRests
800 By default a multi-measure rest is expanded in the printed score to
801 show all the rest measures explicitly. Alternatively, a multi-measure
802 rest can be shown as a single measure containing a multi-measure rest
803 symbol, with the number of measures of rest printed above the measure:
805 @lilypond[quote,fragment,verbatim]
807 \time 3/4 r2. | R2.*2 |
810 % Rest measures contracted to single measure
811 \compressFullBarRests
813 % Rest measures expanded
820 @cindex text on multi-measure rest
821 @cindex multi-measure rest, attaching text
822 @cindex script on multi-measure rest
823 @cindex multi-measure rest, script
824 @cindex fermata on multi-measure rest
825 @cindex multi-measure rest, attaching fermata
826 @cindex markup on multi-measure rest
827 @cindex multi-measure rest with markup
829 @funindex \fermataMarkup
830 @funindex fermataMarkup
831 @funindex MultiMeasureRestText
833 Markups can be added to multi-measure rests.
834 The predefined command @code{\fermataMarkup}
835 is provided for adding fermatas.
837 @lilypond[quote,verbatim,fragment]
838 \compressFullBarRests
840 R2.*10^\markup { \italic "ad lib." }
845 Markups attached to a multi-measure rest are
846 objects of type @code{MultiMeasureRestText}, not
847 @code{TextScript}. Overrides must be directed to the correct
848 object, or they will be ignored. See the following example.
851 @lilypond[quote,verbatim,fragment]
852 % This fails, as the wrong object name is specified
853 \override TextScript #'padding = #5
855 % This is correct and works
856 \override MultiMeasureRestText #'padding = #5
860 When a multi-measure rest immediately follows a @code{\partial}
861 setting, resulting bar-check warnings may not be displayed.
864 @funindex \textLengthOn
865 @funindex textLengthOn
866 @funindex \textLengthOff
867 @funindex textLenthOff
868 @funindex \fermataMarkup
869 @funindex fermataMarkup
870 @funindex \compressFullBarRests
871 @funindex compressFullBarRests
872 @funindex \expandFullBarRests
873 @funindex expandFullBarRests
876 @code{\textLengthOn},
877 @code{\textLengthOff},
878 @code{\fermataMarkup},
879 @code{\compressFullBarRests},
880 @code{\expandFullBarRests}.
888 @cindex kirchenpausen
890 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
891 {changing-form-of-multi-measure-rests.ly}
893 @cindex multi-measure rests, positioning
894 @cindex positioning multi-measure rests
896 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
897 {positioning-multi-measure-rests.ly}
899 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
900 {multi-measure-rest-markup.ly}
905 @rglos{multi-measure rest}.
910 @ref{Formatting text},
917 @rinternals{MultiMeasureRest},
918 @rinternals{MultiMeasureRestNumber},
919 @rinternals{MultiMeasureRestText}.
922 @cindex fingerings and multi-measure rests
923 @cindex multi-measure rests and fingerings
927 If an attempt is made to use fingerings (e.g.,
928 @code{R1*10-4}) to put numbers over multi-measure rests, the
929 fingering numeral (4) may collide with the bar counter
932 @cindex condensing rests
933 @cindex rest, condensing ordinary
935 There is no way to automatically condense multiple ordinary rests
936 into a single multi-measure rest.
938 @cindex rest, collisions of
940 Multi-measure rests do not take part in rest collisions.
942 @node Displaying rhythms
943 @subsection Displaying rhythms
949 * Polymetric notation::
950 * Automatic note splitting::
951 * Showing melody rhythms::
955 @unnumberedsubsubsec Time signature
957 @cindex time signature
963 The time signature is set as follows:
965 @lilypond[quote,verbatim,relative=2]
970 @cindex time signature, visibility of
972 Time signatures are printed at the beginning of a piece
973 and whenever the time signature changes. If a change takes place
974 at the end of a line a warning time signature sign is printed
975 there. This default behavior may be changed, see
976 @ref{Visibility of objects}.
978 @lilypond[quote,verbatim,relative=2]
988 @cindex time signature style
991 @funindex \numericTimeSignature
992 @funindex numericTimeSignature
993 @funindex \defaultTimeSignature
994 @funindex defaultTimeSignature
996 The time signature symbol that is used in 2/2 and 4/4 time can be
997 changed to a numeric style:
999 @lilypond[quote,verbatim,relative=2]
1003 % Change to numeric style
1004 \numericTimeSignature
1007 % Revert to default style
1008 \defaultTimeSignature
1014 Mensural time signatures are covered in
1015 @ref{Mensural time signatures}.
1019 @code{\numericTimeSignature},
1020 @code{\defaultTimeSignature}.
1026 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1027 {changing-the-time-signature-without-affecting-the-beaming.ly}
1029 @cindex compound time signatures
1030 @cindex time signature, compound
1032 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1033 {compound-time-signatures.ly}
1038 @rglos{time signature}
1041 @ref{Mensural time signatures},
1042 @ref{Time administration}.
1047 Internals Reference:
1048 @rinternals{TimeSignature},
1049 @rinternals{Timing_translator}.
1053 @unnumberedsubsubsec Upbeats
1057 @cindex partial measure
1058 @cindex measure, partial
1059 @cindex pickup measure
1060 @cindex measure, change length
1062 @funindex measurePosition
1066 Partial or pick-up measures, such as an anacrusis or upbeat, are
1067 entered using the @code{\partial} command, with the syntax
1070 \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, this is translated into
1091 \set Timing.measurePosition = -@var{duration}
1094 The property @code{measurePosition} contains a rational number
1095 indicating how much of the measure has passed at this point. Note
1096 that this is set to a negative number by the @code{\partial}
1097 command: i.e., @code{\partial 4} is internally translated to
1098 @code{-4}, meaning @qq{there is a quarter note left in the measure.}
1112 @rinternals{Timing_translator}.
1117 The @code{\partial} command is intended to be used only at the
1118 beginning of a piece. If you use it after the beginning, some
1119 odd warnings may occur.
1121 @node Unmetered music
1122 @unnumberedsubsubsec Unmetered music
1124 @cindex bar lines, turning off
1125 @cindex bar numbering, turning off
1127 @cindex unmetered music
1129 @funindex \cadenzaOn
1131 @funindex \cadenzaOff
1132 @funindex cadenzaOff
1134 Bar lines and bar numbers are calculated automatically. For
1135 unmetered music (some cadenzas, for example), this is not desirable.
1136 To turn off automatic calculation of bar lines and bar numbers,
1137 use the command @code{\cadenzaOn}, and use @code{\cadenzaOff}
1138 to turn them on again.
1140 @lilypond[verbatim,relative=2,fragment]
1149 Bar numbering is resumed at the end of the cadenza as if the
1150 cadenza were not there:
1152 @lilypond[verbatim,relative=2,fragment]
1153 % Show all bar numbers
1154 \override Score.BarNumber #'break-visibility = #all-visible
1175 @ref{Visibility of objects}.
1181 @cindex cadenza line breaks
1182 @cindex cadenza page breaks
1183 @cindex unmetered music, line breaks
1184 @cindex unmetered music, page breaks
1185 @cindex breaks in unmetered music
1186 @cindex line breaks in cadenzas
1187 @cindex page breaks in cadenzas
1188 @cindex line breaks in unmetered music
1189 @cindex page breaks in unmetered music
1193 LilyPond will insert line breaks and page breaks only at a
1194 bar line. Unless the unmetered music ends before the end of the
1195 staff line, you will need to insert invisible bar lines with
1202 to indicate where breaks can occur.
1205 @node Polymetric notation
1206 @unnumberedsubsubsec Polymetric notation
1208 @c This section necessarily uses \set
1209 @c This is acceptable -td
1211 @cindex double time signatures
1212 @cindex signatures, polymetric
1213 @cindex time signatures, polymetric
1214 @cindex time signatures, double
1215 @cindex polymetric signatures
1216 @cindex meter, polymetric
1218 @funindex timeSignatureFraction
1219 @funindex \scaleDurations
1220 @funindex scaleDurations
1224 Polymetric notation is supported, either explicitly or by modifying
1225 the visible time signature symbol and scaling the note durations.
1227 @strong{@i{Staves with different time signatures, equal measure lengths}}
1229 This notation can be created by setting a common time signature
1230 for each staff but replacing the symbol manually by setting
1231 @code{timeSignatureFraction} to the desired fraction and scaling
1232 the printed durations in each staff to the common time
1233 signature; see @ref{Time signature}. The scaling is done with
1234 @code{\scaleDurations}, which is used in a similar way to
1235 @code{\times}, but does not create a tuplet bracket; see
1236 @ref{Scaling durations}.
1238 @cindex beaming in polymetric music
1239 @cindex beaming in polymetric meter
1241 In this example, music with the time signatures of 3/4, 9/8, and
1242 10/8 are used in parallel. In the second staff, shown durations
1243 are multiplied by 2/3, as 2/3 * 9/8 = 3/4, and in the third
1244 staff, shown durations are multiplied by 3/5, as 3/5 * 10/8 = 3/4.
1245 It will often be necessary to insert beams manually, as the
1246 duration scaling affects the autobeaming rules.
1248 @lilypond[quote,verbatim,fragment]
1257 \set Staff.timeSignatureFraction = #'(9 . 8)
1258 \scaleDurations #'(2 . 3)
1259 \repeat unfold 6 { c8[ c c] }
1263 \set Staff.timeSignatureFraction = #'(10 . 8)
1264 \scaleDurations #'(3 . 5) {
1265 \repeat unfold 2 { c8[ c c] }
1266 \repeat unfold 2 { c8[ c] } |
1267 c4. c4. \times 2/3 { c8[ c c] } c4
1273 @strong{@i{Staves with different time signatures, unequal bar lengths}}
1275 Each staff can be given its own independent time signature by
1276 moving the @code{Timing_translator} and the
1277 @code{Default_bar_line_engraver} to the @code{Staff} context.
1279 @lilypond[quote,verbatim]
1283 \remove "Timing_translator"
1284 \remove "Default_bar_line_engraver"
1288 \consists "Timing_translator"
1289 \consists "Default_bar_line_engraver"
1293 % Now each staff has its own time signature.
1319 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1320 {compound-time-signatures.ly}
1326 @rglos{polymetric time signature},
1330 @ref{Time signature},
1331 @ref{Scaling durations}.
1336 Internals Reference:
1337 @rinternals{TimeSignature},
1338 @rinternals{Timing_translator},
1339 @rinternals{Default_bar_line_engraver},
1345 When using different time signatures in parallel, notes
1346 at the same moment will be be placed at the same horizontal
1347 location. However, the bar lines in the different staves
1348 will cause the note spacing to be less regular in each of the
1349 individual staves than would be normal without the different
1352 @node Automatic note splitting
1353 @unnumberedsubsubsec Automatic note splitting
1355 @cindex notes, splitting
1356 @cindex splitting notes
1358 @funindex Note_heads_engraver
1359 @funindex Completion_heads_engraver
1361 Long notes which overrun bar lines can be converted automatically
1362 to tied notes. This is done by replacing the
1363 @code{Note_heads_engraver} with the
1364 @code{Completion_heads_engraver}. In the following
1365 example, notes crossing the bar lines are split and tied.
1367 @lilypond[quote,verbatim,relative=1]
1369 \remove "Note_heads_engraver"
1370 \consists "Completion_heads_engraver"
1373 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 }
1376 This engraver splits all running notes at the bar line, and
1377 inserts ties. One of its uses is to debug complex scores: if the
1378 measures are not entirely filled, then the ties show exactly how
1379 much each measure is off.
1383 Music Glossary: @rglos{tie}
1386 @rlearning{Engravers explained},
1387 @rlearning{Adding and removing engravers}.
1392 Internals Reference:
1393 @rinternals{Note_heads_engraver},
1394 @rinternals{Completion_heads_engraver},
1395 @rinternals{Forbid_line_break_engraver}.
1400 Not all durations (especially those containing tuplets) can be
1401 represented exactly with normal notes and dots, but the
1402 @code{Completion_heads_engraver} will not insert tuplets.
1404 The @code{Completion_heads_engraver} only affects notes; it does not
1408 @node Showing melody rhythms
1409 @unnumberedsubsubsec Showing melody rhythms
1411 @cindex melody rhythms, showing
1412 @cindex rhythms, showing melody
1414 Sometimes you might want to show only the rhythm of a melody. This
1415 can be done with the rhythmic staff. All pitches of notes on such a
1416 staff are squashed, and the staff itself has a single line
1418 @lilypond[quote,relative=1,verbatim]
1420 \new RhythmicStaff {
1421 \new Voice = "myRhythm" {
1429 \lyricsto "myRhythm" {
1437 @cindex guitar chord charts
1438 @cindex strumming rhythms, showing
1439 @cindex guitar strumming rhythms, showing
1441 @funindex Pitch_squash_engraver
1442 @funindex \improvisationOn
1443 @funindex improvisationOn
1444 @funindex \improvisationOff
1445 @funindex improvisationOff
1447 Guitar chord charts often show the strumming rhythms. This can
1448 be done with the @code{Pitch_squash_engraver} and
1449 @code{\improvisationOn}.
1452 @lilypond[quote,verbatim]
1461 \consists Pitch_squash_engraver
1474 @code{\improvisationOn},
1475 @code{\improvisationOff}.
1481 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1482 {guitar-strum-rhythms.ly}
1489 Internals Reference:
1490 @rinternals{RhythmicStaff},
1491 @rinternals{Pitch_squash_engraver}.
1499 * Setting automatic beam behavior::
1504 @node Automatic beams
1505 @unnumberedsubsubsec Automatic beams
1507 By default, beams are inserted automatically:
1509 @cindex beams, manual
1510 @cindex manual beams
1511 @cindex beams, setting rules for
1512 @cindex beams, custom rules for
1514 @funindex \autoBeamOn
1515 @funindex autoBeamOn
1516 @funindex \autoBeamOff
1517 @funindex autoBeamOff
1519 @lilypond[quote,verbatim,relative=2]
1521 \time 6/8 c c c c8. c16 c8
1524 If these automatic decisions are not satisfactory, beaming can be
1525 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1526 entered manually if beams are to be extended over rests.
1528 If automatic beaming is not required, it may be turned off with
1529 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1531 @lilypond[quote,relative=1,verbatim]
1532 c4 c8 c8. c16 c8. c16 c8
1539 @cindex melismata, beams
1540 @cindex beams and melismata
1542 @warning{If beams are used to indicate melismata in songs, then
1543 automatic beaming should be switched off with @code{\autoBeamOff}
1544 and the beams indicated manually.}
1546 Beaming patterns that differ from the automatic defaults can be
1547 created; see @ref{Setting automatic beam behavior}.
1551 @code{\autoBeamOff},
1558 @cindex line breaks and beams
1559 @cindex beams and line breaks
1563 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1564 {beams-across-line-breaks.ly}
1566 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1567 {changing-beam-knee-gap.ly}
1573 @ref{Setting automatic beam behavior}.
1576 @file{scm/@/auto@/-beam@/.scm}.
1581 Internals Reference: @rinternals{Beam}.
1586 Beams can collide with note heads and accidentals in other voices
1589 @node Setting automatic beam behavior
1590 @unnumberedsubsubsec Setting automatic beam behavior
1593 @cindex automatic beams, tuning
1594 @cindex tuning automatic beaming
1595 @cindex automatic beam generation
1597 @cindex lyrics and beaming
1599 @funindex autoBeaming
1600 @funindex beamSettings
1601 @funindex measureLength
1602 @funindex beatLength
1608 The placement of automatic beams is determined by the time signature.
1609 Three types of rules are used for determining the end of automatic
1610 beams: @emph{default} rules
1611 for the time signature, @emph{explicit} rules for the beam in the time
1612 signature, and the @emph{beatLength} for the time signature.
1614 The following rules, in order of priority, apply when determining
1615 the appearance of beams:
1619 @item If a manual beam is specified with @code{[..]} set the beam
1620 as specified, otherwise
1622 @item if @code{\autoBeamOff} is in force do not beam, otherwise
1624 @item if an explicit beam-ending rule is defined for the beam type
1625 in the time signature, use it to determine the valid
1626 places where beams may end, otherwise
1628 @item if a default beam-ending rule is defined in the time signature,
1629 use it to group notes with beams, otherwise
1631 @item use the value of @code{beatLength} to group notes with beams
1635 @i{@strong{Modifying the grouping of beats}}
1637 By default @code{beatLength} is
1638 derived from the time signature set by the @code{\time} command.
1639 The @code{beatLength} is set to be one over the denominator
1640 of the time signature.
1642 @code{beatLength} is a @i{moment},
1643 a unit of musical duration. A quantity of type @i{moment} is
1644 created by the scheme function @code{ly:make-moment}. For more
1645 information about this function, see @ref{Time administration}.
1647 Autobeam and beam subdivide settings are stored in the
1648 @code{beamSettings} property. Default values of @code{beamSettings}
1649 are determined in @file{scm/beam-settings.scm}. Entries in
1650 @code{beamSettings} are indexed by time signature and
1653 Time signature should be a scheme pair , e.g. @code{#'(4 . 4)}.
1655 Rule type should be @code{#'end} for beam ending and @code{#'subdivide} for
1658 The ending and subdivision rules consist of a scheme alist
1659 (or list of pairs) that
1660 indicates the beam type and the grouping to be applied to that
1664 #'((beam-type1 . grouping-1)
1665 (beam-type2 . grouping-2)
1666 (beam-type3 . grouping-3))
1669 Beam type is either a scheme pair indicating the duration
1670 of the beam, e.g. @code{(1 . 16)}, or @code{*} to indicate a
1671 default rule, which applies to all beams if no explicit rule is
1674 Grouping is a scheme list indicating the grouping to be applied to
1675 the beam. For default rules (where beam type is
1676 @code{*}, the grouping is in units of @code{beatLength}.
1677 For explicit rules, the grouping is in units of the beam type.
1679 Beam settings are changed with
1680 @code{\overrideBeamSettings} and @code{\revertBeamSettings}.
1682 @lilypond[quote,relative=2,verbatim]
1685 \overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (2 3)))
1687 \overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (3 2)))
1691 Beam setting changes can be limited to specific contexts. If no
1692 setting is included in a lower-level context, the setting of the
1693 enclosing context will apply.
1695 @lilypond[quote, verbatim,relative=1]
1700 \overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (2 3 2)))
1707 \overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (1 3 3)))
1714 When multiple voices are used the @code{Staff} context must be
1715 specified if the beaming is to be applied to all voices in the
1718 @lilypond[quote,verbatim,relative=2]
1721 % Context Voice specified -- does not work correctly
1722 % Because of autogenerated voices, all beating will
1723 % be at beatLength (1 . 8)
1724 \overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (3 1 1 2)))
1725 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
1727 % Works correctly with context Staff specified
1728 \overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (3 1 1 2)))
1729 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
1732 @funindex revertBeamSettings
1734 Beam settings can be reverted to get back to default behavior. This
1735 is accomplished by using @code{\revertBeamSettings}. The arguments
1736 are the same as for @code{\overrideBeamSettings}, except no value
1737 for @var{grouping} is given:
1740 \revertBeamSettings context time-signature rule-type
1744 @lilypond[quote,verbatim,relative=2]
1746 \repeat unfold 16 {a16}
1747 % set default rule for (1 1 1 1) grouping
1748 \overrideBeamSettings #'Score #'(4 . 4) #'end #'((* . (1 1 1 1)))
1749 \repeat unfold 16 {a16}
1750 % revert the new rule
1751 \revertBeamSettings #'Score #'(4 . 4) #'end
1752 \repeat unfold 16 {a16}
1757 @cindex beams, subdividing
1759 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1760 {sub-dividing-beams.ly}
1762 @cindex measure groupings
1763 @cindex beats, grouping
1764 @cindex grouping beats
1765 @cindex measure sub-grouping
1767 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1768 {conducting-signs,-measure-grouping-signs.ly}
1770 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1771 {beam-endings-in-score-context.ly}
1773 @cindex beam, last in score
1774 @cindex beam, last in polyphonic voice
1778 If a score ends while an automatic beam has not been ended and is
1779 still accepting notes, this last beam will not be typeset at all.
1780 The same holds for polyphonic voices, entered with @code{<<
1781 @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
1782 automatic beam is still accepting notes, it is not typeset.
1791 @unnumberedsubsubsec Manual beams
1793 @cindex beams, manual
1794 @cindex manual beams
1799 In some cases it may be necessary to override the automatic
1800 beaming algorithm. For example, the autobeamer will not put beams
1801 over rests or bar lines, and in choral scores the beaming is
1802 often set to follow the meter of the lyrics rather than the
1803 notes. Such beams can be specified manually by
1804 marking the begin and end point with @code{[} and @code{]}
1806 @lilypond[quote,relative=1,verbatim]
1808 r4 r8[ g' a r8] r8 g[ | a] r8
1816 Individual notes may be marked with @code{\noBeam} to prevent them
1819 @lilypond[quote,verbatim,relative=2]
1820 \time 2/4 c8 c\noBeam c c
1823 @funindex stemLeftBeamCount
1824 @funindex stemRightBeamCount
1826 Even more strict manual control with the beams can be achieved by
1827 setting the properties @code{stemLeftBeamCount} and
1828 @code{stemRightBeamCount}. They specify the number of beams to
1829 draw on the left and right side, respectively, of the next note.
1830 If either property is set, its value will be used only once, and
1831 then it is erased. In this example, the last @code{f} is printed
1832 with only one beam on the left side, i.e., the eighth-note beam of
1833 the group as a whole.
1835 @lilypond[quote,relative=2,verbatim]
1838 \set stemLeftBeamCount = #2
1839 \set stemRightBeamCount = #1
1841 \set stemLeftBeamCount = #1
1848 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1849 {flat-flags-and-beam-nibs.ly}
1851 @node Feathered beams
1852 @unnumberedsubsubsec Feathered beams
1854 @cindex beams, feathered
1855 @cindex feathered beams
1857 @funindex \featherDurations
1858 @funindex featherDurations
1859 @funindex grow-direction
1861 Feathered beams are used to indicate that a small group of notes
1862 should be played at an increasing (or decreasing) tempo, without
1863 changing the overall tempo of the piece. The extent of the
1864 feathered beam must be indicated manually using @code{[} and
1865 @code{]}, and the beam feathering is turned on by specifying a
1866 direction to the @code{Beam} property @code{grow-direction}.
1868 If the placement of the notes and the sound in the MIDI output is to
1869 reflect the ritardando or accelerando indicated by the feathered beam
1870 the notes must be grouped as a music expression delimited by braces
1871 and preceded by a @code{featherDurations} command which specifies
1872 the ratio between the durations of the first and last notes in the
1875 The square brackets show the extent of the beam and the braces show
1876 which notes are to have their durations modified. Normally these
1877 would delimit the same group of notes, but this is not required: the
1878 two commands are independent.
1880 In the following example the eight 16th notes occupy exactly the
1881 same time as a half note, but the first note is one half as long
1882 as the last one, with the intermediate notes gradually
1883 lengthening. The first four 32nd notes gradually speed up, while
1884 the last four 32nd notes are at a constant tempo.
1886 @lilypond[relative=1,verbatim,quote]
1887 \override Beam #'grow-direction = #LEFT
1888 \featherDurations #(ly:make-moment 2 1)
1889 { c16[ c c c c c c c] }
1890 \override Beam #'grow-direction = #RIGHT
1891 \featherDurations #(ly:make-moment 2 3)
1893 % revert to non-feathered beams
1894 \override Beam #'grow-direction = #'()
1899 The spacing in the printed output represents the
1900 note durations only approximately, but the MIDI output is exact.
1904 The @code{\featherDurations} command only works with very short
1905 music snippets, and when numbers in the fraction are small.
1920 * Bar and bar number checks::
1925 @unnumberedsubsubsec Bar lines
1928 @cindex measure lines
1929 @cindex closing bar lines
1930 @cindex bar lines, closing
1931 @cindex double bar lines
1932 @cindex bar lines, double
1938 Bar lines delimit measures, and are also used to indicate
1939 repeats. Normally, simple bar lines are automatically inserted
1940 into the printed output at places based on the current time
1943 The simple bar lines inserted automatically can be changed to
1944 other types with the @code{\bar} command. For example, a closing
1945 double bar line is usually placed at the end of a piece:
1947 @lilypond[quote,relative=1,verbatim]
1951 It is not invalid if the final note in a measure does not
1952 end on the automatically entered bar line: the note is assumed
1953 to carry over into the next measure. But if a long sequence
1954 of such carry-over measures appears the music can appear compressed
1955 or even flowing off the page. This is because automatic line
1956 breaks happen only at the end of complete measures, i.e., where
1957 all notes end before the end of a measure.
1959 @warning{An incorrect duration can cause line breaks to be
1960 inhibited, leading to a line of highly compressed music or
1961 music which flows off the page.}
1964 @cindex bar lines, invisible
1965 @cindex measure lines, invisible
1967 Line breaks are also permitted at manually inserted bar lines
1968 even within incomplete measures. To allow a line break without
1969 printing a bar line, use
1976 This will insert an invisible bar line and allow (but not
1977 force) a line break to occur at this point. The bar number
1978 counter is not increased. To force a line break see
1979 @ref{Line breaking}.
1981 @cindex manual bar lines
1982 @cindex manual measure lines
1983 @cindex bar lines, manual
1984 @cindex measure lines, manual
1986 This and other special bar lines may be inserted manually at any
1987 point. When they coincide with the end of a measure they replace the
1988 simple bar line which would have been inserted there automatically.
1989 When they do not coincide with the end of a measure the specified bar
1990 line is inserted at that point in the printed output. Such insertions
1991 do not affect the calculation and placement of subsequent automatic
1994 Two types of simple bar lines and five types of double bar lines are available
1995 for manual insertion:
1997 @lilypond[quote,relative=1,verbatim]
1998 f1 \bar "|" f \bar "." g \bar "||" a \bar ".|" b \bar ".|." c \bar "|.|" d \bar "|." e
2002 together with dotted and dashed bar lines:
2004 @lilypond[quote,relative=1,verbatim]
2005 f1 \bar ":" g \bar "dashed" a
2009 and five types of repeat bar line:
2011 @lilypond[quote,relative=1,verbatim]
2012 f1 \bar "|:" g \bar ":|:" a \bar ":|.|:" b \bar ":|.:" c \bar ":|" d
2015 Additionally, a bar line can be printed as a simple tick:
2016 @lilypond[quote,relative=1,verbatim]
2019 However, as such ticks are typically used in Gregorian chant, it is preferable
2020 to use @code{\divisioMinima} there instead, described in the section
2021 @ref{Divisiones} in Gregorian chant.
2026 Although the bar line types signifying repeats may be inserted
2027 manually they do not in themselves cause LilyPond to recognize
2028 a repeated section. Such repeated sections are better entered
2029 using the various repeat commands (see @ref{Repeats}), which
2030 automatically print the appropriate bar lines.
2032 In addition, you can specify @code{"||:"}, which is equivalent to
2033 @code{"|:"} except at line breaks, where it gives a double bar
2034 line at the end of the line and a start repeat at the beginning of
2037 @lilypond[quote,relative=2,verbatim]
2038 \override Score.RehearsalMark #'padding = #3
2046 In scores with many staves, a @code{\bar} command in one staff is
2047 automatically applied to all staves. The resulting bar lines are
2048 connected between different staves of a @code{StaffGroup},
2049 @code{PianoStaff}, or @code{GrandStaff}.
2051 @lilypond[quote,fragment,verbatim]
2059 \new Staff { \clef bass c4 g e g }
2061 \new Staff { \clef bass c2 c2 }
2066 @cindex default bar lines, changing
2067 @cindex bar lines, default, changing
2072 @funindex defaultBarType
2077 The command @code{\bar }@var{bartype} is a shortcut for
2078 @code{\set Timing.whichBar = }@var{bartype}. A bar line is
2079 created whenever the @code{whichBar} property is
2082 The default bar type used for automatically inserted bar lines is
2083 @code{"|"}. This may be changed at any time
2084 with @code{\set Timing.defaultBarType = }@var{bartype}.
2089 @ref{Line breaking},
2091 @ref{Grouping staves}.
2096 Internals Reference: @rinternals{BarLine} (created at
2097 @rinternals{Staff} level), @rinternals{SpanBar} (across
2098 staves), @rinternals{Timing_translator} (for Timing
2103 @unnumberedsubsubsec Bar numbers
2106 @cindex measure numbers
2107 @cindex numbers, bar
2108 @cindex numbers, measure
2110 @funindex currentBarNumber
2112 Bar numbers are typeset by default at the start of every line except
2113 the first line. The number itself is stored in the
2114 @code{currentBarNumber} property, which is normally updated
2115 automatically for every measure. It may also be set manually:
2117 @lilypond[verbatim,quote,fragment,relative=1]
2120 \set Score.currentBarNumber = #50
2124 @cindex bar numbers, regular spacing
2126 @funindex barNumberVisibility
2129 Bar numbers can be typeset at regular intervals instead of just at
2130 the beginning of every line. To do this the default behavior
2131 must be overridden to permit bar numbers to be printed at places
2132 other than the start of a line. This is controlled by the
2133 @code{break-visibility} property of @code{BarNumber}. This takes
2134 three values which may be set to @code{#t} or @code{#f} to specify
2135 whether the corresponding bar number is visible or not. The order
2136 of the three values is @code{end of line visible}, @code{middle of
2137 line visible}, @code{beginning of line visible}. In the following
2138 example bar numbers are printed at all possible places:
2140 @lilypond[verbatim,quote,relative=1]
2141 \override Score.BarNumber #'break-visibility = #'#(#t #t #t)
2142 \set Score.currentBarNumber = #11
2143 % Permit first bar number to be printed
2153 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2154 {printing-the-bar-number-for-the-first-measure.ly}
2156 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2157 {printing-bar-numbers-at-regular-intervals.ly}
2159 @cindex measure number, format
2160 @cindex bar number, format
2162 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2163 {printing-bar-numbers-inside-boxes-or-circles.ly}
2165 @cindex bar number alignment
2167 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2168 {aligning-bar-numbers.ly}
2170 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2171 {removing-bar-numbers-from-a-score.ly}
2178 Internals Reference: @rinternals{BarNumber}.
2181 @cindex bar number collision
2182 @cindex collision, bar number
2186 Bar numbers may collide with the top of the
2187 @rinternals{StaffGroup} bracket, if there is one. To solve
2188 this, the @code{padding} property of @rinternals{BarNumber} can
2189 be used to position the number correctly.
2193 @node Bar and bar number checks
2194 @unnumberedsubsubsec Bar and bar number checks
2197 @cindex bar number check
2198 @cindex measure check
2199 @cindex measure number check
2201 @funindex barCheckSynchronize
2204 Bar checks help detect errors in the entered durations. A bar check
2205 may be entered using the bar symbol, @code{|}, at any place where a
2206 bar line is expected to fall. If bar check lines are encountered at
2207 other places, a list of warnings is printed in the log file, showing
2208 the line numbers and lines in which the bar checks failed. In the
2209 next example, the second bar check will signal an error.
2212 \time 3/4 c2 e4 | g2 |
2215 Bar checks can also be used in lyrics, for example
2220 Twin -- kle | Twin -- kle |
2224 An incorrect duration can result in a completely garbled score,
2225 especially if the score is polyphonic, so a good place to start
2226 correcting input is by scanning for failed bar checks and
2227 incorrect durations.
2229 If successive bar checks are off by the same musical interval,
2230 only the first warning message is displayed. This allows the
2231 warning to focus on the source of the timing error.
2235 @funindex pipeSymbol
2237 It is also possible to redefine the action taken when a bar check
2238 or pipe symbol, @code{|}, is encountered in the input, so that
2239 it does something other than a bar check. This is done by
2240 assigning a music expression to @code{pipeSymbol}.
2241 In the following example @code{|} is set to insert a double bar
2242 line wherever it appears in the input, rather than checking
2245 @lilypond[quote,verbatim]
2246 pipeSymbol = \bar "||"
2255 @funindex \barNumberCheck
2256 @funindex barNumberCheck
2258 When copying large pieces of music, it can be helpful to check that
2259 the LilyPond bar number corresponds to the original that you are
2260 entering from. This can be checked with @code{\barNumberCheck}, for
2264 \barNumberCheck #123
2268 will print a warning if the @code{currentBarNumber} is not 123
2269 when it is processed.
2277 @node Rehearsal marks
2278 @unnumberedsubsubsec Rehearsal marks
2280 @cindex rehearsal marks
2281 @cindex mark, rehearsal
2286 To print a rehearsal mark, use the @code{\mark} command
2288 @lilypond[quote,verbatim,relative=2]
2297 The letter@tie{}@q{I} is skipped in accordance with engraving
2298 traditions. If you wish to include the letter @q{I}, then use
2301 \set Score.markFormatter = #format-mark-alphabet
2304 The mark is incremented automatically if you use @code{\mark
2305 \default}, but you can also use an integer argument to set the
2306 mark manually. The value to use is stored in the property
2307 @code{rehearsalMark}.
2309 @cindex rehearsal mark format
2310 @cindex rehearsal mark style
2311 @cindex style, rehearsal mark
2312 @cindex format, rehearsal mark
2313 @cindex mark, rehearsal, style
2314 @cindex mark, rehearsal, format
2315 @cindex rehearsal mark, manual
2316 @cindex mark, rehearsal, manual
2317 @cindex custom rehearsal mark
2318 @cindex manual rehearsal mark
2320 The style is defined by the property @code{markFormatter}. It is
2321 a function taking the current mark (an integer) and the current
2322 context as argument. It should return a markup object. In the
2323 following example, @code{markFormatter} is set to a pre-defined
2324 procedure. After a few measures, it is set to a procedure that
2325 produces a boxed number.
2327 @lilypond[quote,verbatim,relative=2]
2328 \set Score.markFormatter = #format-mark-numbers
2331 \set Score.markFormatter = #format-mark-box-numbers
2333 \set Score.markFormatter = #format-mark-circle-numbers
2335 \set Score.markFormatter = #format-mark-circle-letters
2339 The file @file{scm/@/translation@/-functions@/.scm} contains the
2340 definitions of @code{format-mark-numbers} (the default format),
2341 @code{format-mark-box-numbers}, @code{format-mark-letters} and
2342 @code{format-mark-box-letters}. These can be used as inspiration
2343 for other formatting functions.
2345 You may use @code{format-mark-barnumbers},
2346 @code{format-mark-box-barnumbers}, and
2347 @code{format-mark-circle-barnumbers} to get bar numbers instead of
2348 incremented numbers or letters.
2350 Other styles of rehearsal mark can be specified manually
2357 @code{Score.markFormatter} does not affect marks specified in this
2358 manner. However, it is possible to apply a @code{\markup} to the
2362 \mark \markup@{ \box A1 @}
2367 @cindex D.S. al Fine
2369 @cindex music glyphs
2370 @cindex glyphs, music
2372 @funindex \musicglyph
2373 @funindex musicglyph
2375 Music glyphs (such as the segno sign) may be printed inside a
2378 @lilypond[quote,verbatim,relative=1]
2379 c1 \mark \markup { \musicglyph #"scripts.segno" }
2380 c1 \mark \markup { \musicglyph #"scripts.coda" }
2381 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
2386 See @ref{The Feta font}, for a list of symbols which may be
2387 printed with @code{\musicglyph}.
2389 For common tweaks to the positioning of rehearsal marks, see
2390 @ref{Formatting text}.
2395 @ref{The Feta font},
2396 @ref{Formatting text}.
2399 @file{scm/@/translation@/-functions@/.scm} contains
2400 the definition of @code{format-mark-numbers} and
2401 @code{format-mark-letters}. They can be used as inspiration for
2402 other formatting functions.
2407 Internals Reference: @rinternals{RehearsalMark}.
2410 @node Special rhythmic concerns
2411 @subsection Special rhythmic concerns
2416 * Aligning to cadenzas::
2417 * Time administration::
2421 @unnumberedsubsubsec Grace notes
2425 @cindex appoggiatura
2426 @cindex acciaccatura
2431 Grace notes are ornaments that are written out. Grace notes
2432 are printed in a smaller font and take up no logical time
2435 @lilypond[quote,relative=2,verbatim]
2437 \grace { c16[ d16] } c2
2440 LilyPond also supports two special types of grace notes, the
2441 @emph{acciaccatura}--an unmeasured grace note indicated by a slurred
2442 small note with a slashed stem--and the @emph{appoggiatura}, which
2443 takes a fixed fraction of the main note and appears in small print
2446 @lilypond[quote,relative=2,verbatim]
2450 \acciaccatura { g16[ f] } e4
2453 The placement of grace notes is synchronized between different
2454 staves. In the following example, there are two sixteenth grace
2455 notes for every eighth grace note
2457 @lilypond[quote,relative=2,verbatim]
2458 << \new Staff { e2 \grace { c16[ d e f] } e2 }
2459 \new Staff { c2 \grace { g8[ b] } c2 } >>
2462 @cindex grace notes, following
2464 @funindex \afterGrace
2465 @funindex afterGrace
2467 If you want to end a note with a grace, use the @code{\afterGrace}
2468 command. It takes two arguments: the main note, and the grace
2469 notes following the main note.
2471 @lilypond[quote,verbatim,relative=2]
2472 c1 \afterGrace d1 { c16[ d] } c1
2475 This will put the grace notes after a space lasting 3/4 of the
2476 length of the main note. The default fraction 3/4 can be changed by
2477 setting @code{afterGraceFraction}. The following example shows
2478 the results from setting the space at the default, at 15/16, and
2479 finally at 1/2 of the main note.
2481 @lilypond[quote,verbatim,relative=2]
2484 c1 \afterGrace d1 { c16[ d] } c1
2487 #(define afterGraceFraction (cons 15 16))
2488 c1 \afterGrace d1 { c16[ d] } c1
2491 #(define afterGraceFraction (cons 1 2))
2492 c1 \afterGrace d1 { c16[ d] } c1
2497 The space between the main note and the grace note may also be
2498 specified using spacers. The following example places the grace
2499 note after a space lasting 7/8 of the main note.
2501 @lilypond[quote,verbatim,relative=2]
2504 { s2 s4. \grace { c16[ d] } } >>
2509 @cindex tweaking grace notes
2510 @cindex grace notes, tweaking
2511 @cindex grace notes, changing layout settings
2513 A @code{\grace} music expression will introduce special
2514 typesetting settings, for example, to produce smaller type, and
2515 set directions. Hence, when introducing layout tweaks to
2516 override the special settings, they should be placed inside
2517 the grace expression. The overrides should also be reverted
2518 inside the grace expression. Here, the grace note's default stem
2519 direction is overridden and then reverted.
2521 @lilypond[quote,verbatim,relative=2]
2533 @cindex stem, with slash
2538 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2539 {using-grace-note-slashes-with-normal-heads.ly}
2541 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2542 {tweaking-grace-layout-within-music.ly}
2544 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2545 {redefining-grace-note-global-defaults.ly}
2547 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2548 {positioning-grace-notes-with-floating-space.ly}
2553 @rglos{grace notes},
2554 @rglos{acciaccatura},
2555 @rglos{appoggiatura}.
2557 Installed Files: @file{ly/@/grace@/-init@/.ly}.
2559 Snippets: @rlsr{Rhythms}.
2561 Internals Reference: @rinternals{GraceMusic}.
2566 @cindex acciaccatura, multi-note
2567 @cindex multi-note acciaccatura
2568 @cindex grace-note synchronization
2570 A multi-note beamed @i{acciaccatura} is printed without a slash,
2571 and looks exactly the same as a multi-note beamed
2574 @c TODO Add link to LSR snippet to add slash when available
2576 Grace note synchronization can also lead to surprises. Staff
2577 notation, such as key signatures, bar lines, etc., are also
2578 synchronized. Take care when you mix staves with grace notes and
2579 staves without, for example,
2581 @lilypond[quote,relative=2,verbatim]
2583 \new Staff { e4 \bar "|:" \grace c16 d2. }
2584 \new Staff { c4 \bar "|:" d2. }
2589 This can be remedied by inserting grace skips of the corresponding
2590 durations in the other staves. For the above example
2592 @lilypond[quote,relative=2,verbatim]
2594 \new Staff { e4 \bar "|:" \grace c16 d2. }
2595 \new Staff { c4 \bar "|:" \grace s16 d2. }
2599 Grace sections should only be used within sequential music
2600 expressions. Nesting or juxtaposing grace sections is not
2601 supported, and might produce crashes or other errors.
2603 @node Aligning to cadenzas
2604 @unnumberedsubsubsec Aligning to cadenzas
2607 @cindex cadenza, aligning to
2608 @cindex aligning to cadenza
2610 In an orchestral context, cadenzas present a special problem: when
2611 constructing a score that includes a measured cadenza or other solo
2612 passage, all other instruments should skip just as many notes as the
2613 length of the cadenza, otherwise they will start too soon or too late.
2615 One solution to this problem is to use the functions
2616 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
2617 functions take a defined piece of music as an argument and generate a
2618 multi-measure rest or @code{\skip} exactly as long as the piece.
2620 @lilypond[verbatim,quote]
2621 MyCadenza = \relative c' {
2632 #(ly:export (mmrest-of-length MyCadenza))
2634 #(ly:export (skip-of-length MyCadenza))
2649 @node Time administration
2650 @unnumberedsubsubsec Time administration
2652 @cindex time administration
2653 @cindex timing (within the score)
2654 @cindex music, unmetered
2655 @cindex unmetered music
2657 @funindex currentBarNumber
2658 @funindex measurePosition
2659 @funindex measureLength
2661 Time is administered by the @code{Timing_translator}, which by
2662 default is to be found in the @code{Score} context. An alias,
2663 @code{Timing}, is added to the context in which the
2664 @code{Timing_translator} is placed.
2666 The following properties of @code{Timing} are used
2667 to keep track of timing within the score.
2670 @cindex measure number
2673 @item currentBarNumber
2674 The current measure number. For an example showing the
2675 use of this property see @ref{Bar numbers}.
2678 The length of the measures in the current time signature. For a
2679 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
2680 determines when bar lines are inserted and how automatic beams
2681 should be generated.
2683 @item measurePosition
2684 The point within the measure where we currently are. This
2685 quantity is reset by subtracting @code{measureLength} whenever
2686 @code{measureLength} is reached or exceeded. When that happens,
2687 @code{currentBarNumber} is incremented.
2690 If set to true, the above variables are updated for every time
2691 step. When set to false, the engraver stays in the current
2692 measure indefinitely.
2696 Timing can be changed by setting any of these variables
2697 explicitly. In the next example, the default 4/4 time
2698 signature is printed, but @code{measureLength} is set to 5/4.
2699 At 4/8 through the third measure, the @code{measurePosition} is
2700 advanced by 1/8 to 5/8, shortening that bar by 1/8.
2701 The next bar line then falls at 9/8 rather than 5/4.
2703 @lilypond[quote,verbatim,relative=1]
2704 \set Score.measureLength = #(ly:make-moment 5 4)
2708 \set Score.measurePosition = #(ly:make-moment 5 8)
2714 As the example illustrates, @code{ly:make-moment n m} constructs a
2715 duration of n/m of a whole note. For example,
2716 @code{ly:make-moment 1 8} is an eighth note duration and
2717 @code{ly:make-moment 7 16} is the duration of seven sixteenths
2722 This manual: @ref{Bar numbers}, @ref{Unmetered music}
2727 Internals Reference: @rinternals{Timing_translator},