]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/beaming-pattern.cc
Merge branch 'master' into lilypond/translation
[lilypond.git] / lily / beaming-pattern.cc
index b6b9060ddaeb59a9e3a3ed30782920148cee9919..8f27c23ef57955f027151c4fd8e8b3d93a8fc9bc 100644 (file)
@@ -43,7 +43,7 @@ Beam_rhythmic_element::Beam_rhythmic_element ()
   tuplet_start_ = false;
 }
 
-Beam_rhythmic_element::Beam_rhythmic_element (Moment m, int i, bool inv, 
+Beam_rhythmic_element::Beam_rhythmic_element (Moment m, int i, bool inv,
   Rational factor, bool tuplet_start)
 {
   start_moment_ = m;
@@ -270,16 +270,11 @@ Beaming_pattern::find_rhythmic_importance (Beaming_options const &options)
           Moment tuplet_moment (tuplet);
           Moment tuplet_dt = infos_[i].start_moment_ - tuplet_start_moment;
           tuplet_number = tuplet.den ();
-          // set the beat end (if not in a tuplet) and increment the next beat
+          // set the beat end and increment the next beat
           if (infos_[i].start_moment_ == next_beat_pos)
             {
-              if (tuplet_number == 1)
-                {
-                  infos_[i].rhythmic_importance_ = -1;
-                  next_beat_pos += options.base_moment_;
-                }
-              if (infos_[i].tuplet_start_)
-                infos_[i].rhythmic_importance_ = -1;
+              infos_[i].rhythmic_importance_ = -1;
+              next_beat_pos += options.base_moment_;
             }
           // The rhythmic importance of a stem between beats depends on its fraction
           // of a beat: those stems with a lower denominator are deemed more
@@ -357,11 +352,12 @@ Beaming_pattern::start_moment (int i) const
 Moment
 Beaming_pattern::end_moment (int i) const
 {
-  Duration *dur = new Duration (2 + max (beamlet_count (i, LEFT),
-                                         beamlet_count (i, RIGHT)),
-                                0);
+  Duration dur (2 + max (beamlet_count (i, LEFT),
+                         beamlet_count (i, RIGHT)),
+                0);
 
-  return infos_.at (i).start_moment_ + dur->get_length ();
+  return infos_.at (i).start_moment_
+    + infos_.at(i).factor_ * dur.get_length ();
 }
 
 bool