]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/rhythms.itely
Doc: ensure two spaces after end of sentence.
[lilypond.git] / Documentation / notation / rhythms.itely
index 0b4bed4fa667485b2a7886b97330f07c5241e076..8d83dd3c9de4f86a636cba031d6e7cb2dc7ff746 100644 (file)
@@ -140,6 +140,12 @@ the staff; see @ref{Direction and placement}.
 @endpredefined
 
 
+@snippets
+
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{changing-the-number-of-augmentation-dots-per-note.ly}
+
+
 @seealso
 Music Glossary:
 @rglos{breve},
@@ -218,7 +224,7 @@ Tuplets may be nested:
 
 @lilypond[quote,verbatim,relative=2]
 \autoBeamOff
-c4 \times 4/5 { f8 e f \times 2/3 { e[ f g] } } f4 |
+c4 \times 4/5 { f8 e f \times 2/3 { e[ f g] } } f4
 @end lilypond
 
 Modifying nested tuplets which begin at the same musical moment
@@ -256,6 +262,9 @@ see @ref{Scaling durations}.
 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
 {non-default-tuplet-numbers.ly}
 
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{controlling-tuplet-bracket-visibility.ly}
+
 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
 {permitting-line-breaks-within-beamed-tuplets.ly}
 
@@ -287,10 +296,16 @@ Internals Reference:
 @cindex grace notes within tuplet brackets
 
 @knownissues
-When the first note on a staff is a grace note followed by a
-tuplet the grace note must be placed before the @code{\times}
-command to avoid errors.  Anywhere else, grace notes may be
-placed within tuplet brackets.
+Grace notes may be placed within tuplet brackets, @emph{except}
+when a staff begins with a grace note followed by a tuplet.  In this
+particular case, the grace note must be placed before the @code{\times}
+command to avoid errors.
+
+@cindex tempo marks within tuplet brackets
+
+When using a tuplet at the beginning of a piece with a @code{\tempo}
+mark, the music must be explicitly entered in a @code{\new Voice}
+block, as discussed in @rlearning{Voices contain music}.
 
 
 @node Scaling durations
@@ -879,7 +894,7 @@ setting, resulting bar-check warnings may not be displayed.
 @funindex \textLengthOn
 @funindex textLengthOn
 @funindex \textLengthOff
-@funindex textLenthOff
+@funindex textLengthOff
 @funindex \fermataMarkup
 @funindex fermataMarkup
 @funindex \compressFullBarRests
@@ -1029,6 +1044,72 @@ changed to a numeric style:
 Mensural time signatures are covered in
 @ref{Mensural time signatures}.
 
+@cindex time signature default settings
+@cindex autobeaming properties for time signatures
+@cindex beaming, time signature default properties
+@funindex \overrideTimeSignatureSettings
+
+In addition to setting the printed time signature, the @code{\time}
+command also sets time-signature-based default values for the properties
+@code{baseMoment}, @code{beatStructure}, and @code{beamExceptions}.  The
+predefined default values for these properties can be found in
+@file{scm/time-signature-settings.scm}.  The existing default values can
+be changed, or new default values can be added:
+
+@lilypond[quote,verbatim]
+\score {
+  \relative c' {
+    \overrideTimeSignatureSettings
+      #'Score
+      #'(4 . 4)  % time signature fraction
+      #'(1 . 4)  % base moment fraction
+      #'(3 1)    % beatStructure
+      #'()       % beamExceptions
+    \time 4/4
+    \repeat unfold 8 c8 |
+  }
+}
+@end lilypond
+
+@code{\overrideTimeSignatureSettings} takes five arguments:
+context, time signature fraction, base moment, beat structure, and
+beaming exception.  The context is a Scheme symbol that describes
+the context to which the default setting will apply.  The
+time signature fraction is a Scheme pair describing the time signature.
+The base moment is a Scheme pair containing the
+numerator and denominator of the basic timing unit for the
+time signature.  The beat structure is a Scheme list indicating
+the structure of the beats in the measure, in units of the base moment.
+The beaming exception is an alist containing any beaming rules for the
+time signature that go beyond ending at every beat,
+as described in @ref{Setting automatic beam behavior}.
+
+@cindex time signature properties, restoring default values
+@cindex restoring default properties for time signatures
+@funindex \revertTimeSignatureSettings
+
+Changed values of default time signature properties can be restored
+to the original values:
+
+@lilypond[quote,verbatim]
+
+\score{
+  \relative c' {
+    \repeat unfold 8 c8 |
+    \overrideTimeSignatureSettings
+      #'Score
+      #'(4 . 4)
+      #'(1 . 4)
+      #'(3 1)
+      #'((end . (((1 . 8) . (3 1)))))
+    \time 4/4
+    \repeat unfold 8 c8 |
+    \revertTimeSignatureSettings #'Score #'(4 . 4)
+    \time 4/4
+    \repeat unfold 8 c8 |
+  }
+}
+@end lilypond
 
 @predefined
 @code{\numericTimeSignature},
