]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/rhythms.itely
Merge branch 'master' into nested-bookparts
[lilypond.git] / Documentation / user / rhythms.itely
index 7f4d1aa15fd50ce246e189b2c78d758286b9c982..c64ea779a6f6d78ee9d9b4dc75e6de5e114ea940 100644 (file)
@@ -8,15 +8,6 @@
 
 @c \version "2.11.61"
 
-@ignore
-GDP TODO list
-
-1.2.3.4 Polymetric notation
-Quite extensive changes. Could you please check through.  Divided
-into three
-sections.  Necessarily uses tweaks.
-@end ignore
-
 @node Rhythms
 @section Rhythms
 
@@ -901,26 +892,8 @@ Mensural time signatures are covered in
 
 @snippets
 
-@c TODO Send as snippet called "Changing the time signature without affecting the beat length"
-
-The @code{\time} command sets the properties
-@code{timeSignatureFraction}, @code{beatLength}, and
-@code{measureLength} in the @code{Timing} context, which is
-normally aliased to @code{Score}.  Changing the value of
-@code{timeSignatureFraction} causes the new time signature symbol
-to be printed without changing the other properties:
-
-@lilypond[quote,verbatim,relative=2]
-\time 3/4
-a16 a a a a a a a a a a a
-% Change time signature but keep 3/4 beaming
-% due to unchanged beatLength
-\set Score.timeSignatureFraction = #'(12 . 16)
-a16 a a a a a a a a a a a
-\time 12/16
-% Lose 3/4 beaming now beatLength has changed to 16
-a16 a a a a a a a a a a a
-@end lilypond
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{changing-the-time-signature-without-affecting-the-beaming.ly}
 
 @cindex compound time signatures
 @cindex time signature, compound
@@ -1084,31 +1057,37 @@ to indicate where breaks can occur.
 @node Polymetric notation
 @unnumberedsubsubsec Polymetric notation
 
+@c This section necessarily uses \set
+@c This is acceptable  -td
+
 @cindex double time signatures
 @cindex signatures, polymetric
 @cindex polymetric signatures
 @cindex meter, polymetric
 
-Polymetric notation is supported, either explicitly or through
-clever use of markup features.
+Polymetric notation is supported, either explicitly or by modifying
+the visible time signature symbol and scaling the note durations.
 
-@strong{Staves with different time signatures, equal measure lengths}
+@strong{@i{Staves with different time signatures, equal measure lengths}}
 
 This notation can be created by setting a common time signature
 for each staff but replacing the symbol manually by setting
 @code{timeSignatureFraction} to the desired fraction and scaling
 the printed durations in each staff to the common time
-signature.  This is done with @code{\scaleDurations}, which
-is used in a similar way to @code{\times}, but does not create
-a tuplet bracket, see @ref{Scaling durations}.
+signature; see @ref{Time signature}.  The scaling is done with
+@code{\scaleDurations}, which is used in a similar way to
+@code{\times}, but does not create a tuplet bracket; see
+@ref{Scaling durations}.
 
 In this example, music with the time signatures of 3/4, 9/8, and
 10/8 are used in parallel.  In the second staff, shown durations
 are multiplied by 2/3, as 2/3 * 9/8 = 3/4, and in the third
 staff, shown durations are multiplied by 3/5, as 3/5 * 10/8 = 3/4.
+It will often be necessary to insert beams manually, as the
+duration scaling affects the autobeaming rules.
 
 @lilypond[quote,verbatim,fragment]
-\relative c' <<
+\relative c' <<
   \new Staff {
     \time 3/4
     c4 c c |
@@ -1118,7 +1097,7 @@ staff, shown durations are multiplied by 3/5, as 3/5 * 10/8 = 3/4.
     \time 3/4
     \set Staff.timeSignatureFraction = #'(9 . 8)
     \scaleDurations #'(2 . 3)
-      \repeat unfold 6 { c8[ c c] }
+    \repeat unfold 6 { c8[ c c] }
   }
   \new Staff {
     \time 3/4
@@ -1126,16 +1105,17 @@ staff, shown durations are multiplied by 3/5, as 3/5 * 10/8 = 3/4.
     \scaleDurations #'(3 . 5) {
       \repeat unfold 2 { c8[ c c] }
       \repeat unfold 2 { c8[ c] } |
-      c4. c4. \times 2/3 { c8 c c } c4
+      c4. c4. \times 2/3 { c8[ c c] } c4
     }
   }
->> }
+>>
 @end lilypond
 
-@strong{Staves with different time signatures, unequal bar lengths}
+@strong{@i{Staves with different time signatures, unequal bar lengths}}
 
 Each staff can be given its own independent time signature by
