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,ragged-right,texidoc,doctitle]
1029 {compound-time-signatures.ly}
1034 @rglos{time signature}
1037 @ref{Mensural time signatures},
1038 @ref{Time administration}.
1043 Internals Reference:
1044 @rinternals{TimeSignature},
1045 @rinternals{Timing_translator}.
1049 @unnumberedsubsubsec Upbeats
1053 @cindex partial measure
1054 @cindex measure, partial
1055 @cindex pickup measure
1056 @cindex measure, change length
1058 @funindex measurePosition
1062 Partial or pick-up measures, such as an anacrusis or upbeat, are
1063 entered using the @code{\partial} command, with the syntax
1066 \partial @var{duration}
1070 where @code{duration} is the rhythmic length of the interval
1071 before the start of the first complete measure:
1073 @lilypond[quote,verbatim,relative=2]
1078 The partial measure can be any duration less than a full measure:
1080 @lilypond[quote,verbatim,relative=2]
1081 \partial 8*3 c8 d e |
1085 Internally, @code{\partial} is translated into
1088 \set Timing.measurePosition = -@var{duration}
1092 The property @code{measurePosition} contains a rational number
1093 indicating how much of the measure has passed at this point. Note
1094 that this is set to a negative number by the @code{\partial}
1095 command: i.e., @code{\partial 4} is internally translated to
1096 @code{-4}, meaning @qq{there is a quarter note left in the measure.}
1110 @rinternals{Timing_translator}.
1115 The @code{\partial} command is intended to be used only at the
1116 beginning of a piece. If you use it after the beginning, some
1117 odd warnings may occur.
1119 @node Unmetered music
1120 @unnumberedsubsubsec Unmetered music
1122 @cindex bar lines, turning off
1123 @cindex bar numbering, turning off
1125 @cindex unmetered music
1127 @funindex \cadenzaOn
1129 @funindex \cadenzaOff
1130 @funindex cadenzaOff
1132 Bar lines and bar numbers are calculated automatically. For
1133 unmetered music (some cadenzas, for example), this is not desirable.
1134 To turn off automatic calculation of bar lines and bar numbers,
1135 use the command @code{\cadenzaOn}, and use @code{\cadenzaOff}
1136 to turn them on again.
1138 @lilypond[verbatim,relative=2,fragment]
1147 Bar numbering is resumed at the end of the cadenza as if the
1148 cadenza were not there:
1150 @lilypond[verbatim,relative=2,fragment]
1151 % Show all bar numbers
1152 \override Score.BarNumber #'break-visibility = #all-visible
1173 @ref{Visibility of objects}.
1179 @cindex cadenza line breaks
1180 @cindex cadenza page breaks
1181 @cindex unmetered music, line breaks
1182 @cindex unmetered music, page breaks
1183 @cindex breaks in unmetered music
1184 @cindex line breaks in cadenzas
1185 @cindex page breaks in cadenzas
1186 @cindex line breaks in unmetered music
1187 @cindex page breaks in unmetered music
1191 LilyPond will insert line breaks and page breaks only at a
1192 bar line. Unless the unmetered music ends before the end of the
1193 staff line, you will need to insert invisible bar lines with
1200 to indicate where breaks can occur.
1203 @node Polymetric notation
1204 @unnumberedsubsubsec Polymetric notation
1206 @c This section necessarily uses \set
1207 @c This is acceptable -td
1209 @cindex double time signatures
1210 @cindex signatures, polymetric
1211 @cindex time signatures, polymetric
1212 @cindex time signatures, double
1213 @cindex polymetric signatures
1214 @cindex meter, polymetric
1216 @funindex timeSignatureFraction
1217 @funindex \scaleDurations
1218 @funindex scaleDurations
1222 Polymetric notation is supported, either explicitly or by modifying
1223 the visible time signature symbol and scaling the note durations.
1225 @strong{@i{Staves with different time signatures, equal measure lengths}}
1227 This notation can be created by setting a common time signature
1228 for each staff but replacing the symbol manually by setting
1229 @code{timeSignatureFraction} to the desired fraction and scaling
1230 the printed durations in each staff to the common time
1231 signature; see @ref{Time signature}. The scaling is done with
1232 @code{\scaleDurations}, which is used in a similar way to
1233 @code{\times}, but does not create a tuplet bracket; see
1234 @ref{Scaling durations}.
1236 @cindex beaming in polymetric music
1237 @cindex beaming in polymetric meter
1239 In this example, music with the time signatures of 3/4, 9/8, and
1240 10/8 are used in parallel. In the second staff, shown durations
1241 are multiplied by 2/3, as 2/3 * 9/8 = 3/4, and in the third
1242 staff, shown durations are multiplied by 3/5, as 3/5 * 10/8 = 3/4.
1243 It will often be necessary to insert beams manually, as the
1244 duration scaling affects the autobeaming rules.
1246 @lilypond[quote,verbatim,fragment]
1255 \set Staff.timeSignatureFraction = #'(9 . 8)
1256 \scaleDurations #'(2 . 3)
1257 \repeat unfold 6 { c8[ c c] }
1261 \set Staff.timeSignatureFraction = #'(10 . 8)
1262 \scaleDurations #'(3 . 5) {
1263 \repeat unfold 2 { c8[ c c] }
1264 \repeat unfold 2 { c8[ c] } |
1265 c4. c4. \times 2/3 { c8[ c c] } c4
1271 @strong{@i{Staves with different time signatures, unequal bar lengths}}
1273 Each staff can be given its own independent time signature by
1274 moving the @code{Timing_translator} and the
1275 @code{Default_bar_line_engraver} to the @code{Staff} context.
1277 @lilypond[quote,verbatim]
1281 \remove "Timing_translator"
1282 \remove "Default_bar_line_engraver"
1286 \consists "Timing_translator"
1287 \consists "Default_bar_line_engraver"
1291 % Now each staff has its own time signature.
1317 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1318 {compound-time-signatures.ly}
1324 @rglos{polymetric time signature},
1328 @ref{Time signature},
1329 @ref{Scaling durations}.
1334 Internals Reference:
1335 @rinternals{TimeSignature},
1336 @rinternals{Timing_translator},
1337 @rinternals{Default_bar_line_engraver},
1343 When using different time signatures in parallel, notes
1344 at the same moment will be be placed at the same horizontal
1345 location. However, the bar lines in the different staves
1346 will cause the note spacing to be less regular in each of the
1347 individual staves than would be normal without the different
1350 @node Automatic note splitting
1351 @unnumberedsubsubsec Automatic note splitting
1353 @cindex notes, splitting
1354 @cindex splitting notes
1356 @funindex Note_heads_engraver
1357 @funindex Completion_heads_engraver
1359 Long notes which overrun bar lines can be converted automatically
1360 to tied notes. This is done by replacing the
1361 @code{Note_heads_engraver} with the
1362 @code{Completion_heads_engraver}. In the following
1363 example, notes crossing the bar lines are split and tied.
1365 @lilypond[quote,verbatim,relative=1]
1367 \remove "Note_heads_engraver"
1368 \consists "Completion_heads_engraver"
1371 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 }
1374 This engraver splits all running notes at the bar line, and
1375 inserts ties. One of its uses is to debug complex scores: if the
1376 measures are not entirely filled, then the ties show exactly how
1377 much each measure is off.
1381 Music Glossary: @rglos{tie}
1384 @rlearning{Engravers explained},
1385 @rlearning{Adding and removing engravers}.
1390 Internals Reference:
1391 @rinternals{Note_heads_engraver},
1392 @rinternals{Completion_heads_engraver},
1393 @rinternals{Forbid_line_break_engraver}.
1398 Not all durations (especially those containing tuplets) can be
1399 represented exactly with normal notes and dots, but the
1400 @code{Completion_heads_engraver} will not insert tuplets.
1402 The @code{Completion_heads_engraver} only affects notes; it does not
1406 @node Showing melody rhythms
1407 @unnumberedsubsubsec Showing melody rhythms
1409 @cindex melody rhythms, showing
1410 @cindex rhythms, showing melody
1412 Sometimes you might want to show only the rhythm of a melody. This
1413 can be done with the rhythmic staff. All pitches of notes on such a
1414 staff are squashed, and the staff itself has a single line
1416 @lilypond[quote,relative=1,verbatim]
1418 \new RhythmicStaff {
1419 \new Voice = "myRhythm" {
1427 \lyricsto "myRhythm" {
1435 @cindex guitar chord charts
1436 @cindex strumming rhythms, showing
1437 @cindex guitar strumming rhythms, showing
1439 @funindex Pitch_squash_engraver
1440 @funindex \improvisationOn
1441 @funindex improvisationOn
1442 @funindex \improvisationOff
1443 @funindex improvisationOff
1445 Guitar chord charts often show the strumming rhythms. This can
1446 be done with the @code{Pitch_squash_engraver} and
1447 @code{\improvisationOn}.
1450 @lilypond[quote,verbatim]
1459 \consists Pitch_squash_engraver
1472 @code{\improvisationOn},
1473 @code{\improvisationOff}.
1479 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1480 {guitar-strum-rhythms.ly}
1487 Internals Reference:
1488 @rinternals{RhythmicStaff},
1489 @rinternals{Pitch_squash_engraver}.
1497 * Setting automatic beam behavior::
1502 @node Automatic beams
1503 @unnumberedsubsubsec Automatic beams
1505 By default, beams are inserted automatically:
1507 @cindex beams, manual
1508 @cindex manual beams
1509 @cindex beams, setting rules for
1510 @cindex beams, custom rules for
1512 @funindex \autoBeamOn
1513 @funindex autoBeamOn
1514 @funindex \autoBeamOff
1515 @funindex autoBeamOff
1517 @lilypond[quote,verbatim,relative=2]
1519 \time 6/8 c c c c8. c16 c8
1522 If these automatic decisions are not satisfactory, beaming can be
1523 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1524 entered manually if beams are to be extended over rests.
1526 If automatic beaming is not required, it may be turned off with
1527 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1529 @lilypond[quote,relative=1,verbatim]
1530 c4 c8 c8. c16 c8. c16 c8
1537 @cindex melismata, beams
1538 @cindex beams and melismata
1540 @warning{If beams are used to indicate melismata in songs, then
1541 automatic beaming should be switched off with @code{\autoBeamOff}
1542 and the beams indicated manually.}
1544 Beaming patterns that differ from the automatic defaults can be
1545 created; see @ref{Setting automatic beam behavior}.
1549 @code{\autoBeamOff},
1556 @cindex line breaks and beams
1557 @cindex beams and line breaks
1561 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1562 {beams-across-line-breaks.ly}
1564 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1565 {changing-beam-knee-gap.ly}
1571 @ref{Setting automatic beam behavior}.
1574 @file{scm/@/auto@/-beam@/.scm}.
1579 Internals Reference: @rinternals{Beam}.
1584 Beams can collide with note heads and accidentals in other voices.
1587 @node Setting automatic beam behavior
1588 @unnumberedsubsubsec Setting automatic beam behavior
1591 @cindex automatic beams, tuning
1592 @cindex tuning automatic beaming
1593 @cindex automatic beam generation
1595 @cindex lyrics and beaming
1597 @funindex autoBeaming
1598 @funindex beamSettings
1599 @funindex measureLength
1600 @funindex beatLength
1606 The placement of automatic beams is determined by the time signature.
1607 Three types of rules are used for determining the end of automatic
1608 beams: @emph{default} rules
1609 for the time signature, @emph{explicit} rules for the beam in the time
1610 signature, and the @emph{beatLength} for the time signature.
1612 The following rules, in order of priority, apply when determining
1613 the appearance of beams:
1617 @item If a manual beam is specified with @code{[..]} set the beam
1618 as specified, otherwise
1620 @item if @code{\autoBeamOff} is in force do not beam, otherwise
1622 @item if an explicit beam-ending rule is defined for the beam type
1623 in the time signature, use it to determine the valid
1624 places where beams may end, otherwise
1626 @item if a default beam-ending rule is defined in the time signature,
1627 use it to group notes with beams, otherwise
1629 @item use the value of @code{beatLength} to group notes with beams
1633 @i{@strong{Modifying the grouping of beats}}
1635 By default @code{beatLength} is
1636 derived from the time signature set by the @code{\time} command.
1637 The @code{beatLength} is set to be one over the denominator
1638 of the time signature.
1640 @code{beatLength} is a @i{moment},
1641 a unit of musical duration. A quantity of type @i{moment} is
1642 created by the scheme function @code{ly:make-moment}. For more
1643 information about this function, see @ref{Time administration}.
1645 Autobeam and beam subdivide settings are stored in the
1646 @code{beamSettings} property. Default values of @code{beamSettings}
1647 are determined in @file{scm/beam-settings.scm}. Entries in
1648 @code{beamSettings} are indexed by time signature and
1651 Time signature should be a scheme pair , e.g. @code{#'(4 . 4)}.
1653 Rule type should be @code{#'end} for beam ending and @code{#'subdivide} for
1656 The ending and subdivision rules consist of a scheme alist
1657 (or list of pairs) that
1658 indicates the beam type and the grouping to be applied to that
1662 #'((beam-type1 . grouping-1)
1663 (beam-type2 . grouping-2)
1664 (beam-type3 . grouping-3))
1667 Beam type is either a scheme pair indicating the duration
1668 of the beam, e.g. @code{(1 . 16)}, or @code{*} to indicate a
1669 default rule, which applies to all beams if no explicit rule is
1672 Grouping is a scheme list indicating the grouping to be applied to
1673 the beam. For default rules (where beam type is
1674 @code{*}, the grouping is in units of @code{beatLength}.
1675 For explicit rules, the grouping is in units of the beam type.
1677 Beam settings are changed with
1678 @code{\overrideBeamSettings} and @code{\revertBeamSettings}.
1680 @lilypond[quote,relative=2,verbatim]
1683 \overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (2 3)))
1685 \overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (3 2)))
1689 Beam setting changes can be limited to specific contexts. If no
1690 setting is included in a lower-level context, the setting of the
1691 enclosing context will apply.
1693 @lilypond[quote, verbatim,relative=1]
1698 \overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (2 3 2)))
1705 \overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (1 3 3)))
1712 When multiple voices are used the @code{Staff} context must be
1713 specified if the beaming is to be applied to all voices in the
1716 @lilypond[quote,verbatim,relative=2]
1719 % Context Voice specified -- does not work correctly
1720 % Because of autogenerated voices, all beating will
1721 % be at beatLength (1 . 8)
1722 \overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (3 1 1 2)))
1723 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
1725 % Works correctly with context Staff specified
1726 \overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (3 1 1 2)))
1727 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
1730 @funindex revertBeamSettings
1732 Beam settings can be reverted to get back to default behavior. This
1733 is accomplished by using @code{\revertBeamSettings}. The arguments
1734 are the same as for @code{\overrideBeamSettings}, except no value
1735 for @var{grouping} is given:
1738 \revertBeamSettings context time-signature rule-type
1742 @lilypond[quote,verbatim,relative=2]
1744 \repeat unfold 16 {a16}
1745 % set default rule for (1 1 1 1) grouping
1746 \overrideBeamSettings #'Score #'(4 . 4) #'end #'((* . (1 1 1 1)))
1747 \repeat unfold 16 {a16}
1748 % revert the new rule
1749 \revertBeamSettings #'Score #'(4 . 4) #'end
1750 \repeat unfold 16 {a16}
1755 @cindex beams, subdividing
1757 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1758 {sub-dividing-beams.ly}
1760 @cindex measure groupings
1761 @cindex beats, grouping
1762 @cindex grouping beats
1763 @cindex measure sub-grouping
1765 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1766 {conducting-signs,-measure-grouping-signs.ly}
1768 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1769 {beam-endings-in-score-context.ly}
1771 @cindex beam, last in score
1772 @cindex beam, last in polyphonic voice
1776 If a score ends while an automatic beam has not been ended and is
1777 still accepting notes, this last beam will not be typeset at all.
1778 The same holds for polyphonic voices, entered with @code{<<
1779 @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
1780 automatic beam is still accepting notes, it is not typeset.
1789 @unnumberedsubsubsec Manual beams
1791 @cindex beams, manual
1792 @cindex manual beams
1797 In some cases it may be necessary to override the automatic
1798 beaming algorithm. For example, the autobeamer will not put beams
1799 over rests or bar lines, and in choral scores the beaming is
1800 often set to follow the meter of the lyrics rather than the
1801 notes. Such beams can be specified manually by
1802 marking the begin and end point with @code{[} and @code{]}
1804 @lilypond[quote,relative=1,verbatim]
1806 r4 r8[ g' a r8] r8 g[ | a] r8
1814 Individual notes may be marked with @code{\noBeam} to prevent them
1817 @lilypond[quote,verbatim,relative=2]
1818 \time 2/4 c8 c\noBeam c c
1821 @funindex stemLeftBeamCount
1822 @funindex stemRightBeamCount
1824 Even more strict manual control with the beams can be achieved by
1825 setting the properties @code{stemLeftBeamCount} and
1826 @code{stemRightBeamCount}. They specify the number of beams to
1827 draw on the left and right side, respectively, of the next note.
1828 If either property is set, its value will be used only once, and
1829 then it is erased. In this example, the last @code{f} is printed
1830 with only one beam on the left side, i.e., the eighth-note beam of
1831 the group as a whole.
1833 @lilypond[quote,relative=2,verbatim]
1836 \set stemLeftBeamCount = #2
1837 \set stemRightBeamCount = #1
1839 \set stemLeftBeamCount = #1
1846 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1847 {flat-flags-and-beam-nibs.ly}
1849 @node Feathered beams
1850 @unnumberedsubsubsec Feathered beams
1852 @cindex beams, feathered
1853 @cindex feathered beams
1855 @funindex \featherDurations
1856 @funindex featherDurations
1857 @funindex grow-direction
1859 Feathered beams are used to indicate that a small group of notes
1860 should be played at an increasing (or decreasing) tempo, without
1861 changing the overall tempo of the piece. The extent of the
1862 feathered beam must be indicated manually using @code{[} and
1863 @code{]}, and the beam feathering is turned on by specifying a
1864 direction to the @code{Beam} property @code{grow-direction}.
1866 If the placement of the notes and the sound in the MIDI output is to
1867 reflect the ritardando or accelerando indicated by the feathered beam
1868 the notes must be grouped as a music expression delimited by braces
1869 and preceded by a @code{featherDurations} command which specifies
1870 the ratio between the durations of the first and last notes in the
1873 The square brackets show the extent of the beam and the braces show
1874 which notes are to have their durations modified. Normally these
1875 would delimit the same group of notes, but this is not required: the
1876 two commands are independent.
1878 In the following example the eight 16th notes occupy exactly the
1879 same time as a half note, but the first note is one half as long
1880 as the last one, with the intermediate notes gradually
1881 lengthening. The first four 32nd notes gradually speed up, while
1882 the last four 32nd notes are at a constant tempo.
1884 @lilypond[relative=1,verbatim,quote]
1885 \override Beam #'grow-direction = #LEFT
1886 \featherDurations #(ly:make-moment 2 1)
1887 { c16[ c c c c c c c] }
1888 \override Beam #'grow-direction = #RIGHT
1889 \featherDurations #(ly:make-moment 2 3)
1891 % revert to non-feathered beams
1892 \override Beam #'grow-direction = #'()
1897 The spacing in the printed output represents the
1898 note durations only approximately, but the MIDI output is exact.
1902 The @code{\featherDurations} command only works with very short
1903 music snippets, and when numbers in the fraction are small.
1918 * Bar and bar number checks::
1923 @unnumberedsubsubsec Bar lines
1926 @cindex measure lines
1927 @cindex closing bar lines
1928 @cindex bar lines, closing
1929 @cindex double bar lines
1930 @cindex bar lines, double
1936 Bar lines delimit measures, and are also used to indicate
1937 repeats. Normally, simple bar lines are automatically inserted
1938 into the printed output at places based on the current time
1941 The simple bar lines inserted automatically can be changed to
1942 other types with the @code{\bar} command. For example, a closing
1943 double bar line is usually placed at the end of a piece:
1945 @lilypond[quote,relative=1,verbatim]
1949 It is not invalid if the final note in a measure does not
1950 end on the automatically entered bar line: the note is assumed
1951 to carry over into the next measure. But if a long sequence
1952 of such carry-over measures appears the music can appear compressed
1953 or even flowing off the page. This is because automatic line
1954 breaks happen only at the end of complete measures, i.e., where
1955 all notes end before the end of a measure.
1957 @warning{An incorrect duration can cause line breaks to be
1958 inhibited, leading to a line of highly compressed music or
1959 music which flows off the page.}
1962 @cindex bar lines, invisible
1963 @cindex measure lines, invisible
1965 Line breaks are also permitted at manually inserted bar lines
1966 even within incomplete measures. To allow a line break without
1967 printing a bar line, use
1974 This will insert an invisible bar line and allow (but not
1975 force) a line break to occur at this point. The bar number
1976 counter is not increased. To force a line break see
1977 @ref{Line breaking}.
1979 @cindex manual bar lines
1980 @cindex manual measure lines
1981 @cindex bar lines, manual
1982 @cindex measure lines, manual
1984 This and other special bar lines may be inserted manually at any
1985 point. When they coincide with the end of a measure they replace the
1986 simple bar line which would have been inserted there automatically.
1987 When they do not coincide with the end of a measure the specified bar
1988 line is inserted at that point in the printed output. Such insertions
1989 do not affect the calculation and placement of subsequent automatic
1992 Two types of simple bar lines and five types of double bar lines are available
1993 for manual insertion:
1995 @lilypond[quote,relative=1,verbatim]
2007 together with dotted and dashed bar lines:
2009 @lilypond[quote,relative=1,verbatim]
2016 and five types of repeat bar line:
2018 @lilypond[quote,relative=1,verbatim]
2027 Additionally, a bar line can be printed as a simple tick:
2028 @lilypond[quote,relative=1,verbatim]
2031 However, as such ticks are typically used in Gregorian chant, it is preferable
2032 to use @code{\divisioMinima} there instead, described in the section
2033 @ref{Divisiones} in Gregorian chant.
2038 Although the bar line types signifying repeats may be inserted
2039 manually they do not in themselves cause LilyPond to recognize
2040 a repeated section. Such repeated sections are better entered
2041 using the various repeat commands (see @ref{Repeats}), which
2042 automatically print the appropriate bar lines.
2044 In addition, you can specify @code{"||:"}, which is equivalent to
2045 @code{"|:"} except at line breaks, where it gives a double bar
2046 line at the end of the line and a start repeat at the beginning of
2049 @lilypond[quote,relative=2,verbatim]
2057 In scores with many staves, a @code{\bar} command in one staff is
2058 automatically applied to all staves. The resulting bar lines are
2059 connected between different staves of a @code{StaffGroup},
2060 @code{PianoStaff}, or @code{GrandStaff}.
2062 @lilypond[quote,fragment,verbatim]
2070 \new Staff { \clef bass c4 g e g }
2072 \new Staff { \clef bass c2 c2 }
2077 @cindex default bar lines, changing
2078 @cindex bar lines, default, changing
2083 @funindex defaultBarType
2088 The command @code{\bar }@var{bartype} is a shortcut for
2089 @code{\set Timing.whichBar = }@var{bartype}. A bar line is
2090 created whenever the @code{whichBar} property is
2093 The default bar type used for automatically inserted bar lines is
2094 @code{"|"}. This may be changed at any time
2095 with @code{\set Timing.defaultBarType = }@var{bartype}.
2100 @ref{Line breaking},
2102 @ref{Grouping staves}.
2107 Internals Reference: @rinternals{BarLine} (created at
2108 @rinternals{Staff} level), @rinternals{SpanBar} (across
2109 staves), @rinternals{Timing_translator} (for Timing
2114 @unnumberedsubsubsec Bar numbers
2117 @cindex measure numbers
2118 @cindex numbers, bar
2119 @cindex numbers, measure
2121 @funindex currentBarNumber
2123 Bar numbers are typeset by default at the start of every line except
2124 the first line. The number itself is stored in the
2125 @code{currentBarNumber} property, which is normally updated
2126 automatically for every measure. It may also be set manually:
2128 @lilypond[verbatim,quote,fragment,relative=1]
2131 \set Score.currentBarNumber = #50
2135 @cindex bar numbers, regular spacing
2137 @funindex barNumberVisibility
2140 Bar numbers can be typeset at regular intervals instead of just at
2141 the beginning of every line. To do this the default behavior
2142 must be overridden to permit bar numbers to be printed at places
2143 other than the start of a line. This is controlled by the
2144 @code{break-visibility} property of @code{BarNumber}. This takes
2145 three values which may be set to @code{#t} or @code{#f} to specify
2146 whether the corresponding bar number is visible or not. The order
2147 of the three values is @code{end of line visible}, @code{middle of
2148 line visible}, @code{beginning of line visible}. In the following
2149 example bar numbers are printed at all possible places:
2151 @lilypond[verbatim,quote,relative=1]
2152 \override Score.BarNumber #'break-visibility = #'#(#t #t #t)
2153 \set Score.currentBarNumber = #11
2154 % Permit first bar number to be printed
2164 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2165 {printing-the-bar-number-for-the-first-measure.ly}
2167 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2168 {printing-bar-numbers-at-regular-intervals.ly}
2170 @cindex measure number, format
2171 @cindex bar number, format
2173 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2174 {printing-bar-numbers-inside-boxes-or-circles.ly}
2176 @cindex bar number alignment
2178 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2179 {aligning-bar-numbers.ly}
2181 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2182 {removing-bar-numbers-from-a-score.ly}
2189 Internals Reference: @rinternals{BarNumber}.
2192 @cindex bar number collision
2193 @cindex collision, bar number
2197 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
2198 if there is one. To solve this, the @code{padding} property of
2199 @code{BarNumber} can be used to position the number correctly. See
2200 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
2204 @node Bar and bar number checks
2205 @unnumberedsubsubsec Bar and bar number checks
2208 @cindex bar number check
2209 @cindex measure check
2210 @cindex measure number check
2212 @funindex barCheckSynchronize
2215 Bar checks help detect errors in the entered durations. A bar check
2216 may be entered using the bar symbol, @code{|}, at any place where a
2217 bar line is expected to fall. If bar check lines are encountered at
2218 other places, a list of warnings is printed in the log file, showing
2219 the line numbers and lines in which the bar checks failed. In the
2220 next example, the second bar check will signal an error.
2223 \time 3/4 c2 e4 | g2 |
2226 Bar checks can also be used in lyrics, for example
2231 Twin -- kle | Twin -- kle |
2235 An incorrect duration can result in a completely garbled score,
2236 especially if the score is polyphonic, so a good place to start
2237 correcting input is by scanning for failed bar checks and
2238 incorrect durations.
2240 If successive bar checks are off by the same musical interval,
2241 only the first warning message is displayed. This allows the
2242 warning to focus on the source of the timing error.
2246 @funindex pipeSymbol
2248 It is also possible to redefine the action taken when a bar check
2249 or pipe symbol, @code{|}, is encountered in the input, so that
2250 it does something other than a bar check. This is done by
2251 assigning a music expression to @code{pipeSymbol}.
2252 In the following example @code{|} is set to insert a double bar
2253 line wherever it appears in the input, rather than checking
2256 @lilypond[quote,verbatim]
2257 pipeSymbol = \bar "||"
2266 @funindex \barNumberCheck
2267 @funindex barNumberCheck
2269 When copying large pieces of music, it can be helpful to check that
2270 the LilyPond bar number corresponds to the original that you are
2271 entering from. This can be checked with @code{\barNumberCheck}, for
2275 \barNumberCheck #123
2279 will print a warning if the @code{currentBarNumber} is not 123
2280 when it is processed.
2288 @node Rehearsal marks
2289 @unnumberedsubsubsec Rehearsal marks
2291 @cindex rehearsal marks
2292 @cindex mark, rehearsal
2297 To print a rehearsal mark, use the @code{\mark} command.
2299 @lilypond[quote,verbatim,relative=2]
2308 The letter@tie{}@q{I} is skipped in accordance with engraving
2309 traditions. If you wish to include the letter @q{I}, then use
2312 \set Score.markFormatter = #format-mark-alphabet
2315 The mark is incremented automatically if you use @code{\mark
2316 \default}, but you can also use an integer argument to set the
2317 mark manually. The value to use is stored in the property
2318 @code{rehearsalMark}.
2320 @cindex rehearsal mark format
2321 @cindex rehearsal mark style
2322 @cindex style, rehearsal mark
2323 @cindex format, rehearsal mark
2324 @cindex mark, rehearsal, style
2325 @cindex mark, rehearsal, format
2326 @cindex rehearsal mark, manual
2327 @cindex mark, rehearsal, manual
2328 @cindex custom rehearsal mark
2329 @cindex manual rehearsal mark
2331 The style is defined by the property @code{markFormatter}. It is
2332 a function taking the current mark (an integer) and the current
2333 context as argument. It should return a markup object. In the
2334 following example, @code{markFormatter} is set to a pre-defined
2335 procedure. After a few measures, it is set to a procedure that
2336 produces a boxed number.
2338 @lilypond[quote,verbatim,relative=2]
2339 \set Score.markFormatter = #format-mark-numbers
2342 \set Score.markFormatter = #format-mark-box-numbers
2344 \set Score.markFormatter = #format-mark-circle-numbers
2346 \set Score.markFormatter = #format-mark-circle-letters
2350 The file @file{scm/@/translation@/-functions@/.scm} contains the
2351 definitions of @code{format-mark-numbers} (the default format),
2352 @code{format-mark-box-numbers}, @code{format-mark-letters} and
2353 @code{format-mark-box-letters}. These can be used as inspiration
2354 for other formatting functions.
2356 You may use @code{format-mark-barnumbers},
2357 @code{format-mark-box-barnumbers}, and
2358 @code{format-mark-circle-barnumbers} to get bar numbers instead of
2359 incremented numbers or letters.
2361 Other styles of rehearsal mark can be specified manually:
2368 Note that @code{Score.markFormatter} does not affect marks specified
2369 in this manner. However, it is possible to apply a @code{\markup} to the
2373 \mark \markup@{ \box A1 @}
2378 @cindex D.S. al Fine
2380 @cindex music glyphs
2381 @cindex glyphs, music
2383 @funindex \musicglyph
2384 @funindex musicglyph
2386 Music glyphs (such as the segno sign) may be printed inside a
2389 @lilypond[quote,verbatim,relative=1]
2390 c1 \mark \markup { \musicglyph #"scripts.segno" }
2391 c1 \mark \markup { \musicglyph #"scripts.coda" }
2392 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
2397 See @ref{The Feta font}, for a list of symbols which may be
2398 printed with @code{\musicglyph}.
2400 For common tweaks to the positioning of rehearsal marks, see
2401 @ref{Formatting text}.
2406 @ref{The Feta font},
2407 @ref{Formatting text}.
2410 @file{scm/@/translation@/-functions@/.scm} contains
2411 the definition of @code{format-mark-numbers} and
2412 @code{format-mark-letters}. They can be used as inspiration for
2413 other formatting functions.
2418 Internals Reference: @rinternals{RehearsalMark}.
2421 @node Special rhythmic concerns
2422 @subsection Special rhythmic concerns
2427 * Aligning to cadenzas::
2428 * Time administration::
2432 @unnumberedsubsubsec Grace notes
2436 @cindex appoggiatura
2437 @cindex acciaccatura
2442 Grace notes are ornaments that are written out. Grace notes
2443 are printed in a smaller font and take up no logical time
2446 @lilypond[quote,relative=2,verbatim]
2448 \grace { c16[ d16] } c2
2451 LilyPond also supports two special types of grace notes, the
2452 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
2453 small note with a slashed stem -- and the @emph{appoggiatura}, which
2454 takes a fixed fraction of the main note and appears in small print
2457 @lilypond[quote,relative=2,verbatim]
2461 \acciaccatura { g16[ f] } e4
2464 The placement of grace notes is synchronized between different
2465 staves. In the following example, there are two sixteenth grace
2466 notes for every eighth grace note
2468 @lilypond[quote,relative=2,verbatim]
2469 << \new Staff { e2 \grace { c16[ d e f] } e2 }
2470 \new Staff { c2 \grace { g8[ b] } c2 } >>
2473 @cindex grace notes, following
2475 @funindex \afterGrace
2476 @funindex afterGrace
2478 If you want to end a note with a grace, use the @code{\afterGrace}
2479 command. It takes two arguments: the main note, and the grace
2480 notes following the main note.
2482 @lilypond[quote,verbatim,relative=2]
2483 c1 \afterGrace d1 { c16[ d] } c1
2486 This will put the grace notes after a space lasting 3/4 of the
2487 length of the main note. The default fraction 3/4 can be changed by
2488 setting @code{afterGraceFraction}. The following example shows
2489 the results from setting the space at the default, at 15/16, and
2490 finally at 1/2 of the main note.
2492 @lilypond[quote,verbatim,relative=2]
2495 c1 \afterGrace d1 { c16[ d] } c1
2498 #(define afterGraceFraction (cons 15 16))
2499 c1 \afterGrace d1 { c16[ d] } c1
2502 #(define afterGraceFraction (cons 1 2))
2503 c1 \afterGrace d1 { c16[ d] } c1
2508 The space between the main note and the grace note may also be
2509 specified using spacers. The following example places the grace
2510 note after a space lasting 7/8 of the main note.
2512 @lilypond[quote,verbatim,relative=2]
2515 { s2 s4. \grace { c16[ d] } } >>
2520 @cindex tweaking grace notes
2521 @cindex grace notes, tweaking
2522 @cindex grace notes, changing layout settings
2524 A @code{\grace} music expression will introduce special
2525 typesetting settings, for example, to produce smaller type, and
2526 set directions. Hence, when introducing layout tweaks to
2527 override the special settings, they should be placed inside
2528 the grace expression. The overrides should also be reverted
2529 inside the grace expression. Here, the grace note's default stem
2530 direction is overridden and then reverted.
2532 @lilypond[quote,verbatim,relative=2]
2544 @cindex stem, with slash
2549 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2550 {using-grace-note-slashes-with-normal-heads.ly}
2552 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2553 {tweaking-grace-layout-within-music.ly}
2555 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2556 {redefining-grace-note-global-defaults.ly}
2558 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2559 {positioning-grace-notes-with-floating-space.ly}
2564 @rglos{grace notes},
2565 @rglos{acciaccatura},
2566 @rglos{appoggiatura}.
2568 Installed Files: @file{ly/@/grace@/-init@/.ly}.
2570 Snippets: @rlsr{Rhythms}.
2572 Internals Reference: @rinternals{GraceMusic}.
2577 @cindex acciaccatura, multi-note
2578 @cindex multi-note acciaccatura
2579 @cindex grace-note synchronization
2581 A multi-note beamed @i{acciaccatura} is printed without a slash,
2582 and looks exactly the same as a multi-note beamed
2585 @c TODO Add link to LSR snippet to add slash when available
2587 Grace note synchronization can also lead to surprises. Staff
2588 notation, such as key signatures, bar lines, etc., are also
2589 synchronized. Take care when you mix staves with grace notes and
2590 staves without, for example,
2592 @lilypond[quote,relative=2,verbatim]
2594 \new Staff { e4 \bar "|:" \grace c16 d2. }
2595 \new Staff { c4 \bar "|:" d2. }
2600 This can be remedied by inserting grace skips of the corresponding
2601 durations in the other staves. For the above example
2603 @lilypond[quote,relative=2,verbatim]
2605 \new Staff { e4 \bar "|:" \grace c16 d2. }
2606 \new Staff { c4 \bar "|:" \grace s16 d2. }
2610 Grace sections should only be used within sequential music
2611 expressions. Nesting or juxtaposing grace sections is not
2612 supported, and might produce crashes or other errors.
2614 @node Aligning to cadenzas
2615 @unnumberedsubsubsec Aligning to cadenzas
2618 @cindex cadenza, aligning to
2619 @cindex aligning to cadenza
2621 In an orchestral context, cadenzas present a special problem: when
2622 constructing a score that includes a measured cadenza or other solo
2623 passage, all other instruments should skip just as many notes as the
2624 length of the cadenza, otherwise they will start too soon or too late.
2626 One solution to this problem is to use the functions
2627 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
2628 functions take a defined piece of music as an argument and generate a
2629 multi-measure rest or @code{\skip} exactly as long as the piece.
2631 @lilypond[verbatim,quote]
2632 MyCadenza = \relative c' {
2643 #(ly:export (mmrest-of-length MyCadenza))
2645 #(ly:export (skip-of-length MyCadenza))
2660 @node Time administration
2661 @unnumberedsubsubsec Time administration
2663 @cindex time administration
2664 @cindex timing (within the score)
2665 @cindex music, unmetered
2666 @cindex unmetered music
2668 @funindex currentBarNumber
2669 @funindex measurePosition
2670 @funindex measureLength
2672 Time is administered by the @code{Timing_translator}, which by
2673 default is to be found in the @code{Score} context. An alias,
2674 @code{Timing}, is added to the context in which the
2675 @code{Timing_translator} is placed.
2677 The following properties of @code{Timing} are used
2678 to keep track of timing within the score.
2681 @cindex measure number
2684 @item currentBarNumber
2685 The current measure number. For an example showing the
2686 use of this property see @ref{Bar numbers}.
2689 The length of the measures in the current time signature. For a
2690 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
2691 determines when bar lines are inserted and how automatic beams
2692 should be generated.
2694 @item measurePosition
2695 The point within the measure where we currently are. This
2696 quantity is reset by subtracting @code{measureLength} whenever
2697 @code{measureLength} is reached or exceeded. When that happens,
2698 @code{currentBarNumber} is incremented.
2701 If set to true, the above variables are updated for every time
2702 step. When set to false, the engraver stays in the current
2703 measure indefinitely.
2707 Timing can be changed by setting any of these variables
2708 explicitly. In the next example, the default 4/4 time
2709 signature is printed, but @code{measureLength} is set to 5/4.
2710 At 4/8 through the third measure, the @code{measurePosition} is
2711 advanced by 1/8 to 5/8, shortening that bar by 1/8.
2712 The next bar line then falls at 9/8 rather than 5/4.
2714 @lilypond[quote,verbatim,relative=1]
2715 \set Score.measureLength = #(ly:make-moment 5 4)
2719 \set Score.measurePosition = #(ly:make-moment 5 8)
2725 As the example illustrates, @code{ly:make-moment n m} constructs a
2726 duration of n/m of a whole note. For example,
2727 @code{ly:make-moment 1 8} is an eighth note duration and
2728 @code{ly:make-moment 7 16} is the duration of seven sixteenths
2733 This manual: @ref{Bar numbers}, @ref{Unmetered music}
2738 Internals Reference: @rinternals{Timing_translator},