lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fix issue 4355 -- broken beam subdivision (issue 226700043 by addres


From: Carl . D . Sorensen
Subject: Re: Fix issue 4355 -- broken beam subdivision (issue 226700043 by address@hidden)
Date: Sat, 25 Apr 2015 11:33:01 +0000

Reviewers: lemzwerg, uliska,

Message:
Ok, so let me see if I understand what you are saying.

When we choose to subdivide beams with a given baseMoment, there should
be a subdivision at baseMoment and at every even interval larger than
that.

So if we have a baseMoment of 1/32, we should subdivide at 1/32, 1/16,
and 1/8.

If we have a baseMoment of 1/16, we should subdivide at 1/16 and 1/8.

If we have a baseMoment of 1/8, we should subdivide at 1/8.

And presumably if we have a baseMoment of 1/128, we should subdivide at
1/128, 1/64, 1/32, 1/16, and 1/8.

Is this correct?


Description:
Fix issue 4355 -- broken beam subdivision

When beams are subdivided, the number of beams joining the subdivisions
should match the length of the subdivision.  Previously, the
subdivisions
were joined by a single beam.

Please review this at https://codereview.appspot.com/226700043/

Affected files (+25, -2 lines):
  A input/regression/beam-subdivision.ly
  M lily/beaming-pattern.cc


Index: input/regression/beam-subdivision.ly
diff --git a/input/regression/beam-subdivision.ly b/input/regression/beam-subdivision.ly
new file mode 100644
index 0000000000000000000000000000000000000000..812e3ae62e5d7e8b72411ede7535eadac0dafd8f
--- /dev/null
+++ b/input/regression/beam-subdivision.ly
@@ -0,0 +1,21 @@
+\header {
+
+  texidoc = "Beam subdivisions should match the durations of the subdivided
+groups, as established by baseMoment. The first beamed group should be joined
+by a single beam.  The second should be joined by a double beam."
+  }
+
+\version "2.19.19"
+
+\layout {
+  ragged-right = ##t
+}
+
+{
+  \set subdivideBeams = ##t
+  \set baseMoment = #(ly:make-moment 1 8)
+  c''32[ c'' c'' c'' c'' c'' c'' c'']
+  \set baseMoment = #(ly:make-moment 1 16)
+  c''32[ c'' c'' c'' c'' c'' c'' c'']
+}
+
Index: lily/beaming-pattern.cc
diff --git a/lily/beaming-pattern.cc b/lily/beaming-pattern.cc
index 5ffbcfb9d9047ef558213bcc3293b117c9443c37..5f9be8a901e1df02fc3bfcc144a7a9e428054d59 100644
--- a/lily/beaming-pattern.cc
+++ b/lily/beaming-pattern.cc
@@ -156,6 +156,7 @@ Beaming_pattern::beamify (Beaming_options const &options)
         flag_directions[i] = LEFT;
     }

+  Duration base_dur = Duration(options.base_moment_.main_part_, false);
   // Set the count on each side of the stem
   // We need to run this code twice to make both the
   // left and the right counts work properly
@@ -166,8 +167,9 @@ Beaming_pattern::beamify (Beaming_options const &options)
         if (non_flag_dir)
           {
             int importance = infos_[i + 1].rhythmic_importance_;
-            int count = (importance < 0 && options.subdivide_beams_)
-                        ? 1 : min (min (infos_[i].count (non_flag_dir),
+            int count = (importance < 0 && options.subdivide_beams_)
+ ? base_dur.duration_log () - 2 // durlog 3 has 1 beams
+                        : 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));






reply via email to

[Prev in Thread] Current Thread [Next in Thread]