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]
96 Durations occuring on their own within a music sequence will take
97 their pitches from the preceding note or chord.
99 @lilypond[quote,verbatim,relative=2]
105 @cindex notes, dotted
107 @cindex notes, double-dotted
108 @cindex double-dotted notes
112 To obtain dotted note lengths, place a dot (@code{.}) after the
113 duration. Double-dotted notes are specified by appending two
116 @lilypond[quote,verbatim,relative=2]
117 a4 b c4. b8 a4. b4.. c8.
120 Some durations cannot be represented with just binary durations
121 and dots; they can be represented only by tying two or more
122 notes together. For details, see @ref{Ties}.
124 For ways of specifying durations for the syllables of lyrics and
125 ways of aligning lyrics to notes, see @ref{Vocal music}.
127 Optionally, notes can be spaced strictly proportionately to their
128 duration. For details of this and other settings which control
129 proportional notation, see @ref{Proportional notation}.
135 @funindex \dotsNeutral
136 @funindex dotsNeutral
138 Dots are normally moved up to avoid staff lines, except in
139 polyphonic situations. Dots may be manually placed above or below
140 the staff; see @ref{Direction and placement}.
154 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
155 {alternative-breve-notes.ly}
157 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
158 {changing-the-number-of-augmentation-dots-per-note.ly}
166 @rglos{Duration names notes and rests}.
169 @ref{Automatic beams},
172 @ref{Writing rhythms},
175 @ref{Ancient notation},
176 @ref{Proportional notation}.
183 @rinternals{DotColumn}.
186 @c Deliberately duplicated in Durations and Rests. -gp
187 There is no fundamental limit to rest durations (both in terms of
188 longest and shortest), but the number of glyphs is limited:
189 rests from 128th to maxima (8 x whole) may be printed.
193 @unnumberedsubsubsec Tuplets
201 Tuplets are made from a music expression with the @code{\tuplet}
202 command, multiplying the speed of the music expression by a fraction:
205 \tuplet @var{fraction} @{ @var{music} @}
209 The fraction's numerator will be printed over or under the notes,
210 optionally with a bracket. The most common tuplets are triplets
211 (3@tie{}notes sound within the duration normally allowed for@tie{}2).
213 @lilypond[quote,verbatim,relative=2]
214 a2 \tuplet 3/2 { b4 4 4 }
215 c4 c \tuplet 3/2 { b4 a g }
218 @cindex tuplet grouping
220 When entering long passages of tuplets, having to write a separate
221 @code{\tuplet} command for each group is inconvenient. It is possible
222 to specify the duration of one tuplet group directly before the music
223 in order to have the tuplets grouped automatically:
225 @lilypond[quote,verbatim,relative=2]
226 g2 r8 \tuplet 3/2 8 { cis16 d e e f g g f e }
229 @cindex tuplet bracket placement
233 @funindex \tupletDown
235 @funindex \tupletNeutral
236 @funindex tupletNeutral
238 Tuplet brackets may be manually placed above or below the staff:
240 @lilypond[quote,verbatim,relative=2]
241 \tupletUp \tuplet 3/2 { c8 d e }
242 \tupletNeutral \tuplet 3/2 { c8 d e }
243 \tupletDown \tuplet 3/2 { f,8 g a }
244 \tupletNeutral \tuplet 3/2 { f8 g a }
247 Tuplets may be nested:
249 @lilypond[quote,verbatim,relative=2]
251 c4 \tuplet 5/4 { f8 e f \tuplet 3/2 { e[ f g] } } f4
254 Modifying nested tuplets which begin at the same musical moment must be
255 done with @code{\tweak}.
257 To modify the duration of notes without printing a tuplet bracket, see
258 @ref{Scaling durations}.
263 @code{\tupletNeutral}.
269 @cindex tuplet formatting
270 @cindex triplet formatting
272 @funindex tupletNumberFormatFunction
273 @funindex tupletSpannerDuration
275 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
276 {entering-several-tuplets-using-only-one--tuplet-command.ly}
278 @cindex Tuplet number changes
280 @funindex TupletNumber
282 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
283 {changing-the-tuplet-number.ly}
285 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
286 {non-default-tuplet-numbers.ly}
288 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
289 {controlling-tuplet-bracket-visibility.ly}
291 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
292 {permitting-line-breaks-within-beamed-tuplets.ly}
301 @rlearning{Tweaking methods}.
304 @ref{Direction and placement},
305 @ref{Time administration},
306 @ref{Scaling durations},
307 @ref{The tweak command},
308 @ref{Polymetric notation}.
314 @rinternals{TupletBracket},
315 @rinternals{TupletNumber},
316 @rinternals{TimeScaledMusic}.
319 @node Scaling durations
320 @unnumberedsubsubsec Scaling durations
322 @cindex scaling durations
323 @cindex durations, scaling
325 The duration of single notes, rests or chords may be multiplied by a
326 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
327 is 1) to the duration. This will not affect the appearance of the
328 notes or rests produced, but the altered duration will be used in
329 calculating the position within the measure and setting the duration
330 in the MIDI output. Multiplying factors may be combined like
331 @code{*L*M/N}. Factors are part of the duration: if a duration is
332 not specified for subsequent notes, the default duration taken from
333 the preceding note will include any scaling factor.
335 In the following example, the first three notes take up exactly
336 two beats, but no triplet bracket is printed.
338 @lilypond[quote,relative=2,verbatim]
340 % Alter durations to triplets
344 % Double the duration of chord
346 % Duration of quarter, appears like sixteenth
350 The duration of spacer rests may also be modified by
351 a multiplier. This is useful for skipping many measures, e.g.,
354 @cindex compressing music
355 @cindex expanding music
357 @funindex \scaleDurations
358 @funindex scaleDurations
360 Longer stretches of music may be compressed by a fraction in the
361 same way, as if every note, chord or rest had the fraction as a
362 multiplier. This leaves the appearance of the music unchanged but
363 the internal duration of the notes will be multiplied by the
364 fraction @emph{num}/@emph{den}. Here is an example showing how music
365 can be compressed and expanded:
367 @lilypond[quote,relative=2,verbatim]
371 % Scale music by *2/3
372 \scaleDurations 2/3 {
376 \scaleDurations 2/1 {
381 One application of this command is in polymetric
382 notation, see @ref{Polymetric notation}.
387 @ref{Invisible rests},
388 @ref{Polymetric notation}.
394 The calculation of the position within a measure must take into
395 account all the scaling factors applied to the notes within that
396 measure and any fractional carry-out from earlier measures. This
397 calculation is carried out using rational numbers. If an intermediate
398 numerator or denominator in that calculation exceeds 2^30 the
399 execution and typesetting will stop at that point without indicating
404 @unnumberedsubsubsec Ties
410 A tie connects two adjacent note heads of the same pitch. The tie
411 in effect extends the duration of a note.
413 @warning{Ties should not be confused with @emph{slurs}, which
414 indicate articulation, or @emph{phrasing slurs}, which indicate
415 musical phrasing. A tie is just a way of extending a note
416 duration, similar to the augmentation dot.}
418 A tie is entered by appending a tilde symbol (@code{~}) to the first
419 of each pair of notes being tied. This indicates that the note
420 should be tied to the following note, which must be at the same pitch.
422 @lilypond[quote,verbatim,relative=2]
426 Ties can make use of the @q{last explicit pitch} interpretation of
429 @lilypond[quote,verbatim,relative=2]
433 Ties are used either when the note crosses a bar line, or when
434 dots cannot be used to denote the rhythm. Ties should also be
435 used when note values cross larger subdivisions of the measure:
437 @lilypond[verbatim,quote]
444 If you need to tie many notes across bar lines, it may be
445 easier to use automatic note splitting, see @ref{Automatic note
446 splitting}. This mechanism automatically splits long notes, and
447 ties them across bar lines.
449 @cindex ties and chords
450 @cindex chords and ties
452 When a tie is applied to a chord, all note heads whose pitches
453 match are connected. When no note heads match, no ties will be
454 created. Chords may be partially tied by placing the ties inside
457 @lilypond[quote,verbatim,relative=1]
460 <c~ e g~ b> <c e g b>
463 @cindex repeating ties
464 @cindex ties, repeating
465 @cindex volta brackets and ties
466 @cindex ties and volta brackets
471 When a second alternative of a repeat starts with a tied note, you
472 have to specify the repeated tie as follows:
474 @lilypond[quote,relative=2,verbatim]
475 \repeat volta 2 { c g <c e>2~ }
477 % First alternative: following note is tied normally
479 % Second alternative: following note has a repeated tie
480 { <c e>2\repeatTie d4 c } }
483 @cindex laissez vibrer
484 @cindex ties, laissez vibrer
486 @funindex \laissezVibrer
487 @funindex laissezVibrer
489 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
490 notes must not be damped at the end. It is used in notation for
491 piano, harp and other string and percussion instruments. They can
492 be entered as follows:
494 @lilypond[quote,verbatim,relative=1]
495 <c f g>1\laissezVibrer
498 @cindex ties, placement
504 @funindex \tieNeutral
507 Ties may be made to curve up or down manually; see
508 @ref{Direction and placement}.
510 @cindex ties, appearance
523 Ties may be made dashed, dotted, or a combination of solid and
526 @lilypond[quote, verbatim, relative=1]
539 Custom dash patterns can be specified:
541 @lilypond[quote, verbatim, relative=1]
542 \tieDashPattern #0.3 #0.75
544 \tieDashPattern #0.7 #1.5
550 Dash pattern definitions for ties have the same structure as dash
551 pattern definitions for slurs. For more information about complex dash
552 patterns, see @ref{Slurs}.
554 Override @var{whiteout} and @var{layer} layout properties for ties that
555 collide with other objects in a staff.
557 @lilypond[verbatim,quote,ragged-right,relative=2]
558 \override Tie.layer = #-2
559 \override Staff.TimeSignature.layer = #-1
560 \override Staff.KeySignature.layer = #-1
561 \override Staff.TimeSignature.whiteout = ##t
562 \override Staff.KeySignature.whiteout = ##t
575 @code{\tieDashPattern},
576 @code{\tieHalfDashed},
577 @code{\tieHalfSolid},
583 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
584 {using-ties-with-arpeggios.ly}
586 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
587 {engraving-ties-manually.ly}
592 @rglos{laissez vibrer}.
596 @ref{Automatic note splitting}.
599 @rlsr{Expressive marks},
603 @rinternals{LaissezVibrerTie},
604 @rinternals{LaissezVibrerTieColumn},
605 @rinternals{TieColumn},
609 Switching staves when a tie is active will not produce a slanted tie.
611 Changing clefs or ottavations during a tie is not really well-defined.
612 In these cases, a slur may be preferable.
616 @subsection Writing rests
618 Rests are entered as part of the music in music expressions.
623 * Full measure rests::
627 @unnumberedsubsubsec Rests
630 @cindex rest, entering durations
645 Rests are entered like notes with the note name @code{r}.
646 Durations longer than a whole rest use the following predefined
649 @c \time 16/1 is used to avoid spurious bar lines
650 @c and long tracts of empty measures
651 @lilypond[quote,verbatim,relative=2]
653 % These two lines are just to prettify this example
655 \omit Staff.TimeSignature
656 % Print a maxima rest, equal to four breves
658 % Print a longa rest, equal to two breves
662 r1 r2 r4 r8 r16 r32 r64 r128
666 @cindex rest, multi-measure
667 @cindex rest, whole-measure
669 Whole measure rests, centered in the middle of the measure, must be
670 entered as multi-measure rests. They can be used for a single
671 measure as well as many measures and are discussed in
672 @ref{Full measure rests}.
674 @cindex rest, specifying vertical position
676 To explicitly specify a rest's vertical position, write a note
677 followed by @code{\rest}. A rest of the duration of the note will
678 be placed at the staff position where the note would appear. This
679 allows for precise manual formatting of polyphonic music, since the
680 automatic rest collision formatter will not move these rests.
682 @lilypond[quote,verbatim,relative=2]
688 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
698 @ref{Full measure rests}.
707 @c Deliberately duplicated in Durations and Rests. -gp
708 There is no fundamental limit to rest durations (both in terms of
709 longest and shortest), but the number of glyphs is limited: there
710 are rests from 128th to maxima (8 x whole).
713 @node Invisible rests
714 @unnumberedsubsubsec Invisible rests
717 @cindex invisible rest
718 @cindex rest, invisible
726 An invisible rest (also called a @q{spacer rest}) can be entered
727 like a note with the note name@tie{}@code{s}:
729 @lilypond[verbatim,quote,relative=2]
736 Spacer rests are available only in note mode and chord mode. In
737 other situations, for example, when entering lyrics, the
738 command @code{\skip} is used to skip a musical moment.
739 @code{\skip} requires an explicit duration, but this is ignored if
740 the lyrics derive their durations from the notes in an associated
741 melody through @code{\addlyrics} or @code{\lyricsto}.
743 @lilypond[quote,verbatim,relative=2]
756 Because @code{\skip} is a command, it does not affect the default
757 durations of following notes, unlike@tie{}@code{s}.
759 @lilypond[quote,verbatim,relative=2]
762 \repeat unfold 8 { a4 }
772 A spacer rest implicitly causes @code{Staff} and @code{Voice}
773 contexts to be created if none exist, just like notes and rests
776 @lilypond[quote,verbatim,relative=2]
780 @code{\skip} simply skips musical time; it creates no output of
783 @lilypond[quote,verbatim,relative=2]
784 % This is valid input, but does nothing
785 \skip 1 \skip1 \skip 1
790 @rlearning{Visibility and color of objects}.
794 @ref{Visibility of objects}.
800 @rinternals{SkipMusic}.
803 @node Full measure rests
804 @unnumberedsubsubsec Full measure rests
806 @cindex multi-measure rests
807 @cindex full-measure rests
808 @cindex rest, multi-measure
809 @cindex rest, full-measure
810 @cindex whole rest for a full measure
811 @cindex rest, whole for a full measure
815 Rests for one or more full measures are entered like notes with
816 the note name uppercase @code{R}:
818 @lilypond[quote,verbatim,relative=2]
819 % Rest measures contracted to single measure
820 \compressFullBarRests
827 The duration of full-measure rests is identical to the duration
828 notation used for notes. The duration in a multi-measure rest must
829 always be an integral number of measure-lengths, so augmentation dots
830 or fractions must often be used:
832 @lilypond[quote,verbatim,relative=2]
833 \compressFullBarRests
839 R1*13/8 | R1*13/8*12 |
844 A full-measure rest is printed as either a whole or breve rest,
845 centered in the measure, depending on the time signature.
847 @lilypond[quote,verbatim,relative=2]
856 @cindex multi-measure rest, expanding
857 @cindex multi-measure rest, contracting
859 @funindex \expandFullBarRests
860 @funindex expandFullBarRests
861 @funindex \compressFullBarRests
862 @funindex compressFullBarRests
864 By default a multi-measure rest is expanded in the printed score to
865 show all the rest measures explicitly. Alternatively, a multi-measure
866 rest can be shown as a single measure containing a multi-measure rest
867 symbol, with the number of measures of rest printed above the measure:
869 @lilypond[quote,verbatim,relative=2]
871 \time 3/4 r2. | R2.*2 |
874 % Rest measures contracted to single measure
875 \compressFullBarRests
877 % Rest measures expanded
884 @cindex text on multi-measure rest
885 @cindex multi-measure rest, attaching text
886 @cindex script on multi-measure rest
887 @cindex multi-measure rest, script
888 @cindex fermata on multi-measure rest
889 @cindex multi-measure rest, attaching fermata
890 @cindex markup on multi-measure rest
891 @cindex multi-measure rest with markup
893 @funindex \fermataMarkup
894 @funindex fermataMarkup
895 @funindex MultiMeasureRestText
897 Markups can be added to multi-measure rests.
898 The predefined command @code{\fermataMarkup}
899 is provided for adding fermatas.
901 @lilypond[quote,verbatim,relative=2]
902 \compressFullBarRests
904 R2.*10^\markup { \italic "ad lib." }
908 @warning{Markups attached to a multi-measure rest are objects of type
909 @code{MultiMeasureRestText}, not @code{TextScript}. Overrides must
910 be directed to the correct object, or they will be ignored. See the
913 @lilypond[quote,verbatim,relative=2]
914 % This fails, as the wrong object name is specified
915 \override TextScript.padding = #5
917 % This is the correct object name to be specified
918 \override MultiMeasureRestText.padding = #5
922 When a multi-measure rest immediately follows a @code{\partial}
923 setting, resulting bar-check warnings may not be displayed.
926 @funindex \textLengthOn
927 @funindex textLengthOn
928 @funindex \textLengthOff
929 @funindex textLengthOff
930 @funindex \fermataMarkup
931 @funindex fermataMarkup
932 @funindex \compressFullBarRests
933 @funindex compressFullBarRests
934 @funindex \expandFullBarRests
935 @funindex expandFullBarRests
938 @code{\textLengthOn},
939 @code{\textLengthOff},
940 @code{\fermataMarkup},
941 @code{\compressFullBarRests},
942 @code{\expandFullBarRests}.
950 @cindex kirchenpausen
952 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
953 {changing-form-of-multi-measure-rests.ly}
955 @cindex multi-measure rests, positioning
956 @cindex positioning multi-measure rests
958 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
959 {positioning-multi-measure-rests.ly}
961 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
962 {multi-measure-rest-markup.ly}
966 @rglos{multi-measure rest}.
971 @ref{Formatting text},
978 @rinternals{MultiMeasureRest},
979 @rinternals{MultiMeasureRestNumber},
980 @rinternals{MultiMeasureRestText}.
982 @cindex fingerings and multi-measure rests
983 @cindex multi-measure rests and fingerings
986 Fingerings over multi-measure rests (e.g. @code{R1*10-4}) may result
987 in the fingering numeral colliding with the bar counter
990 @cindex condensing rests
991 @cindex rest, condensing ordinary
993 There is no way to automatically condense multiple ordinary rests
994 into a single multi-measure rest.
996 @cindex rest, collisions of
998 Multi-measure rests do not take part in rest collisions.
1001 @node Displaying rhythms
1002 @subsection Displaying rhythms
1009 * Polymetric notation::
1010 * Automatic note splitting::
1011 * Showing melody rhythms::
1014 @node Time signature
1015 @unnumberedsubsubsec Time signature
1017 @cindex time signature
1023 The time signature is set as follows:
1025 @lilypond[quote,verbatim,relative=2]
1030 Mid-measure time signature changes are covered in @ref{Upbeats}.
1032 @cindex time signature visibility
1034 Time signatures are printed at the beginning of a piece
1035 and whenever the time signature changes. If a change takes place
1036 at the end of a line a warning time signature sign is printed
1037 there. This default behavior may be changed, see
1038 @ref{Visibility of objects}.
1040 @lilypond[quote,verbatim,relative=2]
1050 @cindex time signature style
1053 @funindex \numericTimeSignature
1054 @funindex numericTimeSignature
1055 @funindex \defaultTimeSignature
1056 @funindex defaultTimeSignature
1058 The time signature symbol that is used in 2/2 and 4/4 time can be
1059 changed to a numeric style:
1061 @lilypond[quote,verbatim,relative=2]
1065 % Change to numeric style
1066 \numericTimeSignature
1069 % Revert to default style
1070 \defaultTimeSignature
1076 Mensural time signatures are covered in
1077 @ref{Mensural time signatures}.
1079 @cindex time signature default settings
1080 @cindex autobeaming properties for time signatures
1081 @cindex beaming, time signature default properties
1082 @funindex \overrideTimeSignatureSettings
1084 In addition to setting the printed time signature, the @code{\time}
1085 command also sets the values of the time-signature-based properties
1086 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
1087 The predefined default values for these properties can be found in
1088 @file{scm/time-signature-settings.scm}.
1090 The default value of @code{beatStructure} can be overridden in the
1091 @code{\time} command itself by supplying it as the optional first
1094 @lilypond[quote,verbatim]
1099 \repeat unfold 7 { c8 } |
1101 \repeat unfold 7 { c8 } |
1107 Alternatively, the default values of all these time-signature-based
1108 variables, including @code{baseMoment} and @code{beamExceptions},
1109 can be set together. The values can be set independently for several
1110 different time signatures. The new values take effect when a
1111 subsequent @code{\time} command with the same value of the time
1112 signature is executed:
1114 @lilypond[quote,verbatim]
1118 \overrideTimeSignatureSettings
1119 4/4 % timeSignatureFraction
1120 1/4 % baseMomentFraction
1121 #'(3 1) % beatStructure
1122 #'() % beamExceptions
1124 \repeat unfold 8 { c8 } |
1130 @code{\overrideTimeSignatureSettings} takes four arguments:
1135 @code{@var{timeSignatureFraction}}, a fraction describing the
1136 time signature to which these values apply.
1139 @code{@var{baseMomentFraction}}, a fraction containing the numerator
1140 and denominator of the basic timing unit for the time signature.
1143 @code{@var{beatStructure}}, a Scheme list indicating the structure
1144 of the beats in the measure, in units of the base moment.
1147 @code{@var{beamExceptions}}, an alist containing any beaming rules
1148 for the time signature that go beyond ending at every beat, as
1149 described in @ref{Setting automatic beam behavior}.
1153 @cindex time signature properties, restoring default values
1154 @cindex restoring default properties for time signatures
1155 @funindex \revertTimeSignatureSettings
1157 Changed values of default time signature properties can be restored
1158 to the original values:
1160 @lilypond[quote,verbatim]
1163 \repeat unfold 8 { c8 } |
1164 \overrideTimeSignatureSettings
1165 4/4 % timeSignatureFraction
1166 1/4 % baseMomentFraction
1167 #'(3 1) % beatStructure
1168 #'() % beamExceptions
1170 \repeat unfold 8 { c8 } |
1171 \revertTimeSignatureSettings 4/4
1173 \repeat unfold 8 { c8 } |
1178 Different values of default time signature properties can be established
1179 for different staves by moving the @code{Timing_translator} and the
1180 @code{Default_bar_line_engraver} from the @code{Score} context to the
1181 @code{Staff} context.
1183 @lilypond[quote, verbatim]
1187 \overrideTimeSignatureSettings
1188 4/4 % timeSignatureFraction
1189 1/4 % baseMomentFraction
1190 #'(3 1) % beatStructure
1191 #'() % beamExceptions
1193 \repeat unfold 8 {c''8}
1196 \overrideTimeSignatureSettings
1197 4/4 % timeSignatureFraction
1198 1/4 % baseMomentFraction
1199 #'(1 3) % beatStructure
1200 #'() % beamExceptions
1202 \repeat unfold 8 {c''8}
1208 \remove "Timing_translator"
1209 \remove "Default_bar_line_engraver"
1213 \consists "Timing_translator"
1214 \consists "Default_bar_line_engraver"
1220 A further method of changing these time-signature-related variables,
1221 which avoids reprinting the time signature at the time of the change,
1222 is shown in @ref{Setting automatic beam behavior}.
1225 @code{\numericTimeSignature},
1226 @code{\defaultTimeSignature}.
1231 @lilypondfile[verbatim,quote,texidoc,doctitle]
1232 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1236 @rglos{time signature}
1239 @ref{Mensural time signatures},
1240 @ref{Setting automatic beam behavior},
1241 @ref{Time administration}.
1244 @file{scm/time-signature-settings.scm}.
1249 Internals Reference:
1250 @rinternals{TimeSignature},
1251 @rinternals{Timing_translator}.
1254 @node Metronome marks
1255 @unnumberedsubsubsec Metronome marks
1258 @cindex beats per minute
1259 @cindex metronome mark
1260 @cindex metronome marking with text
1265 A basic metronome mark is simple to write:
1267 @lilypond[verbatim,quote,relative=1]
1273 Metronome marks may also be printed as a range of two numbers:
1275 @lilypond[verbatim,quote,relative=1]
1281 Tempo indications with text can be used instead:
1283 @lilypond[verbatim,quote,relative=2]
1289 Combining a metronome mark and text will automatically place the
1290 metronome mark within parentheses:
1292 @lilypond[verbatim,quote,relative=2]
1293 \tempo "Allegro" 4 = 160
1298 In general, the text can be any markup object:
1300 @lilypond[verbatim,quote,relative=2]
1301 \tempo \markup { \italic Faster } 4 = 132
1302 a8-. r8 b-. r gis-. r a-. r
1305 A parenthesized metronome mark with no textual indication may be
1306 written by including an empty string in the input:
1308 @lilypond[verbatim,quote,relative=2]
1313 @funindex \markLengthOn
1314 @funindex markLengthOn
1315 @funindex \markLengthOff
1316 @funindex markLengthOff
1318 In a part for an instrument with long periods of rests,
1319 tempo indications sometimes follow each other closely.
1320 The command @code{\markLengthOn} provides extra horizontal space
1321 to prevent tempo indications from overlapping, and @code{\markLengthOff}
1322 restores the default behavior of ignoring tempo marks
1323 for horizontal spacing.
1325 @lilypond[verbatim,quote,relative=0]
1326 \compressFullBarRests
1328 \tempo "Molto vivace"
1339 @lilypondfile[verbatim,quote,texidoc,doctitle]
1340 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
1342 @c perhaps also an example of how to move it horizontally?
1344 @lilypondfile[verbatim,quote,texidoc,doctitle]
1345 {changing-the-tempo-without-a-metronome-mark.ly}
1347 @lilypondfile[verbatim,quote,texidoc,doctitle]
1348 {creating-metronome-marks-in-markup-mode.ly}
1350 For more details, see @ref{Formatting text}.
1355 @rglos{metronomic indication},
1356 @rglos{tempo indication},
1357 @rglos{metronome mark}.
1360 @ref{Formatting text},
1364 @rlsr{Staff notation}.
1366 Internals Reference:
1367 @rinternals{MetronomeMark}.
1371 @unnumberedsubsubsec Upbeats
1375 @cindex partial measure
1376 @cindex measure, partial
1377 @cindex measure, pickup
1378 @cindex pickup measure
1379 @cindex time signature, mid-measure
1381 @funindex measurePosition
1385 Partial or pick-up measures, such as an @emph{anacrusis} or an
1386 @emph{upbeat}, are entered using the @code{\partial} command:
1389 \partial @var{duration}
1392 When @code{\partial} is used at the beginning of a score,
1393 @code{@var{duration}} is the length of the music preceding the
1396 @lilypond[quote,verbatim,relative=1]
1399 r4 e8 | a4 c8 b c4 |
1402 When @code{\partial} is used after the beginning of a score,
1403 @code{@var{duration}} is the @emph{remaining} length of the
1404 current measure. It does not create a new numbered bar.
1406 @lilypond[quote,verbatim,relative=1]
1407 \set Score.barNumberVisibility = #all-bar-numbers-visible
1408 \override Score.BarNumber.break-visibility =
1409 #end-of-line-invisible
1411 d'4.~ 4 d8 d( c) b | c4.~ 4. \bar "||"
1414 c8( d) e | f2.~ 4 f8 a,( c) f |
1417 The @code{\partial} command is @emph{required} when the time
1418 signature changes in mid measure, but it may also be used alone.
1420 @lilypond[quote,verbatim,relative=1]
1421 \set Score.barNumberVisibility = #all-bar-numbers-visible
1422 \override Score.BarNumber.break-visibility =
1423 #end-of-line-invisible
1426 e8 | a4 c8 b[ c b] |
1428 r8 e,8 | a4 \bar "||"
1434 The @code{\partial} command sets the @code{Timing.measurePosition}
1435 property, which is a rational number that indicates how much of
1436 the measure has passed.
1449 @rinternals{Timing_translator}.
1452 @node Unmetered music
1453 @unnumberedsubsubsec Unmetered music
1456 @cindex cadenza, beams
1457 @cindex cadenza, accidentals
1458 @cindex cadenza, bar lines
1459 @cindex cadenza, bar numbers
1460 @cindex unmetered music
1461 @cindex unmetered music, beams
1462 @cindex unmetered music, accidentals
1463 @cindex unmetered music, bar lines
1464 @cindex unmetered music, bar numbers
1465 @cindex accidentals, cadenzas
1466 @cindex accidentals, unmetered music
1467 @cindex bar lines, cadenzas
1468 @cindex bar lines, unmetered music
1469 @cindex bar numbers, cadenzas
1470 @cindex bar numbers, unmetered music
1471 @cindex beams, cadenzas
1472 @cindex beams, unmetered music
1474 @funindex \cadenzaOn
1476 @funindex \cadenzaOff
1477 @funindex cadenzaOff
1479 In metered music bar lines are inserted and bar numbers are calculated
1480 automatically. In unmetered music (i.e. cadenzas), this is not
1481 desirable and can be @q{switched off} using the command
1482 @code{\cadenzaOn}, then @q{switched back on} at the appropriate place
1483 using @code{\cadenzaOff}.
1485 @lilypond[verbatim,relative=2,quote]
1488 c4 c d8[ d d] f4 g4.
1494 Bar numbering is resumed at the end of the cadenza.
1496 @lilypond[verbatim,relative=2,quote]
1497 % Show all bar numbers
1498 \override Score.BarNumber.break-visibility = #all-visible
1501 c4 c d8[ d d] f4 g4.
1507 Inserting a @code{\bar} command within a cadenza does not start a new
1508 measure, even if a bar line is printed. So any accidentals -- which
1509 are usually assumed to remain in force until the end of the measure --
1510 will still be valid after the bar line printed by @code{\bar}. If
1511 subsequent accidentals should be printed, forced accidentals or
1512 reminder accidentals need to be inserted manually, see
1515 @lilypond[verbatim,relative=2,quote]
1520 % First cis is printed without alteration even if it's after a \bar
1526 Automatic beaming is disabled by @code{\cadenzaOn}. Therefore, all
1527 beaming in cadenzas must be entered manually. See @ref{Manual beams}.
1529 @lilypond[verbatim,relative=2,quote]
1530 \repeat unfold 8 { c8 }
1536 \repeat unfold 8 { c8 }
1539 These predefined commands affect all staves in the score, even when
1540 placed in just one @code{Voice} context. To change this, move the
1541 @code{Timing_translator} from the @code{Score} context to the
1542 @code{Staff} context. See @ref{Polymetric notation}.
1554 @ref{Visibility of objects},
1555 @ref{Polymetric notation},
1562 @cindex cadenza, line breaks
1563 @cindex cadenza, page breaks
1564 @cindex unmetered music, line breaks
1565 @cindex unmetered music, page breaks
1566 @cindex breaks in unmetered music
1567 @cindex line breaks, cadenzas
1568 @cindex page breaks, cadenzas
1569 @cindex line breaks, unmetered music
1570 @cindex page breaks, unmetered music
1573 Automatic line and page breaks are inserted only at bar lines, so
1574 @q{invisible} bar lines will need to be inserted manually in long
1575 stretches of unmetered music to permit breaking:
1582 @node Polymetric notation
1583 @unnumberedsubsubsec Polymetric notation
1585 @c This section necessarily uses \set
1586 @c This is acceptable -td
1588 @cindex double time signatures
1589 @cindex signatures, polymetric
1590 @cindex time signature, polymetric
1591 @cindex time signature, double
1592 @cindex polymetric signatures
1593 @cindex meter, polymetric
1595 @funindex timeSignatureFraction
1596 @funindex \scaleDurations
1597 @funindex scaleDurations
1601 Polymetric notation is supported explicitly or by manually modifying the
1602 visible time signature symbol and/or scaling note durations.
1604 @subsubsubheading Different time signatures with equal-length measures
1606 Set a common time signature for each staff, and set the
1607 @code{timeSignatureFraction} to the desired fraction. Then use the
1608 @code{\scaleDurations} function to scale the durations of the notes in
1609 each staff to the common time signature.
1611 @cindex beams, with polymetric meters
1612 @cindex polymetric meters, with beams
1614 In the following example, music with the time signatures of 3/4, 9/8 and
1615 10/8 are used in parallel. In the second staff, shown durations are
1616 multiplied by 2/3 (because 2/3 * 9/8 = 3/4) and in the third staff, the
1617 shown durations are multiplied by 3/5 (because 3/5 * 10/8 = 3/4). It
1618 may be necessary to insert beams manually, as the duration scaling will
1619 affect the autobeaming rules.
1621 @lilypond[quote,verbatim]
1630 \set Staff.timeSignatureFraction = 9/8
1632 \repeat unfold 6 { c8[ c c] }
1636 \set Staff.timeSignatureFraction = 10/8
1637 \scaleDurations 3/5 {
1638 \repeat unfold 2 { c8[ c c] }
1639 \repeat unfold 2 { c8[ c] } |
1640 c4. c \tuplet 3/2 { c8[ c c] } c4
1646 @subsubsubheading Different time signatures with unequal-length measures
1648 Each staff can be given its own independent time signature by
1649 moving the @code{Timing_translator} and the
1650 @code{Default_bar_line_engraver} to the @code{Staff} context.
1652 @lilypond[quote,verbatim]
1656 \remove "Timing_translator"
1657 \remove "Default_bar_line_engraver"
1661 \consists "Timing_translator"
1662 \consists "Default_bar_line_engraver"
1666 % Now each staff has its own time signature.
1690 @funindex \compoundMeter
1691 @cindex compound time signatures
1692 @cindex time signature, compound
1694 @subsubsubheading Compound time signatures
1696 These are created using the @code{\compoundMeter} function. The syntax
1700 \compoundMeter #'@code{(list of lists)}
1703 The simplest construction is a single list, where the @emph{last} number
1704 indicates the bottom number of the time signature and those that come
1705 before it, the top numbers.
1707 @lilypond[quote,verbatim]
1709 \compoundMeter #'((2 2 2 8))
1710 \repeat unfold 6 c8 \repeat unfold 12 c16
1714 More complex meters can be constructed using additional lists. Also,
1715 automatic beaming settings will be adjusted depending on the values.
1717 @lilypond[quote,verbatim]
1719 \compoundMeter #'((1 4) (3 8))
1720 \repeat unfold 5 c8 \repeat unfold 10 c16
1724 \compoundMeter #'((1 2 3 8) (3 4))
1725 \repeat unfold 12 c8
1732 @rglos{polymetric time signature},
1736 @ref{Automatic beams},
1738 @ref{Time signature},
1739 @ref{Scaling durations}.
1744 Internals Reference:
1745 @rinternals{TimeSignature},
1746 @rinternals{Timing_translator},
1747 @rinternals{Default_bar_line_engraver},
1751 When using different time signatures in parallel, notes at the same
1752 moment will be placed at the same horizontal location. However, the bar
1753 lines in the different staves will cause the note spacing to be less
1754 regular in each of the individual staves than would be normal without
1755 the different time signatures.
1758 @node Automatic note splitting
1759 @unnumberedsubsubsec Automatic note splitting
1761 @cindex notes, splitting
1762 @cindex splitting notes
1763 @cindex rests, splitting
1764 @cindex splitting rests
1766 @funindex Note_heads_engraver
1767 @funindex Completion_heads_engraver
1768 @funindex Completion_rest_engraver
1770 Long notes which overrun bar lines can be converted automatically to
1771 tied notes. This is done by replacing the @code{Note_heads_engraver}
1772 with the @code{Completion_heads_engraver}. Similarly, long rests which
1773 overrun bar lines are split automatically by replacing the
1774 @code{Rest_engraver} with the @code{Completion_rest_engraver}. In the
1775 following example, notes and rests crossing the bar lines are split,
1776 notes are also tied.
1778 @lilypond[quote,verbatim,relative=1]
1780 \remove "Note_heads_engraver"
1781 \consists "Completion_heads_engraver"
1782 \remove "Rest_engraver"
1783 \consists "Completion_rest_engraver"
1786 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 r1*2 }
1789 These engravers split all running notes and rests at the bar line, and
1790 inserts ties for notes. One of its uses is to debug complex scores: if
1791 the measures are not entirely filled, then the ties show exactly how
1792 much each measure is off.
1794 The property @code{completionUnit} sets a preferred duration for
1797 @lilypond[quote,verbatim,relative=2]
1799 \remove "Note_heads_engraver"
1800 \consists "Completion_heads_engraver"
1802 \time 9/8 g\breve. d4. \bar "||"
1803 \set completionUnit = #(ly:make-moment 3 8)
1808 These engravers split notes with scaled duration, such as those in tuplets,
1809 into notes with the same scale-factor as in the input note.
1811 @lilypond[quote,verbatim,relative=2]
1813 \remove "Note_heads_engraver"
1814 \consists "Completion_heads_engraver"
1817 \tuplet 3/2 {g4 a b}
1818 \scaleDurations 2/3 {g a b}
1820 \tuplet 3/2 {g4 a b}
1830 @rlearning{Engravers explained},
1831 @rlearning{Adding and removing engravers}.
1836 Internals Reference:
1837 @rinternals{Note_heads_engraver},
1838 @rinternals{Completion_heads_engraver},
1839 @rinternals{Rest_engraver},
1840 @rinternals{Completion_rest_engraver},
1841 @rinternals{Forbid_line_break_engraver}.
1844 For consistency with previous behavior, notes and rests with
1845 duration longer than a measure, such as @code{c1*2}, are split into
1846 notes without any scale factor, @code{@{ c1 c1 @}}. The property
1847 @code{completionFactor} controls this behavior, and setting it to
1848 @code{#f} cause split notes and rest to have the scale factor
1849 of the input durations.
1852 @node Showing melody rhythms
1853 @unnumberedsubsubsec Showing melody rhythms
1855 @cindex melody rhythms, showing
1856 @cindex rhythms, showing melody
1858 Sometimes you might want to show only the rhythm of a melody. This
1859 can be done with the rhythmic staff. All pitches of notes on such a
1860 staff are squashed, and the staff itself has a single line
1862 @lilypond[quote,relative=1,verbatim]
1864 \new RhythmicStaff {
1865 \new Voice = "myRhythm" {
1873 \lyricsto "myRhythm" {
1881 @cindex guitar chord charts
1882 @cindex strumming rhythms, showing
1883 @cindex guitar strumming rhythms, showing
1885 @funindex Pitch_squash_engraver
1886 @funindex \improvisationOn
1887 @funindex improvisationOn
1888 @funindex \improvisationOff
1889 @funindex improvisationOff
1891 Guitar chord charts often show the strumming rhythms. This can
1892 be done with the @code{Pitch_squash_engraver} and
1893 @code{\improvisationOn}.
1896 @lilypond[quote,verbatim]
1904 \consists "Pitch_squash_engraver"
1917 @code{\improvisationOn},
1918 @code{\improvisationOff}.
1924 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1925 {guitar-strum-rhythms.ly}
1931 Internals Reference:
1932 @rinternals{RhythmicStaff},
1933 @rinternals{Pitch_squash_engraver}.
1941 * Setting automatic beam behavior::
1946 @node Automatic beams
1947 @unnumberedsubsubsec Automatic beams
1949 By default, beams are inserted automatically:
1951 @cindex beams, manual
1952 @cindex manual beams
1953 @cindex beams, customizing rules
1955 @funindex \autoBeamOn
1956 @funindex autoBeamOn
1957 @funindex \autoBeamOff
1958 @funindex autoBeamOff
1960 @lilypond[quote,verbatim,relative=2]
1962 \time 6/8 c8 c c c8. c16 c8
1965 If these automatic decisions are not satisfactory, beaming can be
1966 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1967 entered manually if beams are to be extended over rests.
1969 If automatic beaming is not required, it may be turned off with
1970 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1972 @lilypond[quote,relative=1,verbatim]
1973 c4 c8 c8. c16 c8. c16 c8
1980 @cindex melismata, with beams
1981 @cindex beams, with melismata
1983 @warning{If beams are used to indicate melismata in songs, then
1984 automatic beaming should be switched off with @code{@bs{}autoBeamOff}
1985 and the beams indicated manually. Using @code{@bs{}partcombine} with
1986 @code{@bs{}autoBeamOff} can produce unintended results. See the
1987 snippets for more information.}
1989 Beaming patterns that differ from the automatic defaults can be
1990 created; see @ref{Setting automatic beam behavior}.
1993 @code{\autoBeamOff},
1997 @cindex beams, line breaks
1998 @cindex line breaks, beams
1999 @cindex beams, with knee gap
2000 @cindex knee gap, with beams
2004 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2005 {beams-across-line-breaks.ly}
2007 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2008 {changing-beam-knee-gap.ly}
2010 @cindex beams, \partcombine with \autoBeamOff
2011 @cindex voices, \partcombine with \autoBeamOff
2013 @lilypondfile [verbatim, quote, ragged-right, texidoc, doctitle]
2014 {partcombine-and-autobeamoff.ly}
2019 @ref{Setting automatic beam behavior}.
2022 @file{scm/auto-beam.scm}.
2027 Internals Reference:
2028 @rinternals{Auto_beam_engraver},
2029 @rinternals{Beam_engraver},
2031 @rinternals{BeamEvent},
2032 @rinternals{BeamForbidEvent},
2033 @rinternals{beam-interface},
2034 @rinternals{unbreakable-spanner-interface}.
2037 The properties of a beam are determined at the @emph{start} of its
2038 construction and any additional beam-property changes that occur before
2039 the beam has been completed will not take effect until the @emph{next},
2043 @node Setting automatic beam behavior
2044 @unnumberedsubsubsec Setting automatic beam behavior
2046 @cindex beams, with lyrics
2047 @cindex lyrics, with beams
2049 @funindex autoBeaming
2050 @funindex baseMoment
2051 @funindex beamExceptions
2052 @funindex \beamExceptions
2053 @funindex beatStructure
2054 @funindex measureLength
2060 When automatic beaming is enabled, the placement of automatic beams
2061 is determined by three context properties:
2062 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2063 The default values of these variables may be overridden as described
2064 below, or alternatively the default values themselves may be changed
2065 as explained in @ref{Time signature}.
2067 If a @code{beamExceptions} rule is defined for the time signature in
2068 force, that rule alone is used to determine the beam placement; the
2069 values of @code{baseMoment} and @code{beatStructure} are ignored.
2071 If no @code{beamExceptions} rule is defined for the time signature
2072 in force, the beam placement is determined by the values of
2073 @code{baseMoment} and @code{beatStructure}.
2076 @subsubsubheading Beaming based on @code{baseMoment} and @code{beatStructure}
2078 By default, @code{beamExceptions} rules are defined for most common
2079 time signatures, so the @code{beamExceptions} rules must be disabled
2080 if automatic beaming is to be based on @code{baseMoment} and
2081 @code{beatStructure}. The @code{beamExceptions} rules are disabled
2085 \set Timing.beamExceptions = #'()
2088 When @code{beamExceptions} is set to @code{#'()}, either due to an
2089 explicit setting or because no @code{beamExceptions} rules are defined
2090 internally for the time signature in force, the ending points for
2091 beams are on beats as specified by the context properties
2092 @code{baseMoment} and @code{beatStructure}. @code{beatStructure} is
2093 a scheme list that defines the length of each beat in the measure in
2094 units of @code{baseMoment}. By default, @code{baseMoment} is one
2095 over the denominator of the time signature. By default, each unit of
2096 length @code{baseMoment} is a single beat.
2098 @lilypond[quote,relative=2,verbatim]
2100 c16^"default" c c c c |
2101 % beamExceptions are unlikely to be defined for 5/16 time,
2102 % but let's disable them anyway to be sure
2103 \set Timing.beamExceptions = #'()
2104 \set Timing.beatStructure = #'(2 3)
2105 c16^"(2+3)" c c c c |
2106 \set Timing.beatStructure = #'(3 2)
2107 c16^"(3+2)" c c c c |
2110 @lilypond[quote,relative=2,verbatim]
2112 a8^"default" a a a a a a a
2113 % Disable beamExceptions because they are definitely
2114 % defined for 4/4 time
2115 \set Timing.beamExceptions = #'()
2116 \set Timing.baseMoment = #(ly:make-moment 1/4)
2117 \set Timing.beatStructure = #'(1 1 1 1)
2118 a8^"changed" a a a a a a a
2121 Beam setting changes can be limited to specific contexts. If no
2122 setting is included in a lower-level context, the setting of the
2123 enclosing context will apply.
2125 @lilypond[quote, verbatim,relative=1]
2128 % No need to disable beamExceptions
2129 % as they are not defined for 7/8 time
2130 \set Staff.beatStructure = #'(2 3 2)
2140 \set Voice.beatStructure = #'(1 3 3)
2148 When multiple voices are used the @code{Staff} context must be
2149 specified if the beaming is to be applied to all voices in the
2152 @lilypond[quote,verbatim,relative=2]
2155 % Change applied to Voice by default -- does not work correctly
2156 % Because of autogenerated voices, all beating will
2157 % be at baseMoment (1 . 8)
2158 \set beatStructure = #'(3 1 1 2)
2159 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2161 % Works correctly with context Staff specified
2162 \set Staff.beatStructure = #'(3 1 1 2)
2163 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2166 The value of @code{baseMoment} can be adjusted to change
2167 the beaming behavior, if desired. When this is done,
2168 the value of @code{beatStructure} must be set to be
2169 compatible with the new value of @code{baseMoment}.
2171 @lilypond[quote,verbatim,relative=2]
2173 % No need to disable beamExceptions
2174 % as they are not defined for 5/8 time
2175 \set Timing.baseMoment = #(ly:make-moment 1/16)
2176 \set Timing.beatStructure = #'(7 3)
2177 \repeat unfold 10 { a16 }
2180 @code{baseMoment} is a @i{moment}; a unit of musical duration. A
2181 quantity of type @i{moment} is created by the scheme function
2182 @code{ly:make-moment}. For more information about this function,
2183 see @ref{Time administration}.
2185 By default @code{baseMoment} is set to one over the denominator of
2186 the time signature. Any exceptions to this default can be found in
2187 @file{scm/time-signature-settings.scm}.
2189 @subsubsubheading Beaming based on @code{beamExceptions}
2191 Special autobeaming rules (other than ending a beam on a beat)
2192 are defined in the @code{beamExceptions} property.
2194 The value for @code{beamExceptions}, a somewhat complex Scheme
2195 data structure, is easiest generated with the
2196 @code{\beamExceptions} function. This function is given one or
2197 more manually beamed measure-length rhythmic patterns (measures
2198 have to be separated by a bar check@tie{}@code{|} since the
2199 function has no other way to discern the measure length). Here is
2202 @lilypond[quote,relative=2,verbatim]
2204 \set Timing.beatStructure = #'(2 1)
2205 \set Timing.beamExceptions =
2206 \beamExceptions { 32[ 32] 32[ 32] 32[ 32] }
2208 \repeat unfold 6 { c32 } |
2211 @warning{A @code{beamExceptions} value must be @emph{complete}
2212 exceptions list. That is, every exception that should be applied
2213 must be included in the setting. It is not possible to add, remove,
2214 or change only one of the exceptions. While this may seem cumbersome,
2215 it means that the current beaming settings need not be known in order
2216 to specify a new beaming pattern.}
2218 When the time signature is changed, default values of
2219 @code{Timing.baseMoment}, @code{Timing.beatStructure},
2220 and @code{Timing.beamExceptions} are set. Setting the time signature
2221 will reset the automatic beaming settings for the @code{Timing}
2222 context to the default behavior.
2224 @lilypond[quote,verbatim,relative=2]
2226 \repeat unfold 6 { a8 }
2228 \set Timing.beatStructure = #'(4 2)
2229 \repeat unfold 6 { a8 }
2230 % go back to default behavior
2232 \repeat unfold 6 { a8 }
2235 The default automatic beaming settings for a time signature
2236 are determined in @file{scm/time-signature-settings.scm}.
2237 Changing the default automatic beaming settings
2238 for a time signature is described in @ref{Time signature}.
2240 Many automatic beaming settings for a time signature contain an
2241 entry for @code{beamExceptions}. For example, 4/4 time tries to
2242 beam the measure in two if there are only eighth notes. The
2243 @code{beamExceptions} rule can override the @code{beatStructure} setting
2244 if @code{beamExceptions} is not reset.
2246 @lilypond[quote,verbatim,relative=2]
2248 \set Timing.baseMoment = #(ly:make-moment 1/8)
2249 \set Timing.beatStructure = #'(3 3 2)
2250 % This won't beam (3 3 2) because of beamExceptions
2251 \repeat unfold 8 {c8} |
2252 % This will beam (3 3 2) because we clear beamExceptions
2253 \set Timing.beamExceptions = #'()
2254 \repeat unfold 8 {c8}
2257 In a similar fashion, eighth notes in 3/4 time are beamed as a full
2258 measure by default. To beam eighth notes in 3/4 time on the beat,
2259 reset @code{beamExceptions}.
2261 @lilypond[quote,verbatim,relative=2]
2263 % by default we beam in (6) due to beamExceptions
2264 \repeat unfold 6 {a8} |
2265 % This will beam (1 1 1) due to default baseMoment and beatStructure
2266 \set Timing.beamExceptions = #'()
2267 \repeat unfold 6 {a8}
2270 In engraving from the Romantic and Classical periods,
2271 beams often begin midway through the measure in 3/4 time,
2272 but modern practice is to avoid the false impression of 6/8 time
2273 (see Gould, p. 153). Similar situations arise in 3/8 time.
2274 This behavior is controlled by the context property @code{beamHalfMeasure},
2275 which has effect only in time signatures with 3 in the numerator:
2277 @lilypond[quote,verbatim,relative=2]
2280 \set Timing.beamHalfMeasure = ##f
2284 @subsubsubheading How automatic beaming works
2286 When automatic beaming is enabled, the placement of automatic beams
2287 is determined by the context properties
2288 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2290 The following rules, in order of priority, apply when determining
2291 the appearance of beams:
2295 If a manual beam is specified with @code{[@dots{}]} set the beam
2296 as specified, otherwise
2299 if a beam-ending rule is defined in @code{beamExceptions}
2300 for the beam-type, use it to determine the valid places where
2301 beams may end, otherwise
2304 if a beam-ending rule is defined in @code{beamExceptions}
2305 for a longer beam-type, use it to determine the valid places
2306 where beams may end, otherwise
2309 use the values of @code{baseMoment} and @code{beatStructure} to
2310 determine the ends of the beats in the measure, and
2311 end beams at the end of beats.
2315 In the rules above, the @emph{beam-type} is the duration of the
2316 shortest note in the beamed group.
2318 The default beaming rules can be found in
2319 @file{scm/time-signature-settings.scm}.
2323 @cindex beams, subdividing
2325 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2326 {subdividing-beams.ly}
2328 @cindex beamlets, orienting
2330 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2331 {strict-beat-beaming.ly}
2333 @cindex measure groupings
2334 @cindex beats, grouping
2335 @cindex grouping beats
2336 @cindex measure sub-grouping
2338 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2339 {conducting-signs,-measure-grouping-signs.ly}
2341 @cindex beam, endings in a score
2342 @cindex beam, endings with multiple voices
2344 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2345 {beam-endings-in-score-context.ly}
2349 @ref{Time signature}.
2352 @file{scm/time-signature-settings.scm}.
2357 Internals Reference:
2358 @rinternals{Auto_beam_engraver},
2360 @rinternals{BeamForbidEvent},
2361 @rinternals{beam-interface}.
2364 If a score ends while an automatic beam has not been ended and is
2365 still accepting notes, this last beam will not be typeset at all.
2366 The same holds for polyphonic voices, entered with
2367 @code{<< @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
2368 automatic beam is still accepting notes, it is not typeset.
2369 The workaround for these problems is to manually beam the last
2370 beam in the voice or score.
2372 By default, the @code{Timing} translator is aliased to the
2373 @code{Score} context. This means that setting the time signature
2374 in one staff will affect the beaming of the other staves as well.
2375 Thus, a time signature setting in a later staff will reset custom
2376 beaming that was set in an earlier staff.
2377 One way to avoid this problem is to set the time signature
2380 @lilypond[quote,verbatim,relative=2]
2384 \set Timing.baseMoment = #(ly:make-moment 1/8)
2385 \set Timing.beatStructure = #'(1 5)
2386 \set Timing.beamExceptions = #'()
2387 \repeat unfold 6 { a8 }
2390 \repeat unfold 6 { a8 }
2395 The default beam settings for the time signature can also be changed, so
2396 that the desired beaming will always be used. Changes in automatic
2397 beaming settings for a time signature are described in
2398 @ref{Time signature}.
2400 @lilypond[quote,verbatim,relative=2]
2403 \overrideTimeSignatureSettings
2404 3/4 % timeSignatureFraction
2405 1/8 % baseMomentFraction
2406 #'(1 5) % beatStructure
2407 #'() % beamExceptions
2409 \repeat unfold 6 { a8 }
2413 \repeat unfold 6 { a8 }
2420 @unnumberedsubsubsec Manual beams
2422 @cindex beams, manual
2423 @cindex manual beams
2428 In some cases it may be necessary to override the automatic
2429 beaming algorithm. For example, the autobeamer will not put beams
2430 over rests or bar lines, and in choral scores the beaming is
2431 often set to follow the meter of the lyrics rather than the
2432 notes. Such beams can be specified manually by
2433 marking the begin and end point with @code{[} and @code{]}.
2435 @lilypond[quote,relative=1,verbatim]
2436 r4 r8[ g' a r] r g[ | a] r
2439 @cindex manual beams, direction shorthand for
2440 @cindex manual beams, grace notes
2442 Beaming direction can be set manually using direction indicators:
2444 @lilypond[quote,relative=2,verbatim]
2445 c8^[ d e] c,_[ d e f g]
2451 Individual notes may be marked with @code{\noBeam} to prevent them
2454 @lilypond[quote,verbatim,relative=2]
2459 Grace note beams and normal note beams can occur simultaneously.
2460 Unbeamed grace notes are not put into normal note beams.
2462 @lilypond[quote,verbatim,relative=2]
2464 \grace { e32 d c d }
2470 @funindex stemLeftBeamCount
2471 @funindex stemRightBeamCount
2473 Even more strict manual control with the beams can be achieved by
2474 setting the properties @code{stemLeftBeamCount} and
2475 @code{stemRightBeamCount}. They specify the number of beams to
2476 draw on the left and right side, respectively, of the next note.
2477 If either property is set, its value will be used only once, and
2478 then it is erased. In this example, the last @code{f} is printed
2479 with only one beam on the left side, i.e., the eighth-note beam of
2480 the group as a whole.
2482 @lilypond[quote,relative=2,verbatim]
2485 \set stemLeftBeamCount = #2
2486 \set stemRightBeamCount = #1
2488 \set stemLeftBeamCount = #1
2500 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2501 {flat-flags-and-beam-nibs.ly}
2505 @ref{Direction and placement},
2511 Internals Reference:
2513 @rinternals{BeamEvent},
2514 @rinternals{Beam_engraver},
2515 @rinternals{beam-interface},
2516 @rinternals{Stem_engraver}.
2519 @node Feathered beams
2520 @unnumberedsubsubsec Feathered beams
2522 @cindex beams, feathered
2523 @cindex feathered beams
2525 @funindex \featherDurations
2526 @funindex featherDurations
2527 @funindex grow-direction
2529 Feathered beams are used to indicate that a small group of notes
2530 should be played at an increasing (or decreasing) tempo, without
2531 changing the overall tempo of the piece. The extent of the
2532 feathered beam must be indicated manually using @code{[} and
2533 @code{]}, and the beam feathering is turned on by specifying a
2534 direction to the @code{Beam} property @code{grow-direction}.
2536 If the placement of the notes and the sound in the MIDI output is to
2537 reflect the @emph{ritardando} or @emph{accelerando} indicated by the
2538 feathered beam the notes must be grouped as a music expression delimited
2539 by braces and preceded by a @code{featherDurations} command which specifies
2540 the ratio between the durations of the first and last notes in the
2543 The square brackets show the extent of the beam and the braces show
2544 which notes are to have their durations modified. Normally these
2545 would delimit the same group of notes, but this is not required: the
2546 two commands are independent.
2548 In the following example the eight 16th notes occupy exactly the
2549 same time as a half note, but the first note is one half as long
2550 as the last one, with the intermediate notes gradually
2551 lengthening. The first four 32nd notes gradually speed up, while
2552 the last four 32nd notes are at a constant tempo.
2554 @lilypond[relative=1,verbatim,quote]
2555 \override Beam.grow-direction = #LEFT
2556 \featherDurations #(ly:make-moment 2/1)
2557 { c16[ c c c c c c c] }
2558 \override Beam.grow-direction = #RIGHT
2559 \featherDurations #(ly:make-moment 2/3)
2561 % revert to non-feathered beams
2562 \override Beam.grow-direction = #'()
2567 The spacing in the printed output represents the
2568 note durations only approximately, but the MIDI output is exact.
2571 @code{\featherDurations}.
2579 The @code{\featherDurations} command only works with very short
2580 music snippets, and when numbers in the fraction are small.
2589 * Bar and bar number checks::
2594 @unnumberedsubsubsec Bar lines
2597 @cindex measure lines
2598 @cindex closing bar lines
2599 @cindex bar lines, closing
2600 @cindex double bar lines
2601 @cindex bar lines, double
2607 Bar lines delimit measures, and are also used to indicate
2608 repeats. Normally, simple bar lines are automatically inserted
2609 into the printed output at places based on the current time
2612 The simple bar lines inserted automatically can be changed to
2613 other types with the @code{\bar} command. For example, a closing
2614 double bar line is usually placed at the end of a piece:
2616 @lilypond[quote,relative=1,verbatim]
2620 It is not invalid if the final note in a measure does not
2621 end on the automatically entered bar line: the note is assumed
2622 to carry over into the next measure. But if a long sequence
2623 of such carry-over measures appears the music can appear compressed
2624 or even flowing off the page. This is because automatic line
2625 breaks happen only at the end of complete measures, i.e., where
2626 all notes end before the end of a measure.
2628 @warning{An incorrect duration can cause line breaks to be
2629 inhibited, leading to a line of highly compressed music or
2630 music which flows off the page.}
2633 @cindex bar lines, invisible
2634 @cindex measure lines, invisible
2636 Line breaks are also permitted at manually inserted bar lines
2637 even within incomplete measures. To allow a line break without
2638 printing a bar line, use the following:
2645 This will insert an invisible bar line and allow (but not
2646 force) a line break to occur at this point. The bar number
2647 counter is not increased. To force a line break see
2648 @ref{Line breaking}.
2650 @cindex manual bar lines
2651 @cindex manual measure lines
2652 @cindex bar lines, manual
2653 @cindex measure lines, manual
2655 This and other special bar lines may be inserted manually at any
2656 point. When they coincide with the end of a measure they replace
2657 the simple bar line which would have been inserted there
2658 automatically. When they do not coincide with the end of a measure
2659 the specified bar line is inserted at that point in the printed
2662 Note that manual bar lines are purely visual. They do not affect
2663 any of the properties that a normal bar line would affect, such as
2664 measure numbers, accidentals, line breaks, etc. They do not affect
2665 the calculation and placement of subsequent automatic bar lines.
2666 When a manual bar line is placed where a normal bar line already
2667 exists, the effects of the original bar line are not altered.
2669 Two types of simple bar lines and five types of double bar lines are
2670 available for manual insertion:
2672 @lilypond[quote,relative=1,verbatim]
2684 together with dotted and dashed bar lines:
2686 @lilypond[quote,relative=1,verbatim]
2693 and nine types of repeat bar lines:
2695 @lilypond[quote,relative=1,verbatim]
2708 Additionally, a bar line can be printed as a simple tick:
2709 @lilypond[quote,relative=1,verbatim]
2712 However, as such ticks are typically used in Gregorian chant, it is
2713 preferable to use @code{\divisioMinima} there instead, described in
2714 the section @ref{Divisiones} in Gregorian chant.
2716 Lilypond supports kievan notation and provides a special kievan
2718 @lilypond[quote,relative=1,verbatim]
2721 Further details of this notation are explained in
2722 @ref{Typesetting Kievan square notation}.
2726 For in-line segno signs, there are three types of bar lines which
2727 differ in their behavior at line breaks:
2729 @lilypond[quote,relative=2,verbatim]
2747 Although the bar line types signifying repeats may be inserted
2748 manually they do not in themselves cause LilyPond to recognize
2749 a repeated section. Such repeated sections are better entered
2750 using the various repeat commands (see @ref{Repeats}), which
2751 automatically print the appropriate bar lines.
2753 In addition, you can specify @code{".|:-||"}, which is equivalent to
2754 @code{".|:"} except at line breaks, where it gives a double bar
2755 line at the end of the line and a start repeat at the beginning of
2758 @lilypond[quote,relative=2,verbatim]
2766 For combinations of repeats with the segno sign, there are six different
2769 @lilypond[quote,relative=2,verbatim]
2797 Additionally there is an @code{\inStaffSegno} command which creates
2798 a segno bar line in conjunction with an appropriate repeat bar line
2799 when used with a @code{\repeat volta} command, see
2800 @ref{Normal repeats}.
2802 @funindex \defineBarLine
2803 @funindex defineBarLine
2804 @cindex bar lines, defining
2805 @cindex defining bar lines
2807 New bar line types can be defined with @code{\defineBarLine}:
2810 \defineBarLine @var{bartype} #'(@var{end} @var{begin} @var{span})
2813 The @code{\defineBarline} variables can include the
2814 @q{empty} string @code{""}, which is equivalent to an invisible
2815 bar line being printed. Or they can be set to @code{#f} which
2816 prints no bar line at all.
2818 After the definiton, the new bar line can be used by
2819 @code{\bar} @var{bartype}.
2821 There are currently ten bar line elements available:
2823 @lilypond[quote,verbatim]
2824 \defineBarLine ":" #'("" ":" "")
2825 \defineBarLine "=" #'("=" "" "")
2826 \defineBarLine "[" #'("" "[" "")
2827 \defineBarLine "]" #'("]" "" "")
2844 The @code{"="} bar line provides the double span bar line, used
2845 in combination with the segno sign. Do not use it as a standalone
2846 double thin bar line; here, @code{\bar} @var{"||"} is
2849 The @code{"-"} sign starts annotations to bar lines which
2850 are useful to distinguish those with identical appearance
2851 but different behavior at line breaks and/or different span bars.
2852 The part following the @code{"-"} sign is not used for building up
2855 @lilypond[quote,relative=2,verbatim]
2856 \defineBarLine "||-dashedSpan" #'("||" "" "!!")
2861 c1 \bar "||-dashedSpan"
2872 Furthermore, the space character @code{" "} serves as a placeholder
2873 for defining span bars correctly aligned to the main bar lines:
2875 @lilypond[quote,relative=2,verbatim]
2876 \defineBarLine ":|.-wrong" #'(":|." "" "|.")
2877 \defineBarLine ":|.-right" #'(":|." "" " |.")
2893 If additional elements are needed, LilyPond provides a simple
2894 way to define them. For more informations on modifying or adding
2895 bar lines, see file @file{scm/bar-line.scm}.
2897 In scores with many staves, a @code{\bar} command in one staff is
2898 automatically applied to all staves. The resulting bar lines are
2899 connected between different staves of a @code{StaffGroup},
2900 @code{PianoStaff}, or @code{GrandStaff}.
2902 @lilypond[quote,relative=1,verbatim]
2910 \new Staff { \clef bass c4 g e g }
2912 \new Staff { \clef bass c2 c2 }
2917 @cindex default bar lines, changing
2918 @cindex bar lines, default, changing
2921 @funindex defaultBarType
2926 The command @samp{\bar @var{bartype}} is a shortcut for
2927 @samp{\set Timing.whichBar = @var{bartype}}. A bar line is
2928 created whenever the @code{whichBar} property is set.
2930 The default bar type used for automatically inserted bar lines is
2931 @code{"|"}. This may be changed at any time with
2932 @samp{\set Timing.defaultBarType = @var{bartype}}.
2936 @ref{Line breaking},
2938 @ref{Grouping staves}.
2941 @file{scm/bar-line.scm}.
2946 Internals Reference:
2947 @rinternals{BarLine} (created at @code{Staff} level),
2948 @rinternals{SpanBar} (across staves),
2949 @rinternals{Timing_translator} (for Timing properties).
2953 @unnumberedsubsubsec Bar numbers
2956 @cindex measure numbers
2957 @cindex numbers, bar
2958 @cindex numbers, measure
2960 @funindex currentBarNumber
2962 Bar numbers are typeset by default at the start of every line except
2963 the first line. The number itself is stored in the
2964 @code{currentBarNumber} property, which is normally updated
2965 automatically for every measure. It may also be set manually:
2967 @lilypond[verbatim,quote,relative=1]
2970 \set Score.currentBarNumber = #50
2974 @cindex bar numbers, regular spacing
2976 @funindex barNumberVisibility
2979 Bar numbers can be typeset at regular intervals instead of just at
2980 the beginning of every line. To do this the default behavior
2981 must be overridden to permit bar numbers to be printed at places
2982 other than the start of a line. This is controlled by the
2983 @code{break-visibility} property of @code{BarNumber}. This takes
2984 three values which may be set to @code{#t} or @code{#f} to specify
2985 whether the corresponding bar number is visible or not. The order
2986 of the three values is @code{end of line visible}, @code{middle of
2987 line visible}, @code{beginning of line visible}. In the following
2988 example bar numbers are printed at all possible places:
2990 @lilypond[verbatim,quote,relative=1]
2991 \override Score.BarNumber.break-visibility = ##(#t #t #t)
2992 \set Score.currentBarNumber = #11
2993 % Permit first bar number to be printed
3001 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3002 {printing-the-bar-number-for-the-first-measure.ly}
3004 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3005 {printing-bar-numbers-at-regular-intervals.ly}
3007 @cindex measure number, format
3008 @cindex bar number, format
3010 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3011 {printing-bar-numbers-inside-boxes-or-circles.ly}
3013 @cindex bar numbers, with letters
3014 @cindex bar numbers, with repeats
3016 @lilypondfile[verbatim,quote,texidoc,doctitle]
3017 {alternative-bar-numbering.ly}
3019 @cindex bar number alignment
3021 @lilypondfile[verbatim,quote,texidoc,doctitle]
3022 {aligning-bar-numbers.ly}
3024 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3025 {removing-bar-numbers-from-a-score.ly}
3031 Internals Reference:
3032 @rinternals{BarNumber},
3033 @rinternals{Bar_number_engraver}.
3035 @cindex bar number collision
3036 @cindex collision, bar number
3039 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
3040 if there is one. To solve this, the @code{padding} property of
3041 @code{BarNumber} can be used to position the number correctly. See
3042 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
3045 @node Bar and bar number checks
3046 @unnumberedsubsubsec Bar and bar number checks
3049 @cindex bar number check
3050 @cindex measure check
3051 @cindex measure number check
3053 @funindex barCheckSynchronize
3056 Bar checks help detect errors in the entered durations. A bar check
3057 may be entered using the bar symbol, @code{|}, at any place where a
3058 bar line is expected to fall. If bar check lines are encountered at
3059 other places, a list of warnings is printed in the log file, showing
3060 the line numbers and lines in which the bar checks failed. In the
3061 next example, the second bar check will signal an error.
3064 \time 3/4 c2 e4 | g2 |
3067 An incorrect duration can result in a completely garbled score,
3068 especially if the score is polyphonic, so a good place to start
3069 correcting input is by scanning for failed bar checks and
3070 incorrect durations.
3072 If successive bar checks are off by the same musical interval,
3073 only the first warning message is displayed. This allows the
3074 warning to focus on the source of the timing error.
3076 Bar checks can also be inserted in lyrics:
3081 Twin -- kle | Twin -- kle |
3085 Note that bar check marks in lyrics are evaluated at the musical
3086 moment when the syllable @emph{following} the check mark is processed.
3087 If the lyrics are associated with the notes of a voice which has a
3088 rest at the beginning of a bar, then no syllable can be located at the
3089 start of that bar and a warning will be issued if a bar check mark is
3090 placed in the lyrics at that position.
3096 It is also possible to redefine the action taken when a bar check
3097 or pipe symbol, @code{|}, is encountered in the input, so that
3098 it does something other than a bar check. This is done by
3099 assigning a music expression to @code{"|"}.
3100 In the following example @code{|} is set to insert a double bar
3101 line wherever it appears in the input, rather than checking
3104 @lilypond[quote,verbatim]
3114 @funindex \barNumberCheck
3115 @funindex barNumberCheck
3117 When copying large pieces of music, it can be helpful to check that
3118 the LilyPond bar number corresponds to the original that you are
3119 entering from. This can be checked with @code{\barNumberCheck}, for
3123 \barNumberCheck #123
3127 will print a warning if the @code{currentBarNumber} is not 123
3128 when it is processed.
3135 @node Rehearsal marks
3136 @unnumberedsubsubsec Rehearsal marks
3138 @cindex rehearsal marks
3139 @cindex mark, rehearsal
3144 To print a rehearsal mark, use the @code{\mark} command.
3146 @lilypond[quote,verbatim,relative=2]
3154 The mark is incremented automatically if you use @code{\mark
3155 \default}, but you can also use an integer argument to set the
3156 mark manually. The value to use is stored in the property
3157 @code{rehearsalMark}.
3159 @lilypond[quote,verbatim,relative=2]
3168 The letter@tie{}@q{I} is skipped in accordance with engraving
3169 traditions. If you wish to include the letter @q{I}, then use one
3170 of the following commands, depending on which style of rehearsal mark
3171 you want (letters only, letters in a hollow box, or letters in a
3175 \set Score.markFormatter = #format-mark-alphabet
3176 \set Score.markFormatter = #format-mark-box-alphabet
3177 \set Score.markFormatter = #format-mark-circle-alphabet
3180 @lilypond[quote,verbatim,relative=2]
3181 \set Score.markFormatter = #format-mark-box-alphabet
3189 @cindex rehearsal mark format
3190 @cindex rehearsal mark style
3191 @cindex style, rehearsal mark
3192 @cindex format, rehearsal mark
3193 @cindex mark, rehearsal, style
3194 @cindex mark, rehearsal, format
3195 @cindex rehearsal mark, manual
3196 @cindex mark, rehearsal, manual
3197 @cindex custom rehearsal mark
3198 @cindex manual rehearsal mark
3200 The style is defined by the property @code{markFormatter}. It is
3201 a function taking the current mark (an integer) and the current
3202 context as argument. It should return a markup object. In the
3203 following example, @code{markFormatter} is set to a pre-defined
3204 procedure. After a few measures, it is set to a procedure that
3205 produces a boxed number.
3207 @lilypond[quote,verbatim,relative=2]
3208 \set Score.markFormatter = #format-mark-numbers
3211 \set Score.markFormatter = #format-mark-box-numbers
3213 \set Score.markFormatter = #format-mark-circle-numbers
3215 \set Score.markFormatter = #format-mark-circle-letters
3219 The file @file{scm/translation-functions.scm} contains the
3220 definitions of @code{format-mark-numbers} (the default format),
3221 @code{format-mark-box-numbers}, @code{format-mark-letters} and
3222 @code{format-mark-box-letters}. These can be used as inspiration
3223 for other formatting functions.
3225 You may use @code{format-mark-barnumbers},
3226 @code{format-mark-box-barnumbers}, and
3227 @code{format-mark-circle-barnumbers} to get bar numbers instead of
3228 incremented numbers or letters.
3230 Other styles of rehearsal mark can be specified manually:
3237 Note that @code{Score.markFormatter} does not affect marks specified
3238 in this manner. However, it is possible to apply a @code{\markup} to the
3242 \mark \markup@{ \box A1 @}
3247 @cindex D.S. al Fine
3249 @cindex music glyphs
3250 @cindex glyphs, music
3252 @funindex \musicglyph
3253 @funindex musicglyph
3255 Music glyphs (such as the segno sign) may be printed inside a
3258 @lilypond[quote,verbatim,relative=1]
3259 c1 \mark \markup { \musicglyph #"scripts.segno" }
3260 c1 \mark \markup { \musicglyph #"scripts.coda" }
3261 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
3266 See @ref{The Feta font}, for a list of symbols which may be
3267 printed with @code{\musicglyph}.
3269 For common tweaks to the positioning of rehearsal marks, see
3270 @ref{Formatting text}. For more precise control, see
3271 @code{break-alignable-interface} in @ref{Aligning objects}.
3273 The file @file{scm/translation-functions.scm} contains
3274 the definitions of @code{format-mark-numbers} and
3275 @code{format-mark-letters}. They can be used as inspiration for
3276 other formatting functions.
3280 @ref{The Feta font},
3281 @ref{Formatting text},
3282 @ref{Aligning objects}.
3285 @file{scm/translation-functions.scm}.
3290 Internals Reference:
3291 @rinternals{MarkEvent},
3292 @rinternals{Mark_engraver},
3293 @rinternals{RehearsalMark}.
3296 @node Special rhythmic concerns
3297 @subsection Special rhythmic concerns
3302 * Aligning to cadenzas::
3303 * Time administration::
3307 @unnumberedsubsubsec Grace notes
3311 @cindex appoggiatura
3312 @cindex acciaccatura
3315 @funindex \slashedGrace
3316 @funindex \acciaccatura
3317 @funindex \appoggiatura
3319 Grace notes are musical ornaments, printed in a smaller font, that take
3320 up no additional logical time in a measure.
3322 @lilypond[quote,relative=2,verbatim]
3324 \grace { b16 c16 } a2)
3327 There are three other types of grace notes possible; the
3328 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
3329 note with a slashed stem -- and the @emph{appoggiatura}, which takes a
3330 fixed fraction of the main note it is attached to and prints without the
3331 slash. It is also possible to write a grace note with a slashed stem,
3332 like the @emph{acciaccatura} but without the slur, so as to place it
3333 between notes that are slurred themselves, using the
3334 @code{\slashedGrace} function.
3336 @lilypond[quote,relative=2,verbatim]
3339 \acciaccatura { g16 f } e2
3340 \slashedGrace a,8 g4
3341 \slashedGrace b16 a4(
3342 \slashedGrace b8 a2)
3345 The placement of grace notes is synchronized between different staves.
3346 In the following example, there are two sixteenth grace notes for every
3349 @lilypond[quote,relative=2,verbatim]
3351 \new Staff { e2 \grace { c16 d e f } e2 }
3352 \new Staff { c2 \grace { g8 b } c2 }
3356 @cindex grace notes, following
3358 @funindex \afterGrace
3359 @funindex afterGrace
3361 If you want to end a note with a grace, use the @code{\afterGrace}
3362 command. It takes two arguments: the main note, and the grace
3363 notes following the main note.
3365 @lilypond[quote,verbatim,relative=2]
3366 c1 \afterGrace d1 { c16[ d] } c1
3369 This will put the grace notes after a space lasting 3/4 of the
3370 length of the main note. The default fraction 3/4 can be changed by
3371 setting @code{afterGraceFraction}. The following example shows
3372 the results from setting the space at the default, at 15/16, and
3373 finally at 1/2 of the main note.
3375 @lilypond[quote,verbatim,relative=2]
3378 c1 \afterGrace d1 { c16[ d] } c1
3381 #(define afterGraceFraction (cons 15 16))
3382 c1 \afterGrace d1 { c16[ d] } c1
3385 #(define afterGraceFraction (cons 1 2))
3386 c1 \afterGrace d1 { c16[ d] } c1
3391 The space between the main note and the grace note may also be
3392 specified using spacers. The following example places the grace
3393 note after a space lasting 7/8 of the main note.
3395 @lilypond[quote,verbatim,relative=2]
3399 { s2 s4. \grace { c16 d } }
3405 @cindex tweaking grace notes
3406 @cindex grace notes, tweaking
3407 @cindex grace notes, changing layout settings
3409 A @code{\grace} music expression will introduce special
3410 typesetting settings, for example, to produce smaller type, and
3411 set directions. Hence, when introducing layout tweaks to
3412 override the special settings, they should be placed inside
3413 the grace expression. The overrides should also be reverted
3414 inside the grace expression. Here, the grace note's default stem
3415 direction is overridden and then reverted.
3417 @lilypond[quote,verbatim,relative=2]
3429 @cindex stem, with slash
3434 @lilypondfile[verbatim,quote,texidoc,doctitle]
3435 {using-grace-note-slashes-with-normal-heads.ly}
3437 @lilypondfile[verbatim,quote,texidoc,doctitle]
3438 {tweaking-grace-layout-within-music.ly}
3440 @lilypondfile[verbatim,quote,texidoc,doctitle]
3441 {redefining-grace-note-global-defaults.ly}
3443 @lilypondfile[verbatim,quote,texidoc,doctitle]
3444 {positioning-grace-notes-with-floating-space.ly}
3448 @rglos{grace notes},
3449 @rglos{acciaccatura},
3450 @rglos{appoggiatura}.
3453 @ref{Scaling durations},
3457 @file{ly/grace-init.ly}.
3462 Internals Reference:
3463 @rinternals{GraceMusic},
3464 @rinternals{Grace_beam_engraver},
3465 @rinternals{Grace_auto_beam_engraver},
3466 @rinternals{Grace_engraver},
3467 @rinternals{Grace_spacing_engraver}.
3471 @cindex acciaccatura, multi-note
3472 @cindex multi-note acciaccatura
3473 @cindex grace-note synchronization
3475 A multi-note beamed @i{acciaccatura} is printed without a slash,
3476 and looks exactly the same as a multi-note beamed
3479 @c TODO Add link to LSR snippet to add slash when available
3481 Grace note synchronization can also lead to surprises. Staff
3482 notation, such as key signatures, bar lines, etc., are also
3483 synchronized. Take care when you mix staves with grace notes and
3484 staves without, for example,
3486 @lilypond[quote,relative=2,verbatim]
3488 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3489 \new Staff { c4 \bar ".|:" d2. }
3494 This can be remedied by inserting grace skips of the corresponding
3495 durations in the other staves. For the above example
3497 @lilypond[quote,relative=2,verbatim]
3499 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3500 \new Staff { c4 \bar ".|:" \grace s16 d2. }
3504 Please make sure that you use the @code{\grace} command for the
3505 spacer part, even if the visual part uses @code{\acciaccatura} or
3506 @code{\appoggiatura} because otherwise an ugly slur fragment will
3507 be printed, connecting the invisible grace note with the following
3510 The use of grace notes within voice contexts confuses the way the voice
3511 is typeset. This can be overcome by inserting a rest or note between the
3512 voice command and the grace note.
3514 @lilypond[quote,verbatim]
3516 \acciaccatura { f8 } e8 r8 \acciaccatura { f8 } e8 r4
3523 r8 r8 \voiceOne \accMusic \oneVoice r8 |
3524 r8 \voiceOne r8 \accMusic \oneVoice r8 |
3529 s8 s8 \voiceTwo \accMusic \oneVoice s8 |
3530 s8 \voiceTwo r8 \accMusic \oneVoice s8 |
3537 Grace sections should only be used within sequential music expressions.
3538 Nesting or juxtaposing grace sections is not supported, and might
3539 produce crashes or other errors.
3541 Each grace note in MIDI output has a length of 1/4 of its actual
3542 duration. If the combined length of the grace notes is greater than the
3543 length of the preceding note a @qq{@code{Going back in MIDI time}}
3544 error will be generated. Either make the grace notes shorter in
3545 duration, for example:
3548 c'8 \acciaccatura @{ c'8[ d' e' f' g'] @}
3554 c'8 \acciaccatura @{ c'16[ d' e' f' g'] @}
3557 Or explicitly change the musical duration:
3560 c'8 \acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
3563 See @ref{Scaling durations}.
3566 @node Aligning to cadenzas
3567 @unnumberedsubsubsec Aligning to cadenzas
3570 @cindex cadenza, aligning to
3571 @cindex aligning to cadenza
3573 In an orchestral context, cadenzas present a special problem: when
3574 constructing a score that includes a measured cadenza or other solo
3575 passage, all other instruments should skip just as many notes as the
3576 length of the cadenza, otherwise they will start too soon or too late.
3578 One solution to this problem is to use the functions
3579 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
3580 functions take a defined piece of music as an argument and generate a
3581 multi-measure rest or @code{\skip} exactly as long as the piece.
3583 @lilypond[verbatim,quote]
3584 MyCadenza = \relative c' {
3595 #(mmrest-of-length MyCadenza)
3597 #(skip-of-length MyCadenza)
3611 @node Time administration
3612 @unnumberedsubsubsec Time administration
3614 @cindex time administration
3615 @cindex timing (within the score)
3616 @cindex music, unmetered
3617 @cindex unmetered music
3619 @funindex currentBarNumber
3620 @funindex measurePosition
3621 @funindex measureLength
3623 Time is administered by the @code{Timing_translator}, which by
3624 default is to be found in the @code{Score} context. An alias,
3625 @code{Timing}, is added to the context in which the
3626 @code{Timing_translator} is placed. To ensure that the
3627 @code{Timing} alias is available, you may need to explicitly
3628 instantiate the containing context (such as @code{Voice} or
3631 The following properties of @code{Timing} are used
3632 to keep track of timing within the score.
3635 @cindex measure number
3638 @item currentBarNumber
3639 The current measure number. For an example showing the
3640 use of this property see @ref{Bar numbers}.
3643 The length of the measures in the current time signature. For a
3644 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
3645 determines when bar lines are inserted and how automatic beams
3646 should be generated.
3648 @item measurePosition
3649 The point within the measure where we currently are. This
3650 quantity is reset by subtracting @code{measureLength} whenever
3651 @code{measureLength} is reached or exceeded. When that happens,
3652 @code{currentBarNumber} is incremented.
3655 If set to true, the above variables are updated for every time
3656 step. When set to false, the engraver stays in the current
3657 measure indefinitely.
3661 Timing can be changed by setting any of these variables
3662 explicitly. In the next example, the default 4/4 time
3663 signature is printed, but @code{measureLength} is set to 5/4.
3664 At 4/8 through the third measure, the @code{measurePosition} is
3665 advanced by 1/8 to 5/8, shortening that bar by 1/8.
3666 The next bar line then falls at 9/8 rather than 5/4.
3668 @lilypond[quote,verbatim]
3669 \new Voice \relative c' {
3670 \set Timing.measureLength = #(ly:make-moment 5/4)
3674 \set Timing.measurePosition = #(ly:make-moment 5/8)
3681 As the example illustrates, @code{ly:make-moment n m} constructs a
3682 duration of n/m of a whole note. For example,
3683 @code{ly:make-moment 1 8} is an eighth note duration and
3684 @code{ly:make-moment 7 16} is the duration of seven sixteenths
3690 @ref{Unmetered music}.
3695 Internals Reference:
3696 @rinternals{Timing_translator},