@@ -1089,34 +1170,38 @@ entered using the @code{\partial} command, with the syntax
 @end example
 
 @noindent
-where @code{duration} is the rhythmic length of the interval
-before the start of the first complete measure:
+where @code{duration} is the rhythmic length of the remaining
+interval of the current measure before the start of the next.
 
 @lilypond[quote,verbatim,relative=2]
 \partial 4 e4 |
 a2. c,4 |
 @end lilypond
 
-The partial measure can be any duration less than a full measure:
+The partial measure can be any duration less than the full measure:
 
 @lilypond[quote,verbatim,relative=2]
 \partial 8*3 c8 d e |
 a2. c,4 |
 @end lilypond
 
-Internally, @code{\partial} is translated into
+Internally, @code{\partial @var{duration}} is translated into:
 
 @example
-\set Timing.measurePosition = -@var{duration}
+\set Timing.measurePosition -@var{duration}
+@end example
+
+For example, @code{\partial 8*3} becomes:
+
+@example
+\set Timing.measurePosition = #(ly:make-moment -3 8)
 @end example
 
-@noindent
 The property @code{measurePosition} contains a rational number
 indicating how much of the measure has passed at this point.  Note
-that this is set to a negative number by the @code{\partial}
-command: i.e., @code{\partial 4} is internally translated to
-@code{-4}, meaning @qq{there is a quarter note left in the measure.}
-
+that this is set to a negative number by the @code{\partial} command:
+i.e., @code{\partial 4} is internally translated to @code{-4}, meaning
+@qq{there is a quarter note left in the measure.}
 
 @seealso
 Music Glossary:
@@ -1131,12 +1216,12 @@ Snippets:
 Internal Reference:
 @rinternals{Timing_translator}.
 
-
 @knownissues
 
 The @code{\partial} command is intended to be used only at the
 beginning of a piece.  If you use it after the beginning, some
-odd warnings may occur.
+odd warnings or effects may occur, in this case use
+@code{\set Timing.measurePosition} instead.
 
 @node Unmetered music
 @unnumberedsubsubsec Unmetered music
@@ -1642,19 +1727,18 @@ Beams can collide with note heads and accidentals in other voices.
 @cindex lyrics and beaming
 
 @funindex autoBeaming
-@funindex beamSettings
+@funindex baseMoment
+@funindex beamExceptions
+@funindex beatStructure
 @funindex measureLength
-@funindex beatLength
 @funindex \time
 @funindex time
 @funindex \set
 @funindex set
 
-The placement of automatic beams is determined by the time signature.
-Three types of rules are used for determining the end of automatic
-beams: @emph{default} rules
-for the time signature, @emph{explicit} rules for the beam in the time
-signature, and the @emph{beatLength} for the time signature.
+The placement of automatic beams is determined by the context properties
+@code{baseMoment}, @code{beatStructure}, @code{beamExceptions},
+and @code{autoBeaming}.
 
 The following rules, in order of priority, apply when determining
 the appearance of beams:
@@ -1668,38 +1752,47 @@ as specified, otherwise
 if @code{\autoBeamOff} is in force do not beam, otherwise
 
 @item
-if an explicit beam-ending rule is defined for the beam type
-in the time signature, use it to determine the valid
-places where beams may end, otherwise
+if a beam-ending rule is defined in @code{beamExceptions}
+for the beam type, use it to determine the valid places where
+beams may end, otherwise
 
 @item
