]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/spacing-spanner.cc: bound shortest_playing_len by
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 13 Feb 2004 20:08:15 +0000 (20:08 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 13 Feb 2004 20:08:15 +0000 (20:08 +0000)
measure_length

* lily/spacing-engraver.cc (acknowledge_grob): ignore
multi-measure events for spacing computation.

* input/GNUmakefile (SUBDIRS): remove ascii-art

ChangeLog
input/regression/multi-measure-rest-spacing.ly [new file with mode: 0644]
lily/multi-measure-rest-engraver.cc
lily/spacing-engraver.cc
lily/spacing-spanner.cc

index 5bdb4069bfd95d2b9e87399214efe35a9923b24d..d872f1cd0908179cc63c7bbffe8cd79e11185fd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2004-02-13  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/spacing-spanner.cc: bound shortest_playing_len by
+       measure_length
+
+       * lily/spacing-engraver.cc (acknowledge_grob): ignore
+       multi-measure events for spacing computation.
+
        * mf/feta-bolletjes.mf (overdone_heads): make note heads more
        elliptical, to 1.49.
 
diff --git a/input/regression/multi-measure-rest-spacing.ly b/input/regression/multi-measure-rest-spacing.ly
new file mode 100644 (file)
index 0000000..6ccb8b9
--- /dev/null
@@ -0,0 +1,18 @@
+\header {
+
+    texidoc = "By setting texts starting with a mmrest we create
+an extra spacing column. This should not cause problems."
+    }
+\version "2.1.22"
+
+\score {
+    <<
+       \set Score.skipBars = ##t
+       \context Staff = flute \notes \new Voice { 
+           <<  { R1*40 }  { s1*0^"bla" }>> 
+       }
+    >>
+    \paper {
+       raggedright = ##t
+    }
+ }
index 33a02b3f90b81e8e3a8f8d5b8e4ddef90ddeea6f..9caf9f100b238822ec557c04d20b876eafdf1074 100644 (file)
@@ -169,7 +169,6 @@ Multi_measure_rest_engraver::stop_translation_timestep ()
        }      
     }
   
-  
   SCM smp = get_property ("measurePosition");
   Moment mp = (unsmob_moment (smp)) ? *unsmob_moment (smp) : Moment (0);
 
index 109a3063212d1ea991e436a507507a6d01b0bc5d..e2dbd037a64e07b3dafb6cdcfc6a4dd0e08087c7 100644 (file)
@@ -105,7 +105,8 @@ Spacing_engraver::acknowledge_grob (Grob_info i)
       Pointer_group_interface::add_grob (spacing_, ly_symbol2scm  ("wishes"), i.grob_);
     }
   
-  if (i.grob_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+  if (i.grob_->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface"))
+      || i.grob_->internal_has_interface (ly_symbol2scm ("multi-measure-event")))
     return;
 
   /*
index 666253aeebcf0c07a5ebedcea3fab22f175de926..1f18c4939a7033373dc971b72d504baf6d27127b 100644 (file)
@@ -505,7 +505,7 @@ Spacing_spanner::find_shortest (Grob *me, Link_array<Grob> const &cols)
   (different time sigs) than others, and should be spaced differently.
  */
 void
-Spacing_spanner::do_measure (Rational shortest, Grob*me, Link_array<Grob> *cols) 
+Spacing_spanner::do_measure (Rational global_shortest, Grob*me, Link_array<Grob> *cols) 
 {
 
   Real headwid = robust_scm2double (me->get_grob_property ("spacing-increment"), 1);
@@ -519,7 +519,7 @@ Spacing_spanner::do_measure (Rational shortest, Grob*me, Link_array<Grob> *cols)
 
       if (!Paper_column::is_musical (l))
        {
-         breakable_column_spacing (me, l, r, shortest);
+         breakable_column_spacing (me, l, r, global_shortest);
 
          /*
            
@@ -532,20 +532,20 @@ Spacing_spanner::do_measure (Rational shortest, Grob*me, Link_array<Grob> *cols)
          Item *rb = r->find_prebroken_piece (LEFT);
          
          if (lb)
-           breakable_column_spacing (me, lb,r, shortest);
+           breakable_column_spacing (me, lb,r, global_shortest);
 
          if (rb)
-           breakable_column_spacing (me, l, rb, shortest);
+           breakable_column_spacing (me, l, rb, global_shortest);
          if (lb && rb)
-           breakable_column_spacing (me, lb, rb, shortest);
+           breakable_column_spacing (me, lb, rb, global_shortest);
          
          continue ; 
        }
 
 
-      musical_column_spacing (me, lc, rc, headwid, shortest);
+      musical_column_spacing (me, lc, rc, headwid, global_shortest);
       if (Item *rb = r->find_prebroken_piece (LEFT))
-       musical_column_spacing (me, lc, rb, headwid, shortest);
+       musical_column_spacing (me, lc, rb, headwid, global_shortest);
     }    
 }
 
@@ -555,10 +555,10 @@ Spacing_spanner::do_measure (Rational shortest, Grob*me, Link_array<Grob> *cols)
   spacing parameters INCR and SHORTEST.
  */
 void
-Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real increment, Rational shortest)
+Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real increment, Rational global_shortest)
 {
   bool expand_only = false;
-  Real base_note_space = note_spacing (me, lc, rc, shortest, &expand_only);
+  Real base_note_space = note_spacing (me, lc, rc, global_shortest, &expand_only);
 
   Real compound_note_space = 0.0;
   Real compound_fixed_note_space = 0.0;
@@ -873,38 +873,25 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc,
   Moment rwhen =  Paper_column::when_mom (rc);
 
   Moment delta_t = rwhen - lwhen;
-  if (!Paper_column::is_musical (rc ))
+  if (!Paper_column::is_musical (rc))
     {
       /*
        when toying with mmrests, it is possible to have musical
        column on the left and non-musical on the right, spanning
        several measures.
-
-       In 2.0.1, this still fucks up in an interesting way:
-
-       
-\score {
-{      \property Score.skipBars = ##t
-       \context Staff = clarinet
-           { 
-               \notes {
-               \time 3/4 \mark "72"
-<< s1*0^"all"          R4*3*11 >>
-               \mark "73"
-               R4*3*11 \mark "74"
-       d2 r4
-
-
-               }}}
-    \paper { raggedright = ##t }
-}
-
-       
        */
       
       Moment *dt = unsmob_moment (rc->get_grob_property ("measure-length"));
       if (dt)
-       delta_t = delta_t <? *dt; 
+       {
+         delta_t = delta_t <? *dt;
+
+         /*
+           The following is an extra safety measure, such that
+           the length of a mmrest event doesn't cause havoc.
+          */
+         shortest_playing_len = shortest_playing_len <? *dt;
+       }
     }
   Real dist = 0.0;