]> git.donarmstrong.com Git - lilypond.git/commitdiff
Adjust beam subdivision to only occur at baseMoment
authorCarl Sorensen <carl.d.sorensen@gmail.com>
Thu, 7 May 2015 17:39:33 +0000 (11:39 -0600)
committerCarl Sorensen <carl.d.sorensen@gmail.com>
Thu, 21 May 2015 01:10:54 +0000 (19:10 -0600)
Documentation/snippets/new/subdividing-beams.ly [new file with mode: 0644]
Documentation/snippets/subdividing-beams.ly
lily/beaming-pattern.cc

diff --git a/Documentation/snippets/new/subdividing-beams.ly b/Documentation/snippets/new/subdividing-beams.ly
new file mode 100644 (file)
index 0000000..5677de1
--- /dev/null
@@ -0,0 +1,40 @@
+\version "2.18.0"
+
+\header {
+  lsrtags = "rhythms"
+
+  texidoc = "
+The beams of consecutive 16th (or shorter) notes are, by default, not
+subdivided.  That is, the three (or more) beams stretch unbroken over
+entire groups of notes.  This behavior can be modified to subdivide the
+beams into sub-groups by setting the property @code{subdivideBeams}.
+When set, multiple beams will be subdivided at intervals defined by the
+current value of @code{baseMoment} by reducing the multiple beams to
+the number of beams that indicates the length of the sub-group.
+Note that @code{baseMoment}
+defaults to one over the denominator of the current time signature if
+not set explicitly. It must be set to a fraction giving the duration of
+the beam sub-group using the @code{ly:make-moment} function, as shown
+in this snippet. Also, when @code{baseMoment} is changed,
+@code{beatStructure} should also be changed to match the new
+@code{baseMoment}:
+
+"
+  doctitle = "Subdividing beams"
+} % begin verbatim
+
+\relative c'' {
+  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 baseMoment = #(ly:make-moment 1/8)
+  \set beatStructure = #'(2 2 2 2)
+  c32[ c c c c c c c]
+
+  % Set beam sub-group length to a sixteenth note
+  \set baseMoment = #(ly:make-moment 1/16)
+  \set beatStructure = #'(4 4 4 4)
+  c32[ c c c c c c c]
+}
index 9b94dd36191db6432b93f73865cc612c079286cd..bec7e757eab728830a6e0bd10fc5865b06ca64ef 100644 (file)
@@ -1,9 +1,10 @@
-%% DO NOT EDIT this file manually; it is automatically
-%% generated from LSR http://lsr.di.unimi.it
-%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
-%% and then run scripts/auxiliar/makelsr.py
-%%
-%% This file is in the public domain.
+% DO NOT EDIT this file manually; it is automatically
+% generated from Documentation/snippets/new
+% Make any changes in Documentation/snippets/new/
+% and then run scripts/auxiliar/makelsr.py
+%
+% This file is in the public domain.
+%% Note: this file works from version 2.18.0
 \version "2.18.0"
 
 \header {
@@ -16,7 +17,8 @@ entire groups of notes.  This behavior can be modified to subdivide the
 beams into sub-groups by setting the property @code{subdivideBeams}.
 When set, multiple beams will be subdivided at intervals defined by the
 current value of @code{baseMoment} by reducing the multiple beams to
-just one beam between the sub-groups. Note that @code{baseMoment}
+the number of beams that indicates the length of the sub-group.
+Note that @code{baseMoment}
 defaults to one over the denominator of the current time signature if
 not set explicitly. It must be set to a fraction giving the duration of
 the beam sub-group using the @code{ly:make-moment} function, as shown
@@ -42,4 +44,4 @@ in this snippet. Also, when @code{baseMoment} is changed,
   \set baseMoment = #(ly:make-moment 1/16)
   \set beatStructure = #'(4 4 4 4)
   c32[ c c c c c c c]
-}
+} % begin verbatim
index 1dcb791a8d9ca6bc836a10a1276373a4ab47c6ed..cb8c91dbece9de761ba7a5d1421e4f5e8c12987c 100644 (file)
@@ -132,6 +132,8 @@ Beaming_pattern::beamify (Beaming_options const &options)
   if (infos_.size () <= 1)
     return;
 
+  int subdivide_beam_count = intlog2(options.base_moment_.main_part_.den())-2;
+
   unbeam_invisible_stems ();
 
   if (infos_[0].start_moment_.grace_part_)
@@ -167,9 +169,8 @@ Beaming_pattern::beamify (Beaming_options const &options)
         if (non_flag_dir)
           {
             int importance = infos_[i + 1].rhythmic_importance_;
-            int start_dur = intlog2(infos_[i+1].start_moment_.main_part_.den());
             int count = (importance < 0 && options.subdivide_beams_) 
-                        ? max(start_dur,3)-2 // 1/8 note has one beam
+                        ? subdivide_beam_count
                         : min (min (infos_[i].count (non_flag_dir),
                                         infos_[i + non_flag_dir].count (-non_flag_dir)),
                                    infos_[i - non_flag_dir].count (non_flag_dir));