-if a default beam-ending rule is defined in the time signature,
-use it to group notes with beams, otherwise
+if a beam-ending rule is defined in @code{beamExceptions}
+for a larger beam-type, use it to determined the valid places
+where beams may end, otherwise
 
 @item
-use the value of @code{beatLength} to group notes with beams
+use the values of @code{baseMoment} and @code{beatStructure} to
+determine the ends of the beats in the measure, and
+end beams at the end of beats.
 
 @end itemize
 
+The beam type is the duration of the shortest note in the beamed group.
+If no beam-ending rule is defined for a beam type, the rule for the
+smallest beam-type larger than the current beam is used.
+
 @i{@strong{Modifying the grouping of beats}}
 
-By default @code{beatLength} is
-derived from the time signature set by the @code{\time} command.
-The @code{beatLength} is set to be one over the denominator
-of the time signature.
+By default @code{baseMoment} is set by the @code{\time} command,
+normally to one over the denominator of the time signature.
+Any exceptions to this default
+can be found in @file{scm/@/time@/-signature@/-settings@/.scm}.
+Changing the default value of @code{baseMoment} for a given
+time signature is described in @ref{Time signature}.
 
-@code{beatLength} is a @i{moment},
+@code{baseMoment} is a @i{moment},
 a unit of musical duration.  A quantity of type @i{moment} is
 created by the scheme function @code{ly:make-moment}.  For more
 information about this function, see @ref{Time administration}.
 
-Autobeam settings are stored in the
-@code{beamSettings} property.  Default values of @code{beamSettings}
-are determined in @file{scm/@/beam@/-settings@/.scm}.  Entries in
-@code{beamSettings} are indexed by time signature and
-rule type.
-
-Time signature should be a scheme pair , e.g. @code{#'(4 . 4)}.
+Special (i.e., other than at the end of the beat) autobeam settings
+are stored in the
+@code{beamExceptions} property.  Default values of @code{beamExceptions}
+are established by the @code{\time} command.  Default values of
+@code{beamExceptions} for a time signature
+are determined in @file{scm/@/time@/-signature@/-settings@/.scm}.
+Entries in @code{beamExceptions} are indexed by rule type and beam type.
 
 Rule type should be @code{#'end} for beam ending.
 
@@ -1715,37 +1808,33 @@ beam type.
    (beam-type3 . grouping-3))
 @end example
 
-Beam type is either a scheme pair indicating the duration
-of the beam, e.g. @code{(1 . 16)}, or @code{*} to indicate a
-default rule, which applies to all beams if no explicit rule is
-defined.
+Beam type is a scheme pair indicating the duration
+of the beam, e.g., @code{(1 . 16)}.
 
 Grouping is a scheme list indicating the grouping to be applied to
-the beam.  For default rules (where beam type is
-@code{*}, the grouping is in units of @code{beatLength}.
-For explicit rules, the grouping is in units of the beam type.
+the beam.  The grouping is in units of the beam type.
 
 For reference, the default beaming rules are found in
-@file{scm/beam-settings.scm}.
+@file{scm/time-signature-settings.scm}.
 
-Beam settings are changed with
-@code{\overrideBeamSettings} and @code{\revertBeamSettings}.
+Alternate values for @code{beamExceptions}
+can be defined using the @code{\set} command.
 
 @warning{
-The ending settings must be
-@emph{complete} rules.  That is, every rule that should apply to
-the current time signature must be included in the setting.
-It is not possible to change the grouping of only one beam type
-for a given time signature.  While this may seem cumbersome,
+A @code{beamExceptions} value must be
+@emph{complete} exceptions list.  That is, every exception that should
+be applied must be included in the setting.
+It is not possible to add, remove, or change only one of the exceptions.
+While this may seem cumbersome,
 it means that the current beaming settings need not be known
 in order to specify a new beaming pattern.}
 
 @lilypond[quote,relative=2,verbatim]
 \time 5/16
 c8^"beats" c16 c8 |
-\overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (2 3)))
+\set beatStructure = #'(2 3)
 c8^"(2+3)" c16 c8