-moving the @code{Timing_translator} to the @code{Staff} context.
+moving the @code{Timing_translator} and the
+@code{Default_bar_line_engraver} to the @code{Staff} context.
 
 @lilypond[quote,verbatim]
 \layout {
@@ -1188,7 +1168,9 @@ Music Glossary:
 @rglos{polymetric time signature},
 @rglos{meter}.
 
-Notation Reference: @ref{Scaling durations}
+Notation Reference:
+@ref{Time signature},
+@ref{Scaling durations}.
 
 Snippets:
 @rlsr{Rhythms}.
@@ -1196,6 +1178,7 @@ Snippets:
 Internals Reference:
 @rinternals{TimeSignature},
 @rinternals{Timing_translator},
+@rinternals{Default_bar_line_engraver},
 @rinternals{Staff}.
 
 @knownissues
@@ -1357,11 +1340,11 @@ entered explicitly; see @ref{Manual beams}.  It is also possible
 to define beaming patterns that differ from the defaults.  The
 default beaming rules for most common time signatures are defined
 in @file{scm/@/auto@/-beam@/.scm}.  If there are no beaming rules
-defined for the time signature being used the beaming is controlled
-by the values of three context properties, @code{measureLength},
-@code{beatLength} and @code{beatGrouping}.  Both the beaming rules
-and the context properties can be overridden, see
-@ref{Setting automatic beam behavior}.
+defined for a particular beam's duration in the time signature being
+used, its beaming is controlled by the values of three context
+properties, @code{measureLength}, @code{beatLength} and
+@code{beatGrouping}.  Both the beaming rules and the context
+properties can be overridden, see @ref{Setting automatic beam behavior}.
 
 @cindex autoBeamOn
 @cindex autoBeamOff
@@ -1406,7 +1389,7 @@ Notation Reference:
 @ref{Setting automatic beam behavior}.
 
 Installed Files:
-@file{scm/auto-beam.scm}.
+@file{scm/@/auto@/-beam@/.scm}.
 
 Snippets:
 @rlsr{Rhythms}.
@@ -1443,14 +1426,18 @@ exclusive ways in which these rules may be modified.  The
 first, modifying the grouping of beats, applies to uncommon time
 signatures, i.e. those for which there are no predefined rules
 defining the beam end points.  The second method, modifying the
-beam end points, must be used for those time signatures for which
-beam ending rules are pre-defined.  There are predefined rules for
-time signatures of 3/2, 3/4, 4/4, 2/4, 4/8, 4/16, 6/8, 9/8 and 12/8.
+specification of the beam end points, can be used for any time
+signature.  This second method @strong{must} be used for those time
+signatures and beam durations combinations for which beam ending
+rules are pre-defined, unless these have all been reverted.  There
+are predefined rules for time signatures of 3/2, 3/4, 4/4, 2/4,
+4/8, 4/16, 6/8, 9/8 and 12/8.
 
 @i{@strong{Modifying the grouping of beats}}
 
-If there are no beam-ending rules defined for the time signature
-in use the beaming is controlled by three context properties:
+If there are no beam-ending rules defined for the beam duration of a
+particular beam in the time signature in use, its beaming is
+controlled by three context properties:
 @code{measureLength}, @code{beatLength} and @code{beatGrouping}.
 These properties may be set in the @code{Score}, @code{Staff} or
 @code{Voice} contexts to delimit their scope.
@@ -1473,11 +1460,22 @@ the end points of beams.
 
 @end itemize
 
-By default these properties are derived from the time signature set
-by the @code{\time} command.  The @code{measureLength} is, by
-default, exactly the same length as the measure length given by the
-time signature, and the default @code{beatLength} is given by the
-denominator of the time signature.
+@warning{These three properties become effective for a particular
+beam @strong{only} if there are no beam-ending rules predefined for
+that beam's duration in the time signature in use, or if these
+beam-ending rules have all been reverted.}
+
+By default the @code{measureLength} and @code{beatLength} are
+derived from the time signature set by the @code{\time} command.
+The @code{measureLength} is set to be exactly the same length as
+the measure length given by the time signature, and the
+@code{beatLength} is set to be the same as one over the denominator
+of the time signature.
+
+The default value of @code{beatGrouping} is taken from a table in
+@file{scm/@/music@/-functions@/.scm}.  To find this, see
+@rlearning{Other sources of information}.  It defines the beat
+grouping for 5/8, 6/8, 8/8, 9/8 and 12/8 time signatures.
 
 Both @code{measureLength} and @code{beatLength} are @i{moments},
 units of musical duration.  A quantity of type @i{moment} is
@@ -1492,60 +1490,11 @@ beats in each group.
 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
 {grouping-beats.ly}
 
-@c TODO Convert to snippet called "Specifying context with beatGrouping"
-
-By specifying the context, the effect of @code{beatGrouping} can be
-limited to the context specified, and values set in higher-level
-contexts overridden:
-
-@lilypond[quote,verbatim]
-\score {
-  \new Staff <<
-    \time 7/8
-    \new Voice {
-      \relative c'' {
-        \set Staff.beatGrouping = #'(2 3 2)
-        a8 a a a a a a
-      }
-    }
-    \new Voice {
-      \relative c' {
-        \voiceTwo
-        \set Voice.beatGrouping = #'(1 3 3)
-        f8 f f f f f f
-      }
-    }
-  >>
-}
-@end lilypond
-
-
-@c TODO Send as snippet?
-
-The property @code{measureLength} determines where bar lines
-should be inserted and, with @code{beatLength} and
-@code{beatGrouping}, how automatic beams should be generated
-for time signatures for which no beam end rules are defined.
-
-@lilypond[quote,verbatim,relative=2]
-\time 3/4 % auto beam on 1/4 note groups
-a16 a a a a a a a a a a a a a a a
-\time 12/16 % no defined auto-beaming for this time sig
-a16 a a a a a a a a a a a a a a a
-\time 3/4
-a16 a a a a a a a a a a a a a a a
-\set Score.timeSignatureFraction = #'(12 . 16) %keep 3/4 beaming
-                                             % due to beatLength
-a16 a a a a a a a a a a a a a a a
-\set Score.beatLength = #(ly:make-moment 1 8) %beam on 1/8 notes
-a16 a a a a a a a a a a a a a a a
-\set Score.beatLength = #(ly:make-moment 1 16)
-\set Score.beatGrouping = #'(3 4 2 3) %beam on 3/16, 7/16, 9/16, 12/16
-a16 a a a a a a a a a a a a a a a
-@end lilypond
-
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{specifying-context-with-beatgrouping.ly}
 
