+@code{beatGrouping} is a list of integers giving the number of
+beats in each group.
+
+@snippets
+
+@c TODO -- convert to snippet called "Grouping beats"
+@c Added to lsr 18 Oct 08 -td
+
+Beaming patterns may be altered with the @code{beatGrouping} property,
+
+@lilypond[quote,verbatim,relative=2]
+\time 5/16
+\set beatGrouping = #'(2 3)
+c8[^"(2+3)" c16 c8]
+\set beatGrouping = #'(3 2)
+c8[^"(3+2)" c16 c8]
+@end lilypond
+
+@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
+
+
+@c End of snippet
+
+@funindex subdivideBeams
+
+@c TODO convert to snippet called "Sub-dividing beams"
+@c Added to lsr 18 Oct 08
+
+The beams of consecutive 16th (or shorter) notes are, by default,
+not sub-divided. That is, the three (or more) beams stretch
+unbroken over entire groups of notes. This behavior can
+be modified to sub-divide the beams into sub-groups by setting
+the property @code{subdivideBeams}. When set, multiple beams
+will be sub-divided at intervals defined by the current value of
+@code{beatLength} by reducing the multiple beams to just one beam
+between the sub-groups.
+
+@code{beatLength) must be
+set to a fraction giving the duration of the beam sub-group
+using the @code{make-moment} function, as shown here:
+
+@lilypond[quote,relative=2,verbatim]
+c32[ c c c c c c c]
+\set subdivideBeams = ##t
+c32[ c c c c c c c]
+% Set beam sub-group length to an eighth note
+\set Score.beatLength = #(ly:make-moment 1 8)
+c32[ c c c c c c c]
+% Set beam sub-group length to a sixteenth note
+\set Score.beatLength = #(ly:make-moment 1 16)
+c32[ c c c c c c c]
+@end lilypond
+
+@cindex measure groupings
+@cindex beats, grouping
+@cindex grouping beats
+@cindex measure sub-grouping
+
+@c TODO Sent as snippet called "Conducting signs, measure grouping signs" 18 Oct 08 -td
+Options to group beats within a bar are available through the
+Scheme function @code{set-time-signature}, which takes three
+arguments: the number of beats, the beat length, and the internal
+grouping of beats in the measure. If the
+@rinternals{Measure_grouping_engraver} is included, the function
+will also create @rinternals{MeasureGrouping} signs. Such signs
+ease reading rhythmically complex modern music. In the example,
+the 9/8 measure is subdivided in 2, 2, 2 and 3. This is passed to
+@code{set-time-signature} as the third argument: @code{'(2 2 2 3)}:
+
+@lilypond[quote,ragged-right,verbatim]
+\score {
+ \relative c'' {
+ #(set-time-signature 9 8 '(2 2 2 3))
+ g8[ g] d[ d] g[ g] a8[( bes g]) |
+ #(set-time-signature 5 8 '(3 2))
+ a4. g4
+ }
+ \layout {
+ \context {
+ \Staff
+ \consists "Measure_grouping_engraver"
+ }
+ }
+}
+@end lilypond
+@c TODO End of snippet called "grouping beats"
+
+
+@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
+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}.
+
+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.