]> git.donarmstrong.com Git - lilypond.git/commitdiff
(conv): add rule for | ~
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 19 Feb 2004 21:33:59 +0000 (21:33 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 19 Feb 2004 21:33:59 +0000 (21:33 +0000)
ChangeLog
THANKS
input/regression/beam-break.ly
lily/beam.cc
scm/output-tex.scm
scripts/convert-ly.py

index 4791a61dad9afe0b9c805900c574cf07d833707b..6d0e5451c99146f41040269be958d305c6ecd399 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-02-19  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/beam.cc (print): broken beams last until end of staff.
+       (print): broken beams start from prefatory matter.
+
        * scm/output-tex.scm (output-scopes): don't dump fraction exactly.
 
        * lily/paper-score.cc (process): dump header only once.
diff --git a/THANKS b/THANKS
index d52980667e8766ce6d88a1c720198cb0e8844733..a4795624018729d26d7aa1c77572145032837efe 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -4,6 +4,7 @@ Release 2.1
 BUG HUNTERS/SUGGESTIONS
 
 Matthias Kilian
+Delma Avers
 Eric Wurbel
 John Williams
 José Luis Cruz
@@ -14,6 +15,7 @@ Nicolas Sceaux
 Nick Busigin
 Matthias Kilian
 Erik Sandberg
+Kieren Richard MacMillan
 
 Release 2.0
 ***********
index af501340ea012a8d28ece0c19124bd1f90e529f9..c1e688d83b03d8220a354090de23f3e46e092f9d 100644 (file)
@@ -5,9 +5,9 @@
 
 }
 \version "2.1.22"
-    \paper { raggedright= ##t }
+\paper { raggedright= ##t }
 
 \score { \notes \relative c''  {
-    \set Score.forbidBeamBreak = ##f
-   \time 3/16 c16-[ d e \break f-] 
+    \set Score.allowBeamBreak = ##t
+    \time 3/16 c16-[ d e \break f-] 
 }}
index 4d8564075d7fad2ab4e273f29df13d4680961467..4f6f2e84ebb74d8b9afb4c0ac9a85a3adbd1fb88 100644 (file)
@@ -306,13 +306,16 @@ MAKE_SCHEME_CALLBACK (Beam, print, 1);
 SCM
 Beam::print (SCM grob)
 {
-  Grob *me = unsmob_grob (grob);
+  Spanner *me = unsmob_spanner (grob);
   position_beam (me);
   
   Link_array<Grob> stems=
     Pointer_group_interface__extract_grobs (me, (Grob*)0, "stems");
   Grob* xcommon = common_refpoint_of_array (stems, me, X_AXIS);
 
+  xcommon = me->get_bound (LEFT)->common_refpoint (xcommon, X_AXIS);
+  xcommon = me->get_bound (RIGHT)->common_refpoint (xcommon, X_AXIS);
+
   Real x0, dx;
   if (visible_stem_count (me))
     {
@@ -400,7 +403,7 @@ Beam::print (SCM grob)
        how much to stick out for beams across linebreaks
        */
       Real break_overshoot = 3.0;
-      Real w = (i > 0 && st) ? xposn - last_xposn : break_overshoot;
+      Real w = (i > 0 && st) ? (xposn - last_xposn) : break_overshoot;
 
       Real stem_offset =0.0;
       if (i > 0)
@@ -443,8 +446,6 @@ Beam::print (SCM grob)
 
          the_beam.add_stencil (b);           
        }
-
-      
          
       if (lfliebertjes.size() || rfliebertjes.size())
        {
@@ -459,26 +460,41 @@ Beam::print (SCM grob)
              nw_f = gh_scm2double (result);
            }
          else
-           nw_f = break_overshoot;
+           nw_f = break_overshoot / 2;
              
          /* Half beam should be one note-width,
             but let's make sure two half-beams never touch */
-         Real w = (i>0 && st) ? (xposn - last_xposn) : break_overshoot;
-         w = w/2 <? nw_f;
+         Real lw = nw_f;
+         Real rw = nw_f;
+         if (i > 0)
+           rw = nw_f <? ((xposn - last_xposn) / 2);
+         else
+           /*
+             TODO: 0.5 is a guess.
+           */
+           rw = xposn - me->get_bound (LEFT)->extent (xcommon, X_AXIS)[RIGHT]
+             - 0.5;
+         
+         if (st)
+           lw = nw_f <? ((xposn - last_xposn) / 2);
+         else
+           lw = me->get_bound(RIGHT)->relative_coordinate (xcommon, X_AXIS)
+             - last_xposn;
 
-         Stencil half = Lookup::beam (dydx, w, thick, blot);
+         Stencil rhalf = Lookup::beam (dydx, rw, thick, blot);
+         Stencil lhalf = Lookup::beam (dydx, lw, thick, blot);
          for (int j = lfliebertjes.size(); j--;)
            {
-             Stencil b (half);
+             Stencil b (lhalf);
              b.translate_axis (last_xposn -  x0, X_AXIS);
              b.translate_axis (dydx * (last_xposn-x0) + bdy * lfliebertjes[j], Y_AXIS);
              the_beam.add_stencil (b);       
            }
          for (int j = rfliebertjes.size(); j--;)
            {
-             Stencil b (half);
-             b.translate_axis (xposn -  x0 - w , X_AXIS);
-             b.translate_axis (dydx * (xposn-x0 -w) + bdy * rfliebertjes[j], Y_AXIS);
+             Stencil b (rhalf);
+             b.translate_axis (xposn -  x0 - rw , X_AXIS);
+             b.translate_axis (dydx * (xposn-x0 -rw) + bdy * rfliebertjes[j], Y_AXIS);
              the_beam.add_stencil (b);       
            }
        }
index b1b289fdc9c3701348bc1bed9c2a960982007760..4c0b11a08b404805b4bf511e4d0c44ebabae37b2 100644 (file)
           ((val (variable-ref var))
            (tex-key (symbol->string sym))
           )
+        (if (memq sym fields)
+            (header-to-file basename sym val))
 
         (cond
-         ((memq sym fields)
-            (header-to-file basename sym val))
          ((string? val)
           (tex-string-def "lilypond" sym val) )
          ((number? val)
index b7f68d85c92502cd098e973f329d2d53a0c0b897..f84f84298c97c570773106e8a249dd9b8d66b0bb 100644 (file)
@@ -1894,6 +1894,7 @@ def conv (str):
 conversions.append (((2,1,23), conv, """Property setting syntax in \\translator{ }"""))
 def conv (str):
        str = re.sub (r'music-list\?', 'ly:music-list?', str)
+       str = re.sub (r'\|\s*~', '~ |', str)   
        return str
 
 conversions.append (((2,1,24), conv, """music-list? -> ly:music-list?"""))