bug-lilypond
[Top][All Lists]
Advanced

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

spacing bug 1.5.11


From: Han-Wen Nienhuys
Subject: spacing bug 1.5.11
Date: Fri, 21 Sep 2001 21:58:14 +0200

address@hidden writes:
> I haven't been able to reproduce this bug in a small example.
> But Mozart's RondoAllaTurca from mutopia produces buggy output with
> 1.5.11 - no problems in 1.4.7.
> The third page is here:

Yes, it's a two-step bug. There was a bug disallowing line breaks
before grace notes, and an oversight that got the line breaking code
really confused when there was a `unspaceable' section (such as those
caused by having no breakpoints before graces.)  in the music. It's
fixed in the following patch.

(Thanks to Mats who correctly diagnosed the problem)

Generated by address@hidden,
>From = lilypond-1.5.11, To = lilypond-1.5.11.hwn1

usage 

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.5.11.hwn1.diff

Patches do not contain automatically generated files 
or (urg) empty directories, 
i.e., you should rerun autoconf, configure

diff -urN ../lilypond-1.5.11/CHANGES ./CHANGES
--- ../lilypond-1.5.11/CHANGES  Fri Sep 21 00:55:56 2001
+++ ./CHANGES   Fri Sep 21 21:46:02 2001
@@ -1,3 +1,11 @@
+1.5.11
+======
+
+* Allow breaks at measures starting with grace notes.
+
+* Bugfix: don't give up when there is one entirely unspaceable
+measure/line.
+
 1.5.10.jcn3
 ===========
 
diff -urN ../lilypond-1.5.11/VERSION ./VERSION
--- ../lilypond-1.5.11/VERSION  Fri Sep 21 01:04:03 2001
+++ ./VERSION   Fri Sep 21 21:03:27 2001
@@ -2,7 +2,7 @@
 MAJOR_VERSION=1
 MINOR_VERSION=5
 PATCH_LEVEL=11
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=hwn1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff -urN ../lilypond-1.5.11/lily/gourlay-breaking.cc ./lily/gourlay-breaking.cc
--- ../lilypond-1.5.11/lily/gourlay-breaking.cc Sun Mar 11 19:10:33 2001
+++ ./lily/gourlay-breaking.cc  Fri Sep 21 21:53:04 2001
@@ -66,6 +66,8 @@
   optimal_paths[0] = first_node; 
   int break_idx=1;
 
+  Real worst_force = 0.0;
+  
   for (; break_idx< breaks.size (); break_idx++) 
     {
       /*
@@ -94,13 +96,26 @@
          sp->solve (&cp);
          delete sp;
 
+         if (cp.force_f_ > worst_force)
+           worst_force = cp.force_f_;
+
+         /*
+           We remember this solution as a "should always work
+           solution", in case everything fucks up.  */
          if (start_idx == break_idx - 1)
-           backup_sol = cp;    // in case everything fucks up
+           backup_sol = cp;
          if (!cp.satisfies_constraints_b_)
-           break;
-
+           {
+             /*
+               If it doesn't satisfy constraints, we make this one
+               really unattractive.
+             */
+             cp.force_f_ += worst_force;
+             cp.force_f_ *= 10;        
+           }
          
          Real this_demerits;
+
          if (optimal_paths[start_idx].demerits_f_ >= infinity_f)
            this_demerits = infinity_f;
          else
@@ -113,6 +128,13 @@
              minimal_sol = cp;
              minimal_demerits = this_demerits;
            }
+
+         /*
+           we couldn't satisfy the constraints, this won't get better
+           if we add more columns, so we get on with the next one
+         */
+         if (!cp.satisfies_constraints_b_)
+           break ; 
        }
 
       int prev =break_idx - 1;
@@ -156,9 +178,14 @@
   if (optimal_paths.top ().demerits_f_ >= infinity_f)
     warning (_ ("No feasible line breaking found"));
   
-  for (int i= final_breaks.size (); i--;) 
-    lines.push (optimal_paths[final_breaks[i]].line_config_);
-  
+  for (int i= final_breaks.size (); i--;)
+    {
+      Column_x_positions cp (optimal_paths[final_breaks[i]].line_config_);
+      
+      lines.push (cp);
+      if(!cp.satisfies_constraints_b_)
+       warning ("Could not find line breaking that satisfies constraints.");
+    }
   return lines;
 }
 
diff -urN ../lilypond-1.5.11/lily/note-heads-engraver.cc 
./lily/note-heads-engraver.cc
--- ../lilypond-1.5.11/lily/note-heads-engraver.cc      Sun Aug 12 20:51:08 2001
+++ ./lily/note-heads-engraver.cc       Fri Sep 21 21:51:29 2001
@@ -129,9 +129,13 @@
 Note_heads_engraver::start_translation_timestep ()
 {
   
-  /* TODO:make this settable?
+  /*
+    TODO: make this settable?
+
+    TODO: what if someone wants a line break in a grace note section??
    */
-  if (note_end_mom_ > now_mom ())
+  //  if (note_end_mom_ > now_mom ())  
+  if (note_end_mom_.main_part_ > now_mom ().main_part_)
     {
       Score_engraver * e = 0;
       Translator * t  =  daddy_grav_l ();


-- 

Han-Wen Nienhuys   |   address@hidden    | http://www.cs.uu.nl/~hanwen/




reply via email to

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