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}
269 @rlearning{Tweaking methods}.
272 @ref{Time administration},
273 @ref{Scaling durations},
274 @ref{The tweak command},
275 @ref{Polymetric notation}.
281 @rinternals{TupletBracket},
282 @rinternals{TupletNumber},
283 @rinternals{TimeScaledMusic}.
286 @cindex grace notes within tuplet brackets
289 When the first note on a staff is a grace note followed by a
290 tuplet the grace note must be placed before the @code{\times}
291 command to avoid errors. Anywhere else, grace notes may be
292 placed within tuplet brackets.
295 @node Scaling durations
296 @unnumberedsubsubsec Scaling durations
298 @cindex scaling durations
299 @cindex durations, scaling
301 You can alter the duration of single notes, rests or chords by a
302 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
303 is 1) to the duration. This will not affect the appearance of the
304 notes or rests produced, but the altered duration will be used in
305 calculating the position within the measure and setting the duration
306 in the MIDI output. Multiplying factors may be combined such as
309 In the following example, the first three notes take up exactly
310 two beats, but no triplet bracket is printed.
312 @lilypond[quote,relative=2,verbatim]
314 % Alter durations to triplets
315 a4*2/3 gis4*2/3 a4*2/3
318 % Double the duration of chord
320 % Duration of quarter, appears like sixteenth
324 The duration of skip or spacing notes may also be modified by
325 a multiplier. This is useful for skipping many measures, e.g.,
328 @cindex compressing music
329 @cindex expanding music
331 @funindex \scaleDurations
332 @funindex scaleDurations
334 Longer stretches of music may be compressed by a fraction in the
335 same way, as if every note, chord or rest had the fraction as a
336 multiplier. This leaves the appearance of the music unchanged but
337 the internal duration of the notes will be multiplied by the
338 fraction @emph{num}/@emph{den}. The spaces around the dot are
339 required. Here is an example showing how music can be compressed
342 @lilypond[quote,relative=2,verbatim]
346 % Scale music by *2/3
347 \scaleDurations #'(2 . 3) {
351 \scaleDurations #'(2 . 1) {
356 One application of this command is in polymetric
357 notation, see @ref{Polymetric notation}.
363 @ref{Invisible rests},
364 @ref{Polymetric notation}.
371 @unnumberedsubsubsec Ties
377 A tie connects two adjacent note heads of the same pitch. The tie
378 in effect extends the duration of a note.
380 @warning{Ties should not be confused with @emph{slurs}, which
381 indicate articulation, or @emph{phrasing slurs}, which indicate
382 musical phrasing. A tie is just a way of extending a note
383 duration, similar to the augmentation dot.}
385 A tie is entered using the tilde symbol (@code{~}).
387 @lilypond[quote,verbatim,relative=2]
391 Ties are used either when the note crosses a bar line, or when
392 dots cannot be used to denote the rhythm. Ties should also be
393 used when note values cross larger subdivisions of the measure:
395 @lilypond[verbatim,quote]
402 If you need to tie many notes across bar lines, it may be
403 easier to use automatic note splitting, see @ref{Automatic note
404 splitting}. This mechanism automatically splits long notes, and
405 ties them across bar lines.
407 @cindex ties and chords
408 @cindex chords and ties
410 When a tie is applied to a chord, all note heads whose pitches
411 match are connected. When no note heads match, no ties will be
412 created. Chords may be partially tied by placing the tie inside
415 @lilypond[quote,verbatim,relative=1]
417 <c~ e g~ b> <c e g b>
420 @cindex repeating ties
421 @cindex ties, repeating
422 @cindex volta brackets and ties
423 @cindex ties and volta brackets
428 When a second alternative of a repeat starts with a tied note, you
429 have to specify the repeated tie as follows:
431 @lilypond[quote,relative=2,verbatim]
432 \repeat volta 2 { c g <c e>2 ~ }
434 % First alternative: following note is tied normally
436 % Second alternative: following note has a repeated tie
437 { <c e>2\repeatTie d4 c } }
440 @cindex laissez vibrer
441 @cindex ties, laissez vibrer
443 @funindex \laissezVibrer
444 @funindex laissezVibrer
446 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
447 notes must not be damped at the end. It is used in notation for
448 piano, harp and other string and percussion instruments. They can
449 be entered as follows:
451 @lilypond[quote,verbatim,relative=1]
452 <c f g>1\laissezVibrer
455 @cindex ties, placement
461 @funindex \tieNeutral
464 Ties may be manually placed above or below the staff; see
465 @ref{Direction and placement}.
467 @cindex ties, appearance
480 Ties may be made dashed, dotted, or a combination of solid and
483 @lilypond[quote, verbatim, relative=1]
496 Custom dash patterns can be specified:
498 @lilypond[quote, verbatim, relative=1]
499 \tieDashPattern #0.3 #0.75
501 \tieDashPattern #0.7 #1.5
507 Dash pattern definitions for ties have the same structure as
508 dash pattern definitions for slurs.
509 For more information about complex dash patterns,
510 see the snippets under @ref{Slurs}.
518 @code{\tieDashPattern},
519 @code{\tieHalfDashed},
520 @code{\tieHalfSolid},
527 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
528 {using-ties-with-arpeggios.ly}
530 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
531 {engraving-ties-manually.ly}
537 @rglos{laissez vibrer}.
541 @ref{Automatic note splitting}.
547 @rinternals{LaissezVibrerTie},
548 @rinternals{LaissezVibrerTieColumn},
549 @rinternals{TieColumn},
555 Switching staves when a tie is active will not produce a slanted
558 Changing clefs or octavations during a tie is not really
559 well-defined. In these cases, a slur may be preferable.
564 @subsection Writing rests
566 Rests are entered as part of the music in music expressions.
571 * Full measure rests::
575 @unnumberedsubsubsec Rests
578 @cindex rest, entering durations
593 Rests are entered like notes with the note name @code{r}.
594 Durations longer than a whole rest use the predefined
597 @c \time 16/1 is used to avoid spurious bar lines
598 @c and long tracts of empty measures
599 @lilypond[fragment,quote,verbatim]
601 % These two lines are just to prettify this example
603 \override Staff.TimeSignature #'stencil = ##f
604 % Print a maxima rest, equal to four breves
606 % Print a longa rest, equal to two breves
610 r1 r2 r4 r8 r16 r32 r64 r128
614 @cindex rest, multi-measure
615 @cindex rest, whole-measure
617 Whole measure rests, centered in the middle of the measure, must be
618 entered as multi-measure rests. They can be used for a single
619 measure as well as many measures and are discussed in @ref{Full
622 @cindex rest, specifying vertical position
624 To explicitly specify a rest's vertical position, write a note
625 followed by @code{\rest}. A rest of the duration of the note will
626 be placed at the staff position where the note would appear. This
627 allows for precise manual formatting of polyphonic music, since the
628 automatic rest collision formatter will not move these rests.
630 @lilypond[quote,verbatim,relative=2]
636 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
647 @ref{Full measure rests}.
658 @c Deliberately duplicated in Durations and Rests. -gp
659 There is no fundamental limit to rest durations (both in terms of
660 longest and shortest), but the number of glyphs is limited: there
661 are rests from 128th to maxima (8 x whole).
664 @node Invisible rests
665 @unnumberedsubsubsec Invisible rests
668 @cindex invisible rest
669 @cindex rest, invisible
677 An invisible rest (also called a @q{spacer rest}) can be entered
678 like a note with the note name@tie{}@code{s}:
680 @lilypond[verbatim,quote,relative=2]
687 Spacer rests are available only in note mode and chord mode. In
688 other situations, for example, when entering lyrics, @code{\skip}
689 is used to skip a musical moment. @code{\skip} requires an
692 @lilypond[quote,verbatim,relative=2]
705 A spacer rest implicitly causes @code{Staff} and @code{Voice}
706 contexts to be created if none exist, just like notes and rests
709 @lilypond[quote,verbatim,fragment]
713 @code{\skip} simply skips musical time; it creates no output of
716 @lilypond[quote,verbatim,fragment]
717 % This is valid input, but does nothing
718 \skip 1 \skip1 \skip 1
724 @rlearning{Visibility and color of objects}.
728 @ref{Visibility of objects}.
734 @rinternals{SkipMusic}.
737 @node Full measure rests
738 @unnumberedsubsubsec Full measure rests
740 @cindex multi-measure rests
741 @cindex full-measure rests
742 @cindex rest, multi-measure
743 @cindex rest, full-measure
744 @cindex whole rest for a full measure
745 @cindex rest, whole for a full measure
749 Rests for one or more full measures are entered like notes with
750 the note name uppercase @code{R}:
752 @lilypond[quote,verbatim,relative=2]
753 % Rest measures contracted to single measure
754 \compressFullBarRests
761 The duration of full-measure rests is identical to the duration
762 notation used for notes. The duration in a multi-measure rest must
763 always be an integral number of measure-lengths, so augmentation dots
764 or fractions must often be used:
766 @lilypond[quote,fragment,verbatim]
767 \compressFullBarRests
773 R1*13/8 | R1*13/8*12 |
778 A full-measure rest is printed as either a whole or breve rest,
779 centered in the measure, depending on the time signature.
781 @lilypond[quote,verbatim,fragment]
790 @cindex multi-measure rest, expanding
791 @cindex multi-measure rest, contracting
793 @funindex \expandFullBarRests
794 @funindex expandFullBarRests
795 @funindex \compressFullBarRests
796 @funindex compressFullBarRests
798 By default a multi-measure rest is expanded in the printed score to
799 show all the rest measures explicitly. Alternatively, a multi-measure
800 rest can be shown as a single measure containing a multi-measure rest
801 symbol, with the number of measures of rest printed above the measure:
803 @lilypond[quote,fragment,verbatim]
805 \time 3/4 r2. | R2.*2 |
808 % Rest measures contracted to single measure
809 \compressFullBarRests
811 % Rest measures expanded
818 @cindex text on multi-measure rest
819 @cindex multi-measure rest, attaching text
820 @cindex script on multi-measure rest
821 @cindex multi-measure rest, script
822 @cindex fermata on multi-measure rest
823 @cindex multi-measure rest, attaching fermata
824 @cindex markup on multi-measure rest
825 @cindex multi-measure rest with markup
827 @funindex \fermataMarkup
828 @funindex fermataMarkup
829 @funindex MultiMeasureRestText
831 Markups can be added to multi-measure rests.
832 The predefined command @code{\fermataMarkup}
833 is provided for adding fermatas.
835 @lilypond[quote,verbatim,fragment]
836 \compressFullBarRests
838 R2.*10^\markup { \italic "ad lib." }
843 Markups attached to a multi-measure rest are
844 objects of type @code{MultiMeasureRestText}, not
845 @code{TextScript}. Overrides must be directed to the correct
846 object, or they will be ignored. See the following example.
849 @lilypond[quote,verbatim,fragment]
850 % This fails, as the wrong object name is specified
851 \override TextScript #'padding = #5
853 % This is correct and works
854 \override MultiMeasureRestText #'padding = #5
858 When a multi-measure rest immediately follows a @code{\partial}
859 setting, resulting bar-check warnings may not be displayed.
862 @funindex \textLengthOn
863 @funindex textLengthOn
864 @funindex \textLengthOff
865 @funindex textLenthOff
866 @funindex \fermataMarkup
867 @funindex fermataMarkup
868 @funindex \compressFullBarRests
869 @funindex compressFullBarRests
870 @funindex \expandFullBarRests
871 @funindex expandFullBarRests
874 @code{\textLengthOn},
875 @code{\textLengthOff},
876 @code{\fermataMarkup},
877 @code{\compressFullBarRests},
878 @code{\expandFullBarRests}.
886 @cindex kirchenpausen
888 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
889 {changing-form-of-multi-measure-rests.ly}
891 @cindex multi-measure rests, positioning
892 @cindex positioning multi-measure rests
894 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
895 {positioning-multi-measure-rests.ly}
897 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
898 {multi-measure-rest-markup.ly}
903 @rglos{multi-measure rest}.
908 @ref{Formatting text},
915 @rinternals{MultiMeasureRest},
916 @rinternals{MultiMeasureRestNumber},
917 @rinternals{MultiMeasureRestText}.
920 @cindex fingerings and multi-measure rests
921 @cindex multi-measure rests and fingerings
925 If an attempt is made to use fingerings (e.g.,
926 @code{R1*10-4}) to put numbers over multi-measure rests, the
927 fingering numeral (4) may collide with the bar counter
930 @cindex condensing rests
931 @cindex rest, condensing ordinary
933 There is no way to automatically condense multiple ordinary rests
934 into a single multi-measure rest.
936 @cindex rest, collisions of
938 Multi-measure rests do not take part in rest collisions.
940 @node Displaying rhythms
941 @subsection Displaying rhythms
947 * Polymetric notation::
948 * Automatic note splitting::
949 * Showing melody rhythms::
953 @unnumberedsubsubsec Time signature
955 @cindex time signature
961 The time signature is set as follows:
963 @lilypond[quote,verbatim,relative=2]
968 @cindex time signature, visibility of
970 Time signatures are printed at the beginning of a piece
971 and whenever the time signature changes. If a change takes place
972 at the end of a line a warning time signature sign is printed
973 there. This default behavior may be changed, see
974 @ref{Visibility of objects}.
976 @lilypond[quote,verbatim,relative=2]
986 @cindex time signature style
989 @funindex \numericTimeSignature
990 @funindex numericTimeSignature
991 @funindex \defaultTimeSignature
992 @funindex defaultTimeSignature
994 The time signature symbol that is used in 2/2 and 4/4 time can be
995 changed to a numeric style:
997 @lilypond[quote,verbatim,relative=2]
1001 % Change to numeric style
1002 \numericTimeSignature
1005 % Revert to default style
1006 \defaultTimeSignature
1012 Mensural time signatures are covered in
1013 @ref{Mensural time signatures}.
1017 @code{\numericTimeSignature},
1018 @code{\defaultTimeSignature}.
1024 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1025 {changing-the-time-signature-without-affecting-the-beaming.ly}
1027 @cindex compound time signatures
1028 @cindex time signature, compound
1030 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1031 {compound-time-signatures.ly}
1033 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
1034 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1039 @rglos{time signature}
1042 @ref{Mensural time signatures},
1043 @ref{Time administration}.
1048 Internals Reference:
1049 @rinternals{TimeSignature},
1050 @rinternals{Timing_translator}.
1054 @unnumberedsubsubsec Upbeats
1058 @cindex partial measure
1059 @cindex measure, partial
1060 @cindex pickup measure
1061 @cindex measure, change length
1063 @funindex measurePosition
1067 Partial or pick-up measures, such as an anacrusis or upbeat, are
1068 entered using the @code{\partial} command, with the syntax
1071 \partial @var{duration}
1075 where @code{duration} is the rhythmic length of the interval
1076 before the start of the first complete measure:
1078 @lilypond[quote,verbatim,relative=2]
1083 The partial measure can be any duration less than a full measure:
1085 @lilypond[quote,verbatim,relative=2]
1086 \partial 8*3 c8 d e |
1090 Internally, @code{\partial} is translated into
1093 \set Timing.measurePosition = -@var{duration}
1097 The property @code{measurePosition} contains a rational number
1098 indicating how much of the measure has passed at this point. Note
1099 that this is set to a negative number by the @code{\partial}
1100 command: i.e., @code{\partial 4} is internally translated to
1101 @code{-4}, meaning @qq{there is a quarter note left in the measure.}
1115 @rinternals{Timing_translator}.
1120 The @code{\partial} command is intended to be used only at the
1121 beginning of a piece. If you use it after the beginning, some
1122 odd warnings may occur.
1124 @node Unmetered music
1125 @unnumberedsubsubsec Unmetered music
1127 @cindex bar lines, turning off
1128 @cindex bar numbering, turning off
1130 @cindex unmetered music
1132 @funindex \cadenzaOn
1134 @funindex \cadenzaOff
1135 @funindex cadenzaOff
1137 Bar lines and bar numbers are calculated automatically. For
1138 unmetered music (some cadenzas, for example), this is not desirable.
1139 To turn off automatic calculation of bar lines and bar numbers,
1140 use the command @code{\cadenzaOn}, and use @code{\cadenzaOff}
1141 to turn them on again.
1143 @lilypond[verbatim,relative=2,fragment]
1152 Bar numbering is resumed at the end of the cadenza as if the
1153 cadenza were not there:
1155 @lilypond[verbatim,relative=2,fragment]
1156 % Show all bar numbers
1157 \override Score.BarNumber #'break-visibility = #all-visible
1166 Note that these predefined commands affect all staves in the
1167 score, even when they are placed in just one @code{Voice}
1168 context. To change this, move the @code{Timing_translator}
1169 from the @code{Score} context to the @code{Staff} context, as
1170 shown in @ref{Polymetric notation}.
1183 @ref{Visibility of objects},
1184 @ref{Polymetric notation}.
1190 @cindex cadenza line breaks
1191 @cindex cadenza page breaks
1192 @cindex unmetered music, line breaks
1193 @cindex unmetered music, page breaks
1194 @cindex breaks in unmetered music
1195 @cindex line breaks in cadenzas
1196 @cindex page breaks in cadenzas
1197 @cindex line breaks in unmetered music
1198 @cindex page breaks in unmetered music
1202 LilyPond will insert line breaks and page breaks only at a
1203 bar line. Unless the unmetered music ends before the end of the
1204 staff line, you will need to insert invisible bar lines with
1211 to indicate where breaks can occur.
1213 You must explicitly create a @code{Voice} context when starting a
1214 piece with @code{\cadenzaOn}, otherwise strange errors may occur.
1216 @lilypond[verbatim,relative=2,fragment]
1217 \new Voice \relative c'{
1219 c16^"Solo Free Time" d e f g2. \bar "||"
1225 @node Polymetric notation
1226 @unnumberedsubsubsec Polymetric notation
1228 @c This section necessarily uses \set
1229 @c This is acceptable -td
1231 @cindex double time signatures
1232 @cindex signatures, polymetric
1233 @cindex time signatures, polymetric
1234 @cindex time signatures, double
1235 @cindex polymetric signatures
1236 @cindex meter, polymetric
1238 @funindex timeSignatureFraction
1239 @funindex \scaleDurations
1240 @funindex scaleDurations
1244 Polymetric notation is supported, either explicitly or by modifying
1245 the visible time signature symbol and scaling the note durations.
1247 @strong{@i{Staves with different time signatures, equal measure lengths}}
1249 This notation can be created by setting a common time signature
1250 for each staff but replacing the symbol manually by setting
1251 @code{timeSignatureFraction} to the desired fraction and scaling
1252 the printed durations in each staff to the common time
1253 signature; see @ref{Time signature}. The scaling is done with
1254 @code{\scaleDurations}, which is used in a similar way to
1255 @code{\times}, but does not create a tuplet bracket; see
1256 @ref{Scaling durations}.
1258 @cindex beaming in polymetric music
1259 @cindex beaming in polymetric meter
1261 In this example, music with the time signatures of 3/4, 9/8, and
1262 10/8 are used in parallel. In the second staff, shown durations
1263 are multiplied by 2/3, as 2/3 * 9/8 = 3/4, and in the third
1264 staff, shown durations are multiplied by 3/5, as 3/5 * 10/8 = 3/4.
1265 It will often be necessary to insert beams manually, as the
1266 duration scaling affects the autobeaming rules.
1268 @lilypond[quote,verbatim,fragment]
1277 \set Staff.timeSignatureFraction = #'(9 . 8)
1278 \scaleDurations #'(2 . 3)
1279 \repeat unfold 6 { c8[ c c] }
1283 \set Staff.timeSignatureFraction = #'(10 . 8)
1284 \scaleDurations #'(3 . 5) {
1285 \repeat unfold 2 { c8[ c c] }
1286 \repeat unfold 2 { c8[ c] } |
1287 c4. c4. \times 2/3 { c8[ c c] } c4
1293 @strong{@i{Staves with different time signatures, unequal bar lengths}}
1295 Each staff can be given its own independent time signature by
1296 moving the @code{Timing_translator} and the
1297 @code{Default_bar_line_engraver} to the @code{Staff} context.
1299 @lilypond[quote,verbatim]
1303 \remove "Timing_translator"
1304 \remove "Default_bar_line_engraver"
1308 \consists "Timing_translator"
1309 \consists "Default_bar_line_engraver"
1313 % Now each staff has its own time signature.
1339 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1340 {compound-time-signatures.ly}
1346 @rglos{polymetric time signature},
1350 @ref{Time signature},
1351 @ref{Scaling durations}.
1356 Internals Reference:
1357 @rinternals{TimeSignature},
1358 @rinternals{Timing_translator},
1359 @rinternals{Default_bar_line_engraver},
1365 When using different time signatures in parallel, notes
1366 at the same moment will be be placed at the same horizontal
1367 location. However, the bar lines in the different staves
1368 will cause the note spacing to be less regular in each of the
1369 individual staves than would be normal without the different
1372 @node Automatic note splitting
1373 @unnumberedsubsubsec Automatic note splitting
1375 @cindex notes, splitting
1376 @cindex splitting notes
1378 @funindex Note_heads_engraver
1379 @funindex Completion_heads_engraver
1381 Long notes which overrun bar lines can be converted automatically
1382 to tied notes. This is done by replacing the
1383 @code{Note_heads_engraver} with the
1384 @code{Completion_heads_engraver}. In the following
1385 example, notes crossing the bar lines are split and tied.
1387 @lilypond[quote,verbatim,relative=1]
1389 \remove "Note_heads_engraver"
1390 \consists "Completion_heads_engraver"
1393 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 }
1396 This engraver splits all running notes at the bar line, and
1397 inserts ties. One of its uses is to debug complex scores: if the
1398 measures are not entirely filled, then the ties show exactly how
1399 much each measure is off.
1407 @rlearning{Engravers explained},
1408 @rlearning{Adding and removing engravers}.
1413 Internals Reference:
1414 @rinternals{Note_heads_engraver},
1415 @rinternals{Completion_heads_engraver},
1416 @rinternals{Forbid_line_break_engraver}.
1421 Not all durations (especially those containing tuplets) can be
1422 represented exactly with normal notes and dots, but the
1423 @code{Completion_heads_engraver} will not insert tuplets.
1425 The @code{Completion_heads_engraver} only affects notes; it does not
1429 @node Showing melody rhythms
1430 @unnumberedsubsubsec Showing melody rhythms
1432 @cindex melody rhythms, showing
1433 @cindex rhythms, showing melody
1435 Sometimes you might want to show only the rhythm of a melody. This
1436 can be done with the rhythmic staff. All pitches of notes on such a
1437 staff are squashed, and the staff itself has a single line
1439 @lilypond[quote,relative=1,verbatim]
1441 \new RhythmicStaff {
1442 \new Voice = "myRhythm" {
1450 \lyricsto "myRhythm" {
1458 @cindex guitar chord charts
1459 @cindex strumming rhythms, showing
1460 @cindex guitar strumming rhythms, showing
1462 @funindex Pitch_squash_engraver
1463 @funindex \improvisationOn
1464 @funindex improvisationOn
1465 @funindex \improvisationOff
1466 @funindex improvisationOff
1468 Guitar chord charts often show the strumming rhythms. This can
1469 be done with the @code{Pitch_squash_engraver} and
1470 @code{\improvisationOn}.
1473 @lilypond[quote,verbatim]
1482 \consists Pitch_squash_engraver
1495 @code{\improvisationOn},
1496 @code{\improvisationOff}.
1502 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1503 {guitar-strum-rhythms.ly}
1510 Internals Reference:
1511 @rinternals{RhythmicStaff},
1512 @rinternals{Pitch_squash_engraver}.
1520 * Setting automatic beam behavior::
1525 @node Automatic beams
1526 @unnumberedsubsubsec Automatic beams
1528 By default, beams are inserted automatically:
1530 @cindex beams, manual
1531 @cindex manual beams
1532 @cindex beams, setting rules for
1533 @cindex beams, custom rules for
1535 @funindex \autoBeamOn
1536 @funindex autoBeamOn
1537 @funindex \autoBeamOff
1538 @funindex autoBeamOff
1540 @lilypond[quote,verbatim,relative=2]
1542 \time 6/8 c c c c8. c16 c8
1545 If these automatic decisions are not satisfactory, beaming can be
1546 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1547 entered manually if beams are to be extended over rests.
1549 If automatic beaming is not required, it may be turned off with
1550 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1552 @lilypond[quote,relative=1,verbatim]
1553 c4 c8 c8. c16 c8. c16 c8
1560 @cindex melismata, beams
1561 @cindex beams and melismata
1563 @warning{If beams are used to indicate melismata in songs, then
1564 automatic beaming should be switched off with @code{\autoBeamOff}
1565 and the beams indicated manually.}
1567 Beaming patterns that differ from the automatic defaults can be
1568 created; see @ref{Setting automatic beam behavior}.
1572 @code{\autoBeamOff},
1579 @cindex line breaks and beams
1580 @cindex beams and line breaks
1584 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1585 {beams-across-line-breaks.ly}
1587 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1588 {changing-beam-knee-gap.ly}
1594 @ref{Setting automatic beam behavior}.
1597 @file{scm/@/auto@/-beam@/.scm}.
1602 Internals Reference:
1603 @rinternals{Auto_beam_engraver},
1604 @rinternals{Beam_engraver},
1606 @rinternals{BeamEvent},
1607 @rinternals{BeamForbidEvent},
1608 @rinternals{beam-interface},
1609 @rinternals{unbreakable-spanner-interface}.
1614 Beams can collide with note heads and accidentals in other voices.
1617 @node Setting automatic beam behavior
1618 @unnumberedsubsubsec Setting automatic beam behavior
1621 @cindex automatic beams, tuning
1622 @cindex tuning automatic beaming
1623 @cindex automatic beam generation
1625 @cindex lyrics and beaming
1627 @funindex autoBeaming
1628 @funindex beamSettings
1629 @funindex measureLength
1630 @funindex beatLength
1636 The placement of automatic beams is determined by the time signature.
1637 Three types of rules are used for determining the end of automatic
1638 beams: @emph{default} rules
1639 for the time signature, @emph{explicit} rules for the beam in the time
1640 signature, and the @emph{beatLength} for the time signature.
1642 The following rules, in order of priority, apply when determining
1643 the appearance of beams:
1647 If a manual beam is specified with @code{[..]} set the beam
1648 as specified, otherwise
1651 if @code{\autoBeamOff} is in force do not beam, otherwise
1654 if an explicit beam-ending rule is defined for the beam type
1655 in the time signature, use it to determine the valid
1656 places where beams may end, otherwise
1659 if a default beam-ending rule is defined in the time signature,
1660 use it to group notes with beams, otherwise
1663 use the value of @code{beatLength} to group notes with beams
1667 @i{@strong{Modifying the grouping of beats}}
1669 By default @code{beatLength} is
1670 derived from the time signature set by the @code{\time} command.
1671 The @code{beatLength} is set to be one over the denominator
1672 of the time signature.
1674 @code{beatLength} is a @i{moment},
1675 a unit of musical duration. A quantity of type @i{moment} is
1676 created by the scheme function @code{ly:make-moment}. For more
1677 information about this function, see @ref{Time administration}.
1679 Autobeam and beam subdivide settings are stored in the
1680 @code{beamSettings} property. Default values of @code{beamSettings}
1681 are determined in @file{scm/@/beam@/-settings@/.scm}. Entries in
1682 @code{beamSettings} are indexed by time signature and
1685 Time signature should be a scheme pair , e.g. @code{#'(4 . 4)}.
1687 Rule type should be @code{#'end} for beam ending and @code{#'subdivide} for
1690 The ending and subdivision rules consist of a scheme alist
1691 (or list of pairs) that
1692 indicates the beam type and the grouping to be applied to that
1696 #'((beam-type1 . grouping-1)
1697 (beam-type2 . grouping-2)
1698 (beam-type3 . grouping-3))
1701 Beam type is either a scheme pair indicating the duration
1702 of the beam, e.g. @code{(1 . 16)}, or @code{*} to indicate a
1703 default rule, which applies to all beams if no explicit rule is
1706 Grouping is a scheme list indicating the grouping to be applied to
1707 the beam. For default rules (where beam type is
1708 @code{*}, the grouping is in units of @code{beatLength}.
1709 For explicit rules, the grouping is in units of the beam type.
1711 For reference, the default beaming rules are found in
1712 @file{scm/beam-settings.scm}.
1714 Beam settings are changed with
1715 @code{\overrideBeamSettings} and @code{\revertBeamSettings}.
1718 The ending and subdivision settings must be
1719 @emph{complete} rules. That is, every rule that should apply to
1720 the current time signature must be included in the setting.
1721 It is not possible to change the grouping of only one beam type
1722 for a given time signature. While this may seem cumbersome,
1723 it means that the current beaming settings need not be known
1724 in order to specify a new beaming pattern.}
1726 @lilypond[quote,relative=2,verbatim]
1729 \overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (2 3)))
1731 \overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (3 2)))
1735 Beam setting changes can be limited to specific contexts. If no
1736 setting is included in a lower-level context, the setting of the
1737 enclosing context will apply.
1739 @lilypond[quote, verbatim,relative=1]
1744 \overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (2 3 2)))
1751 \overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (1 3 3)))
1758 When multiple voices are used the @code{Staff} context must be
1759 specified if the beaming is to be applied to all voices in the
1762 @lilypond[quote,verbatim,relative=2]
1765 % Context Voice specified -- does not work correctly
1766 % Because of autogenerated voices, all beating will
1767 % be at beatLength (1 . 8)
1768 \overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (3 1 1 2)))
1769 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
1771 % Works correctly with context Staff specified
1772 \overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (3 1 1 2)))
1773 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
1776 @funindex revertBeamSettings
1778 Beam settings can be reverted to get back to default behavior. This
1779 is accomplished by using @code{\revertBeamSettings}. The arguments
1780 are the same as for @code{\overrideBeamSettings}, except no value
1781 for @var{grouping} is given:
1784 \revertBeamSettings context time-signature rule-type
1788 @lilypond[quote,verbatim,relative=2]
1790 \repeat unfold 8 {a8}
1791 % set default rule for (1 1 1 1) grouping
1792 \overrideBeamSettings #'Score #'(4 . 4) #'end #'((* . (1 1 1 1)))
1793 \repeat unfold 8 {a8}
1794 % revert the new rule
1795 \revertBeamSettings #'Score #'(4 . 4) #'end
1796 \repeat unfold 8 {a8}
1801 @code{\overrideBeamSettings},
1802 @code{\revertBeamSettings}.
1808 @cindex beams, subdividing
1810 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1811 {sub-dividing-beams.ly}
1813 @cindex measure groupings
1814 @cindex beats, grouping
1815 @cindex grouping beats
1816 @cindex measure sub-grouping
1818 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1819 {conducting-signs,-measure-grouping-signs.ly}
1821 @cindex beam, last in score
1822 @cindex beam, last in polyphonic voice
1824 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1825 {beam-endings-in-score-context.ly}
1830 @file{scm/beam-settings.scm}.
1835 Internals Reference:
1836 @rinternals{Auto_beam_engraver},
1838 @rinternals{BeamForbidEvent},
1839 @rinternals{beam-interface}.
1844 If a score ends while an automatic beam has not been ended and is
1845 still accepting notes, this last beam will not be typeset at all.
1846 The same holds for polyphonic voices, entered with @code{<<
1847 @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
1848 automatic beam is still accepting notes, it is not typeset.
1852 @unnumberedsubsubsec Manual beams
1854 @cindex beams, manual
1855 @cindex manual beams
1860 In some cases it may be necessary to override the automatic
1861 beaming algorithm. For example, the autobeamer will not put beams
1862 over rests or bar lines, and in choral scores the beaming is
1863 often set to follow the meter of the lyrics rather than the
1864 notes. Such beams can be specified manually by
1865 marking the begin and end point with @code{[} and @code{]}.
1867 @lilypond[quote,relative=1,verbatim]
1868 r4 r8[ g' a r8] r8 g[ | a] r8
1871 @cindex manual beams, direction shorthand for
1873 Beaming direction can be set manually using direction indicators:
1875 @lilypond[quote,relative=2,verbatim]
1876 c8^[ d e] c,_[ d e f g]
1882 Individual notes may be marked with @code{\noBeam} to prevent them
1885 @lilypond[quote,verbatim,relative=2]
1890 @funindex stemLeftBeamCount
1891 @funindex stemRightBeamCount
1893 Even more strict manual control with the beams can be achieved by
1894 setting the properties @code{stemLeftBeamCount} and
1895 @code{stemRightBeamCount}. They specify the number of beams to
1896 draw on the left and right side, respectively, of the next note.
1897 If either property is set, its value will be used only once, and
1898 then it is erased. In this example, the last @code{f} is printed
1899 with only one beam on the left side, i.e., the eighth-note beam of
1900 the group as a whole.
1902 @lilypond[quote,relative=2,verbatim]
1905 \set stemLeftBeamCount = #2
1906 \set stemRightBeamCount = #1
1908 \set stemLeftBeamCount = #1
1920 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
1921 {flat-flags-and-beam-nibs.ly}
1926 @ref{Direction and placement}.
1931 Internals Reference:
1933 @rinternals{BeamEvent},
1934 @rinternals{Beam_engraver},
1935 @rinternals{beam-interface},
1936 @rinternals{Stem_engraver}.
1939 @node Feathered beams
1940 @unnumberedsubsubsec Feathered beams
1942 @cindex beams, feathered
1943 @cindex feathered beams
1945 @funindex \featherDurations
1946 @funindex featherDurations
1947 @funindex grow-direction
1949 Feathered beams are used to indicate that a small group of notes
1950 should be played at an increasing (or decreasing) tempo, without
1951 changing the overall tempo of the piece. The extent of the
1952 feathered beam must be indicated manually using @code{[} and
1953 @code{]}, and the beam feathering is turned on by specifying a
1954 direction to the @code{Beam} property @code{grow-direction}.
1956 If the placement of the notes and the sound in the MIDI output is to
1957 reflect the ritardando or accelerando indicated by the feathered beam
1958 the notes must be grouped as a music expression delimited by braces
1959 and preceded by a @code{featherDurations} command which specifies
1960 the ratio between the durations of the first and last notes in the
1963 The square brackets show the extent of the beam and the braces show
1964 which notes are to have their durations modified. Normally these
1965 would delimit the same group of notes, but this is not required: the
1966 two commands are independent.
1968 In the following example the eight 16th notes occupy exactly the
1969 same time as a half note, but the first note is one half as long
1970 as the last one, with the intermediate notes gradually
1971 lengthening. The first four 32nd notes gradually speed up, while
1972 the last four 32nd notes are at a constant tempo.
1974 @lilypond[relative=1,verbatim,quote]
1975 \override Beam #'grow-direction = #LEFT
1976 \featherDurations #(ly:make-moment 2 1)
1977 { c16[ c c c c c c c] }
1978 \override Beam #'grow-direction = #RIGHT
1979 \featherDurations #(ly:make-moment 2 3)
1981 % revert to non-feathered beams
1982 \override Beam #'grow-direction = #'()
1987 The spacing in the printed output represents the
1988 note durations only approximately, but the MIDI output is exact.
1992 @code{\featherDurations}.
2002 The @code{\featherDurations} command only works with very short
2003 music snippets, and when numbers in the fraction are small.
2013 * Bar and bar number checks::
2018 @unnumberedsubsubsec Bar lines
2021 @cindex measure lines
2022 @cindex closing bar lines
2023 @cindex bar lines, closing
2024 @cindex double bar lines
2025 @cindex bar lines, double
2031 Bar lines delimit measures, and are also used to indicate
2032 repeats. Normally, simple bar lines are automatically inserted
2033 into the printed output at places based on the current time
2036 The simple bar lines inserted automatically can be changed to
2037 other types with the @code{\bar} command. For example, a closing
2038 double bar line is usually placed at the end of a piece:
2040 @lilypond[quote,relative=1,verbatim]
2044 It is not invalid if the final note in a measure does not
2045 end on the automatically entered bar line: the note is assumed
2046 to carry over into the next measure. But if a long sequence
2047 of such carry-over measures appears the music can appear compressed
2048 or even flowing off the page. This is because automatic line
2049 breaks happen only at the end of complete measures, i.e., where
2050 all notes end before the end of a measure.
2052 @warning{An incorrect duration can cause line breaks to be
2053 inhibited, leading to a line of highly compressed music or
2054 music which flows off the page.}
2057 @cindex bar lines, invisible
2058 @cindex measure lines, invisible
2060 Line breaks are also permitted at manually inserted bar lines
2061 even within incomplete measures. To allow a line break without
2062 printing a bar line, use the following:
2069 This will insert an invisible bar line and allow (but not
2070 force) a line break to occur at this point. The bar number
2071 counter is not increased. To force a line break see
2072 @ref{Line breaking}.
2074 @cindex manual bar lines
2075 @cindex manual measure lines
2076 @cindex bar lines, manual
2077 @cindex measure lines, manual
2079 This and other special bar lines may be inserted manually at any
2080 point. When they coincide with the end of a measure they replace
2081 the simple bar line which would have been inserted there
2082 automatically. When they do not coincide with the end of a measure
2083 the specified bar line is inserted at that point in the printed
2086 Note that manual bar lines are purely visual. They do not affect
2087 any of the properties that a normal bar line would affect, such as
2088 measure numbers, accidentals, line breaks, etc. They do not affect
2089 the calculation and placement of subsequent automatic bar lines.
2090 When a manual bar line is placed where a normal bar line already
2091 exists, the effects of the original bar line are not altered.
2093 Two types of simple bar lines and five types of double bar lines are
2094 available for manual insertion:
2096 @lilypond[quote,relative=1,verbatim]
2108 together with dotted and dashed bar lines:
2110 @lilypond[quote,relative=1,verbatim]
2117 and five types of repeat bar line:
2119 @lilypond[quote,relative=1,verbatim]
2128 Additionally, a bar line can be printed as a simple tick:
2129 @lilypond[quote,relative=1,verbatim]
2132 However, as such ticks are typically used in Gregorian chant, it is
2133 preferable to use @code{\divisioMinima} there instead, described in
2134 the section @ref{Divisiones} in Gregorian chant.
2139 Although the bar line types signifying repeats may be inserted
2140 manually they do not in themselves cause LilyPond to recognize
2141 a repeated section. Such repeated sections are better entered
2142 using the various repeat commands (see @ref{Repeats}), which
2143 automatically print the appropriate bar lines.
2145 In addition, you can specify @code{"||:"}, which is equivalent to
2146 @code{"|:"} except at line breaks, where it gives a double bar
2147 line at the end of the line and a start repeat at the beginning of
2150 @lilypond[quote,relative=2,verbatim]
2158 In scores with many staves, a @code{\bar} command in one staff is
2159 automatically applied to all staves. The resulting bar lines are
2160 connected between different staves of a @code{StaffGroup},
2161 @code{PianoStaff}, or @code{GrandStaff}.
2163 @lilypond[quote,relative=1,verbatim]
2171 \new Staff { \clef bass c4 g e g }
2173 \new Staff { \clef bass c2 c2 }
2178 @cindex default bar lines, changing
2179 @cindex bar lines, default, changing
2184 @funindex defaultBarType
2189 The command @code{\bar }@var{bartype} is a shortcut for
2190 @code{\set Timing.whichBar = }@var{bartype}. A bar line is
2191 created whenever the @code{whichBar} property is set.
2193 The default bar type used for automatically inserted bar lines is
2194 @code{"|"}. This may be changed at any time
2195 with @code{\set Timing.defaultBarType = }@var{bartype}.
2200 @ref{Line breaking},
2202 @ref{Grouping staves}.
2207 Internals Reference:
2208 @rinternals{BarLine} (created at @code{Staff} level),
2209 @rinternals{SpanBar} (across staves),
2210 @rinternals{Timing_translator} (for Timing properties).
2214 @unnumberedsubsubsec Bar numbers
2217 @cindex measure numbers
2218 @cindex numbers, bar
2219 @cindex numbers, measure
2221 @funindex currentBarNumber
2223 Bar numbers are typeset by default at the start of every line except
2224 the first line. The number itself is stored in the
2225 @code{currentBarNumber} property, which is normally updated
2226 automatically for every measure. It may also be set manually:
2228 @lilypond[verbatim,quote,relative=1]
2231 \set Score.currentBarNumber = #50
2235 @cindex bar numbers, regular spacing
2237 @funindex barNumberVisibility
2240 Bar numbers can be typeset at regular intervals instead of just at
2241 the beginning of every line. To do this the default behavior
2242 must be overridden to permit bar numbers to be printed at places
2243 other than the start of a line. This is controlled by the
2244 @code{break-visibility} property of @code{BarNumber}. This takes
2245 three values which may be set to @code{#t} or @code{#f} to specify
2246 whether the corresponding bar number is visible or not. The order
2247 of the three values is @code{end of line visible}, @code{middle of
2248 line visible}, @code{beginning of line visible}. In the following
2249 example bar numbers are printed at all possible places:
2251 @lilypond[verbatim,quote,relative=1]
2252 \override Score.BarNumber #'break-visibility = #'#(#t #t #t)
2253 \set Score.currentBarNumber = #11
2254 % Permit first bar number to be printed
2264 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2265 {printing-the-bar-number-for-the-first-measure.ly}
2267 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2268 {printing-bar-numbers-at-regular-intervals.ly}
2270 @cindex measure number, format
2271 @cindex bar number, format
2273 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2274 {printing-bar-numbers-inside-boxes-or-circles.ly}
2276 @cindex bar number alignment
2278 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2279 {aligning-bar-numbers.ly}
2281 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
2282 {removing-bar-numbers-from-a-score.ly}
2289 Internals Reference:
2290 @rinternals{BarNumber},
2291 @rinternals{Bar_number_engraver}.
2294 @cindex bar number collision
2295 @cindex collision, bar number
2299 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
2300 if there is one. To solve this, the @code{padding} property of
2301 @code{BarNumber} can be used to position the number correctly. See
2302 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
2305 @node Bar and bar number checks
2306 @unnumberedsubsubsec Bar and bar number checks
2309 @cindex bar number check
2310 @cindex measure check
2311 @cindex measure number check
2313 @funindex barCheckSynchronize
2316 Bar checks help detect errors in the entered durations. A bar check
2317 may be entered using the bar symbol, @code{|}, at any place where a
2318 bar line is expected to fall. If bar check lines are encountered at
2319 other places, a list of warnings is printed in the log file, showing
2320 the line numbers and lines in which the bar checks failed. In the
2321 next example, the second bar check will signal an error.
2324 \time 3/4 c2 e4 | g2 |
2327 Bar checks can also be used in lyrics:
2332 Twin -- kle | Twin -- kle |
2336 An incorrect duration can result in a completely garbled score,
2337 especially if the score is polyphonic, so a good place to start
2338 correcting input is by scanning for failed bar checks and
2339 incorrect durations.
2341 If successive bar checks are off by the same musical interval,
2342 only the first warning message is displayed. This allows the
2343 warning to focus on the source of the timing error.
2347 @funindex pipeSymbol
2349 It is also possible to redefine the action taken when a bar check
2350 or pipe symbol, @code{|}, is encountered in the input, so that
2351 it does something other than a bar check. This is done by
2352 assigning a music expression to @code{pipeSymbol}.
2353 In the following example @code{|} is set to insert a double bar
2354 line wherever it appears in the input, rather than checking
2357 @lilypond[quote,verbatim]
2358 pipeSymbol = \bar "||"
2367 @funindex \barNumberCheck
2368 @funindex barNumberCheck
2370 When copying large pieces of music, it can be helpful to check that
2371 the LilyPond bar number corresponds to the original that you are
2372 entering from. This can be checked with @code{\barNumberCheck}, for
2376 \barNumberCheck #123
2380 will print a warning if the @code{currentBarNumber} is not 123
2381 when it is processed.
2389 @node Rehearsal marks
2390 @unnumberedsubsubsec Rehearsal marks
2392 @cindex rehearsal marks
2393 @cindex mark, rehearsal
2398 To print a rehearsal mark, use the @code{\mark} command.
2400 @lilypond[quote,verbatim,relative=2]
2409 The letter@tie{}@q{I} is skipped in accordance with engraving
2410 traditions. If you wish to include the letter @q{I}, then use
2413 \set Score.markFormatter = #format-mark-alphabet
2416 The mark is incremented automatically if you use @code{\mark
2417 \default}, but you can also use an integer argument to set the
2418 mark manually. The value to use is stored in the property
2419 @code{rehearsalMark}.
2421 @cindex rehearsal mark format
2422 @cindex rehearsal mark style
2423 @cindex style, rehearsal mark
2424 @cindex format, rehearsal mark
2425 @cindex mark, rehearsal, style
2426 @cindex mark, rehearsal, format
2427 @cindex rehearsal mark, manual
2428 @cindex mark, rehearsal, manual
2429 @cindex custom rehearsal mark
2430 @cindex manual rehearsal mark
2432 The style is defined by the property @code{markFormatter}. It is
2433 a function taking the current mark (an integer) and the current
2434 context as argument. It should return a markup object. In the
2435 following example, @code{markFormatter} is set to a pre-defined
2436 procedure. After a few measures, it is set to a procedure that
2437 produces a boxed number.
2439 @lilypond[quote,verbatim,relative=2]
2440 \set Score.markFormatter = #format-mark-numbers
2443 \set Score.markFormatter = #format-mark-box-numbers
2445 \set Score.markFormatter = #format-mark-circle-numbers
2447 \set Score.markFormatter = #format-mark-circle-letters
2451 The file @file{scm/@/translation@/-functions@/.scm} contains the
2452 definitions of @code{format-mark-numbers} (the default format),
2453 @code{format-mark-box-numbers}, @code{format-mark-letters} and
2454 @code{format-mark-box-letters}. These can be used as inspiration
2455 for other formatting functions.
2457 You may use @code{format-mark-barnumbers},
2458 @code{format-mark-box-barnumbers}, and
2459 @code{format-mark-circle-barnumbers} to get bar numbers instead of
2460 incremented numbers or letters.
2462 Other styles of rehearsal mark can be specified manually:
2469 Note that @code{Score.markFormatter} does not affect marks specified
2470 in this manner. However, it is possible to apply a @code{\markup} to the
2474 \mark \markup@{ \box A1 @}
2479 @cindex D.S. al Fine
2481 @cindex music glyphs
2482 @cindex glyphs, music
2484 @funindex \musicglyph
2485 @funindex musicglyph
2487 Music glyphs (such as the segno sign) may be printed inside a
2490 @lilypond[quote,verbatim,relative=1]
2491 c1 \mark \markup { \musicglyph #"scripts.segno" }
2492 c1 \mark \markup { \musicglyph #"scripts.coda" }
2493 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
2498 See @ref{The Feta font}, for a list of symbols which may be
2499 printed with @code{\musicglyph}.
2501 For common tweaks to the positioning of rehearsal marks, see
2502 @ref{Formatting text}.
2507 @ref{The Feta font},
2508 @ref{Formatting text}.
2511 @file{scm/@/translation@/-functions@/.scm} contains
2512 the definitions of @code{format-mark-numbers} and
2513 @code{format-mark-letters}. They can be used as inspiration for
2514 other formatting functions.
2519 Internals Reference:
2520 @rinternals{MarkEvent},
2521 @rinternals{Mark_engraver},
2522 @rinternals{RehearsalMark}.
2525 @node Special rhythmic concerns
2526 @subsection Special rhythmic concerns
2531 * Aligning to cadenzas::
2532 * Time administration::
2536 @unnumberedsubsubsec Grace notes
2540 @cindex appoggiatura
2541 @cindex acciaccatura
2546 Grace notes are ornaments that are written out. Grace notes
2547 are printed in a smaller font and take up no logical time
2550 @lilypond[quote,relative=2,verbatim]
2552 \grace { c16[ d16] } c2
2555 LilyPond also supports two special types of grace notes, the
2556 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
2557 small note with a slashed stem -- and the @emph{appoggiatura}, which
2558 takes a fixed fraction of the main note and appears in small print
2561 @lilypond[quote,relative=2,verbatim]
2565 \acciaccatura { g16[ f] } e4
2568 The placement of grace notes is synchronized between different
2569 staves. In the following example, there are two sixteenth grace
2570 notes for every eighth grace note
2572 @lilypond[quote,relative=2,verbatim]
2574 \new Staff { e2 \grace { c16[ d e f] } e2 }
2575 \new Staff { c2 \grace { g8[ b] } c2 }
2579 @cindex grace notes, following
2581 @funindex \afterGrace
2582 @funindex afterGrace
2584 If you want to end a note with a grace, use the @code{\afterGrace}
2585 command. It takes two arguments: the main note, and the grace
2586 notes following the main note.
2588 @lilypond[quote,verbatim,relative=2]
2589 c1 \afterGrace d1 { c16[ d] } c1
2592 This will put the grace notes after a space lasting 3/4 of the
2593 length of the main note. The default fraction 3/4 can be changed by
2594 setting @code{afterGraceFraction}. The following example shows
2595 the results from setting the space at the default, at 15/16, and
2596 finally at 1/2 of the main note.
2598 @lilypond[quote,verbatim,relative=2]
2601 c1 \afterGrace d1 { c16[ d] } c1
2604 #(define afterGraceFraction (cons 15 16))
2605 c1 \afterGrace d1 { c16[ d] } c1
2608 #(define afterGraceFraction (cons 1 2))
2609 c1 \afterGrace d1 { c16[ d] } c1
2614 The space between the main note and the grace note may also be
2615 specified using spacers. The following example places the grace
2616 note after a space lasting 7/8 of the main note.
2618 @lilypond[quote,verbatim,relative=2]
2622 { s2 s4. \grace { c16[ d] } }
2628 @cindex tweaking grace notes
2629 @cindex grace notes, tweaking
2630 @cindex grace notes, changing layout settings
2632 A @code{\grace} music expression will introduce special
2633 typesetting settings, for example, to produce smaller type, and
2634 set directions. Hence, when introducing layout tweaks to
2635 override the special settings, they should be placed inside
2636 the grace expression. The overrides should also be reverted
2637 inside the grace expression. Here, the grace note's default stem
2638 direction is overridden and then reverted.
2640 @lilypond[quote,verbatim,relative=2]
2652 @cindex stem, with slash
2657 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2658 {using-grace-note-slashes-with-normal-heads.ly}
2660 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2661 {tweaking-grace-layout-within-music.ly}
2663 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2664 {redefining-grace-note-global-defaults.ly}
2666 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
2667 {positioning-grace-notes-with-floating-space.ly}
2672 @rglos{grace notes},
2673 @rglos{acciaccatura},
2674 @rglos{appoggiatura}.
2677 @file{ly/@/grace@/-init@/.ly}.
2682 Internals Reference:
2683 @rinternals{GraceMusic},
2684 @rinternals{Grace_beam_engraver},
2685 @rinternals{Grace_engraver},
2686 @rinternals{Grace_spacing_engraver}.
2691 @cindex acciaccatura, multi-note
2692 @cindex multi-note acciaccatura
2693 @cindex grace-note synchronization
2695 A multi-note beamed @i{acciaccatura} is printed without a slash,
2696 and looks exactly the same as a multi-note beamed
2699 @c TODO Add link to LSR snippet to add slash when available
2701 Grace note synchronization can also lead to surprises. Staff
2702 notation, such as key signatures, bar lines, etc., are also
2703 synchronized. Take care when you mix staves with grace notes and
2704 staves without, for example,
2706 @lilypond[quote,relative=2,verbatim]
2708 \new Staff { e4 \bar "|:" \grace c16 d2. }
2709 \new Staff { c4 \bar "|:" d2. }
2714 This can be remedied by inserting grace skips of the corresponding
2715 durations in the other staves. For the above example
2717 @lilypond[quote,relative=2,verbatim]
2719 \new Staff { e4 \bar "|:" \grace c16 d2. }
2720 \new Staff { c4 \bar "|:" \grace s16 d2. }
2724 Grace sections should only be used within sequential music
2725 expressions. Nesting or juxtaposing grace sections is not
2726 supported, and might produce crashes or other errors.
2728 @node Aligning to cadenzas
2729 @unnumberedsubsubsec Aligning to cadenzas
2732 @cindex cadenza, aligning to
2733 @cindex aligning to cadenza
2735 In an orchestral context, cadenzas present a special problem: when
2736 constructing a score that includes a measured cadenza or other solo
2737 passage, all other instruments should skip just as many notes as the
2738 length of the cadenza, otherwise they will start too soon or too late.
2740 One solution to this problem is to use the functions
2741 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
2742 functions take a defined piece of music as an argument and generate a
2743 multi-measure rest or @code{\skip} exactly as long as the piece.
2745 @lilypond[verbatim,quote]
2746 MyCadenza = \relative c' {
2757 #(ly:export (mmrest-of-length MyCadenza))
2759 #(ly:export (skip-of-length MyCadenza))
2774 @node Time administration
2775 @unnumberedsubsubsec Time administration
2777 @cindex time administration
2778 @cindex timing (within the score)
2779 @cindex music, unmetered
2780 @cindex unmetered music
2782 @funindex currentBarNumber
2783 @funindex measurePosition
2784 @funindex measureLength
2786 Time is administered by the @code{Timing_translator}, which by
2787 default is to be found in the @code{Score} context. An alias,
2788 @code{Timing}, is added to the context in which the
2789 @code{Timing_translator} is placed.
2791 The following properties of @code{Timing} are used
2792 to keep track of timing within the score.
2795 @cindex measure number
2798 @item currentBarNumber
2799 The current measure number. For an example showing the
2800 use of this property see @ref{Bar numbers}.
2803 The length of the measures in the current time signature. For a
2804 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
2805 determines when bar lines are inserted and how automatic beams
2806 should be generated.
2808 @item measurePosition
2809 The point within the measure where we currently are. This
2810 quantity is reset by subtracting @code{measureLength} whenever
2811 @code{measureLength} is reached or exceeded. When that happens,
2812 @code{currentBarNumber} is incremented.
2815 If set to true, the above variables are updated for every time
2816 step. When set to false, the engraver stays in the current
2817 measure indefinitely.
2821 Timing can be changed by setting any of these variables
2822 explicitly. In the next example, the default 4/4 time
2823 signature is printed, but @code{measureLength} is set to 5/4.
2824 At 4/8 through the third measure, the @code{measurePosition} is
2825 advanced by 1/8 to 5/8, shortening that bar by 1/8.
2826 The next bar line then falls at 9/8 rather than 5/4.
2828 @lilypond[quote,verbatim,relative=1]
2829 \set Score.measureLength = #(ly:make-moment 5 4)
2833 \set Score.measurePosition = #(ly:make-moment 5 8)
2839 As the example illustrates, @code{ly:make-moment n m} constructs a
2840 duration of n/m of a whole note. For example,
2841 @code{ly:make-moment 1 8} is an eighth note duration and
2842 @code{ly:make-moment 7 16} is the duration of seven sixteenths
2849 @ref{Unmetered music}.
2854 Internals Reference:
2855 @rinternals{Timing_translator},