-\overrideBeamSettings #'Score #'(5 . 16) #'end #'((* . (3 2)))
+\set beatStructure = #'(3 2)
 c8^"(3+2)" c16 c8
 @end lilypond
 
@@ -1754,22 +1843,24 @@ setting is included in a lower-level context, the setting of the
 enclosing context will apply.
 
 @lilypond[quote, verbatim,relative=1]
-\new Staff <<
+\new Staff {
   \time 7/8
-  \new Voice = one {
-    \relative c'' {
-      \overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (2 3 2)))
+  \set Staff.beatStructure = #'(2 3 2)
+  <<
+    \new Voice = one {
+      \relative c'' {
         a8 a a a a a a
+      }
     }
-  }
-  \new Voice  = two {
-    \relative c' {
-      \voiceTwo
-      \overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (1 3 3)))
-      f8 f f f f f f
+    \new Voice = two {
+      \relative c' {
+        \voiceTwo
+        \set Voice.beatStructure = #'(1 3 3)
+        f8 f f f f f f
+      }
     }
-  }
->>
+  >>
+}
 @end lilypond
 
 When multiple voices are used the @code{Staff} context must be
@@ -1781,51 +1872,36 @@ staff:
 % rhythm 3-1-1-2
 % Context Voice specified --  does not work correctly
 % Because of autogenerated voices, all beating will
-% be at beatLength (1 . 8)
-\overrideBeamSettings #'Voice #'(7 . 8) #'end #'((* . (3 1 1 2)))
+% be at baseMoment (1 . 8)
+\set beatStructure = #'(3 1 1 2)
 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
 
 % Works correctly with context Staff specified
-\overrideBeamSettings #'Staff #'(7 . 8) #'end #'((* . (3 1 1 2)))
+\set Staff.beatStructure = #'(3 1 1 2)
 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
 @end lilypond
 
-@funindex revertBeamSettings
-
-Beam settings can be reverted to get back to default behavior.  This
-is accomplished by using @code{\revertBeamSettings}.  The arguments
-are the same as for @code{\overrideBeamSettings}, except no value
-for @var{grouping} is given:
-
-@example
-\revertBeamSettings context time-signature rule-type
-@end example
-
+Beam settings can be set back to default behavior.  This
+is accomplished by setting the time signature.
 
 @lilypond[quote,verbatim,relative=2]
 \time 4/4
 \repeat unfold 8 {a8}
-% set default rule for (1 1 1 1) grouping
-\overrideBeamSettings #'Score #'(4 . 4) #'end #'((* . (1 1 1 1)))
+% eliminate beam exception that groups beats 1, 2 and 3, 4
+\set Timing.beamExceptions = #'()
 \repeat unfold 8 {a8}
-% revert the new rule
-\revertBeamSettings #'Score #'(4 . 4) #'end
+% go back to default behavior
+\time 4/4
 \repeat unfold 8 {a8}
 @end lilypond
 
 
-@predefined
-@code{\overrideBeamSettings},
-@code{\revertBeamSettings}.
-@endpredefined
-
-
 @snippets
 
 @cindex beams, subdividing
 
 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
-{sub-dividing-beams.ly}
+{subdividing-beams.ly}
 
 @cindex measure groupings
 @cindex beats, grouping
@@ -1887,6 +1963,7 @@ r4 r8[ g' a r8] r8 g[ | a] r8
 @end lilypond
 
 @cindex manual beams, direction shorthand for
+@cindex manual beams, grace notes
 
 Beaming direction can be set manually using direction indicators:
 
@@ -1905,6 +1982,17 @@ from being beamed:
 c8 c\noBeam c c
 @end lilypond
 
+Grace note beams and normal note beams can occur simultaneously.
+Unbeamed grace notes are not put into normal note beams.
+
+@lilypond[quote,verbatim,relative=2]
+c4 d8[
+\grace { e32[ d c d] }
+e8] e8[ e
+\grace { f16 }
+e8 e]
+@end lilypond
+
 @funindex stemLeftBeamCount
 @funindex stemRightBeamCount
 
@@ -1941,7 +2029,8 @@ g16 a]
 
 @seealso
 Notation Reference:
-@ref{Direction and placement}.
+@ref{Direction and placement},
+@ref{Grace notes}.
 
 Snippets:
 @rlsr{Rhythms}.
