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: Urs Liska
Subject: Re: Fix issue 4355 -- broken beam subdivision (issue 226700043 by address@hidden)
Date: Sat, 25 Apr 2015 13:58:47 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0



Am 25.04.2015 um 13:33 schrieb address@hidden:
Reviewers: lemzwerg, uliska,

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

Unfortunately I'm not 100% sure if I understand your questions correctly, so I'm not sure if my answers will make perfect sense to you ...


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.

That depends on how you mean that.
Subdivisions should be present at each 32nd note hear, as 1/32, 2/32 .. n/32. But they should have different numbers of beams. But you can also see that as "layered" subdivisions.

I think that could be a viable approach:
- start with the larges value (1/8) and determine all possible subdivision points
  (having 1 beam)
- go on to 16th notes and determine all possible subdivision points
  (having 2 beams) and apply them to all where 1/8 didn't already match
- go on until you reach baseMoment.

In that context I'd like to raise the question if baseMoment really is the appropriate property for configuring beamSubdivision or if it shouldn't have a dedicated property. Changing baseMoment might have side-effects on other aspects of the engraving that may or may not be intended.

Urs


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));




_______________________________________________
lilypond-devel mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-devel




reply via email to

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