]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.5.25
authorfred <fred>
Wed, 27 Mar 2002 02:04:31 +0000 (02:04 +0000)
committerfred <fred>
Wed, 27 Mar 2002 02:04:31 +0000 (02:04 +0000)
lily/gourlay-breaking.cc
lily/pitch.cc

index 86914fcd0eab394751b69378dad3e74a73fa4e7d..4c9ef7c9fa6bc3fedbf6ec1cc5ea757c889dbeb9 100644 (file)
@@ -64,7 +64,7 @@ Gourlay_breaking::do_solve () const
 
   Real worst_force = 0.0;
   
-  for (  int break_idx=1; break_idx< breaks.size (); break_idx++) 
+  for (int break_idx=1; break_idx< breaks.size (); break_idx++) 
     {
       /*
        start with a short line, add measures. At some point 
@@ -187,6 +187,10 @@ Gourlay_breaking::Gourlay_breaking ()
 
 /*
   TODO: uniformity parameter to control rel. importance of spacing differences.
+
+  TODO:
+
+  mixing break penalties and constraint-failing solutions is confusing.
  */
 Real
 Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
@@ -197,7 +201,7 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
   if (pc->original_l_)
     {
       SCM pen = pc->get_grob_property ("penalty");
-      if (gh_number_p (pen))
+      if (gh_number_p (pen) && fabs (gh_scm2double (pen)) < 10000)
        {
          break_penalties += gh_scm2double (pen);
        }
@@ -212,9 +216,12 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
        /*
         If it doesn't satisfy constraints, we make this one
         really unattractive.
-       */
-       demerit += 10;
-       demerit *= 100;
+
+        add 20000 to the demerits, so that a break penalty
+        of -10000 won't change the result */
+       demerit = (demerit + 20000) >? 2000;
+       
+       demerit *= 10;
      }
 
    return demerit;
index 46013523fd454bc124e9295ca69129c0aff1964a..df4db48a8c0ba16197442ed24ba1eda3f8988ec6 100644 (file)
@@ -154,13 +154,13 @@ Pitch::str () const
   if (alteration_i_)
     s += String (accname[alteration_i_ + 2]);
 
-  if (octave_i_ > 0)
+  if (octave_i_ >= 0)
     {
       int o = octave_i_ + 1;
       while (o--)
        s += "'";
     }
-  else if (octave_i_ <0)
+  else if (octave_i_ < 0)
     {
       int o = (-octave_i_) - 1;
       while (o--)