@@ -2151,6 +2240,26 @@ However, as such ticks are typically used in Gregorian chant, it is
 preferable to use @code{\divisioMinima} there instead, described in
 the section @ref{Divisiones} in Gregorian chant.
 
+@cindex segno
+
+For in-line segno signs, there are three types of bar lines which
+differ in their behavior at line breaks:
+
+@lilypond[quote,relative=2,verbatim]
+c4 c c c
+\bar "S"
+c4 c c c \break
+\bar "S"
+c4 c c c
+\bar "|S"
+c4 c c c \break
+\bar "|S"
+c4 c c c
+\bar "S|"
+c4 c c c \break
+\bar "S|"
+c1
+@end lilypond
 
 @cindex repeats
 
@@ -2173,6 +2282,38 @@ c4 c c c \break
 c4 c c c
 @end lilypond
 
+For combinations of repeats with the segno sign, there are six different
+variations:
+
+@lilypond[quote,relative=2,verbatim]
+c4 c c c
+\bar ":|S"
+c4 c c c \break
+\bar ":|S"
+c4 c c c
+\bar ":|S."
+c4 c c c \break
+\bar ":|S."
+c4 c c c
+\bar "S|:"
+c4 c c c \break
+\bar "S|:"
+c4 c c c
+\bar ".S|:"
+c4 c c c \break
+\bar ".S|:"
+c4 c c c
+\bar ":|S|:"
+c4 c c c \break
+\bar ":|S|:"
+c4 c c c
+\bar ":|S.|:"
+c4 c c c \break
+\bar ":|S.|:"
+c1
+@end lilypond
+
+
 In scores with many staves, a @code{\bar} command in one staff is
 automatically applied to all staves.  The resulting bar lines are
 connected between different staves of a @code{StaffGroup},
@@ -2585,7 +2726,7 @@ Internals Reference:
 @funindex \grace
 @funindex grace
 
-Grace notes are ornaments that are written out. Grace notes
+Grace notes are ornaments that are written out.  Grace notes
 are printed in a smaller font and take up no logical time
 in a measure.
 
@@ -2654,7 +2795,7 @@ finally at 1/2 of the main note.
 @end lilypond
 
 The space between the main note and the grace note may also be
-specified using spacers. The following example places the grace
+specified using spacers.  The following example places the grace
 note after a space lasting 7/8 of the main note.
 
 @lilypond[quote,verbatim,relative=2]
@@ -2715,6 +2856,9 @@ Music Glossary:
 @rglos{acciaccatura},
 @rglos{appoggiatura}.
 
+Notation Reference:
+@ref{Manual beams}.
+
 Installed Files:
 @file{ly/@/grace@/-init@/.ly}.
 
@@ -2828,7 +2972,10 @@ Snippets:
 Time is administered by the @code{Timing_translator}, which by
 default is to be found in the @code{Score} context.  An alias,
 @code{Timing}, is added to the context in which the
-@code{Timing_translator} is placed.
+@code{Timing_translator} is placed.  To ensure that the
+@code{Timing} alias is available, you may need to explicitly
+instantiate the containing context (such as @code{Voice} or
+@code{Staff}).
 
 The following properties of @code{Timing} are used
 to keep track of timing within the score.
@@ -2867,14 +3014,16 @@ At 4/8 through the third measure, the @code{measurePosition} is
 advanced by 1/8 to 5/8, shortening that bar by 1/8.
 The next bar line then falls at 9/8 rather than 5/4.
 
-@lilypond[quote,verbatim,relative=1]
-\set Score.measureLength = #(ly:make-moment 5 4)
-c1 c4
-c1 c4
-c4 c4
-\set Score.measurePosition = #(ly:make-moment 5 8)
-b4 b4 b8
-c4 c1
+@lilypond[quote,verbatim]
+\new Voice \relative c' {
+  \set Timing.measureLength = #(ly:make-moment 5 4)
+  c1 c4 |
+  c1 c4 |
+  c4 c
+  \set Timing.measurePosition = #(ly:make-moment 5 8)
+  b4 b b8 |
+  c4 c1 |
+}
 @end lilypond
 
 @noindent