]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/subdividing-beams.ly
Adjust beam subdivision to only occur at baseMoment
[lilypond.git] / Documentation / snippets / new / subdividing-beams.ly
1 \version "2.18.0"
2
3 \header {
4   lsrtags = "rhythms"
5
6   texidoc = "
7 The beams of consecutive 16th (or shorter) notes are, by default, not
8 subdivided.  That is, the three (or more) beams stretch unbroken over
9 entire groups of notes.  This behavior can be modified to subdivide the
10 beams into sub-groups by setting the property @code{subdivideBeams}.
11 When set, multiple beams will be subdivided at intervals defined by the
12 current value of @code{baseMoment} by reducing the multiple beams to
13 the number of beams that indicates the length of the sub-group.
14 Note that @code{baseMoment}
15 defaults to one over the denominator of the current time signature if
16 not set explicitly. It must be set to a fraction giving the duration of
17 the beam sub-group using the @code{ly:make-moment} function, as shown
18 in this snippet. Also, when @code{baseMoment} is changed,
19 @code{beatStructure} should also be changed to match the new
20 @code{baseMoment}:
21
22 "
23   doctitle = "Subdividing beams"
24 } % begin verbatim
25
26 \relative c'' {
27   c32[ c c c c c c c]
28   \set subdivideBeams = ##t
29   c32[ c c c c c c c]
30
31   % Set beam sub-group length to an eighth note
32   \set baseMoment = #(ly:make-moment 1/8)
33   \set beatStructure = #'(2 2 2 2)
34   c32[ c c c c c c c]
35
36   % Set beam sub-group length to a sixteenth note
37   \set baseMoment = #(ly:make-moment 1/16)
38   \set beatStructure = #'(4 4 4 4)
39   c32[ c c c c c c c]
40 }