1 @c -*- coding: utf-8; mode: texinfo; -*-
3 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 When revising a translation, copy the HEAD committish of the
6 version that you are working on. For details, see the Contributors'
7 Guide, node Updating translation committishes..
15 @lilypondfile[quote]{rhythms-headword.ly}
17 This section discusses rhythms, rests, durations, beaming and bars.
22 * Displaying rhythms::
25 * Special rhythmic concerns::
30 @subsection Writing rhythms
40 @unnumberedsubsubsec Durations
42 @cindex durations, of notes
43 @cindex note durations
44 @cindex length of notes
54 Durations are designated by numbers and dots. Durations are entered
55 as their reciprocal values. For example, a quarter note is entered
56 using a @code{4} (since it is a 1/4 note), and a half note is entered
57 using a @code{2} (since it is a 1/2 note). For notes longer than a
58 whole you must use the @code{\longa} (a double breve) and
59 @code{\breve} commands. Durations as short as 128th notes may be
60 specified. Shorter values are possible, but only as beamed notes.
62 @c Two 64th notes are needed to obtain beams
63 @lilypond[quote,verbatim,relative=2]
66 c4 c8 c16 c32 c64 c128 c128
69 Here are the same durations with automatic beaming turned off.
71 @c not strictly "writing rhythms"; more of a "displaying" thing,
72 @c but it's ok here. -gp
73 @lilypond[quote,verbatim,relative=2]
77 c4 c8 c16 c32 c64 c128 c128
80 A note with the duration of a quadruple breve may be entered with
81 @code{\maxima}, but this is supported only within ancient music
82 notation. For details, see @ref{Ancient notation}.
84 @cindex duration, default
85 @cindex default note duration
86 @cindex note duration, default
88 If the duration is omitted, it is set to the previously
89 entered duration. The default for the first note is a quarter
92 @lilypond[quote,verbatim,relative=2]
98 @cindex notes, double-dotted
99 @cindex double-dotted notes
103 To obtain dotted note lengths, place a dot (@code{.}) after the
104 duration. Double-dotted notes are specified by appending two
107 @lilypond[quote,verbatim,relative=2]
108 a4 b c4. b8 a4. b4.. c8.
111 Some durations cannot be represented with just binary durations
112 and dots; they can be represented only by tying two or more
113 notes together. For details, see @ref{Ties}.
117 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
118 {dot-count-override.ly}
120 For ways of specifying durations for the syllables of lyrics and
121 ways of aligning lyrics to notes, see @ref{Vocal music}.
123 Optionally, notes can be spaced strictly proportionately to their
124 duration. For details of this and other settings which control
125 proportional notation, see @ref{Proportional notation}.
131 @funindex \dotsNeutral
132 @funindex dotsNeutral
134 Dots are normally moved up to avoid staff lines, except in
135 polyphonic situations. Dots may be manually placed above or below
136 the staff; see @ref{Direction and placement}.
154 @rglos{Duration names notes and rests}.
157 @ref{Automatic beams},
160 @ref{Writing rhythms},
163 @ref{Ancient notation},
164 @ref{Proportional notation}.
171 @rinternals{DotColumn}.
176 @c Deliberately duplicated in Durations and Rests. -gp
177 There is no fundamental limit to rest durations (both in terms of
178 longest and shortest), but the number of glyphs is limited:
179 rests from 128th to maxima (8 x whole) may be printed.
183 @unnumberedsubsubsec Tuplets
191 Tuplets are made from a music expression by multiplying all the
192 durations with a fraction:
195 \times @var{fraction} @{ @var{music} @}
199 The duration of @var{music} will be multiplied by the
200 fraction. The fraction's denominator will be printed over or
201 under the notes, optionally with a bracket. The most common
202 tuplet is the triplet in which 3 notes have the duration of 2, so
203 the notes are 2/3 of their written length.
205 @lilypond[quote,verbatim,relative=2]
206 a2 \times 2/3 { b4 b b }
207 c4 c \times 2/3 { b4 a g }
210 @cindex tuplet bracket placement
214 @funindex \tupletDown
216 @funindex \tupletNeutral
217 @funindex tupletNeutral
219 Tuplet brackets may be manually placed above or below the staff;
220 see @ref{Direction and placement}.
222 Tuplets may be nested:
224 @lilypond[quote,verbatim,relative=2]
226 c4 \times 4/5 { f8 e f \times 2/3 { e[ f g] } } f4
229 Modifying nested tuplets which begin at the same musical moment
230 must be done with @code{\tweak}.
232 To modify the duration of notes without printing a tuplet bracket,
233 see @ref{Scaling durations}.
239 @code{\tupletNeutral}.
245 @cindex tuplet formatting
246 @cindex triplet formatting
248 @funindex tupletNumberFormatFunction
249 @funindex tupletSpannerDuration
251 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
252 {entering-several-tuplets-using-only-one--times-command.ly}
254 @cindex Tuplet number changes
256 @funindex TupletNumber
258 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
259 {changing-the-tuplet-number.ly}
261 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
262 {non-default-tuplet-numbers.ly}
264 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
265 {controlling-tuplet-bracket-visibility.ly}
267 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
268 {permitting-line-breaks-within-beamed-tuplets.ly}
278 @rlearning{Tweaking methods}.
281 @ref{Time administration},
282 @ref{Scaling durations},
283 @ref{The tweak command},
284 @ref{Polymetric notation}.
290 @rinternals{TupletBracket},
291 @rinternals{TupletNumber},
292 @rinternals{TimeScaledMusic}.
295 @cindex grace notes within tuplet brackets
298 Grace notes may be placed within tuplet brackets, @emph{except}
299 when a staff begins with a grace note followed by a tuplet. In this
300 particular case, the grace note must be placed before the @code{\times}
301 command to avoid errors.
303 @cindex tempo marks within tuplet brackets
305 When using a tuplet at the beginning of a piece with a @code{\tempo}
306 mark, the music must be explicitely entered in a @code{\new Voice}
307 block, as discussed in @rlearning{Voices contain music}.
310 @node Scaling durations
311 @unnumberedsubsubsec Scaling durations
313 @cindex scaling durations
314 @cindex durations, scaling
316 You can alter the duration of single notes, rests or chords by a
317 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
318 is 1) to the duration. This will not affect the appearance of the
319 notes or rests produced, but the altered duration will be used in
320 calculating the position within the measure and setting the duration
321 in the MIDI output. Multiplying factors may be combined such as
324 In the following example, the first three notes take up exactly
325 two beats, but no triplet bracket is printed.
327 @lilypond[quote,relative=2,verbatim]
329 % Alter durations to triplets
330 a4*2/3 gis4*2/3 a4*2/3
333 % Double the duration of chord
335 % Duration of quarter, appears like sixteenth
339 The duration of spacing notes may also be modified by
340 a multiplier. This is useful for skipping many measures, e.g.,
343 @cindex compressing music
344 @cindex expanding music
346 @funindex \scaleDurations
347 @funindex scaleDurations
349 Longer stretches of music may be compressed by a fraction in the
350 same way, as if every note, chord or rest had the fraction as a
351 multiplier. This leaves the appearance of the music unchanged but
352 the internal duration of the notes will be multiplied by the
353 fraction @emph{num}/@emph{den}. The spaces around the dot are
354 required. Here is an example showing how music can be compressed
357 @lilypond[quote,relative=2,verbatim]
361 % Scale music by *2/3
362 \scaleDurations #'(2 . 3) {
366 \scaleDurations #'(2 . 1) {
371 One application of this command is in polymetric
372 notation, see @ref{Polymetric notation}.
378 @ref{Invisible rests},
379 @ref{Polymetric notation}.
386 @unnumberedsubsubsec Ties
392 A tie connects two adjacent note heads of the same pitch. The tie
393 in effect extends the duration of a note.
395 @warning{Ties should not be confused with @emph{slurs}, which
396 indicate articulation, or @emph{phrasing slurs}, which indicate
397 musical phrasing. A tie is just a way of extending a note
398 duration, similar to the augmentation dot.}
400 A tie is entered using the tilde symbol (@code{~}).
402 @lilypond[quote,verbatim,relative=2]
406 Ties are used either when the note crosses a bar line, or when
407 dots cannot be used to denote the rhythm. Ties should also be
408 used when note values cross larger subdivisions of the measure:
410 @lilypond[verbatim,quote]
417 If you need to tie many notes across bar lines, it may be
418 easier to use automatic note splitting, see @ref{Automatic note
419 splitting}. This mechanism automatically splits long notes, and
420 ties them across bar lines.
422 @cindex ties and chords
423 @cindex chords and ties
425 When a tie is applied to a chord, all note heads whose pitches
426 match are connected. When no note heads match, no ties will be
427 created. Chords may be partially tied by placing the tie inside
430 @lilypond[quote,verbatim,relative=1]
432 <c~ e g~ b> <c e g b>
435 @cindex repeating ties
436 @cindex ties, repeating
437 @cindex volta brackets and ties
438 @cindex ties and volta brackets
443 When a second alternative of a repeat starts with a tied note, you
444 have to specify the repeated tie as follows:
446 @lilypond[quote,relative=2,verbatim]
447 \repeat volta 2 { c g <c e>2 ~ }
449 % First alternative: following note is tied normally
451 % Second alternative: following note has a repeated tie
452 { <c e>2\repeatTie d4 c } }
455 @cindex laissez vibrer
456 @cindex ties, laissez vibrer
458 @funindex \laissezVibrer
459 @funindex laissezVibrer
461 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
462 notes must not be damped at the end. It is used in notation for
463 piano, harp and other string and percussion instruments. They can
464 be entered as follows:
466 @lilypond[quote,verbatim,relative=1]
467 <c f g>1\laissezVibrer
470 @cindex ties, placement
476 @funindex \tieNeutral
479 Ties may be manually placed above or below the staff; see
480 @ref{Direction and placement}.
482 @cindex ties, appearance
495 Ties may be made dashed, dotted, or a combination of solid and
498 @lilypond[quote, verbatim, relative=1]
511 Custom dash patterns can be specified:
513 @lilypond[quote, verbatim, relative=1]
514 \tieDashPattern #0.3 #0.75
516 \tieDashPattern #0.7 #1.5
522 Dash pattern definitions for ties have the same structure as
523 dash pattern definitions for slurs.
524 For more information about complex dash patterns,
525 see the snippets under @ref{Slurs}.
533 @code{\tieDashPattern},
534 @code{\tieHalfDashed},
535 @code{\tieHalfSolid},
542 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
543 {using-ties-with-arpeggios.ly}
545 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
546 {engraving-ties-manually.ly}
552 @rglos{laissez vibrer}.
556 @ref{Automatic note splitting}.
562 @rinternals{LaissezVibrerTie},
563 @rinternals{LaissezVibrerTieColumn},
564 @rinternals{TieColumn},
570 Switching staves when a tie is active will not produce a slanted
573 Changing clefs or octavations during a tie is not really
574 well-defined. In these cases, a slur may be preferable.
579 @subsection Writing rests
581 Rests are entered as part of the music in music expressions.
586 * Full measure rests::
590 @unnumberedsubsubsec Rests
593 @cindex rest, entering durations
608 Rests are entered like notes with the note name @code{r}.
609 Durations longer than a whole rest use the predefined
612 @c \time 16/1 is used to avoid spurious bar lines
613 @c and long tracts of empty measures
614 @lilypond[fragment,quote,verbatim]
616 % These two lines are just to prettify this example
618 \override Staff.TimeSignature #'stencil = ##f
619 % Print a maxima rest, equal to four breves
621 % Print a longa rest, equal to two breves
625 r1 r2 r4 r8 r16 r32 r64 r128
629 @cindex rest, multi-measure
630 @cindex rest, whole-measure
632 Whole measure rests, centered in the middle of the measure, must be
633 entered as multi-measure rests. They can be used for a single
634 measure as well as many measures and are discussed in @ref{Full
637 @cindex rest, specifying vertical position
639 To explicitly specify a rest's vertical position, write a note
640 followed by @code{\rest}. A rest of the duration of the note will
641 be placed at the staff position where the note would appear. This
642 allows for precise manual formatting of polyphonic music, since the
643 automatic rest collision formatter will not move these rests.
645 @lilypond[quote,verbatim,relative=2]
651 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
662 @ref{Full measure rests}.
673 @c Deliberately duplicated in Durations and Rests. -gp
674 There is no fundamental limit to rest durations (both in terms of
675 longest and shortest), but the number of glyphs is limited: there
676 are rests from 128th to maxima (8 x whole).
679 @node Invisible rests
680 @unnumberedsubsubsec Invisible rests
683 @cindex invisible rest
684 @cindex rest, invisible
692 An invisible rest (also called a @q{spacer rest}) can be entered
693 like a note with the note name@tie{}@code{s}:
695 @lilypond[verbatim,quote,relative=2]
702 Spacer rests are available only in note mode and chord mode. In
703 other situations, for example, when entering lyrics, the
704 command @code{\skip} is used to skip a musical moment.
705 @code{\skip} requires an explicit duration.
707 @lilypond[quote,verbatim,relative=2]
720 Because @code{\skip} is a command, it does not affect the default
721 durations of following notes, unlike@tie{}@code{s}.
723 @lilypond[quote,verbatim,relative=2]
726 \repeat unfold 8 {a4}
736 A spacer rest implicitly causes @code{Staff} and @code{Voice}
737 contexts to be created if none exist, just like notes and rests
740 @lilypond[quote,verbatim,fragment]
744 @code{\skip} simply skips musical time; it creates no output of
747 @lilypond[quote,verbatim,fragment]
748 % This is valid input, but does nothing
749 \skip 1 \skip1 \skip 1
755 @rlearning{Visibility and color of objects}.
759 @ref{Visibility of objects}.
765 @rinternals{SkipMusic}.
768 @node Full measure rests
769 @unnumberedsubsubsec Full measure rests
771 @cindex multi-measure rests
772 @cindex full-measure rests
773 @cindex rest, multi-measure
774 @cindex rest, full-measure
775 @cindex whole rest for a full measure
776 @cindex rest, whole for a full measure
780 Rests for one or more full measures are entered like notes with
781 the note name uppercase @code{R}:
783 @lilypond[quote,verbatim,relative=2]
784 % Rest measures contracted to single measure
785 \compressFullBarRests
792 The duration of full-measure rests is identical to the duration
793 notation used for notes. The duration in a multi-measure rest must
794 always be an integral number of measure-lengths, so augmentation dots
795 or fractions must often be used:
797 @lilypond[quote,fragment,verbatim]
798 \compressFullBarRests
804 R1*13/8 | R1*13/8*12 |
809 A full-measure rest is printed as either a whole or breve rest,
810 centered in the measure, depending on the time signature.
812 @lilypond[quote,verbatim,fragment]
821 @cindex multi-measure rest, expanding
822 @cindex multi-measure rest, contracting
824 @funindex \expandFullBarRests
825 @funindex expandFullBarRests
826 @funindex \compressFullBarRests
827 @funindex compressFullBarRests
829 By default a multi-measure rest is expanded in the printed score to
830 show all the rest measures explicitly. Alternatively, a multi-measure
831 rest can be shown as a single measure containing a multi-measure rest
832 symbol, with the number of measures of rest printed above the measure:
834 @lilypond[quote,fragment,verbatim]
836 \time 3/4 r2. | R2.*2 |
839 % Rest measures contracted to single measure
840 \compressFullBarRests
842 % Rest measures expanded
849 @cindex text on multi-measure rest
850 @cindex multi-measure rest, attaching text
851 @cindex script on multi-measure rest
852 @cindex multi-measure rest, script
853 @cindex fermata on multi-measure rest
854 @cindex multi-measure rest, attaching fermata
855 @cindex markup on multi-measure rest
856 @cindex multi-measure rest with markup
858 @funindex \fermataMarkup
859 @funindex fermataMarkup
860 @funindex MultiMeasureRestText
862 Markups can be added to multi-measure rests.
863 The predefined command @code{\fermataMarkup}
864 is provided for adding fermatas.
866 @lilypond[quote,verbatim,fragment]
867 \compressFullBarRests
869 R2.*10^\markup { \italic "ad lib." }
874 Markups attached to a multi-measure rest are
875 objects of type @code{MultiMeasureRestText}, not
876 @code{TextScript}. Overrides must be directed to the correct
877 object, or they will be ignored. See the following example.
880 @lilypond[quote,verbatim,fragment]
881 % This fails, as the wrong object name is specified
882 \override TextScript #'padding = #5
884 % This is correct and works
885 \override MultiMeasureRestText #'padding = #5
889 When a multi-measure rest immediately follows a @code{\partial}
890 setting, resulting bar-check warnings may not be displayed.
893 @funindex \textLengthOn
894 @funindex textLengthOn
895 @funindex \textLengthOff
896 @funindex textLenthOff
897 @funindex \fermataMarkup
898 @funindex fermataMarkup
899 @funindex \compressFullBarRests
900 @funindex compressFullBarRests
901 @funindex \expandFullBarRests
902 @funindex expandFullBarRests
905 @code{\textLengthOn},
906 @code{\textLengthOff},
907 @code{\fermataMarkup},
908 @code{\compressFullBarRests},
909 @code{\expandFullBarRests}.
917 @cindex kirchenpausen
919 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
920 {changing-form-of-multi-measure-rests.ly}
922 @cindex multi-measure rests, positioning
923 @cindex positioning multi-measure rests
925 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
926 {positioning-multi-measure-rests.ly}
928 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
929 {multi-measure-rest-markup.ly}
934 @rglos{multi-measure rest}.
939 @ref{Formatting text},
946 @rinternals{MultiMeasureRest},
947 @rinternals{MultiMeasureRestNumber},
948 @rinternals{MultiMeasureRestText}.
951 @cindex fingerings and multi-measure rests
952 @cindex multi-measure rests and fingerings
956 If an attempt is made to use fingerings (e.g.,
957 @code{R1*10-4}) to put numbers over multi-measure rests, the
958 fingering numeral (4) may collide with the bar counter
961 @cindex condensing rests
962 @cindex rest, condensing ordinary
964 There is no way to automatically condense multiple ordinary rests
965 into a single multi-measure rest.
967 @cindex rest, collisions of
969 Multi-measure rests do not take part in rest collisions.
971 @node Displaying rhythms
972 @subsection Displaying rhythms
978 * Polymetric notation::
979 * Automatic note splitting::
980 * Showing melody rhythms::
984 @unnumberedsubsubsec Time signature
986 @cindex time signature
992 The time signature is set as follows:
994 @lilypond[quote,verbatim,relative=2]
999 @cindex time signature, visibility of
1001 Time signatures are printed at the beginning of a piece
1002 and whenever the time signature changes. If a change takes place
1003 at the end of a line a warning time signature sign is printed
1004 there. This default behavior may be changed, see
1005 @ref{Visibility of objects}.
1007 @lilypond[quote,verbatim,relative=2]
1017 @cindex time signature style
1020 @funindex \numericTimeSignature
1021 @funindex numericTimeSignature
1022 @funindex \defaultTimeSignature
1023 @funindex defaultTimeSignature
1025 The time signature symbol that is used in 2/2 and 4/4 time can be
1026 changed to a numeric style:
1028 @lilypond[quote,verbatim,relative=2]
1032 % Change to numeric style
1033 \numericTimeSignature
1036 % Revert to default style
1037 \defaultTimeSignature
1043 Mensural time signatures are covered in
1044 @ref{Mensural time signatures}.
1048 @code{\numericTimeSignature},
1049 @code{\defaultTimeSignature}.
1055 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1056 {changing-the-time-signature-without-affecting-the-beaming.ly}
1058 @cindex compound time signatures
1059 @cindex time signature, compound
1061 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1062 {compound-time-signatures.ly}
1064 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1065 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1070 @rglos{time signature}
1073 @ref{Mensural time signatures},
1074 @ref{Time administration}.
1079 Internals Reference:
1080 @rinternals{TimeSignature},
1081 @rinternals{Timing_translator}.
1085 @unnumberedsubsubsec Upbeats
1089 @cindex partial measure
1090 @cindex measure, partial
1091 @cindex pickup measure
1092 @cindex measure, change length
1094 @funindex measurePosition
1098 Partial or pick-up measures, such as an anacrusis or upbeat, are
1099 entered using the @code{\partial} command, with the syntax
1102 \partial @var{duration}
1106 where @code{duration} is the rhythmic length of the remaining
1107 interval of the current measure before the start of the next.
1109 @lilypond[quote,verbatim,relative=2]
1114 The partial measure can be any duration less than the full measure:
1116 @lilypond[quote,verbatim,relative=2]
1117 \partial 8*3 c8 d e |
1121 Internally, @code{\partial @var{duration}} is translated into:
1124 \set Timing.measurePosition -@var{duration}
1127 For example, @code{\partial 8*3} becomes:
1130 \set Timing.measurePosition = #(ly:make-moment -3 8)
1133 The property @code{measurePosition} contains a rational number
1134 indicating how much of the measure has passed at this point. Note
1135 that this is set to a negative number by the @code{\partial} command:
1136 i.e., @code{\partial 4} is internally translated to @code{-4}, meaning
1137 @qq{there is a quarter note left in the measure.}
1150 @rinternals{Timing_translator}.
1154 The @code{\partial} command is intended to be used only at the
1155 beginning of a piece. If you use it after the beginning, some
1156 odd warnings or effects may occur, in this case use
1157 @code{\set Timing.measurePosition} instead.
1159 @node Unmetered music
1160 @unnumberedsubsubsec Unmetered music
1162 @cindex bar lines, turning off
1163 @cindex bar numbering, turning off
1165 @cindex unmetered music
1167 @funindex \cadenzaOn
1169 @funindex \cadenzaOff
1170 @funindex cadenzaOff
1172 Bar lines and bar numbers are calculated automatically. For
1173 unmetered music (some cadenzas, for example), this is not desirable.
1174 To turn off automatic calculation of bar lines and bar numbers,
1175 use the command @code{\cadenzaOn}, and use @code{\cadenzaOff}
1176 to turn them on again.
1178 @lilypond[verbatim,relative=2,fragment]
1187 Bar numbering is resumed at the end of the cadenza as if the
1188 cadenza were not there:
1190 @lilypond[verbatim,relative=2,fragment]
1191 % Show all bar numbers
1192 \override Score.BarNumber #'break-visibility = #all-visible
1201 Note that these predefined commands affect all staves in the
1202 score, even when they are placed in just one @code{Voice}
1203 context. To change this, move the @code{Timing_translator}
1204 from the @code{Score} context to the @code{Staff} context, as
1205 shown in @ref{Polymetric notation}.
1218 @ref{Visibility of objects},
1219 @ref{Polymetric notation}.
1225 @cindex cadenza line breaks
1226 @cindex cadenza page breaks
1227 @cindex unmetered music, line breaks
1228 @cindex unmetered music, page breaks
1229 @cindex breaks in unmetered music
1230 @cindex line breaks in cadenzas
1231 @cindex page breaks in cadenzas
1232 @cindex line breaks in unmetered music
1233 @cindex page breaks in unmetered music
1237 LilyPond will insert line breaks and page breaks only at a
1238 bar line. Unless the unmetered music ends before the end of the
1239 staff line, you will need to insert invisible bar lines with
1246 to indicate where breaks can occur.
1248 You must explicitly create a @code{Voice} context when starting a
1249 piece with @code{\cadenzaOn}, otherwise strange errors may occur.
1251 @lilypond[verbatim,relative=2,fragment]
1252 \new Voice \relative c'{
1254 c16^"Solo Free Time" d e f g2. \bar "||"
1260 @node Polymetric notation
1261 @unnumberedsubsubsec Polymetric notation
1263 @c This section necessarily uses \set
1264 @c This is acceptable -td
1266 @cindex double time signatures
1267 @cindex signatures, polymetric
1268 @cindex time signatures, polymetric
1269 @cindex time signatures, double
1270 @cindex polymetric signatures
1271 @cindex meter, polymetric
1273 @funindex timeSignatureFraction
1274 @funindex \scaleDurations
1275 @funindex scaleDurations
1279 Polymetric notation is supported, either explicitly or by modifying
1280 the visible time signature symbol and scaling the note durations.
1282 @strong{@i{Staves with different time signatures, equal measure lengths}}
1284 This notation can be created by setting a common time signature
1285 for each staff but replacing the symbol manually by setting
1286 @code{timeSignatureFraction} to the desired fraction and scaling
1287 the printed durations in each staff to the common time
1288 signature; see @ref{Time signature}. The scaling is done with
1289 @code{\scaleDurations}, which is used in a similar way to
1290 @code{\times}, but does not create a tuplet bracket; see
1291 @ref{Scaling durations}.
1293 @cindex beaming in polymetric music
1294 @cindex beaming in polymetric meter
1296 In this example, music with the time signatures of 3/4, 9/8, and
1297 10/8 are used in parallel. In the second staff, shown durations
1298 are multiplied by 2/3, as 2/3 * 9/8 = 3/4, and in the third
1299 staff, shown durations are multiplied by 3/5, as 3/5 * 10/8 = 3/4.
1300 It will often be necessary to insert beams manually, as the
1301 duration scaling affects the autobeaming rules.
1303 @lilypond[quote,verbatim,fragment]
1312 \set Staff.timeSignatureFraction = #'(9 . 8)
1313 \scaleDurations #'(2 . 3)
1314 \repeat unfold 6 { c8[ c c] }
1318 \set Staff.timeSignatureFraction = #'(10 . 8)
1319 \scaleDurations #'(3 . 5) {
1320 \repeat unfold 2 { c8[ c c] }
1321 \repeat unfold 2 { c8[ c] } |
1322 c4. c4. \times 2/3 { c8[ c c] } c4
1328 @strong{@i{Staves with different time signatures, unequal bar lengths}}
1330 Each staff can be given its own independent time signature by
1331 moving the @code{Timing_translator} and the
1332 @code{Default_bar_line_engraver} to the @code{Staff} context.
1334 @lilypond[quote,verbatim]
1338 \remove "Timing_translator"
1339 \remove "Default_bar_line_engraver"
1343 \consists "Timing_translator"
1344 \consists "Default_bar_line_engraver"
1348 % Now each staff has its own time signature.
1374 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1375 {compound-time-signatures.ly}
1381 @rglos{polymetric time signature},
1385 @ref{Time signature},
1386 @ref{Scaling durations}.
1391 Internals Reference:
1392 @rinternals{TimeSignature},
1393 @rinternals{Timing_translator},
1394 @rinternals{Default_bar_line_engraver},
1400 When using different time signatures in parallel, notes
1401 at the same moment will be placed at the same horizontal
1402 location. However, the bar lines in the different staves
1403 will cause the note spacing to be less regular in each of the
1404 individual staves than would be normal without the different
1407 @node Automatic note splitting
1408 @unnumberedsubsubsec Automatic note splitting
1410 @cindex notes, splitting
1411 @cindex splitting notes
1413 @funindex Note_heads_engraver
1414 @funindex Completion_heads_engraver
1416 Long notes which overrun bar lines can be converted automatically
1417 to tied notes. This is done by replacing the
1418 @code{Note_heads_engraver} with the
1419 @code{Completion_heads_engraver}. In the following
1420 example, notes crossing the bar lines are split and tied.
1422 @lilypond[quote,verbatim,relative=1]
1424 \remove "Note_heads_engraver"
1425 \consists "Completion_heads_engraver"
1428 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 }
1431 This engraver splits all running notes at the bar line, and
1432 inserts ties. One of its uses is to debug complex scores: if the
1433 measures are not entirely filled, then the ties show exactly how
1434 much each measure is off.
1442 @rlearning{Engravers explained},
1443 @rlearning{Adding and removing engravers}.
1448 Internals Reference:
1449 @rinternals{Note_heads_engraver},
1450 @rinternals{Completion_heads_engraver},
1451 @rinternals{Forbid_line_break_engraver}.
1456 Not all durations (especially those containing tuplets) can be
1457 represented exactly with normal notes and dots, but the
1458 @code{Completion_heads_engraver} will not insert tuplets.
1460 The @code{Completion_heads_engraver} only affects notes; it does not
1464 @node Showing melody rhythms
1465 @unnumberedsubsubsec Showing melody rhythms
1467 @cindex melody rhythms, showing
1468 @cindex rhythms, showing melody
1470 Sometimes you might want to show only the rhythm of a melody. This
1471 can be done with the rhythmic staff. All pitches of notes on such a
1472 staff are squashed, and the staff itself has a single line
1474 @lilypond[quote,relative=1,verbatim]
1476 \new RhythmicStaff {
1477 \new Voice = "myRhythm" {
1485 \lyricsto "myRhythm" {
1493 @cindex guitar chord charts
1494 @cindex strumming rhythms, showing
1495 @cindex guitar strumming rhythms, showing
1497 @funindex Pitch_squash_engraver
1498 @funindex \improvisationOn
1499 @funindex improvisationOn
1500 @funindex \improvisationOff
1501 @funindex improvisationOff
1503 Guitar chord charts often show the strumming rhythms. This can
1504 be done with the @code{Pitch_squash_engraver} and
1505 @code{\improvisationOn}.
1508 @lilypond[quote,verbatim]
1517 \consists Pitch_squash_engraver
1530 @code{\improvisationOn},
1531 @code{\improvisationOff}.
1537 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1538 {guitar-strum-rhythms.ly}
1545 Internals Reference:
1546 @rinternals{RhythmicStaff},
1547 @rinternals{Pitch_squash_engraver}.
1555 * Setting automatic beam behavior::
1560 @node Automatic beams
1561 @unnumberedsubsubsec Automatic beams
1563 By default, beams are inserted automatically:
1565 @cindex beams, manual
1566 @cindex manual beams
1567 @cindex beams, setting rules for
1568 @cindex beams, custom rules for
1570 @funindex \autoBeamOn
1571 @funindex autoBeamOn
1572 @funindex \autoBeamOff
1573 @funindex autoBeamOff
1575 @lilypond[quote,verbatim,relative=2]
1577 \time 6/8 c c c c8. c16 c8
1580 If these automatic decisions are not satisfactory, beaming can be
1581 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1582 entered manually if beams are to be extended over rests.
1584 If automatic beaming is not required, it may be turned off with
1585 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1587 @lilypond[quote,relative=1,verbatim]
1588 c4 c8 c8. c16 c8. c16 c8
1595 @cindex melismata, beams
1596 @cindex beams and melismata
1598 @warning{If beams are used to indicate melismata in songs, then
1599 automatic beaming should be switched off with @code{\autoBeamOff}
1600 and the beams indicated manually.}
1602 Beaming patterns that differ from the automatic defaults can be
1603 created; see @ref{Setting automatic beam behavior}.
1607 @code{\autoBeamOff},
1614 @cindex line breaks and beams
1615 @cindex beams and line breaks
1619 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1620 {beams-across-line-breaks.ly}
1622 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1623 {changing-beam-knee-gap.ly}
1629 @ref{Setting automatic beam behavior}.
1632 @file{scm/@/auto@/-beam@/.scm}.
1637 Internals Reference:
1638 @rinternals{Auto_beam_engraver},
1639 @rinternals{Beam_engraver},
1641 @rinternals{BeamEvent},
1642 @rinternals{BeamForbidEvent},
1643 @rinternals{beam-interface},
1644 @rinternals{unbreakable-spanner-interface}.
1649 Beams can collide with note heads and accidentals in other voices.
1652 @node Setting automatic beam behavior
1653 @unnumberedsubsubsec Setting automatic beam behavior
1656 @cindex automatic beams, tuning
1657 @cindex tuning automatic beaming
1658 @cindex automatic beam generation
1660 @cindex lyrics and beaming
1662 @funindex autoBeaming
1663 @funindex beamSettings
1664 @funindex measureLength
1665 @funindex beatLength
1671 The placement of automatic beams is determined by the time signature.
1672 Three types of rules are used for determining the end of automatic
1673 beams: @emph{default} rules
1674 for the time signature, @emph{explicit} rules for the beam in the time
1675 signature, and the @emph{beatLength} for the time signature.
1677 The following rules, in order of priority, apply when determining
1678 the appearance of beams:
1682 If a manual beam is specified with @code{[..]} set the beam
1683 as specified, otherwise
1686 if @code{\autoBeamOff} is in force do not beam, otherwise
1689 if an explicit beam-ending rule is defined for the beam type
1690 in the time signature, use it to determine the valid
1691 places where beams may end, otherwise
1694 if a default beam-ending rule is defined in the time signature,
1695 use it to group notes with beams, otherwise
1698 use the value of @code{beatLength} to group notes with beams
1702 @i{@strong{Modifying the grouping of beats}}
1704 By default @code{beatLength} is
1705 derived from the time signature set by the @code{\time} command.
1706 The @code{beatLength} is set to be one over the denominator
1707 of the time signature.
1709 @code{beatLength} is a @i{moment},
1710 a unit of musical duration. A quantity of type @i{moment} is
1711 created by the scheme function @code{ly:make-moment}. For more
1712 information about this function, see @ref{Time administration}.
1714 Autobeam settings are stored in the
1715 @code{beamSettings} property. Default values of @code{beamSettings}
1716 are determined in @file{scm/@/beam@/-settings@/.scm}. Entries in
1717 @code{beamSettings} are indexed by time signature and
1720 Time signature should be a scheme pair , e.g. @code{#'(4 . 4)}.
1722 Rule type should be @code{#'end} for beam ending.
1724 The ending rules consist of a scheme alist
1725 (or list of pairs) that
1726 indicates the beam type and the grouping to be applied to
1727 beams containing notes with a shortest duration of that
1731 #'((beam-type1 . grouping-1)
1732 (beam-type2 . grouping-2)
1733 (beam-type3 . grouping-3))
1736 Beam type is either a scheme pair indicating the duration
1737 of the beam, e.g. @code{(1 . 16)}, or @code{*} to indicate a
1738 default rule, which applies to all beams if no explicit rule is
1741 Grouping is a scheme list indicating the grouping to be applied to
1742 the beam. For default rules (where beam type is
1743 @code{*}, the grouping is in units of @code{beatLength}.
1744 For explicit rules, the grouping is in units of the beam type.
1746 For reference, the default beaming rules are found in
1747 @file{scm/beam-settings.scm}.
1749 Beam settings are changed with
1750 @code{\overrideBeamSettings} and @code{\revertBeamSettings}.
1753 The ending settings must be
1754 @emph{complete} rules. That is, every rule that should apply to
1755 the current time signature must be included in the setting.
1756 It is not possible to change the grouping of only one beam type
1757 for a given time signature. While this may seem cumbersome,
1758 it means that the current beaming settings need not be known
1759 in order to specify a new beaming pattern.}
1761 @lilypond[quote,relative=2,verbatim]
1764 \overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (2 3)))
1766 \overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (3 2)))
1770 Beam setting changes can be limited to specific contexts. If no
1771 setting is included in a lower-level context, the setting of the
1772 enclosing context will apply.
1774 @lilypond[quote, verbatim,relative=1]
1779 \overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (2 3 2)))
1786 \overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (1 3 3)))
1793 When multiple voices are used the @code{Staff} context must be
1794 specified if the beaming is to be applied to all voices in the
1797 @lilypond[quote,verbatim,relative=2]
1800 % Context Voice specified -- does not work correctly
1801 % Because of autogenerated voices, all beating will
1802 % be at beatLength (1 . 8)
1803 \overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (3 1 1 2)))
1804 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
1806 % Works correctly with context Staff specified
1807 \overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (3 1 1 2)))
1808 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
1811 @funindex revertBeamSettings
1813 Beam settings can be reverted to get back to default behavior. This
1814 is accomplished by using @code{\revertBeamSettings}. The arguments
1815 are the same as for @code{\overrideBeamSettings}, except no value
1816 for @var{grouping} is given:
1819 \revertBeamSettings context time-signature rule-type
1823 @lilypond[quote,verbatim,relative=2]
1825 \repeat unfold 8 {a8}
1826 % set default rule for (1 1 1 1) grouping
1827 \overrideBeamSettings #'Score #'(4 . 4) #'end #'((* . (1 1 1 1)))
1828 \repeat unfold 8 {a8}
1829 % revert the new rule
1830 \revertBeamSettings #'Score #'(4 . 4) #'end
1831 \repeat unfold 8 {a8}
1836 @code{\overrideBeamSettings},
1837 @code{\revertBeamSettings}.
1843 @cindex beams, subdividing
1845 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1846 {sub-dividing-beams.ly}
1848 @cindex measure groupings
1849 @cindex beats, grouping
1850 @cindex grouping beats
1851 @cindex measure sub-grouping
1853 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1854 {conducting-signs,-measure-grouping-signs.ly}
1856 @cindex beam, last in score
1857 @cindex beam, last in polyphonic voice
1859 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1860 {beam-endings-in-score-context.ly}
1865 @file{scm/beam-settings.scm}.
1870 Internals Reference:
1871 @rinternals{Auto_beam_engraver},
1873 @rinternals{BeamForbidEvent},
1874 @rinternals{beam-interface}.
1879 If a score ends while an automatic beam has not been ended and is
1880 still accepting notes, this last beam will not be typeset at all.
1881 The same holds for polyphonic voices, entered with @code{<<
1882 @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
1883 automatic beam is still accepting notes, it is not typeset.
1884 The workaround for these problems is to manually beam the last
1885 beam in the voice or score.
1888 @unnumberedsubsubsec Manual beams
1890 @cindex beams, manual
1891 @cindex manual beams
1896 In some cases it may be necessary to override the automatic
1897 beaming algorithm. For example, the autobeamer will not put beams
1898 over rests or bar lines, and in choral scores the beaming is
1899 often set to follow the meter of the lyrics rather than the
1900 notes. Such beams can be specified manually by
1901 marking the begin and end point with @code{[} and @code{]}.
1903 @lilypond[quote,relative=1,verbatim]
1904 r4 r8[ g' a r8] r8 g[ | a] r8
1907 @cindex manual beams, direction shorthand for
1908 @cindex manual beams, grace notes
1910 Beaming direction can be set manually using direction indicators:
1912 @lilypond[quote,relative=2,verbatim]
1913 c8^[ d e] c,_[ d e f g]
1919 Individual notes may be marked with @code{\noBeam} to prevent them
1922 @lilypond[quote,verbatim,relative=2]
1927 Grace note beams and normal note beams can occur simultaneously.
1928 Unbeamed grace notes are not put into normal note beams.
1930 @lilypond[quote,verbatim,relative=2]
1932 \grace { e32[ d c d] }
1938 @funindex stemLeftBeamCount
1939 @funindex stemRightBeamCount
1941 Even more strict manual control with the beams can be achieved by
1942 setting the properties @code{stemLeftBeamCount} and
1943 @code{stemRightBeamCount}. They specify the number of beams to
1944 draw on the left and right side, respectively, of the next note.
1945 If either property is set, its value will be used only once, and
1946 then it is erased. In this example, the last @code{f} is printed
1947 with only one beam on the left side, i.e., the eighth-note beam of
1948 the group as a whole.
1950 @lilypond[quote,relative=2,verbatim]
1953 \set stemLeftBeamCount = #2
1954 \set stemRightBeamCount = #1
1956 \set stemLeftBeamCount = #1
1968 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1969 {flat-flags-and-beam-nibs.ly}
1974 @ref{Direction and placement},
1980 Internals Reference:
1982 @rinternals{BeamEvent},
1983 @rinternals{Beam_engraver},
1984 @rinternals{beam-interface},
1985 @rinternals{Stem_engraver}.
1988 @node Feathered beams
1989 @unnumberedsubsubsec Feathered beams
1991 @cindex beams, feathered
1992 @cindex feathered beams
1994 @funindex \featherDurations
1995 @funindex featherDurations
1996 @funindex grow-direction
1998 Feathered beams are used to indicate that a small group of notes
1999 should be played at an increasing (or decreasing) tempo, without
2000 changing the overall tempo of the piece. The extent of the
2001 feathered beam must be indicated manually using @code{[} and
2002 @code{]}, and the beam feathering is turned on by specifying a
2003 direction to the @code{Beam} property @code{grow-direction}.
2005 If the placement of the notes and the sound in the MIDI output is to
2006 reflect the ritardando or accelerando indicated by the feathered beam
2007 the notes must be grouped as a music expression delimited by braces
2008 and preceded by a @code{featherDurations} command which specifies
2009 the ratio between the durations of the first and last notes in the
2012 The square brackets show the extent of the beam and the braces show
2013 which notes are to have their durations modified. Normally these
2014 would delimit the same group of notes, but this is not required: the
2015 two commands are independent.
2017 In the following example the eight 16th notes occupy exactly the
2018 same time as a half note, but the first note is one half as long
2019 as the last one, with the intermediate notes gradually
2020 lengthening. The first four 32nd notes gradually speed up, while
2021 the last four 32nd notes are at a constant tempo.
2023 @lilypond[relative=1,verbatim,quote]
2024 \override Beam #'grow-direction = #LEFT
2025 \featherDurations #(ly:make-moment 2 1)
2026 { c16[ c c c c c c c] }
2027 \override Beam #'grow-direction = #RIGHT
2028 \featherDurations #(ly:make-moment 2 3)
2030 % revert to non-feathered beams
2031 \override Beam #'grow-direction = #'()
2036 The spacing in the printed output represents the
2037 note durations only approximately, but the MIDI output is exact.
2041 @code{\featherDurations}.
2051 The @code{\featherDurations} command only works with very short
2052 music snippets, and when numbers in the fraction are small.
2062 * Bar and bar number checks::
2067 @unnumberedsubsubsec Bar lines
2070 @cindex measure lines
2071 @cindex closing bar lines
2072 @cindex bar lines, closing
2073 @cindex double bar lines
2074 @cindex bar lines, double
2080 Bar lines delimit measures, and are also used to indicate
2081 repeats. Normally, simple bar lines are automatically inserted
2082 into the printed output at places based on the current time
2085 The simple bar lines inserted automatically can be changed to
2086 other types with the @code{\bar} command. For example, a closing
2087 double bar line is usually placed at the end of a piece:
2089 @lilypond[quote,relative=1,verbatim]
2093 It is not invalid if the final note in a measure does not
2094 end on the automatically entered bar line: the note is assumed
2095 to carry over into the next measure. But if a long sequence
2096 of such carry-over measures appears the music can appear compressed
2097 or even flowing off the page. This is because automatic line
2098 breaks happen only at the end of complete measures, i.e., where
2099 all notes end before the end of a measure.
2101 @warning{An incorrect duration can cause line breaks to be
2102 inhibited, leading to a line of highly compressed music or
2103 music which flows off the page.}
2106 @cindex bar lines, invisible
2107 @cindex measure lines, invisible
2109 Line breaks are also permitted at manually inserted bar lines
2110 even within incomplete measures. To allow a line break without
2111 printing a bar line, use the following:
2118 This will insert an invisible bar line and allow (but not
2119 force) a line break to occur at this point. The bar number
2120 counter is not increased. To force a line break see
2121 @ref{Line breaking}.
2123 @cindex manual bar lines
2124 @cindex manual measure lines
2125 @cindex bar lines, manual
2126 @cindex measure lines, manual
2128 This and other special bar lines may be inserted manually at any
2129 point. When they coincide with the end of a measure they replace
2130 the simple bar line which would have been inserted there
2131 automatically. When they do not coincide with the end of a measure
2132 the specified bar line is inserted at that point in the printed
2135 Note that manual bar lines are purely visual. They do not affect
2136 any of the properties that a normal bar line would affect, such as
2137 measure numbers, accidentals, line breaks, etc. They do not affect
2138 the calculation and placement of subsequent automatic bar lines.
2139 When a manual bar line is placed where a normal bar line already
2140 exists, the effects of the original bar line are not altered.
2142 Two types of simple bar lines and five types of double bar lines are
2143 available for manual insertion:
2145 @lilypond[quote,relative=1,verbatim]
2157 together with dotted and dashed bar lines:
2159 @lilypond[quote,relative=1,verbatim]
2166 and five types of repeat bar line:
2168 @lilypond[quote,relative=1,verbatim]
2177 Additionally, a bar line can be printed as a simple tick:
2178 @lilypond[quote,relative=1,verbatim]
2181 However, as such ticks are typically used in Gregorian chant, it is
2182 preferable to use @code{\divisioMinima} there instead, described in
2183 the section @ref{Divisiones} in Gregorian chant.
2187 For in-line segno signs, there are three types of bar lines which
2188 differ in their behavior at line breaks:
2190 @lilypond[quote,relative=2,verbatim]
2208 Although the bar line types signifying repeats may be inserted
2209 manually they do not in themselves cause LilyPond to recognize
2210 a repeated section. Such repeated sections are better entered
2211 using the various repeat commands (see @ref{Repeats}), which
2212 automatically print the appropriate bar lines.
2214 In addition, you can specify @code{"||:"}, which is equivalent to
2215 @code{"|:"} except at line breaks, where it gives a double bar
2216 line at the end of the line and a start repeat at the beginning of
2219 @lilypond[quote,relative=2,verbatim]
2227 For combinations of repeats with the segno sign, there are six different
2230 @lilypond[quote,relative=2,verbatim]
2259 In scores with many staves, a @code{\bar} command in one staff is
2260 automatically applied to all staves. The resulting bar lines are
2261 connected between different staves of a @code{StaffGroup},
2262 @code{PianoStaff}, or @code{GrandStaff}.
2264 @lilypond[quote,relative=1,verbatim]
2272 \new Staff { \clef bass c4 g e g }
2274 \new Staff { \clef bass c2 c2 }
2279 @cindex default bar lines, changing
2280 @cindex bar lines, default, changing
2285 @funindex defaultBarType
2290 The command @code{\bar }@var{bartype} is a shortcut for
2291 @code{\set Timing.whichBar = }@var{bartype}. A bar line is
2292 created whenever the @code{whichBar} property is set.
2294 The default bar type used for automatically inserted bar lines is
2295 @code{"|"}. This may be changed at any time
2296 with @code{\set Timing.defaultBarType = }@var{bartype}.
2301 @ref{Line breaking},
2303 @ref{Grouping staves}.
2308 Internals Reference:
2309 @rinternals{BarLine} (created at @code{Staff} level),
2310 @rinternals{SpanBar} (across staves),
2311 @rinternals{Timing_translator} (for Timing properties).
2315 @unnumberedsubsubsec Bar numbers
2318 @cindex measure numbers
2319 @cindex numbers, bar
2320 @cindex numbers, measure
2322 @funindex currentBarNumber
2324 Bar numbers are typeset by default at the start of every line except
2325 the first line. The number itself is stored in the
2326 @code{currentBarNumber} property, which is normally updated
2327 automatically for every measure. It may also be set manually:
2329 @lilypond[verbatim,quote,relative=1]
2332 \set Score.currentBarNumber = #50
2336 @cindex bar numbers, regular spacing
2338 @funindex barNumberVisibility
2341 Bar numbers can be typeset at regular intervals instead of just at
2342 the beginning of every line. To do this the default behavior
2343 must be overridden to permit bar numbers to be printed at places
2344 other than the start of a line. This is controlled by the
2345 @code{break-visibility} property of @code{BarNumber}. This takes
2346 three values which may be set to @code{#t} or @code{#f} to specify
2347 whether the corresponding bar number is visible or not. The order
2348 of the three values is @code{end of line visible}, @code{middle of
2349 line visible}, @code{beginning of line visible}. In the following
2350 example bar numbers are printed at all possible places:
2352 @lilypond[verbatim,quote,relative=1]
2353 \override Score.BarNumber #'break-visibility = #'#(#t #t #t)
2354 \set Score.currentBarNumber = #11
2355 % Permit first bar number to be printed
2365 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2366 {printing-the-bar-number-for-the-first-measure.ly}
2368 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2369 {printing-bar-numbers-at-regular-intervals.ly}
2371 @cindex measure number, format
2372 @cindex bar number, format
2374 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2375 {printing-bar-numbers-inside-boxes-or-circles.ly}
2377 @cindex bar number alignment
2379 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2380 {aligning-bar-numbers.ly}
2382 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2383 {removing-bar-numbers-from-a-score.ly}
2390 Internals Reference:
2391 @rinternals{BarNumber},
2392 @rinternals{Bar_number_engraver}.
2395 @cindex bar number collision
2396 @cindex collision, bar number
2400 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
2401 if there is one. To solve this, the @code{padding} property of
2402 @code{BarNumber} can be used to position the number correctly. See
2403 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
2406 @node Bar and bar number checks
2407 @unnumberedsubsubsec Bar and bar number checks
2410 @cindex bar number check
2411 @cindex measure check
2412 @cindex measure number check
2414 @funindex barCheckSynchronize
2417 Bar checks help detect errors in the entered durations. A bar check
2418 may be entered using the bar symbol, @code{|}, at any place where a
2419 bar line is expected to fall. If bar check lines are encountered at
2420 other places, a list of warnings is printed in the log file, showing
2421 the line numbers and lines in which the bar checks failed. In the
2422 next example, the second bar check will signal an error.
2425 \time 3/4 c2 e4 | g2 |
2428 Bar checks can also be used in lyrics:
2433 Twin -- kle | Twin -- kle |
2437 An incorrect duration can result in a completely garbled score,
2438 especially if the score is polyphonic, so a good place to start
2439 correcting input is by scanning for failed bar checks and
2440 incorrect durations.
2442 If successive bar checks are off by the same musical interval,
2443 only the first warning message is displayed. This allows the
2444 warning to focus on the source of the timing error.
2448 @funindex pipeSymbol
2450 It is also possible to redefine the action taken when a bar check
2451 or pipe symbol, @code{|}, is encountered in the input, so that
2452 it does something other than a bar check. This is done by
2453 assigning a music expression to @code{pipeSymbol}.
2454 In the following example @code{|} is set to insert a double bar
2455 line wherever it appears in the input, rather than checking
2458 @lilypond[quote,verbatim]
2459 pipeSymbol = \bar "||"
2468 @funindex \barNumberCheck
2469 @funindex barNumberCheck
2471 When copying large pieces of music, it can be helpful to check that
2472 the LilyPond bar number corresponds to the original that you are
2473 entering from. This can be checked with @code{\barNumberCheck}, for
2477 \barNumberCheck #123
2481 will print a warning if the @code{currentBarNumber} is not 123
2482 when it is processed.
2490 @node Rehearsal marks
2491 @unnumberedsubsubsec Rehearsal marks
2493 @cindex rehearsal marks
2494 @cindex mark, rehearsal
2499 To print a rehearsal mark, use the @code{\mark} command.
2501 @lilypond[quote,verbatim,relative=2]
2509 The mark is incremented automatically if you use @code{\mark
2510 \default}, but you can also use an integer argument to set the
2511 mark manually. The value to use is stored in the property
2512 @code{rehearsalMark}.
2514 @lilypond[quote,verbatim,relative=2]
2523 The letter@tie{}@q{I} is skipped in accordance with engraving
2524 traditions. If you wish to include the letter @q{I}, then use one
2525 of the following commands, depending on which style of rehearsal mark
2526 you want (letters only, letters in a hollow box, or letters in a
2530 \set Score.markFormatter = #format-mark-alphabet
2531 \set Score.markFormatter = #format-mark-box-alphabet
2532 \set Score.markFormatter = #format-mark-circle-alphabet
2535 @lilypond[quote,verbatim,relative=2]
2536 \set Score.markFormatter = #format-mark-box-alphabet
2544 @cindex rehearsal mark format
2545 @cindex rehearsal mark style
2546 @cindex style, rehearsal mark
2547 @cindex format, rehearsal mark
2548 @cindex mark, rehearsal, style
2549 @cindex mark, rehearsal, format
2550 @cindex rehearsal mark, manual
2551 @cindex mark, rehearsal, manual
2552 @cindex custom rehearsal mark
2553 @cindex manual rehearsal mark
2555 The style is defined by the property @code{markFormatter}. It is
2556 a function taking the current mark (an integer) and the current
2557 context as argument. It should return a markup object. In the
2558 following example, @code{markFormatter} is set to a pre-defined
2559 procedure. After a few measures, it is set to a procedure that
2560 produces a boxed number.
2562 @lilypond[quote,verbatim,relative=2]
2563 \set Score.markFormatter = #format-mark-numbers
2566 \set Score.markFormatter = #format-mark-box-numbers
2568 \set Score.markFormatter = #format-mark-circle-numbers
2570 \set Score.markFormatter = #format-mark-circle-letters
2574 The file @file{scm/@/translation@/-functions@/.scm} contains the
2575 definitions of @code{format-mark-numbers} (the default format),
2576 @code{format-mark-box-numbers}, @code{format-mark-letters} and
2577 @code{format-mark-box-letters}. These can be used as inspiration
2578 for other formatting functions.
2580 You may use @code{format-mark-barnumbers},
2581 @code{format-mark-box-barnumbers}, and
2582 @code{format-mark-circle-barnumbers} to get bar numbers instead of
2583 incremented numbers or letters.
2585 Other styles of rehearsal mark can be specified manually:
2592 Note that @code{Score.markFormatter} does not affect marks specified
2593 in this manner. However, it is possible to apply a @code{\markup} to the
2597 \mark \markup@{ \box A1 @}
2602 @cindex D.S. al Fine
2604 @cindex music glyphs
2605 @cindex glyphs, music
2607 @funindex \musicglyph
2608 @funindex musicglyph
2610 Music glyphs (such as the segno sign) may be printed inside a
2613 @lilypond[quote,verbatim,relative=1]
2614 c1 \mark \markup { \musicglyph #"scripts.segno" }
2615 c1 \mark \markup { \musicglyph #"scripts.coda" }
2616 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
2621 See @ref{The Feta font}, for a list of symbols which may be
2622 printed with @code{\musicglyph}.
2624 For common tweaks to the positioning of rehearsal marks, see
2625 @ref{Formatting text}. For more precise control, see
2626 @code{break-alignable-interface} in @ref{Aligning objects}.
2631 @ref{The Feta font},
2632 @ref{Formatting text},
2633 @ref{Aligning objects}.
2636 @file{scm/@/translation@/-functions@/.scm} contains
2637 the definitions of @code{format-mark-numbers} and
2638 @code{format-mark-letters}. They can be used as inspiration for
2639 other formatting functions.
2644 Internals Reference:
2645 @rinternals{MarkEvent},
2646 @rinternals{Mark_engraver},
2647 @rinternals{RehearsalMark}.
2650 @node Special rhythmic concerns
2651 @subsection Special rhythmic concerns
2656 * Aligning to cadenzas::
2657 * Time administration::
2661 @unnumberedsubsubsec Grace notes
2665 @cindex appoggiatura
2666 @cindex acciaccatura
2671 Grace notes are ornaments that are written out. Grace notes
2672 are printed in a smaller font and take up no logical time
2675 @lilypond[quote,relative=2,verbatim]
2677 \grace { c16[ d16] } c2
2680 LilyPond also supports two special types of grace notes, the
2681 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
2682 small note with a slashed stem -- and the @emph{appoggiatura}, which
2683 takes a fixed fraction of the main note and appears in small print
2686 @lilypond[quote,relative=2,verbatim]
2690 \acciaccatura { g16[ f] } e4
2693 The placement of grace notes is synchronized between different
2694 staves. In the following example, there are two sixteenth grace
2695 notes for every eighth grace note
2697 @lilypond[quote,relative=2,verbatim]
2699 \new Staff { e2 \grace { c16[ d e f] } e2 }
2700 \new Staff { c2 \grace { g8[ b] } c2 }
2704 @cindex grace notes, following
2706 @funindex \afterGrace
2707 @funindex afterGrace
2709 If you want to end a note with a grace, use the @code{\afterGrace}
2710 command. It takes two arguments: the main note, and the grace
2711 notes following the main note.
2713 @lilypond[quote,verbatim,relative=2]
2714 c1 \afterGrace d1 { c16[ d] } c1
2717 This will put the grace notes after a space lasting 3/4 of the
2718 length of the main note. The default fraction 3/4 can be changed by
2719 setting @code{afterGraceFraction}. The following example shows
2720 the results from setting the space at the default, at 15/16, and
2721 finally at 1/2 of the main note.
2723 @lilypond[quote,verbatim,relative=2]
2726 c1 \afterGrace d1 { c16[ d] } c1
2729 #(define afterGraceFraction (cons 15 16))
2730 c1 \afterGrace d1 { c16[ d] } c1
2733 #(define afterGraceFraction (cons 1 2))
2734 c1 \afterGrace d1 { c16[ d] } c1
2739 The space between the main note and the grace note may also be
2740 specified using spacers. The following example places the grace
2741 note after a space lasting 7/8 of the main note.
2743 @lilypond[quote,verbatim,relative=2]
2747 { s2 s4. \grace { c16[ d] } }
2753 @cindex tweaking grace notes
2754 @cindex grace notes, tweaking
2755 @cindex grace notes, changing layout settings
2757 A @code{\grace} music expression will introduce special
2758 typesetting settings, for example, to produce smaller type, and
2759 set directions. Hence, when introducing layout tweaks to
2760 override the special settings, they should be placed inside
2761 the grace expression. The overrides should also be reverted
2762 inside the grace expression. Here, the grace note's default stem
2763 direction is overridden and then reverted.
2765 @lilypond[quote,verbatim,relative=2]
2777 @cindex stem, with slash
2782 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2783 {using-grace-note-slashes-with-normal-heads.ly}
2785 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2786 {tweaking-grace-layout-within-music.ly}
2788 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2789 {redefining-grace-note-global-defaults.ly}
2791 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2792 {positioning-grace-notes-with-floating-space.ly}
2797 @rglos{grace notes},
2798 @rglos{acciaccatura},
2799 @rglos{appoggiatura}.
2805 @file{ly/@/grace@/-init@/.ly}.
2810 Internals Reference:
2811 @rinternals{GraceMusic},
2812 @rinternals{Grace_beam_engraver},
2813 @rinternals{Grace_engraver},
2814 @rinternals{Grace_spacing_engraver}.
2819 @cindex acciaccatura, multi-note
2820 @cindex multi-note acciaccatura
2821 @cindex grace-note synchronization
2823 A multi-note beamed @i{acciaccatura} is printed without a slash,
2824 and looks exactly the same as a multi-note beamed
2827 @c TODO Add link to LSR snippet to add slash when available
2829 Grace note synchronization can also lead to surprises. Staff
2830 notation, such as key signatures, bar lines, etc., are also
2831 synchronized. Take care when you mix staves with grace notes and
2832 staves without, for example,
2834 @lilypond[quote,relative=2,verbatim]
2836 \new Staff { e4 \bar "|:" \grace c16 d2. }
2837 \new Staff { c4 \bar "|:" d2. }
2842 This can be remedied by inserting grace skips of the corresponding
2843 durations in the other staves. For the above example
2845 @lilypond[quote,relative=2,verbatim]
2847 \new Staff { e4 \bar "|:" \grace c16 d2. }
2848 \new Staff { c4 \bar "|:" \grace s16 d2. }
2852 Grace sections should only be used within sequential music
2853 expressions. Nesting or juxtaposing grace sections is not
2854 supported, and might produce crashes or other errors.
2856 @node Aligning to cadenzas
2857 @unnumberedsubsubsec Aligning to cadenzas
2860 @cindex cadenza, aligning to
2861 @cindex aligning to cadenza
2863 In an orchestral context, cadenzas present a special problem: when
2864 constructing a score that includes a measured cadenza or other solo
2865 passage, all other instruments should skip just as many notes as the
2866 length of the cadenza, otherwise they will start too soon or too late.
2868 One solution to this problem is to use the functions
2869 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
2870 functions take a defined piece of music as an argument and generate a
2871 multi-measure rest or @code{\skip} exactly as long as the piece.
2873 @lilypond[verbatim,quote]
2874 MyCadenza = \relative c' {
2885 #(ly:export (mmrest-of-length MyCadenza))
2887 #(ly:export (skip-of-length MyCadenza))
2902 @node Time administration
2903 @unnumberedsubsubsec Time administration
2905 @cindex time administration
2906 @cindex timing (within the score)
2907 @cindex music, unmetered
2908 @cindex unmetered music
2910 @funindex currentBarNumber
2911 @funindex measurePosition
2912 @funindex measureLength
2914 Time is administered by the @code{Timing_translator}, which by
2915 default is to be found in the @code{Score} context. An alias,
2916 @code{Timing}, is added to the context in which the
2917 @code{Timing_translator} is placed. To ensure that the
2918 @code{Timing} alias is available, you may need to explicitly
2919 instantiate the containing context (such as @code{Voice} or
2922 The following properties of @code{Timing} are used
2923 to keep track of timing within the score.
2926 @cindex measure number
2929 @item currentBarNumber
2930 The current measure number. For an example showing the
2931 use of this property see @ref{Bar numbers}.
2934 The length of the measures in the current time signature. For a
2935 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
2936 determines when bar lines are inserted and how automatic beams
2937 should be generated.
2939 @item measurePosition
2940 The point within the measure where we currently are. This
2941 quantity is reset by subtracting @code{measureLength} whenever
2942 @code{measureLength} is reached or exceeded. When that happens,
2943 @code{currentBarNumber} is incremented.
2946 If set to true, the above variables are updated for every time
2947 step. When set to false, the engraver stays in the current
2948 measure indefinitely.
2952 Timing can be changed by setting any of these variables
2953 explicitly. In the next example, the default 4/4 time
2954 signature is printed, but @code{measureLength} is set to 5/4.
2955 At 4/8 through the third measure, the @code{measurePosition} is
2956 advanced by 1/8 to 5/8, shortening that bar by 1/8.
2957 The next bar line then falls at 9/8 rather than 5/4.
2959 @lilypond[quote,verbatim]
2960 \new Voice \relative c' {
2961 \set Timing.measureLength = #(ly:make-moment 5 4)
2965 \set Timing.measurePosition = #(ly:make-moment 5 8)
2972 As the example illustrates, @code{ly:make-moment n m} constructs a
2973 duration of n/m of a whole note. For example,
2974 @code{ly:make-moment 1 8} is an eighth note duration and
2975 @code{ly:make-moment 7 16} is the duration of seven sixteenths
2982 @ref{Unmetered music}.
2987 Internals Reference:
2988 @rinternals{Timing_translator},