lilypond-devel
[Top][All Lists]
Advanced

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

Beam-patch - first try


From: Rune Zedeler
Subject: Beam-patch - first try
Date: Sat, 22 Sep 2001 02:52:30 +0200

Now I have the first version of the beaming patch.
My idea is to split the beamed section at the middle of duration if this
was possible.

This fixes

\time 6/8 [ c16 c c c8 c16 ]

and it also fixes the earlier mentioned

[\times 2/3 {c16 c c} c8] [\times 2/3 {c16 c c} c8]

(see
http://mail.gnu.org/pipermail/bug-gnu-music/2001-February/000148.html )

I haven't found any negative side-effects yet, but I haven't done any
heavy testing, so please test it and tell if it works.

The bad thing is the way I find the duration of the beam:

  Moment duration = infos_[infos_.size()-1].start_mom_ -
infos_[0].start_mom_ 
    + Rational(1,4<<(infos_[infos_.size()-1].beams_i_drul_[LEFT]));

the 2nd line calculates the length of the last note based on the number
of beams on it. This is ugly, and there must be a better way to do this.

-Rune
--- lilypond-1.5.11/lily/beaming-info.cc.bak    Sat Sep 22 00:45:31 2001
+++ lilypond-1.5.11/lily/beaming-info.cc        Sat Sep 22 02:51:10 2001
@@ -24,12 +24,17 @@
 }
 
 const int infinity_i = INT_MAX;        // guh.
+const int min_infinity_i = INT_MIN;
 
 int
 Beaming_info_list::min_denominator_index () const
 {
   int minden = infinity_i;
   int minidx = -1;
+  /* YIKES!!! FIXME!!! SLAM!!! There must be a simpler and cleaner way to get
+     the duration of the beaming */
+  Moment duration = infos_[infos_.size()-1].start_mom_ - infos_[0].start_mom_ 
+    + Rational(1,4<<(infos_[infos_.size()-1].beams_i_drul_[LEFT]));
 
   for (int i=1; i < infos_.size (); i++)
     {
@@ -38,6 +43,11 @@
          minidx = i;
          minden = infos_[i].start_mom_.den ();
        }
+      if (duration == ((infos_[i].start_mom_ - 
infos_[0].start_mom_)*Rational(2) ))
+        {
+         minidx = i;
+         minden = min_infinity_i;
+        }
     }
 
   return minidx;

reply via email to

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