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
206 \tuplet @var{fraction} @{ @var{music} @}
210 The fraction's numerator will be printed over or
211 under the notes, optionally with a bracket. The most common
212 tuplets are triplets: 3@tie{}notes sound within the duration
213 normally allowed for@tie{}2:
215 @lilypond[quote,verbatim,relative=2]
216 a2 \tuplet 3/2 { b4 4 4 }
217 c4 c \tuplet 3/2 { b4 a g }
220 @cindex tuplet grouping
222 When entering long passages of tuplets, having to write a separate
223 @code{\tuplet} command for each group is inconvenient. It is
224 possible to specify the duration of one tuplet group directly
225 before the music in order to have the tuplets grouped
228 @lilypond[quote,verbatim,relative=2]
229 g2 r8 \tuplet 3/2 8 { cis16 d e e f g g f e }
232 @cindex tuplet bracket placement
236 @funindex \tupletDown
238 @funindex \tupletNeutral
239 @funindex tupletNeutral
241 Tuplet brackets may be manually placed above or below the staff;
242 see @ref{Direction and placement}.
244 Tuplets may be nested:
246 @lilypond[quote,verbatim,relative=2]
248 c4 \tuplet 5/4 { f8 e f \tuplet 3/2 { e[ f g] } } f4
251 Modifying nested tuplets which begin at the same musical moment
252 must be done with @code{\tweak}.
254 To modify the duration of notes without printing a tuplet bracket,
255 see @ref{Scaling durations}.
261 @code{\tupletNeutral}.
267 @cindex tuplet formatting
268 @cindex triplet formatting
270 @funindex tupletNumberFormatFunction
271 @funindex tupletSpannerDuration
273 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
274 {entering-several-tuplets-using-only-one--times-command.ly}
276 @cindex Tuplet number changes
278 @funindex TupletNumber
280 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
281 {changing-the-tuplet-number.ly}
283 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
284 {non-default-tuplet-numbers.ly}
286 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
287 {controlling-tuplet-bracket-visibility.ly}
289 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
290 {permitting-line-breaks-within-beamed-tuplets.ly}
299 @rlearning{Tweaking methods}.
302 @ref{Time administration},
303 @ref{Scaling durations},
304 @ref{The tweak command},
305 @ref{Polymetric notation}.
311 @rinternals{TupletBracket},
312 @rinternals{TupletNumber},
313 @rinternals{TimeScaledMusic}.
315 @cindex grace notes within tuplet brackets
318 Grace notes may be placed within tuplet brackets, @emph{except}
319 when a staff begins with a grace note followed by a tuplet. In this
320 particular case, the grace note must be placed before the @code{\tuplet}
321 command to avoid errors.
323 @cindex tempo marks within tuplet brackets
325 When using a tuplet at the beginning of a piece with a @code{\tempo}
326 mark, the music must be explicitly entered in a @code{\new Voice}
327 block, as discussed in @rlearning{Voices contain music}.
330 @node Scaling durations
331 @unnumberedsubsubsec Scaling durations
333 @cindex scaling durations
334 @cindex durations, scaling
336 The duration of single notes, rests or chords may be multiplied by a
337 fraction @code{N/M} by appending @code{*N/M} (or @code{*N} if @code{M}
338 is 1) to the duration. This will not affect the appearance of the
339 notes or rests produced, but the altered duration will be used in
340 calculating the position within the measure and setting the duration
341 in the MIDI output. Multiplying factors may be combined like
342 @code{*L*M/N}. Factors are part of the duration: if a duration is
343 not specified for subsequent notes, the default duration taken from
344 the preceding note will include any scaling factor.
346 In the following example, the first three notes take up exactly
347 two beats, but no triplet bracket is printed.
349 @lilypond[quote,relative=2,verbatim]
351 % Alter durations to triplets
355 % Double the duration of chord
357 % Duration of quarter, appears like sixteenth
361 The duration of spacer rests may also be modified by
362 a multiplier. This is useful for skipping many measures, e.g.,
365 @cindex compressing music
366 @cindex expanding music
368 @funindex \scaleDurations
369 @funindex scaleDurations
371 Longer stretches of music may be compressed by a fraction in the
372 same way, as if every note, chord or rest had the fraction as a
373 multiplier. This leaves the appearance of the music unchanged but
374 the internal duration of the notes will be multiplied by the
375 fraction @emph{num}/@emph{den}. Here is an example showing how music
376 can be compressed and expanded:
378 @lilypond[quote,relative=2,verbatim]
382 % Scale music by *2/3
383 \scaleDurations 2/3 {
387 \scaleDurations 2/1 {
392 One application of this command is in polymetric
393 notation, see @ref{Polymetric notation}.
398 @ref{Invisible rests},
399 @ref{Polymetric notation}.
405 The calculation of the position within a measure must take into
406 account all the scaling factors applied to the notes within that
407 measure and any fractional carry-out from earlier measures. This
408 calculation is carried out using rational numbers. If an intermediate
409 numerator or denominator in that calculation exceeds 2^30 the
410 execution and typesetting will stop at that point without indicating
415 @unnumberedsubsubsec Ties
421 A tie connects two adjacent note heads of the same pitch. The tie
422 in effect extends the duration of a note.
424 @warning{Ties should not be confused with @emph{slurs}, which
425 indicate articulation, or @emph{phrasing slurs}, which indicate
426 musical phrasing. A tie is just a way of extending a note
427 duration, similar to the augmentation dot.}
429 A tie is entered by appending a tilde symbol (@code{~}) to the first
430 of each pair of notes being tied. This indicates that the note
431 should be tied to the following note, which must be at the same pitch.
433 @lilypond[quote,verbatim,relative=2]
437 Ties can make use of the @q{last explicit pitch} interpretation of
440 @lilypond[quote,verbatim,relative=2]
444 Ties are used either when the note crosses a bar line, or when
445 dots cannot be used to denote the rhythm. Ties should also be
446 used when note values cross larger subdivisions of the measure:
448 @lilypond[verbatim,quote]
455 If you need to tie many notes across bar lines, it may be
456 easier to use automatic note splitting, see @ref{Automatic note
457 splitting}. This mechanism automatically splits long notes, and
458 ties them across bar lines.
460 @cindex ties and chords
461 @cindex chords and ties
463 When a tie is applied to a chord, all note heads whose pitches
464 match are connected. When no note heads match, no ties will be
465 created. Chords may be partially tied by placing the ties inside
468 @lilypond[quote,verbatim,relative=1]
471 <c~ e g~ b> <c e g b>
474 @cindex repeating ties
475 @cindex ties, repeating
476 @cindex volta brackets and ties
477 @cindex ties and volta brackets
482 When a second alternative of a repeat starts with a tied note, you
483 have to specify the repeated tie as follows:
485 @lilypond[quote,relative=2,verbatim]
486 \repeat volta 2 { c g <c e>2~ }
488 % First alternative: following note is tied normally
490 % Second alternative: following note has a repeated tie
491 { <c e>2\repeatTie d4 c } }
494 @cindex laissez vibrer
495 @cindex ties, laissez vibrer
497 @funindex \laissezVibrer
498 @funindex laissezVibrer
500 @notation{L.v.}@: ties (@notation{laissez vibrer}) indicate that
501 notes must not be damped at the end. It is used in notation for
502 piano, harp and other string and percussion instruments. They can
503 be entered as follows:
505 @lilypond[quote,verbatim,relative=1]
506 <c f g>1\laissezVibrer
509 @cindex ties, placement
515 @funindex \tieNeutral
518 Ties may be made to curve up or down manually; see
519 @ref{Direction and placement}.
521 @cindex ties, appearance
534 Ties may be made dashed, dotted, or a combination of solid and
537 @lilypond[quote, verbatim, relative=1]
550 Custom dash patterns can be specified:
552 @lilypond[quote, verbatim, relative=1]
553 \tieDashPattern #0.3 #0.75
555 \tieDashPattern #0.7 #1.5
561 Dash pattern definitions for ties have the same structure as dash
562 pattern definitions for slurs. For more information about complex dash
563 patterns, see @ref{Slurs}.
565 Override @var{whiteout} and @var{layer} layout properties for ties that
566 collide with other objects in a staff.
568 @lilypond[verbatim,quote,ragged-right,relative=2]
569 \override Tie.layer = #-2
570 \override Staff.TimeSignature.layer = #-1
571 \override Staff.KeySignature.layer = #-1
572 \override Staff.TimeSignature.whiteout = ##t
573 \override Staff.KeySignature.whiteout = ##t
586 @code{\tieDashPattern},
587 @code{\tieHalfDashed},
588 @code{\tieHalfSolid},
594 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
595 {using-ties-with-arpeggios.ly}
597 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
598 {engraving-ties-manually.ly}
603 @rglos{laissez vibrer}.
607 @ref{Automatic note splitting}.
610 @rlsr{Expressive marks},
614 @rinternals{LaissezVibrerTie},
615 @rinternals{LaissezVibrerTieColumn},
616 @rinternals{TieColumn},
620 Switching staves when a tie is active will not produce a slanted tie.
622 Changing clefs or ottavations during a tie is not really well-defined.
623 In these cases, a slur may be preferable.
627 @subsection Writing rests
629 Rests are entered as part of the music in music expressions.
634 * Full measure rests::
638 @unnumberedsubsubsec Rests
641 @cindex rest, entering durations
656 Rests are entered like notes with the note name @code{r}.
657 Durations longer than a whole rest use the following predefined
660 @c \time 16/1 is used to avoid spurious bar lines
661 @c and long tracts of empty measures
662 @lilypond[quote,verbatim,relative=2]
664 % These two lines are just to prettify this example
666 \omit Staff.TimeSignature
667 % Print a maxima rest, equal to four breves
669 % Print a longa rest, equal to two breves
673 r1 r2 r4 r8 r16 r32 r64 r128
677 @cindex rest, multi-measure
678 @cindex rest, whole-measure
680 Whole measure rests, centered in the middle of the measure, must be
681 entered as multi-measure rests. They can be used for a single
682 measure as well as many measures and are discussed in
683 @ref{Full measure rests}.
685 @cindex rest, specifying vertical position
687 To explicitly specify a rest's vertical position, write a note
688 followed by @code{\rest}. A rest of the duration of the note will
689 be placed at the staff position where the note would appear. This
690 allows for precise manual formatting of polyphonic music, since the
691 automatic rest collision formatter will not move these rests.
693 @lilypond[quote,verbatim,relative=2]
699 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
709 @ref{Full measure rests}.
718 @c Deliberately duplicated in Durations and Rests. -gp
719 There is no fundamental limit to rest durations (both in terms of
720 longest and shortest), but the number of glyphs is limited: there
721 are rests from 128th to maxima (8 x whole).
724 @node Invisible rests
725 @unnumberedsubsubsec Invisible rests
728 @cindex invisible rest
729 @cindex rest, invisible
737 An invisible rest (also called a @q{spacer rest}) can be entered
738 like a note with the note name@tie{}@code{s}:
740 @lilypond[verbatim,quote,relative=2]
747 Spacer rests are available only in note mode and chord mode. In
748 other situations, for example, when entering lyrics, the
749 command @code{\skip} is used to skip a musical moment.
750 @code{\skip} requires an explicit duration, but this is ignored if
751 the lyrics derive their durations from the notes in an associated
752 melody through @code{\addlyrics} or @code{\lyricsto}.
754 @lilypond[quote,verbatim,relative=2]
767 Because @code{\skip} is a command, it does not affect the default
768 durations of following notes, unlike@tie{}@code{s}.
770 @lilypond[quote,verbatim,relative=2]
773 \repeat unfold 8 { a4 }
783 A spacer rest implicitly causes @code{Staff} and @code{Voice}
784 contexts to be created if none exist, just like notes and rests
787 @lilypond[quote,verbatim,relative=2]
791 @code{\skip} simply skips musical time; it creates no output of
794 @lilypond[quote,verbatim,relative=2]
795 % This is valid input, but does nothing
796 \skip 1 \skip1 \skip 1
801 @rlearning{Visibility and color of objects}.
805 @ref{Visibility of objects}.
811 @rinternals{SkipMusic}.
814 @node Full measure rests
815 @unnumberedsubsubsec Full measure rests
817 @cindex multi-measure rests
818 @cindex full-measure rests
819 @cindex rest, multi-measure
820 @cindex rest, full-measure
821 @cindex whole rest for a full measure
822 @cindex rest, whole for a full measure
826 Rests for one or more full measures are entered like notes with
827 the note name uppercase @code{R}:
829 @lilypond[quote,verbatim,relative=2]
830 % Rest measures contracted to single measure
831 \compressFullBarRests
838 The duration of full-measure rests is identical to the duration
839 notation used for notes. The duration in a multi-measure rest must
840 always be an integral number of measure-lengths, so augmentation dots
841 or fractions must often be used:
843 @lilypond[quote,verbatim,relative=2]
844 \compressFullBarRests
850 R1*13/8 | R1*13/8*12 |
855 A full-measure rest is printed as either a whole or breve rest,
856 centered in the measure, depending on the time signature.
858 @lilypond[quote,verbatim,relative=2]
867 @cindex multi-measure rest, expanding
868 @cindex multi-measure rest, contracting
870 @funindex \expandFullBarRests
871 @funindex expandFullBarRests
872 @funindex \compressFullBarRests
873 @funindex compressFullBarRests
875 By default a multi-measure rest is expanded in the printed score to
876 show all the rest measures explicitly. Alternatively, a multi-measure
877 rest can be shown as a single measure containing a multi-measure rest
878 symbol, with the number of measures of rest printed above the measure:
880 @lilypond[quote,verbatim,relative=2]
882 \time 3/4 r2. | R2.*2 |
885 % Rest measures contracted to single measure
886 \compressFullBarRests
888 % Rest measures expanded
895 @cindex text on multi-measure rest
896 @cindex multi-measure rest, attaching text
897 @cindex script on multi-measure rest
898 @cindex multi-measure rest, script
899 @cindex fermata on multi-measure rest
900 @cindex multi-measure rest, attaching fermata
901 @cindex markup on multi-measure rest
902 @cindex multi-measure rest with markup
904 @funindex \fermataMarkup
905 @funindex fermataMarkup
906 @funindex MultiMeasureRestText
908 Markups can be added to multi-measure rests.
909 The predefined command @code{\fermataMarkup}
910 is provided for adding fermatas.
912 @lilypond[quote,verbatim,relative=2]
913 \compressFullBarRests
915 R2.*10^\markup { \italic "ad lib." }
919 @warning{Markups attached to a multi-measure rest are objects of type
920 @code{MultiMeasureRestText}, not @code{TextScript}. Overrides must
921 be directed to the correct object, or they will be ignored. See the
924 @lilypond[quote,verbatim,relative=2]
925 % This fails, as the wrong object name is specified
926 \override TextScript.padding = #5
928 % This is the correct object name to be specified
929 \override MultiMeasureRestText.padding = #5
933 When a multi-measure rest immediately follows a @code{\partial}
934 setting, resulting bar-check warnings may not be displayed.
937 @funindex \textLengthOn
938 @funindex textLengthOn
939 @funindex \textLengthOff
940 @funindex textLengthOff
941 @funindex \fermataMarkup
942 @funindex fermataMarkup
943 @funindex \compressFullBarRests
944 @funindex compressFullBarRests
945 @funindex \expandFullBarRests
946 @funindex expandFullBarRests
949 @code{\textLengthOn},
950 @code{\textLengthOff},
951 @code{\fermataMarkup},
952 @code{\compressFullBarRests},
953 @code{\expandFullBarRests}.
961 @cindex kirchenpausen
963 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
964 {changing-form-of-multi-measure-rests.ly}
966 @cindex multi-measure rests, positioning
967 @cindex positioning multi-measure rests
969 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
970 {positioning-multi-measure-rests.ly}
972 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
973 {multi-measure-rest-markup.ly}
977 @rglos{multi-measure rest}.
982 @ref{Formatting text},
989 @rinternals{MultiMeasureRest},
990 @rinternals{MultiMeasureRestNumber},
991 @rinternals{MultiMeasureRestText}.
993 @cindex fingerings and multi-measure rests
994 @cindex multi-measure rests and fingerings
997 Fingerings over multi-measure rests (e.g. @code{R1*10-4}) may result
998 in the fingering numeral colliding with the bar counter
1001 @cindex condensing rests
1002 @cindex rest, condensing ordinary
1004 There is no way to automatically condense multiple ordinary rests
1005 into a single multi-measure rest.
1007 @cindex rest, collisions of
1009 Multi-measure rests do not take part in rest collisions.
1012 @node Displaying rhythms
1013 @subsection Displaying rhythms
1020 * Polymetric notation::
1021 * Automatic note splitting::
1022 * Showing melody rhythms::
1025 @node Time signature
1026 @unnumberedsubsubsec Time signature
1028 @cindex time signature
1034 The time signature is set as follows:
1036 @lilypond[quote,verbatim,relative=2]
1041 @cindex time signature, visibility of
1043 Time signatures are printed at the beginning of a piece
1044 and whenever the time signature changes. If a change takes place
1045 at the end of a line a warning time signature sign is printed
1046 there. This default behavior may be changed, see
1047 @ref{Visibility of objects}.
1049 @lilypond[quote,verbatim,relative=2]
1059 @cindex time signature style
1062 @funindex \numericTimeSignature
1063 @funindex numericTimeSignature
1064 @funindex \defaultTimeSignature
1065 @funindex defaultTimeSignature
1067 The time signature symbol that is used in 2/2 and 4/4 time can be
1068 changed to a numeric style:
1070 @lilypond[quote,verbatim,relative=2]
1074 % Change to numeric style
1075 \numericTimeSignature
1078 % Revert to default style
1079 \defaultTimeSignature
1085 Mensural time signatures are covered in
1086 @ref{Mensural time signatures}.
1088 @cindex time signature default settings
1089 @cindex autobeaming properties for time signatures
1090 @cindex beaming, time signature default properties
1091 @funindex \overrideTimeSignatureSettings
1093 In addition to setting the printed time signature, the @code{\time}
1094 command also sets the values of the time-signature-based properties
1095 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
1096 The predefined default values for these properties can be found in
1097 @file{scm/time-signature-settings.scm}.
1099 The default value of @code{beatStructure} can be overridden in the
1100 @code{\time} command itself by supplying it as the optional first
1103 @lilypond[quote,verbatim]
1108 \repeat unfold 7 { c8 } |
1110 \repeat unfold 7 { c8 } |
1116 Alternatively, the default values of all these time-signature-based
1117 variables, including @code{baseMoment} and @code{beamExceptions},
1118 can be set together. The values can be set independently for several
1119 different time signatures. The new values take effect when a
1120 subsequent @code{\time} command with the same value of the time
1121 signature is executed:
1123 @lilypond[quote,verbatim]
1127 \overrideTimeSignatureSettings
1128 4/4 % timeSignatureFraction
1129 1/4 % baseMomentFraction
1130 #'(3 1) % beatStructure
1131 #'() % beamExceptions
1133 \repeat unfold 8 { c8 } |
1139 @code{\overrideTimeSignatureSettings} takes four arguments:
1144 @code{@var{timeSignatureFraction}}, a fraction describing the
1145 time signature to which these values apply.
1148 @code{@var{baseMomentFraction}}, a fraction containing the numerator
1149 and denominator of the basic timing unit for the time signature.
1152 @code{@var{beatStructure}}, a Scheme list indicating the structure
1153 of the beats in the measure, in units of the base moment.
1156 @code{@var{beamExceptions}}, an alist containing any beaming rules
1157 for the time signature that go beyond ending at every beat, as
1158 described in @ref{Setting automatic beam behavior}.
1162 @cindex time signature properties, restoring default values
1163 @cindex restoring default properties for time signatures
1164 @funindex \revertTimeSignatureSettings
1166 Changed values of default time signature properties can be restored
1167 to the original values:
1169 @lilypond[quote,verbatim]
1172 \repeat unfold 8 { c8 } |
1173 \overrideTimeSignatureSettings
1174 4/4 % timeSignatureFraction
1175 1/4 % baseMomentFraction
1176 #'(3 1) % beatStructure
1177 #'() % beamExceptions
1179 \repeat unfold 8 { c8 } |
1180 \revertTimeSignatureSettings 4/4
1182 \repeat unfold 8 { c8 } |
1187 Different values of default time signature properties can be established
1188 for different staves by moving the @code{Timing_translator} and the
1189 @code{Default_bar_line_engraver} from the @code{Score} context to the
1190 @code{Staff} context.
1192 @lilypond[quote, verbatim]
1196 \overrideTimeSignatureSettings
1197 4/4 % timeSignatureFraction
1198 1/4 % baseMomentFraction
1199 #'(3 1) % beatStructure
1200 #'() % beamExceptions
1202 \repeat unfold 8 {c''8}
1205 \overrideTimeSignatureSettings
1206 4/4 % timeSignatureFraction
1207 1/4 % baseMomentFraction
1208 #'(1 3) % beatStructure
1209 #'() % beamExceptions
1211 \repeat unfold 8 {c''8}
1217 \remove "Timing_translator"
1218 \remove "Default_bar_line_engraver"
1222 \consists "Timing_translator"
1223 \consists "Default_bar_line_engraver"
1229 A further method of changing these time-signature-related variables,
1230 which avoids reprinting the time signature at the time of the change,
1231 is shown in @ref{Setting automatic beam behavior}.
1234 @code{\numericTimeSignature},
1235 @code{\defaultTimeSignature}.
1240 @lilypondfile[verbatim,quote,texidoc,doctitle]
1241 {time-signature-printing-only-the-numerator-as-a-number-instead-of-the-fraction.ly}
1245 @rglos{time signature}
1248 @ref{Mensural time signatures},
1249 @ref{Setting automatic beam behavior},
1250 @ref{Time administration}.
1253 @file{scm/time-signature-settings.scm}.
1258 Internals Reference:
1259 @rinternals{TimeSignature},
1260 @rinternals{Timing_translator}.
1263 @node Metronome marks
1264 @unnumberedsubsubsec Metronome marks
1267 @cindex beats per minute
1268 @cindex metronome mark
1269 @cindex metronome marking with text
1274 A basic metronome mark is simple to write:
1276 @lilypond[verbatim,quote,relative=1]
1282 Metronome marks may also be printed as a range of two numbers:
1284 @lilypond[verbatim,quote,relative=1]
1290 Tempo indications with text can be used instead:
1292 @lilypond[verbatim,quote,relative=2]
1298 Combining a metronome mark and text will automatically place the
1299 metronome mark within parentheses:
1301 @lilypond[verbatim,quote,relative=2]
1302 \tempo "Allegro" 4 = 160
1307 In general, the text can be any markup object:
1309 @lilypond[verbatim,quote,relative=2]
1310 \tempo \markup { \italic Faster } 4 = 132
1311 a8-. r8 b-. r gis-. r a-. r
1314 A parenthesized metronome mark with no textual indication may be
1315 written by including an empty string in the input:
1317 @lilypond[verbatim,quote,relative=2]
1322 @funindex \markLengthOn
1323 @funindex markLengthOn
1324 @funindex \markLengthOff
1325 @funindex markLengthOff
1327 In a part for an instrument with long periods of rests,
1328 tempo indications sometimes follow each other closely.
1329 The command @code{\markLengthOn} provides extra horizontal space
1330 to prevent tempo indications from overlapping, and @code{\markLengthOff}
1331 restores the default behavior of ignoring tempo marks
1332 for horizontal spacing.
1334 @lilypond[verbatim,quote,relative=0]
1335 \compressFullBarRests
1337 \tempo "Molto vivace"
1348 @lilypondfile[verbatim,quote,texidoc,doctitle]
1349 {printing-metronome-and-rehearsal-marks-below-the-staff.ly}
1351 @c perhaps also an example of how to move it horizontally?
1353 @lilypondfile[verbatim,quote,texidoc,doctitle]
1354 {changing-the-tempo-without-a-metronome-mark.ly}
1356 @lilypondfile[verbatim,quote,texidoc,doctitle]
1357 {creating-metronome-marks-in-markup-mode.ly}
1359 For more details, see @ref{Formatting text}.
1364 @rglos{metronomic indication},
1365 @rglos{tempo indication},
1366 @rglos{metronome mark}.
1369 @ref{Formatting text},
1373 @rlsr{Staff notation}.
1375 Internals Reference:
1376 @rinternals{MetronomeMark}.
1380 @unnumberedsubsubsec Upbeats
1384 @cindex partial measure
1385 @cindex measure, partial
1386 @cindex measure, pickup
1387 @cindex pickup measure
1389 @funindex measurePosition
1393 Partial or pick-up measures, such as an @emph{anacrusis} or an
1394 @emph{upbeat}, are entered using the @code{\partial} command,
1397 \partial @var{duration}
1401 where @code{@var{duration}} is the @emph{remaining} length of the
1402 partial measure @emph{before} the start of the next full measure.
1404 @lilypond[quote,verbatim,relative=1]
1410 The @var{duration} can be any value less than a full measure:
1412 @lilypond[quote,verbatim,relative=1]
1415 r4 e8 | a4 c8 b c4 |
1418 @code{\partial @var{duration}} can also be written as:
1421 \set Timing.measurePosition -@var{duration}
1424 So the first example above could be written:
1426 @lilypond[quote,verbatim,relative=1]
1428 \set Timing.measurePosition = #(ly:make-moment -1/8)
1432 The property @code{measurePosition} contains a rational number,
1433 which is usually positive and indicates how much of the measure
1434 has passed at this point. @code{\partial @var{duration}} is
1435 defined such that no numbered bar gets created: when used at the
1436 beginning of a measure, @code{measurePosition} is set to a
1437 negative number, implying that the current bar will be
1438 @emph{preceded} by additional material. When used after a measure
1439 has already started, however, it moves the requested distance
1440 before the @emph{end} of the bar.
1442 @lilypond[quote,verbatim,relative=1]
1443 \set Score.barNumberVisibility = #all-bar-numbers-visible
1444 \override Score.BarNumber.break-visibility =
1445 #end-of-line-invisible
1448 e8 | a4 c8 b[ c b] |
1450 r8 e,8 | a4 \bar "||"
1468 @rinternals{Timing_translator}.
1471 @node Unmetered music
1472 @unnumberedsubsubsec Unmetered music
1475 @cindex cadenza, beams
1476 @cindex cadenza, accidentals
1477 @cindex cadenza, bar lines
1478 @cindex cadenza, bar numbers
1479 @cindex unmetered music
1480 @cindex unmetered music, beams
1481 @cindex unmetered music, accidentals
1482 @cindex unmetered music, bar lines
1483 @cindex unmetered music, bar numbers
1484 @cindex accidentals, cadenzas
1485 @cindex accidentals, unmetered music
1486 @cindex bar lines, cadenzas
1487 @cindex bar lines, unmetered music
1488 @cindex bar numbers, cadenzas
1489 @cindex bar numbers, unmetered music
1490 @cindex beams, cadenzas
1491 @cindex beams, unmetered music
1493 @funindex \cadenzaOn
1495 @funindex \cadenzaOff
1496 @funindex cadenzaOff
1498 In metered music bar lines are inserted and bar numbers are calculated
1499 automatically. In unmetered music (i.e. cadenzas), this is not
1500 desirable and can be @q{switched off} using the command
1501 @code{\cadenzaOn}, then @q{switched back on} at the appropriate place
1502 using @code{\cadenzaOff}.
1504 @lilypond[verbatim,relative=2,quote]
1507 c4 c d8[ d d] f4 g4.
1513 Bar numbering is resumed at the end of the cadenza.
1515 @lilypond[verbatim,relative=2,quote]
1516 % Show all bar numbers
1517 \override Score.BarNumber.break-visibility = #all-visible
1520 c4 c d8[ d d] f4 g4.
1526 Inserting a @code{\bar} command within a cadenza does not start a new
1527 measure, even if a bar line is printed. So any accidentals -- which
1528 are usually assumed to remain in force until the end of the measure --
1529 will still be valid after the bar line printed by @code{\bar}. If
1530 subsequent accidentals should be printed, forced accidentals or
1531 reminder accidentals need to be inserted manually, see
1534 @lilypond[verbatim,relative=2,quote]
1539 % First cis is printed without alteration even if it's after a \bar
1545 Automatic beaming is disabled by @code{\cadenzaOn}. Therefore, all
1546 beaming in cadenzas must be entered manually. See @ref{Manual beams}.
1548 @lilypond[verbatim,relative=2,quote]
1549 \repeat unfold 8 { c8 }
1555 \repeat unfold 8 { c8 }
1558 These predefined commands affect all staves in the score, even when
1559 placed in just one @code{Voice} context. To change this, move the
1560 @code{Timing_translator} from the @code{Score} context to the
1561 @code{Staff} context. See @ref{Polymetric notation}.
1573 @ref{Visibility of objects},
1574 @ref{Polymetric notation},
1581 @cindex cadenza, line breaks
1582 @cindex cadenza, page breaks
1583 @cindex unmetered music, line breaks
1584 @cindex unmetered music, page breaks
1585 @cindex breaks in unmetered music
1586 @cindex line breaks, cadenzas
1587 @cindex page breaks, cadenzas
1588 @cindex line breaks, unmetered music
1589 @cindex page breaks, unmetered music
1592 Automatic line and page breaks are inserted only at bar lines, so
1593 @q{invisible} bar lines will need to be inserted manually in long
1594 stretches of unmetered music to permit breaking:
1601 @node Polymetric notation
1602 @unnumberedsubsubsec Polymetric notation
1604 @c This section necessarily uses \set
1605 @c This is acceptable -td
1607 @cindex double time signatures
1608 @cindex signatures, polymetric
1609 @cindex time signatures, polymetric
1610 @cindex time signatures, double
1611 @cindex polymetric signatures
1612 @cindex meter, polymetric
1614 @funindex timeSignatureFraction
1615 @funindex \scaleDurations
1616 @funindex scaleDurations
1620 Polymetric notation is supported explicitly or by manually modifying the
1621 visible time signature symbol and/or scaling note durations.
1623 @subsubsubheading Different time signatures with equal-length measures
1625 Set a common time signature for each staff, and set the
1626 @code{timeSignatureFraction} to the desired fraction. Then use the
1627 @code{\scaleDurations} function to scale the durations of the notes in
1628 each staff to the common time signature.
1630 @cindex beams, with polymetric meters
1631 @cindex polymetric meters, with beams
1633 In the following example, music with the time signatures of 3/4, 9/8 and
1634 10/8 are used in parallel. In the second staff, shown durations are
1635 multiplied by 2/3 (because 2/3 * 9/8 = 3/4) and in the third staff, the
1636 shown durations are multiplied by 3/5 (because 3/5 * 10/8 = 3/4). It
1637 may be necessary to insert beams manually, as the duration scaling will
1638 affect the autobeaming rules.
1640 @lilypond[quote,verbatim]
1649 \set Staff.timeSignatureFraction = 9/8
1651 \repeat unfold 6 { c8[ c c] }
1655 \set Staff.timeSignatureFraction = 10/8
1656 \scaleDurations 3/5 {
1657 \repeat unfold 2 { c8[ c c] }
1658 \repeat unfold 2 { c8[ c] } |
1659 c4. c \tuplet 3/2 { c8[ c c] } c4
1665 @subsubsubheading Different time signatures with unequal-length measures
1667 Each staff can be given its own independent time signature by
1668 moving the @code{Timing_translator} and the
1669 @code{Default_bar_line_engraver} to the @code{Staff} context.
1671 @lilypond[quote,verbatim]
1675 \remove "Timing_translator"
1676 \remove "Default_bar_line_engraver"
1680 \consists "Timing_translator"
1681 \consists "Default_bar_line_engraver"
1685 % Now each staff has its own time signature.
1709 @funindex \compoundMeter
1710 @cindex compound time signatures
1711 @cindex time signature, compound
1713 @subsubsubheading Compound time signatures
1715 These are created using the @code{\compoundMeter} function. The syntax
1719 \compoundMeter #'@code{(list of lists)}
1722 The simplest construction is a single list, where the @emph{last} number
1723 indicates the bottom number of the time signature and those that come
1724 before it, the top numbers.
1726 @lilypond[quote,verbatim]
1728 \compoundMeter #'((2 2 2 8))
1729 \repeat unfold 6 c8 \repeat unfold 12 c16
1733 More complex meters can be constructed using additional lists. Also,
1734 automatic beaming settings will be adjusted depending on the values.
1736 @lilypond[quote,verbatim]
1738 \compoundMeter #'((1 4) (3 8))
1739 \repeat unfold 5 c8 \repeat unfold 10 c16
1743 \compoundMeter #'((1 2 3 8) (3 4))
1744 \repeat unfold 12 c8
1751 @rglos{polymetric time signature},
1755 @ref{Automatic beams},
1757 @ref{Time signature},
1758 @ref{Scaling durations}.
1763 Internals Reference:
1764 @rinternals{TimeSignature},
1765 @rinternals{Timing_translator},
1766 @rinternals{Default_bar_line_engraver},
1770 When using different time signatures in parallel, notes at the same
1771 moment will be placed at the same horizontal location. However, the bar
1772 lines in the different staves will cause the note spacing to be less
1773 regular in each of the individual staves than would be normal without
1774 the different time signatures.
1777 @node Automatic note splitting
1778 @unnumberedsubsubsec Automatic note splitting
1780 @cindex notes, splitting
1781 @cindex splitting notes
1782 @cindex rests, splitting
1783 @cindex splitting rests
1785 @funindex Note_heads_engraver
1786 @funindex Completion_heads_engraver
1787 @funindex Completion_rest_engraver
1789 Long notes which overrun bar lines can be converted automatically to
1790 tied notes. This is done by replacing the @code{Note_heads_engraver}
1791 with the @code{Completion_heads_engraver}. Similarly, long rests which
1792 overrun bar lines are split automatically by replacing the
1793 @code{Rest_engraver} with the @code{Completion_rest_engraver}. In the
1794 following example, notes and rests crossing the bar lines are split,
1795 notes are also tied.
1797 @lilypond[quote,verbatim,relative=1]
1799 \remove "Note_heads_engraver"
1800 \consists "Completion_heads_engraver"
1801 \remove "Rest_engraver"
1802 \consists "Completion_rest_engraver"
1805 { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 r1*2 }
1808 These engravers split all running notes and rests at the bar line, and
1809 inserts ties for notes. One of its uses is to debug complex scores: if
1810 the measures are not entirely filled, then the ties show exactly how
1811 much each measure is off.
1813 The property @code{completionUnit} sets a preferred duration for
1816 @lilypond[quote,verbatim,relative=2]
1818 \remove "Note_heads_engraver"
1819 \consists "Completion_heads_engraver"
1821 \time 9/8 g\breve. d4. \bar "||"
1822 \set completionUnit = #(ly:make-moment 3 8)
1827 These engravers split notes with scaled duration, such as those in tuplets,
1828 into notes with the same scale-factor as in the input note.
1830 @lilypond[quote,verbatim,relative=2]
1832 \remove "Note_heads_engraver"
1833 \consists "Completion_heads_engraver"
1836 \tuplet 3/2 {g4 a b}
1837 \scaleDurations 2/3 {g a b}
1839 \tuplet 3/2 {g4 a b}
1849 @rlearning{Engravers explained},
1850 @rlearning{Adding and removing engravers}.
1855 Internals Reference:
1856 @rinternals{Note_heads_engraver},
1857 @rinternals{Completion_heads_engraver},
1858 @rinternals{Rest_engraver},
1859 @rinternals{Completion_rest_engraver},
1860 @rinternals{Forbid_line_break_engraver}.
1863 For consistency with previous behavior, notes and rests with
1864 duration longer than a measure, such as @code{c1*2}, are split into
1865 notes without any scale factor, @code{@{ c1 c1 @}}. The property
1866 @code{completionFactor} controls this behavior, and setting it to
1867 @code{#f} cause split notes and rest to have the scale factor
1868 of the input durations.
1871 @node Showing melody rhythms
1872 @unnumberedsubsubsec Showing melody rhythms
1874 @cindex melody rhythms, showing
1875 @cindex rhythms, showing melody
1877 Sometimes you might want to show only the rhythm of a melody. This
1878 can be done with the rhythmic staff. All pitches of notes on such a
1879 staff are squashed, and the staff itself has a single line
1881 @lilypond[quote,relative=1,verbatim]
1883 \new RhythmicStaff {
1884 \new Voice = "myRhythm" {
1892 \lyricsto "myRhythm" {
1900 @cindex guitar chord charts
1901 @cindex strumming rhythms, showing
1902 @cindex guitar strumming rhythms, showing
1904 @funindex Pitch_squash_engraver
1905 @funindex \improvisationOn
1906 @funindex improvisationOn
1907 @funindex \improvisationOff
1908 @funindex improvisationOff
1910 Guitar chord charts often show the strumming rhythms. This can
1911 be done with the @code{Pitch_squash_engraver} and
1912 @code{\improvisationOn}.
1915 @lilypond[quote,verbatim]
1923 \consists "Pitch_squash_engraver"
1936 @code{\improvisationOn},
1937 @code{\improvisationOff}.
1943 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
1944 {guitar-strum-rhythms.ly}
1950 Internals Reference:
1951 @rinternals{RhythmicStaff},
1952 @rinternals{Pitch_squash_engraver}.
1960 * Setting automatic beam behavior::
1965 @node Automatic beams
1966 @unnumberedsubsubsec Automatic beams
1968 By default, beams are inserted automatically:
1970 @cindex beams, manual
1971 @cindex manual beams
1972 @cindex beams, customizing rules
1974 @funindex \autoBeamOn
1975 @funindex autoBeamOn
1976 @funindex \autoBeamOff
1977 @funindex autoBeamOff
1979 @lilypond[quote,verbatim,relative=2]
1981 \time 6/8 c8 c c c8. c16 c8
1984 If these automatic decisions are not satisfactory, beaming can be
1985 entered explicitly; see @ref{Manual beams}. Beams @emph{must} be
1986 entered manually if beams are to be extended over rests.
1988 If automatic beaming is not required, it may be turned off with
1989 @code{\autoBeamOff} and on with @code{\autoBeamOn}:
1991 @lilypond[quote,relative=1,verbatim]
1992 c4 c8 c8. c16 c8. c16 c8
1999 @cindex melismata, with beams
2000 @cindex beams, with melismata
2002 @warning{If beams are used to indicate melismata in songs, then
2003 automatic beaming should be switched off with @code{@bs{}autoBeamOff}
2004 and the beams indicated manually. Using @code{@bs{}partcombine} with
2005 @code{@bs{}autoBeamOff} can produce unintended results. See the
2006 snippets for more information.}
2008 Beaming patterns that differ from the automatic defaults can be
2009 created; see @ref{Setting automatic beam behavior}.
2012 @code{\autoBeamOff},
2016 @cindex beams, line breaks
2017 @cindex line breaks, beams
2018 @cindex beams, with knee gap
2019 @cindex knee gap, with beams
2023 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2024 {beams-across-line-breaks.ly}
2026 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2027 {changing-beam-knee-gap.ly}
2029 @cindex beams, \partcombine with \autoBeamOff
2030 @cindex voices, \partcombine with \autoBeamOff
2032 @lilypondfile [verbatim, quote, ragged-right, texidoc, doctitle]
2033 {partcombine-and-autobeamoff.ly}
2038 @ref{Setting automatic beam behavior}.
2041 @file{scm/auto-beam.scm}.
2046 Internals Reference:
2047 @rinternals{Auto_beam_engraver},
2048 @rinternals{Beam_engraver},
2050 @rinternals{BeamEvent},
2051 @rinternals{BeamForbidEvent},
2052 @rinternals{beam-interface},
2053 @rinternals{unbreakable-spanner-interface}.
2056 The properties of a beam are determined at the @emph{start} of its
2057 construction and any additional beam-property changes that occur before
2058 the beam has been completed will not take effect until the @emph{next},
2062 @node Setting automatic beam behavior
2063 @unnumberedsubsubsec Setting automatic beam behavior
2065 @cindex beams, with lyrics
2066 @cindex lyrics, with beams
2068 @funindex autoBeaming
2069 @funindex baseMoment
2070 @funindex beamExceptions
2071 @funindex \beamExceptions
2072 @funindex beatStructure
2073 @funindex measureLength
2079 When automatic beaming is enabled, the placement of automatic beams
2080 is determined by three context properties:
2081 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2082 The default values of these variables may be overridden as described
2083 below, or alternatively the default values themselves may be changed
2084 as explained in @ref{Time signature}.
2086 If a @code{beamExceptions} rule is defined for the time signature in
2087 force, that rule alone is used to determine the beam placement; the
2088 values of @code{baseMoment} and @code{beatStructure} are ignored.
2090 If no @code{beamExceptions} rule is defined for the time signature
2091 in force, the beam placement is determined by the values of
2092 @code{baseMoment} and @code{beatStructure}.
2095 @subsubsubheading Beaming based on @code{baseMoment} and @code{beatStructure}
2097 By default, @code{beamExceptions} rules are defined for most common
2098 time signatures, so the @code{beamExceptions} rules must be disabled
2099 if automatic beaming is to be based on @code{baseMoment} and
2100 @code{beatStructure}. The @code{beamExceptions} rules are disabled
2104 \set Timing.beamExceptions = #'()
2107 When @code{beamExceptions} is set to @code{#'()}, either due to an
2108 explicit setting or because no @code{beamExceptions} rules are defined
2109 internally for the time signature in force, the ending points for
2110 beams are on beats as specified by the context properties
2111 @code{baseMoment} and @code{beatStructure}. @code{beatStructure} is
2112 a scheme list that defines the length of each beat in the measure in
2113 units of @code{baseMoment}. By default, @code{baseMoment} is one
2114 over the denominator of the time signature. By default, each unit of
2115 length @code{baseMoment} is a single beat.
2117 @lilypond[quote,relative=2,verbatim]
2119 c16^"default" c c c c |
2120 % beamExceptions are unlikely to be defined for 5/16 time,
2121 % but let's disable them anyway to be sure
2122 \set Timing.beamExceptions = #'()
2123 \set Timing.beatStructure = #'(2 3)
2124 c16^"(2+3)" c c c c |
2125 \set Timing.beatStructure = #'(3 2)
2126 c16^"(3+2)" c c c c |
2129 @lilypond[quote,relative=2,verbatim]
2131 a8^"default" a a a a a a a
2132 % Disable beamExceptions because they are definitely
2133 % defined for 4/4 time
2134 \set Timing.beamExceptions = #'()
2135 \set Timing.baseMoment = #(ly:make-moment 1/4)
2136 \set Timing.beatStructure = #'(1 1 1 1)
2137 a8^"changed" a a a a a a a
2140 Beam setting changes can be limited to specific contexts. If no
2141 setting is included in a lower-level context, the setting of the
2142 enclosing context will apply.
2144 @lilypond[quote, verbatim,relative=1]
2147 % No need to disable beamExceptions
2148 % as they are not defined for 7/8 time
2149 \set Staff.beatStructure = #'(2 3 2)
2159 \set Voice.beatStructure = #'(1 3 3)
2167 When multiple voices are used the @code{Staff} context must be
2168 specified if the beaming is to be applied to all voices in the
2171 @lilypond[quote,verbatim,relative=2]
2174 % Change applied to Voice by default -- does not work correctly
2175 % Because of autogenerated voices, all beating will
2176 % be at baseMoment (1 . 8)
2177 \set beatStructure = #'(3 1 1 2)
2178 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2180 % Works correctly with context Staff specified
2181 \set Staff.beatStructure = #'(3 1 1 2)
2182 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
2185 The value of @code{baseMoment} can be adjusted to change
2186 the beaming behavior, if desired. When this is done,
2187 the value of @code{beatStructure} must be set to be
2188 compatible with the new value of @code{baseMoment}.
2190 @lilypond[quote,verbatim,relative=2]
2192 % No need to disable beamExceptions
2193 % as they are not defined for 5/8 time
2194 \set Timing.baseMoment = #(ly:make-moment 1/16)
2195 \set Timing.beatStructure = #'(7 3)
2196 \repeat unfold 10 { a16 }
2199 @code{baseMoment} is a @i{moment}; a unit of musical duration. A
2200 quantity of type @i{moment} is created by the scheme function
2201 @code{ly:make-moment}. For more information about this function,
2202 see @ref{Time administration}.
2204 By default @code{baseMoment} is set to one over the denominator of
2205 the time signature. Any exceptions to this default can be found in
2206 @file{scm/time-signature-settings.scm}.
2208 @subsubsubheading Beaming based on @code{beamExceptions}
2210 Special autobeaming rules (other than ending a beam on a beat)
2211 are defined in the @code{beamExceptions} property.
2213 The value for @code{beamExceptions}, a somewhat complex Scheme
2214 data structure, is easiest generated with the
2215 @code{\beamExceptions} function. This function is given one or
2216 more manually beamed measure-length rhythmic patterns (measures
2217 have to be separated by a bar check@tie{}@code{|} since the
2218 function has no other way to discern the measure length). Here is
2221 @lilypond[quote,relative=2,verbatim]
2223 \set Timing.beatStructure = #'(2 1)
2224 \set Timing.beamExceptions =
2225 \beamExceptions { 32[ 32] 32[ 32] 32[ 32] }
2227 \repeat unfold 6 { c32 } |
2230 @warning{A @code{beamExceptions} value must be @emph{complete}
2231 exceptions list. That is, every exception that should be applied
2232 must be included in the setting. It is not possible to add, remove,
2233 or change only one of the exceptions. While this may seem cumbersome,
2234 it means that the current beaming settings need not be known in order
2235 to specify a new beaming pattern.}
2237 When the time signature is changed, default values of
2238 @code{Timing.baseMoment}, @code{Timing.beatStructure},
2239 and @code{Timing.beamExceptions} are set. Setting the time signature
2240 will reset the automatic beaming settings for the @code{Timing}
2241 context to the default behavior.
2243 @lilypond[quote,verbatim,relative=2]
2245 \repeat unfold 6 { a8 }
2247 \set Timing.beatStructure = #'(4 2)
2248 \repeat unfold 6 { a8 }
2249 % go back to default behavior
2251 \repeat unfold 6 { a8 }
2254 The default automatic beaming settings for a time signature
2255 are determined in @file{scm/time-signature-settings.scm}.
2256 Changing the default automatic beaming settings
2257 for a time signature is described in @ref{Time signature}.
2259 Many automatic beaming settings for a time signature contain an
2260 entry for @code{beamExceptions}. For example, 4/4 time tries to
2261 beam the measure in two if there are only eighth notes. The
2262 @code{beamExceptions} rule can override the @code{beatStructure} setting
2263 if @code{beamExceptions} is not reset.
2265 @lilypond[quote,verbatim,relative=2]
2267 \set Timing.baseMoment = #(ly:make-moment 1/8)
2268 \set Timing.beatStructure = #'(3 3 2)
2269 % This won't beam (3 3 2) because of beamExceptions
2270 \repeat unfold 8 {c8} |
2271 % This will beam (3 3 2) because we clear beamExceptions
2272 \set Timing.beamExceptions = #'()
2273 \repeat unfold 8 {c8}
2276 In a similar fashion, eighth notes in 3/4 time are beamed as a full
2277 measure by default. To beam eighth notes in 3/4 time on the beat,
2278 reset @code{beamExceptions}.
2280 @lilypond[quote,verbatim,relative=2]
2282 % by default we beam in (6) due to beamExceptions
2283 \repeat unfold 6 {a8} |
2284 % This will beam (1 1 1) due to default baseMoment and beatStructure
2285 \set Timing.beamExceptions = #'()
2286 \repeat unfold 6 {a8}
2289 In engraving from the Romantic and Classical periods,
2290 beams often begin midway through the measure in 3/4 time,
2291 but modern practice is to avoid the false impression of 6/8 time
2292 (see Gould, p. 153). Similar situations arise in 3/8 time.
2293 This behavior is controlled by the context property @code{beamHalfMeasure},
2294 which has effect only in time signatures with 3 in the numerator:
2296 @lilypond[quote,verbatim,relative=2]
2299 \set Timing.beamHalfMeasure = ##f
2303 @subsubsubheading How automatic beaming works
2305 When automatic beaming is enabled, the placement of automatic beams
2306 is determined by the context properties
2307 @code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.
2309 The following rules, in order of priority, apply when determining
2310 the appearance of beams:
2314 If a manual beam is specified with @code{[@dots{}]} set the beam
2315 as specified, otherwise
2318 if a beam-ending rule is defined in @code{beamExceptions}
2319 for the beam-type, use it to determine the valid places where
2320 beams may end, otherwise
2323 if a beam-ending rule is defined in @code{beamExceptions}
2324 for a longer beam-type, use it to determine the valid places
2325 where beams may end, otherwise
2328 use the values of @code{baseMoment} and @code{beatStructure} to
2329 determine the ends of the beats in the measure, and
2330 end beams at the end of beats.
2334 In the rules above, the @emph{beam-type} is the duration of the
2335 shortest note in the beamed group.
2337 The default beaming rules can be found in
2338 @file{scm/time-signature-settings.scm}.
2342 @cindex beams, subdividing
2344 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2345 {subdividing-beams.ly}
2347 @cindex beamlets, orienting
2349 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2350 {strict-beat-beaming.ly}
2352 @cindex measure groupings
2353 @cindex beats, grouping
2354 @cindex grouping beats
2355 @cindex measure sub-grouping
2357 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2358 {conducting-signs,-measure-grouping-signs.ly}
2360 @cindex beam, endings in a score
2361 @cindex beam, endings with multiple voices
2363 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2364 {beam-endings-in-score-context.ly}
2368 @ref{Time signature}.
2371 @file{scm/time-signature-settings.scm}.
2376 Internals Reference:
2377 @rinternals{Auto_beam_engraver},
2379 @rinternals{BeamForbidEvent},
2380 @rinternals{beam-interface}.
2383 If a score ends while an automatic beam has not been ended and is
2384 still accepting notes, this last beam will not be typeset at all.
2385 The same holds for polyphonic voices, entered with
2386 @code{<< @dots{} \\ @dots{} >>}. If a polyphonic voice ends while an
2387 automatic beam is still accepting notes, it is not typeset.
2388 The workaround for these problems is to manually beam the last
2389 beam in the voice or score.
2391 By default, the @code{Timing} translator is aliased to the
2392 @code{Score} context. This means that setting the time signature
2393 in one staff will affect the beaming of the other staves as well.
2394 Thus, a time signature setting in a later staff will reset custom
2395 beaming that was set in an earlier staff.
2396 One way to avoid this problem is to set the time signature
2399 @lilypond[quote,verbatim,relative=2]
2403 \set Timing.baseMoment = #(ly:make-moment 1/8)
2404 \set Timing.beatStructure = #'(1 5)
2405 \repeat unfold 6 { a8 }
2408 \repeat unfold 6 { a8 }
2413 The default beam settings for the time signature can also be changed, so
2414 that the desired beaming will always be used. Changes in automatic
2415 beaming settings for a time signature are described in
2416 @ref{Time signature}.
2418 @lilypond[quote,verbatim,relative=2]
2421 \overrideTimeSignatureSettings
2422 3/4 % timeSignatureFraction
2423 1/8 % baseMomentFraction
2424 #'(1 5) % beatStructure
2425 #'() % beamExceptions
2427 \repeat unfold 6 { a8 }
2431 \repeat unfold 6 { a8 }
2438 @unnumberedsubsubsec Manual beams
2440 @cindex beams, manual
2441 @cindex manual beams
2446 In some cases it may be necessary to override the automatic
2447 beaming algorithm. For example, the autobeamer will not put beams
2448 over rests or bar lines, and in choral scores the beaming is
2449 often set to follow the meter of the lyrics rather than the
2450 notes. Such beams can be specified manually by
2451 marking the begin and end point with @code{[} and @code{]}.
2453 @lilypond[quote,relative=1,verbatim]
2454 r4 r8[ g' a r] r g[ | a] r
2457 @cindex manual beams, direction shorthand for
2458 @cindex manual beams, grace notes
2460 Beaming direction can be set manually using direction indicators:
2462 @lilypond[quote,relative=2,verbatim]
2463 c8^[ d e] c,_[ d e f g]
2469 Individual notes may be marked with @code{\noBeam} to prevent them
2472 @lilypond[quote,verbatim,relative=2]
2477 Grace note beams and normal note beams can occur simultaneously.
2478 Unbeamed grace notes are not put into normal note beams.
2480 @lilypond[quote,verbatim,relative=2]
2482 \grace { e32 d c d }
2488 @funindex stemLeftBeamCount
2489 @funindex stemRightBeamCount
2491 Even more strict manual control with the beams can be achieved by
2492 setting the properties @code{stemLeftBeamCount} and
2493 @code{stemRightBeamCount}. They specify the number of beams to
2494 draw on the left and right side, respectively, of the next note.
2495 If either property is set, its value will be used only once, and
2496 then it is erased. In this example, the last @code{f} is printed
2497 with only one beam on the left side, i.e., the eighth-note beam of
2498 the group as a whole.
2500 @lilypond[quote,relative=2,verbatim]
2503 \set stemLeftBeamCount = #2
2504 \set stemRightBeamCount = #1
2506 \set stemLeftBeamCount = #1
2518 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
2519 {flat-flags-and-beam-nibs.ly}
2523 @ref{Direction and placement},
2529 Internals Reference:
2531 @rinternals{BeamEvent},
2532 @rinternals{Beam_engraver},
2533 @rinternals{beam-interface},
2534 @rinternals{Stem_engraver}.
2537 @node Feathered beams
2538 @unnumberedsubsubsec Feathered beams
2540 @cindex beams, feathered
2541 @cindex feathered beams
2543 @funindex \featherDurations
2544 @funindex featherDurations
2545 @funindex grow-direction
2547 Feathered beams are used to indicate that a small group of notes
2548 should be played at an increasing (or decreasing) tempo, without
2549 changing the overall tempo of the piece. The extent of the
2550 feathered beam must be indicated manually using @code{[} and
2551 @code{]}, and the beam feathering is turned on by specifying a
2552 direction to the @code{Beam} property @code{grow-direction}.
2554 If the placement of the notes and the sound in the MIDI output is to
2555 reflect the @emph{ritardando} or @emph{accelerando} indicated by the
2556 feathered beam the notes must be grouped as a music expression delimited
2557 by braces and preceded by a @code{featherDurations} command which specifies
2558 the ratio between the durations of the first and last notes in the
2561 The square brackets show the extent of the beam and the braces show
2562 which notes are to have their durations modified. Normally these
2563 would delimit the same group of notes, but this is not required: the
2564 two commands are independent.
2566 In the following example the eight 16th notes occupy exactly the
2567 same time as a half note, but the first note is one half as long
2568 as the last one, with the intermediate notes gradually
2569 lengthening. The first four 32nd notes gradually speed up, while
2570 the last four 32nd notes are at a constant tempo.
2572 @lilypond[relative=1,verbatim,quote]
2573 \override Beam.grow-direction = #LEFT
2574 \featherDurations #(ly:make-moment 2/1)
2575 { c16[ c c c c c c c] }
2576 \override Beam.grow-direction = #RIGHT
2577 \featherDurations #(ly:make-moment 2/3)
2579 % revert to non-feathered beams
2580 \override Beam.grow-direction = #'()
2585 The spacing in the printed output represents the
2586 note durations only approximately, but the MIDI output is exact.
2589 @code{\featherDurations}.
2597 The @code{\featherDurations} command only works with very short
2598 music snippets, and when numbers in the fraction are small.
2607 * Bar and bar number checks::
2612 @unnumberedsubsubsec Bar lines
2615 @cindex measure lines
2616 @cindex closing bar lines
2617 @cindex bar lines, closing
2618 @cindex double bar lines
2619 @cindex bar lines, double
2625 Bar lines delimit measures, and are also used to indicate
2626 repeats. Normally, simple bar lines are automatically inserted
2627 into the printed output at places based on the current time
2630 The simple bar lines inserted automatically can be changed to
2631 other types with the @code{\bar} command. For example, a closing
2632 double bar line is usually placed at the end of a piece:
2634 @lilypond[quote,relative=1,verbatim]
2638 It is not invalid if the final note in a measure does not
2639 end on the automatically entered bar line: the note is assumed
2640 to carry over into the next measure. But if a long sequence
2641 of such carry-over measures appears the music can appear compressed
2642 or even flowing off the page. This is because automatic line
2643 breaks happen only at the end of complete measures, i.e., where
2644 all notes end before the end of a measure.
2646 @warning{An incorrect duration can cause line breaks to be
2647 inhibited, leading to a line of highly compressed music or
2648 music which flows off the page.}
2651 @cindex bar lines, invisible
2652 @cindex measure lines, invisible
2654 Line breaks are also permitted at manually inserted bar lines
2655 even within incomplete measures. To allow a line break without
2656 printing a bar line, use the following:
2663 This will insert an invisible bar line and allow (but not
2664 force) a line break to occur at this point. The bar number
2665 counter is not increased. To force a line break see
2666 @ref{Line breaking}.
2668 @cindex manual bar lines
2669 @cindex manual measure lines
2670 @cindex bar lines, manual
2671 @cindex measure lines, manual
2673 This and other special bar lines may be inserted manually at any
2674 point. When they coincide with the end of a measure they replace
2675 the simple bar line which would have been inserted there
2676 automatically. When they do not coincide with the end of a measure
2677 the specified bar line is inserted at that point in the printed
2680 Note that manual bar lines are purely visual. They do not affect
2681 any of the properties that a normal bar line would affect, such as
2682 measure numbers, accidentals, line breaks, etc. They do not affect
2683 the calculation and placement of subsequent automatic bar lines.
2684 When a manual bar line is placed where a normal bar line already
2685 exists, the effects of the original bar line are not altered.
2687 Two types of simple bar lines and five types of double bar lines are
2688 available for manual insertion:
2690 @lilypond[quote,relative=1,verbatim]
2702 together with dotted and dashed bar lines:
2704 @lilypond[quote,relative=1,verbatim]
2711 and nine types of repeat bar lines:
2713 @lilypond[quote,relative=1,verbatim]
2726 Additionally, a bar line can be printed as a simple tick:
2727 @lilypond[quote,relative=1,verbatim]
2730 However, as such ticks are typically used in Gregorian chant, it is
2731 preferable to use @code{\divisioMinima} there instead, described in
2732 the section @ref{Divisiones} in Gregorian chant.
2734 Lilypond supports kievan notation and provides a special kievan
2736 @lilypond[quote,relative=1,verbatim]
2739 Further details of this notation are explained in
2740 @ref{Typesetting Kievan square notation}.
2744 For in-line segno signs, there are three types of bar lines which
2745 differ in their behavior at line breaks:
2747 @lilypond[quote,relative=2,verbatim]
2765 Although the bar line types signifying repeats may be inserted
2766 manually they do not in themselves cause LilyPond to recognize
2767 a repeated section. Such repeated sections are better entered
2768 using the various repeat commands (see @ref{Repeats}), which
2769 automatically print the appropriate bar lines.
2771 In addition, you can specify @code{".|:-||"}, which is equivalent to
2772 @code{".|:"} except at line breaks, where it gives a double bar
2773 line at the end of the line and a start repeat at the beginning of
2776 @lilypond[quote,relative=2,verbatim]
2784 For combinations of repeats with the segno sign, there are six different
2787 @lilypond[quote,relative=2,verbatim]
2815 Additionally there is an @code{\inStaffSegno} command which creates
2816 a segno bar line in conjunction with an appropriate repeat bar line
2817 when used with a @code{\repeat volta} command, see
2818 @ref{Normal repeats}.
2820 @funindex \defineBarLine
2821 @funindex defineBarLine
2822 @cindex bar lines, defining
2823 @cindex defining bar lines
2825 New bar line types can be defined with @code{\defineBarLine}:
2828 \defineBarLine @var{bartype} #'(@var{end} @var{begin} @var{span})
2831 The @code{\defineBarline} variables can include the
2832 @q{empty} string @code{""}, which is equivalent to an invisible
2833 bar line being printed. Or they can be set to @code{#f} which
2834 prints no bar line at all.
2836 After the definiton, the new bar line can be used by
2837 @code{\bar} @var{bartype}.
2839 There are currently ten bar line elements available:
2841 @lilypond[quote,verbatim]
2842 \defineBarLine ":" #'("" ":" "")
2843 \defineBarLine "=" #'("=" "" "")
2844 \defineBarLine "[" #'("" "[" "")
2845 \defineBarLine "]" #'("]" "" "")
2862 The @code{"="} bar line provides the double span bar line, used
2863 in combination with the segno sign. Do not use it as a standalone
2864 double thin bar line; here, @code{\bar} @var{"||"} is
2867 The @code{"-"} sign starts annotations to bar lines which
2868 are useful to distinguish those with identical appearance
2869 but different behavior at line breaks and/or different span bars.
2870 The part following the @code{"-"} sign is not used for building up
2873 @lilypond[quote,relative=2,verbatim]
2874 \defineBarLine "||-dashedSpan" #'("||" "" "!!")
2879 c1 \bar "||-dashedSpan"
2890 Furthermore, the space character @code{" "} serves as a placeholder
2891 for defining span bars correctly aligned to the main bar lines:
2893 @lilypond[quote,relative=2,verbatim]
2894 \defineBarLine ":|.-wrong" #'(":|." "" "|.")
2895 \defineBarLine ":|.-right" #'(":|." "" " |.")
2911 If additional elements are needed, LilyPond provides a simple
2912 way to define them. For more informations on modifying or adding
2913 bar lines, see file @file{scm/bar-line.scm}.
2915 In scores with many staves, a @code{\bar} command in one staff is
2916 automatically applied to all staves. The resulting bar lines are
2917 connected between different staves of a @code{StaffGroup},
2918 @code{PianoStaff}, or @code{GrandStaff}.
2920 @lilypond[quote,relative=1,verbatim]
2928 \new Staff { \clef bass c4 g e g }
2930 \new Staff { \clef bass c2 c2 }
2935 @cindex default bar lines, changing
2936 @cindex bar lines, default, changing
2939 @funindex defaultBarType
2944 The command @samp{\bar @var{bartype}} is a shortcut for
2945 @samp{\set Timing.whichBar = @var{bartype}}. A bar line is
2946 created whenever the @code{whichBar} property is set.
2948 The default bar type used for automatically inserted bar lines is
2949 @code{"|"}. This may be changed at any time with
2950 @samp{\set Timing.defaultBarType = @var{bartype}}.
2954 @ref{Line breaking},
2956 @ref{Grouping staves}.
2959 @file{scm/bar-line.scm}.
2964 Internals Reference:
2965 @rinternals{BarLine} (created at @code{Staff} level),
2966 @rinternals{SpanBar} (across staves),
2967 @rinternals{Timing_translator} (for Timing properties).
2971 @unnumberedsubsubsec Bar numbers
2974 @cindex measure numbers
2975 @cindex numbers, bar
2976 @cindex numbers, measure
2978 @funindex currentBarNumber
2980 Bar numbers are typeset by default at the start of every line except
2981 the first line. The number itself is stored in the
2982 @code{currentBarNumber} property, which is normally updated
2983 automatically for every measure. It may also be set manually:
2985 @lilypond[verbatim,quote,relative=1]
2988 \set Score.currentBarNumber = #50
2992 @cindex bar numbers, regular spacing
2994 @funindex barNumberVisibility
2997 Bar numbers can be typeset at regular intervals instead of just at
2998 the beginning of every line. To do this the default behavior
2999 must be overridden to permit bar numbers to be printed at places
3000 other than the start of a line. This is controlled by the
3001 @code{break-visibility} property of @code{BarNumber}. This takes
3002 three values which may be set to @code{#t} or @code{#f} to specify
3003 whether the corresponding bar number is visible or not. The order
3004 of the three values is @code{end of line visible}, @code{middle of
3005 line visible}, @code{beginning of line visible}. In the following
3006 example bar numbers are printed at all possible places:
3008 @lilypond[verbatim,quote,relative=1]
3009 \override Score.BarNumber.break-visibility = ##(#t #t #t)
3010 \set Score.currentBarNumber = #11
3011 % Permit first bar number to be printed
3019 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3020 {printing-the-bar-number-for-the-first-measure.ly}
3022 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3023 {printing-bar-numbers-at-regular-intervals.ly}
3025 @cindex measure number, format
3026 @cindex bar number, format
3028 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3029 {printing-bar-numbers-inside-boxes-or-circles.ly}
3031 @cindex bar numbers, with letters
3032 @cindex bar numbers, with repeats
3034 @lilypondfile[verbatim,quote,texidoc,doctitle]
3035 {alternative-bar-numbering.ly}
3037 @cindex bar number alignment
3039 @lilypondfile[verbatim,quote,texidoc,doctitle]
3040 {aligning-bar-numbers.ly}
3042 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
3043 {removing-bar-numbers-from-a-score.ly}
3049 Internals Reference:
3050 @rinternals{BarNumber},
3051 @rinternals{Bar_number_engraver}.
3053 @cindex bar number collision
3054 @cindex collision, bar number
3057 Bar numbers may collide with the top of the @code{StaffGroup} bracket,
3058 if there is one. To solve this, the @code{padding} property of
3059 @code{BarNumber} can be used to position the number correctly. See
3060 @rinternals{StaffGroup} and @rinternals{BarNumber} for more.
3063 @node Bar and bar number checks
3064 @unnumberedsubsubsec Bar and bar number checks
3067 @cindex bar number check
3068 @cindex measure check
3069 @cindex measure number check
3071 @funindex barCheckSynchronize
3074 Bar checks help detect errors in the entered durations. A bar check
3075 may be entered using the bar symbol, @code{|}, at any place where a
3076 bar line is expected to fall. If bar check lines are encountered at
3077 other places, a list of warnings is printed in the log file, showing
3078 the line numbers and lines in which the bar checks failed. In the
3079 next example, the second bar check will signal an error.
3082 \time 3/4 c2 e4 | g2 |
3085 Bar checks can also be used in lyrics:
3090 Twin -- kle | Twin -- kle |
3094 An incorrect duration can result in a completely garbled score,
3095 especially if the score is polyphonic, so a good place to start
3096 correcting input is by scanning for failed bar checks and
3097 incorrect durations.
3099 If successive bar checks are off by the same musical interval,
3100 only the first warning message is displayed. This allows the
3101 warning to focus on the source of the timing error.
3107 It is also possible to redefine the action taken when a bar check
3108 or pipe symbol, @code{|}, is encountered in the input, so that
3109 it does something other than a bar check. This is done by
3110 assigning a music expression to @code{"|"}.
3111 In the following example @code{|} is set to insert a double bar
3112 line wherever it appears in the input, rather than checking
3115 @lilypond[quote,verbatim]
3125 @funindex \barNumberCheck
3126 @funindex barNumberCheck
3128 When copying large pieces of music, it can be helpful to check that
3129 the LilyPond bar number corresponds to the original that you are
3130 entering from. This can be checked with @code{\barNumberCheck}, for
3134 \barNumberCheck #123
3138 will print a warning if the @code{currentBarNumber} is not 123
3139 when it is processed.
3146 @node Rehearsal marks
3147 @unnumberedsubsubsec Rehearsal marks
3149 @cindex rehearsal marks
3150 @cindex mark, rehearsal
3155 To print a rehearsal mark, use the @code{\mark} command.
3157 @lilypond[quote,verbatim,relative=2]
3165 The mark is incremented automatically if you use @code{\mark
3166 \default}, but you can also use an integer argument to set the
3167 mark manually. The value to use is stored in the property
3168 @code{rehearsalMark}.
3170 @lilypond[quote,verbatim,relative=2]
3179 The letter@tie{}@q{I} is skipped in accordance with engraving
3180 traditions. If you wish to include the letter @q{I}, then use one
3181 of the following commands, depending on which style of rehearsal mark
3182 you want (letters only, letters in a hollow box, or letters in a
3186 \set Score.markFormatter = #format-mark-alphabet
3187 \set Score.markFormatter = #format-mark-box-alphabet
3188 \set Score.markFormatter = #format-mark-circle-alphabet
3191 @lilypond[quote,verbatim,relative=2]
3192 \set Score.markFormatter = #format-mark-box-alphabet
3200 @cindex rehearsal mark format
3201 @cindex rehearsal mark style
3202 @cindex style, rehearsal mark
3203 @cindex format, rehearsal mark
3204 @cindex mark, rehearsal, style
3205 @cindex mark, rehearsal, format
3206 @cindex rehearsal mark, manual
3207 @cindex mark, rehearsal, manual
3208 @cindex custom rehearsal mark
3209 @cindex manual rehearsal mark
3211 The style is defined by the property @code{markFormatter}. It is
3212 a function taking the current mark (an integer) and the current
3213 context as argument. It should return a markup object. In the
3214 following example, @code{markFormatter} is set to a pre-defined
3215 procedure. After a few measures, it is set to a procedure that
3216 produces a boxed number.
3218 @lilypond[quote,verbatim,relative=2]
3219 \set Score.markFormatter = #format-mark-numbers
3222 \set Score.markFormatter = #format-mark-box-numbers
3224 \set Score.markFormatter = #format-mark-circle-numbers
3226 \set Score.markFormatter = #format-mark-circle-letters
3230 The file @file{scm/translation-functions.scm} contains the
3231 definitions of @code{format-mark-numbers} (the default format),
3232 @code{format-mark-box-numbers}, @code{format-mark-letters} and
3233 @code{format-mark-box-letters}. These can be used as inspiration
3234 for other formatting functions.
3236 You may use @code{format-mark-barnumbers},
3237 @code{format-mark-box-barnumbers}, and
3238 @code{format-mark-circle-barnumbers} to get bar numbers instead of
3239 incremented numbers or letters.
3241 Other styles of rehearsal mark can be specified manually:
3248 Note that @code{Score.markFormatter} does not affect marks specified
3249 in this manner. However, it is possible to apply a @code{\markup} to the
3253 \mark \markup@{ \box A1 @}
3258 @cindex D.S. al Fine
3260 @cindex music glyphs
3261 @cindex glyphs, music
3263 @funindex \musicglyph
3264 @funindex musicglyph
3266 Music glyphs (such as the segno sign) may be printed inside a
3269 @lilypond[quote,verbatim,relative=1]
3270 c1 \mark \markup { \musicglyph #"scripts.segno" }
3271 c1 \mark \markup { \musicglyph #"scripts.coda" }
3272 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
3277 See @ref{The Feta font}, for a list of symbols which may be
3278 printed with @code{\musicglyph}.
3280 For common tweaks to the positioning of rehearsal marks, see
3281 @ref{Formatting text}. For more precise control, see
3282 @code{break-alignable-interface} in @ref{Aligning objects}.
3284 The file @file{scm/translation-functions.scm} contains
3285 the definitions of @code{format-mark-numbers} and
3286 @code{format-mark-letters}. They can be used as inspiration for
3287 other formatting functions.
3291 @ref{The Feta font},
3292 @ref{Formatting text},
3293 @ref{Aligning objects}.
3296 @file{scm/translation-functions.scm}.
3301 Internals Reference:
3302 @rinternals{MarkEvent},
3303 @rinternals{Mark_engraver},
3304 @rinternals{RehearsalMark}.
3307 @node Special rhythmic concerns
3308 @subsection Special rhythmic concerns
3313 * Aligning to cadenzas::
3314 * Time administration::
3318 @unnumberedsubsubsec Grace notes
3322 @cindex appoggiatura
3323 @cindex acciaccatura
3326 @funindex \slashedGrace
3327 @funindex \acciaccatura
3328 @funindex \appoggiatura
3330 Grace notes are musical ornaments, printed in a smaller font, that take
3331 up no additional logical time in a measure.
3333 @lilypond[quote,relative=2,verbatim]
3335 \grace { b16 c16 } a2)
3338 There are three other types of grace notes possible; the
3339 @emph{acciaccatura} -- an unmeasured grace note indicated by a slurred
3340 note with a slashed stem -- and the @emph{appoggiatura}, which takes a
3341 fixed fraction of the main note it is attached to and prints without the
3342 slash. It is also possible to write a grace note with a slashed stem,
3343 like the @emph{acciaccatura} but without the slur, so as to place it
3344 between notes that are slurred themselves, using the
3345 @code{\slashedGrace} function.
3347 @lilypond[quote,relative=2,verbatim]
3350 \acciaccatura { g16 f } e2
3351 \slashedGrace a,8 g4
3352 \slashedGrace b16 a4(
3353 \slashedGrace b8 a2)
3356 The placement of grace notes is synchronized between different staves.
3357 In the following example, there are two sixteenth grace notes for every
3360 @lilypond[quote,relative=2,verbatim]
3362 \new Staff { e2 \grace { c16 d e f } e2 }
3363 \new Staff { c2 \grace { g8 b } c2 }
3367 @cindex grace notes, following
3369 @funindex \afterGrace
3370 @funindex afterGrace
3372 If you want to end a note with a grace, use the @code{\afterGrace}
3373 command. It takes two arguments: the main note, and the grace
3374 notes following the main note.
3376 @lilypond[quote,verbatim,relative=2]
3377 c1 \afterGrace d1 { c16[ d] } c1
3380 This will put the grace notes after a space lasting 3/4 of the
3381 length of the main note. The default fraction 3/4 can be changed by
3382 setting @code{afterGraceFraction}. The following example shows
3383 the results from setting the space at the default, at 15/16, and
3384 finally at 1/2 of the main note.
3386 @lilypond[quote,verbatim,relative=2]
3389 c1 \afterGrace d1 { c16[ d] } c1
3392 #(define afterGraceFraction (cons 15 16))
3393 c1 \afterGrace d1 { c16[ d] } c1
3396 #(define afterGraceFraction (cons 1 2))
3397 c1 \afterGrace d1 { c16[ d] } c1
3402 The space between the main note and the grace note may also be
3403 specified using spacers. The following example places the grace
3404 note after a space lasting 7/8 of the main note.
3406 @lilypond[quote,verbatim,relative=2]
3410 { s2 s4. \grace { c16 d } }
3416 @cindex tweaking grace notes
3417 @cindex grace notes, tweaking
3418 @cindex grace notes, changing layout settings
3420 A @code{\grace} music expression will introduce special
3421 typesetting settings, for example, to produce smaller type, and
3422 set directions. Hence, when introducing layout tweaks to
3423 override the special settings, they should be placed inside
3424 the grace expression. The overrides should also be reverted
3425 inside the grace expression. Here, the grace note's default stem
3426 direction is overridden and then reverted.
3428 @lilypond[quote,verbatim,relative=2]
3440 @cindex stem, with slash
3445 @lilypondfile[verbatim,quote,texidoc,doctitle]
3446 {using-grace-note-slashes-with-normal-heads.ly}
3448 @lilypondfile[verbatim,quote,texidoc,doctitle]
3449 {tweaking-grace-layout-within-music.ly}
3451 @lilypondfile[verbatim,quote,texidoc,doctitle]
3452 {redefining-grace-note-global-defaults.ly}
3454 @lilypondfile[verbatim,quote,texidoc,doctitle]
3455 {positioning-grace-notes-with-floating-space.ly}
3459 @rglos{grace notes},
3460 @rglos{acciaccatura},
3461 @rglos{appoggiatura}.
3464 @ref{Scaling durations},
3468 @file{ly/grace-init.ly}.
3473 Internals Reference:
3474 @rinternals{GraceMusic},
3475 @rinternals{Grace_beam_engraver},
3476 @rinternals{Grace_auto_beam_engraver},
3477 @rinternals{Grace_engraver},
3478 @rinternals{Grace_spacing_engraver}.
3482 @cindex acciaccatura, multi-note
3483 @cindex multi-note acciaccatura
3484 @cindex grace-note synchronization
3486 A multi-note beamed @i{acciaccatura} is printed without a slash,
3487 and looks exactly the same as a multi-note beamed
3490 @c TODO Add link to LSR snippet to add slash when available
3492 Grace note synchronization can also lead to surprises. Staff
3493 notation, such as key signatures, bar lines, etc., are also
3494 synchronized. Take care when you mix staves with grace notes and
3495 staves without, for example,
3497 @lilypond[quote,relative=2,verbatim]
3499 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3500 \new Staff { c4 \bar ".|:" d2. }
3505 This can be remedied by inserting grace skips of the corresponding
3506 durations in the other staves. For the above example
3508 @lilypond[quote,relative=2,verbatim]
3510 \new Staff { e4 \bar ".|:" \grace c16 d2. }
3511 \new Staff { c4 \bar ".|:" \grace s16 d2. }
3515 The use of grace notes within voice contexts confuses the way the voice
3516 is typeset. This can be overcome by inserting a rest or note between the
3517 voice command and the grace note.
3519 @lilypond[quote,verbatim]
3521 \acciaccatura { f8 } e8 r8 \acciaccatura { f8 } e8 r4
3528 r8 r8 \voiceOne \accMusic \oneVoice r8 |
3529 r8 \voiceOne r8 \accMusic \oneVoice r8 |
3534 s8 s8 \voiceTwo \accMusic \oneVoice s8 |
3535 s8 \voiceTwo r8 \accMusic \oneVoice s8 |
3542 Grace sections should only be used within sequential music expressions.
3543 Nesting or juxtaposing grace sections is not supported, and might
3544 produce crashes or other errors.
3546 Each grace note in MIDI output has a length of 1/4 of its actual
3547 duration. If the combined length of the grace notes is greater than the
3548 length of the preceding note a @qq{@code{Going back in MIDI time}}
3549 error will be generated. Either make the grace notes shorter in
3550 duration, for example:
3553 c'8 \acciaccatura @{ c'8[ d' e' f' g'] @}
3559 c'8 \acciaccatura @{ c'16[ d' e' f' g'] @}
3562 Or explicitly change the musical duration:
3565 c'8 \acciaccatura @{ \scaleDurations 1/2 @{ c'8[ d' e' f' g'] @} @}
3568 See @ref{Scaling durations}.
3571 @node Aligning to cadenzas
3572 @unnumberedsubsubsec Aligning to cadenzas
3575 @cindex cadenza, aligning to
3576 @cindex aligning to cadenza
3578 In an orchestral context, cadenzas present a special problem: when
3579 constructing a score that includes a measured cadenza or other solo
3580 passage, all other instruments should skip just as many notes as the
3581 length of the cadenza, otherwise they will start too soon or too late.
3583 One solution to this problem is to use the functions
3584 @code{mmrest-of-length} and @code{skip-of-length}. These Scheme
3585 functions take a defined piece of music as an argument and generate a
3586 multi-measure rest or @code{\skip} exactly as long as the piece.
3588 @lilypond[verbatim,quote]
3589 MyCadenza = \relative c' {
3600 #(mmrest-of-length MyCadenza)
3602 #(skip-of-length MyCadenza)
3616 @node Time administration
3617 @unnumberedsubsubsec Time administration
3619 @cindex time administration
3620 @cindex timing (within the score)
3621 @cindex music, unmetered
3622 @cindex unmetered music
3624 @funindex currentBarNumber
3625 @funindex measurePosition
3626 @funindex measureLength
3628 Time is administered by the @code{Timing_translator}, which by
3629 default is to be found in the @code{Score} context. An alias,
3630 @code{Timing}, is added to the context in which the
3631 @code{Timing_translator} is placed. To ensure that the
3632 @code{Timing} alias is available, you may need to explicitly
3633 instantiate the containing context (such as @code{Voice} or
3636 The following properties of @code{Timing} are used
3637 to keep track of timing within the score.
3640 @cindex measure number
3643 @item currentBarNumber
3644 The current measure number. For an example showing the
3645 use of this property see @ref{Bar numbers}.
3648 The length of the measures in the current time signature. For a
3649 4/4 time this is@tie{}1, and for 6/8 it is 3/4. Its value
3650 determines when bar lines are inserted and how automatic beams
3651 should be generated.
3653 @item measurePosition
3654 The point within the measure where we currently are. This
3655 quantity is reset by subtracting @code{measureLength} whenever
3656 @code{measureLength} is reached or exceeded. When that happens,
3657 @code{currentBarNumber} is incremented.
3660 If set to true, the above variables are updated for every time
3661 step. When set to false, the engraver stays in the current
3662 measure indefinitely.
3666 Timing can be changed by setting any of these variables
3667 explicitly. In the next example, the default 4/4 time
3668 signature is printed, but @code{measureLength} is set to 5/4.
3669 At 4/8 through the third measure, the @code{measurePosition} is
3670 advanced by 1/8 to 5/8, shortening that bar by 1/8.
3671 The next bar line then falls at 9/8 rather than 5/4.
3673 @lilypond[quote,verbatim]
3674 \new Voice \relative c' {
3675 \set Timing.measureLength = #(ly:make-moment 5/4)
3679 \set Timing.measurePosition = #(ly:make-moment 5/8)
3686 As the example illustrates, @code{ly:make-moment n m} constructs a
3687 duration of n/m of a whole note. For example,
3688 @code{ly:make-moment 1 8} is an eighth note duration and
3689 @code{ly:make-moment 7 16} is the duration of seven sixteenths
3695 @ref{Unmetered music}.
3700 Internals Reference:
3701 @rinternals{Timing_translator},