-@c End of snippet
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{using-beatlength-and-beatgrouping.ly}
 
 @funindex subdivideBeams
 
@@ -1563,22 +1512,19 @@ a16 a a a a a a a a a a a a a a a
 
 @strong{@i{Modifying the beam end points}}
 
-In normal time signatures, automatic beams can start on any note but
-can end at only a few positions within the measure, namely at
+In common time signatures, automatic beams can start on any note
+but can end at only a few positions within the measure, namely at
 durations specified by the properties in @code{autoBeamSettings}.
 These properties consist of a list of rules defining where beams can
 end.  The default @code{autoBeamSettings} rules are defined in
-@file{scm/@/auto@/-beam@/.scm}.
+@file{scm/@/auto@/-beam@/.scm}.  To find this, see
+@rlearning{Other sources of information}.
 
-This method @strong{must} be used for the common time signatures,
-and is also particularly suitable for many other time signatures
-if the time signature of the measures changes frequently.  Because
-the rules can be written to apply to a specific time signature they
-need to be set up only once with rules for each time signature.
-Attempting to achieve the same result by modifying the beat grouping
-would require the insertion of @code{\set} commands every time the
-time signature changed, unless the default values in that time
-signature were suitable.
+This method @strong{must} be used for the time signatures for which
+beam-ending rules are defined by default, unless these have all
+been reverted.  It is also particularly suitable for many other time
+signatures if the time signature of the measures changes frequently,
+or if the beaming should be different for different beam durations.
 
 In order to add a rule to the list, use
 
@@ -1679,9 +1625,6 @@ staff:
 << {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
 @end lilypond
 
-@c TODO Add example using Score for multiple staves?
-@c Hmm.  Not sure it works correctly.  Needs more investigation.
-
 @warning{If any unexpected beam behavior occurs, check the default
 automatic beam settings in @file{scm/@/auto@/-beam@/.scm} for
 possible interference, because the beam endings defined there will
@@ -1732,26 +1675,36 @@ a a a a
 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
 {beam-grouping-in-7-8-time.ly}
 
-@ignore
-
-@c TODO Does this example add anything?
-
-In this
-example, automatic beams can only end on a dotted quarter note
-@example
-#(override-auto-beam-setting '(end * * * *) 3 8)
-#(override-auto-beam-setting '(end * * * *) 1 2)
-#(override-auto-beam-setting '(end * * * *) 7 8)
-@end example
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{reverting-default-beam-endings.ly}
 
-In 4/4 time signature, this means that automatic beams could end only on
-3/8 and on the fourth beat of the measure (after 3/4, that is 2 times
-3/8, has passed within the measure).
+@c TODO Convert to snippet called "Beam endings in Score context"
+@c Submitted to LSR 3 Nov 08
 
-@end ignore
+Beam-ending rules specified in the Score context apply to all
+staves, but can be modified at both Staff and Voice levels:
 
-@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
-{reverting-default-beam-endings.ly}
+@lilypond[quote,verbatim,relative=2]
+  \time 5/4
+  % Set default beaming for all staves
+  #(override-auto-beam-setting '(end * * 5 4) 3 8 'Score)
+  #(override-auto-beam-setting '(end * * 5 4) 7 8 'Score)
+  <<
+    \new Staff {
+      c8 c c c c c c c c c
+    }
+    \new Staff {
+      % Modify beaming for just this staff
+      #(override-auto-beam-setting '(end * * 5 4) 6 8 'Staff)
+      #(revert-auto-beam-setting '(end * * 5 4) 7 8 'Staff)
+      c8 c c c c c c c c c
+    }
+    \new Staff {
+      % Inherit beaming from Score context
+      c8 c c c c c c c c c
+    }
+  >>
+@end lilypond
 
 
 @predefined
@@ -1829,8 +1782,8 @@ g a]
 
 @snippets
 
-@c TODO Add snippet "Flat flags and beam nibs" when available
-@c Added to LSR 27 Oct 08
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{flat-flags-and-beam-nibs.ly}
 
 @node Feathered beams
 @unnumberedsubsubsec Feathered beams