]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.1.60.jcn2
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 16 Jul 1999 11:20:58 +0000 (13:20 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 16 Jul 1999 11:20:58 +0000 (13:20 +0200)
pl 60.jcn2
- moved creation of $BUILDDIR/share/locale into set-lily.sh
- slur slope change constraints when snapping
- slur height damping based on bow height
- don't typeset unfinished (auto) beams

17 files changed:
NEWS
TODO
VERSION
buildscripts/set-lily.sh
configure.in
flower/include/direction.hh
input/bugs/spacing.ly
input/bugs/spanners.ly [new file with mode: 0644]
lily/auto-beam-engraver.cc
lily/bezier.cc
lily/bow.cc
lily/include/bezier.hh
lily/include/bow.hh
lily/main.cc
lily/slur.cc
ly/params.ly
stepmake/bin/package-zet.sh

diff --git a/NEWS b/NEWS
index f685548b28f495ec3f56615c0840212607f828dd..9af9e4c2353c358ee4605540fac3323183a9e6fe 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+pl 60.jcn2
+       - moved creation of $BUILDDIR/share/locale into set-lily.sh
+       - slur slope change constraints when snapping
+       - slur height damping based on bow height
+       - don't typeset unfinished (auto) beams
+
 pl 60.jcn1
        - interstaff slur tuning
        - added some regtests
diff --git a/TODO b/TODO
index 8fb1eb1a4bcfaa29b30a705bac7a6a8d7d2a243a..bf57a9aacf62af08e9a624c13c2a87858d750006 100644 (file)
--- a/TODO
+++ b/TODO
@@ -18,6 +18,8 @@ typeface. ie. leading is vertical space  --hwn]
 . * Rewrite \rhythm to be during interpreting.
 . * move \version check to lexer.ll
 . * junk delayed spanner breaking.
+. * core dump on broken (de)crescendo
+. * align left edge of broken (de)cresc/slur/tie/tuplet/volta
 . * check dangling_scm_sym working.
 . * spacing of accidentals
 . * key restorations & repeats
@@ -114,11 +116,6 @@ following example.
 .  * deps for ly2dvi
 . * indent = 0.0 with linewidth=-1.0
 . * collisions & accidentals.
-. * auto-beaming in input/test/spacing.ly:
-Non-finished auto-beams (consider_end_and_begin didn't decide to
-end beam), that get typeset in removal_processing (eg: end of a piece)
-Huh, snap niks van: gewone beam gaat wel goed.  hoe kan abe nu
-invloed hebben op beam-creatie, stopt toch gewoon stokken in?
 . * music ending in grace notes.
 . * PostScript
 .  * half notes in pfa
@@ -147,6 +144,7 @@ invloed hebben op beam-creatie, stopt toch gewoon stokken in?
 . * Duration
 . * clef engraver 
 . * parser
+. * Bezier
 
 .* BUGS
 . * [c8. c16 c16 c16] in 6/8 timesig. 
diff --git a/VERSION b/VERSION
index 8dc0dc50e861d2e7ba952120ef6e2ad7c87d42f7..d2754bc3fa6aef3e0b49862e51d5683caa5d965d 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=60
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=jcn2
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 6446b9624fc4e22f8312193ef4e07a989c92300a..65b4f7b4f3730c548cfc7e392b6dd7db395ae633 100755 (executable)
@@ -61,6 +61,26 @@ testmkdir $prefix/share
 rm -rf $prefix/share/lilypond
 showln -sf $sources/lilypond $prefix/share/lilypond
 
+
+BUILDDIR=`pwd`
+LOCALES="it nl"
+for i in $LOCALES; do
+       dir=$BUILDDIR/share/locale/$i/LC_MESSAGES
+       if test ! -x $dir ; then
+               mkdir -p $dir
+       fi
+       rm -f $dir/lilypond.mo 
+       showln -sf $BUILDDIR/po/out/$i.mo $dir/lilypond.mo
+done
+rm -f afm; showln -sf $BUILDDIR/mf/out afm
+rm -f tfm; showln -sf $BUILDDIR/mf/out tfm
+if test "x$TEX_TFMDIR" = "x" ; then
+       CMR10=`kpsewhich tfm cmr10.tfm`
+       TEX_TFMDIR=`dirname $CMR10`
+fi
+rm -f cmtfm; showln -sf $TEX_TFMDIR $BUILDDIR/cmtfm
+
+
 if [ -f ../.gdbinit ];
 then
     showln -f ../.gdbinit .
index 10a18a76b29da98b39bbb1c729c2866203862c1f..1355b73bf5d01696453a575894919d6d616e6400 100644 (file)
@@ -54,21 +54,5 @@ AC_CHECK_PROGS(MAKEINFO, makeinfo, error)
 AC_CHECK_SEARCH_RESULT($YODL2TEXINFO, yodl,  
     You should install Yodl 1.30.2 or newer)
 
-AC_MSG_CHECKING(links for running from sourcetree)
-LILYPONDPREFIX=$absolute_builddir
-LOCALES="it nl"
-for i in $LOCALES; do
-       dir=$LILYPONDPREFIX/share/locale/$i/LC_MESSAGES
-       if test ! -x $dir ; then
-               mkdir -p $dir
-       fi
-       rm -f $dir/lilypond.mo 
-       ln -sf $LILYPONDPREFIX/po/out/$i.mo $dir/lilypond.mo
-done
-rm -f afm; ln -sf $LILYPONDPREFIX/mf/out afm
-rm -f tfm; ln -sf $LILYPONDPREFIX/mf/out tfm
-rm -f cmtfm; ln -sf $TEX_TFMDIR cmtfm
-AC_MSG_RESULT(ok)
-
 AC_STEPMAKE_END
 
index 33792a4849de6b9a4e5b2bf22cd7e3837bc7a363..ffd262f6a825a53fe03ffb0e8621cdde0dfd0ae6 100644 (file)
@@ -24,7 +24,9 @@ enum Direction
   SMALLER=-1,
   BIGGER=1,
   START = -1,
-  STOP = 1
+  STOP = 1,
+  X=1,
+  Y=-1,
 };
 
 inline Direction
index 70d831405a6cf9a610d962d8f26b9e90a6486a3b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,7 +0,0 @@
-
-%JAN: Dit is een autobiem bug.
-\score {
-    \notes \transpose c'' \context Voice { c8 c16 c32 c64 }
-   }
-
-
diff --git a/input/bugs/spanners.ly b/input/bugs/spanners.ly
new file mode 100644 (file)
index 0000000..bc9692d
--- /dev/null
@@ -0,0 +1,11 @@
+% spanners start at line start
+\score{
+       \notes\relative c''{
+               % broken cresc dumps core
+               c2\< c4 \times 2/3 { c( c c }
+               c4 c )\!c c
+       }
+       \paper{
+               linewidth=30.\mm;
+       }
+}
index 77094004d368cc2bb6b450dd0eb620b541afb910..fcf83877e21dc8a331ed52a2c64636c64f60bb7f 100644 (file)
@@ -259,9 +259,11 @@ Auto_beam_engraver::do_pre_move_processing ()
 void
 Auto_beam_engraver::do_removal_processing ()
 {
-  if (stem_l_arr_p_)
-    end_beam ();
+  /* finished beams may be typeset */
   typeset_beam ();
+  /* but unfinished may need another announce/acknoledge pass */
+  if (stem_l_arr_p_)
+    junk_beam ();
 }
 
 bool
index 2ebf23c2ea1882fbe012b8d7e2a0bbbd5eaafe9c..d72163f24a320ff6aa159822bb68a543cc02bce8 100644 (file)
 #define BEZIER_BOW_DOUT cerr
 #endif
 
+
+/*
+  [TODO]
+
+  * better names, esp. for all calc_foo functions
+  * blow_fit vs calc_default (Real) and calc_f (Real)
+  * exact height / tangent calculation
+
+ */
+
 void
 Curve::flipy ()
 {
@@ -245,6 +255,18 @@ Bezier_bow::calc ()
 
   calc_controls ();
 
+  /*
+    duh, this is crude (control-points)
+    perhaps it's even better to check the amount of blow_fit ()
+   */
+  for (int i=0; i < control_.size (); i++)
+    {
+      Real y = control_[i][Y_AXIS];
+      curve_extent_drul_[Y].unite (Interval (y, y));
+      Real x = control_[i][X_AXIS];
+      curve_extent_drul_[X].unite (Interval (x, x));
+    }
+
   print ();
   transform_back ();
 #ifndef NPRINT
@@ -360,6 +382,10 @@ Bezier_bow::calc_controls ()
       if (i && !calc_clipping ())
        return;
 
+      /*
+       why do we always recalc from 0?
+       shouldn't calc_f () be used (too), rather than blow_fit () (only)?
+       */
       calc_default (0);
       calc_bezier ();
       
index 588c7f9c74f85261aef863b0dc8a41aafd0896c6..a72e2fe4337ef56dc0108e3427799e46c43744e6 100644 (file)
@@ -58,8 +58,6 @@ Bow::center () const
   return Offset (dx / 2, dy);
 }
 
-
-
 /*
    Ugh.  Control points are too crude measures.
  */
@@ -76,6 +74,14 @@ Bow::do_height () const
   return iv;
 }
 
+Drul_array<Interval>
+Bow::curve_extent_drul () const
+{
+  Bezier_bow b (paper_l ());
+  b.set (get_encompass_offset_arr (), dir_);
+  b.calc ();
+  return b.curve_extent_drul_;
+}
 
 Array<Offset>
 Bow::get_controls () const
index 1d18331a40a734cb0341c52d8859d2bbc1efe640..1122e2c8cc293a07bf09637f587af843fd488c53 100644 (file)
@@ -13,6 +13,8 @@
 
 #include "real.hh"
 #include "curve.hh"
+#include "drul-array.hh"
+#include "interval.hh"
 
 /**
   Simple bezier curve
@@ -72,6 +74,7 @@ public:
   Real alpha_;
   Offset origin_;
   Curve return_;
+  Drul_array<Interval> curve_extent_drul_;
 };
 
 
index dd3426ce10665930d582f810c2f468abfede4ec7..58f7d5fb2cd552888afd5a0d7e3d277c167248dc 100644 (file)
@@ -34,6 +34,7 @@ protected:
   Array<Offset> get_controls () const;
   virtual Array<Offset> get_encompass_offset_arr () const;
   virtual Interval do_height () const;
+  Drul_array<Interval> curve_extent_drul () const;
 
   Drul_array<Real> dy_f_drul_;
   Drul_array<Real> dx_f_drul_;
index abc2f5d169a7abd77e7056e378f891d2dd9c1bff..a5a222b2e50e563116abccd4708d3ae77d25be6b 100644 (file)
@@ -221,6 +221,11 @@ setup_paths ()
   String lily_locale_dir;
   String name (PACKAGE);
   name.to_lower ();
+
+  /*
+    urg; what *do* we want with $LILYPONDPREFIX, DIR_DATADIR and $prefix/share
+    handy for multiple source-dir runs, though...
+   */
   if (!prefix_directory.empty_b())
     {
       lily_locale_dir = prefix_directory + "/share/locale";
index 474712e8d59f677b8afd51d30914480ec78e1ee1..025b17da6b5ee7c4cebaf1e15050263f75cc177d 100644 (file)
@@ -186,7 +186,12 @@ Slur::do_post_processing ()
       */
       else
        {
-         dx_f_drul_[d] -= d * x_gap_f;
+         /*
+           need break-align too.  what about other spanners?
+          */
+         if (d == LEFT)
+           dx_f_drul_[d] = spanned_drul_[LEFT]->extent (X_AXIS).length ();
+               
          /*
            broken: should get y from other piece, so that slur
            continues up/down trend
@@ -241,18 +246,21 @@ Slur::do_post_processing ()
   Real height_damp_f;
   Real slope_damp_f;
   Real snap_f;
+  Real snap_max_dy_f;
 
   if (!interstaff_b)
     {
       height_damp_f = paper_l ()->get_var ("slur_height_damping");
       slope_damp_f = paper_l ()->get_var ("slur_slope_damping");
       snap_f = paper_l ()->get_var ("slur_snap_to_stem");
+      snap_max_dy_f = paper_l ()->get_var ("slur_snap_max_slope_change");
     }
   else
     {
       height_damp_f = paper_l ()->get_var ("slur_interstaff_height_damping");
       slope_damp_f = paper_l ()->get_var ("slur_interstaff_slope_damping");
       snap_f = paper_l ()->get_var ("slur_interstaff_snap_to_stem");
+      snap_max_dy_f = paper_l ()->get_var ("slur_interstaff_snap_max_slope_change");
     }
 
   Real ratio_f;
@@ -287,17 +295,20 @@ Slur::do_post_processing ()
    */
   for (int i = 0; i < 3; i++)
     {
-      Real height_f = do_height ().length ();
+      Drul_array<Interval> curve_xy_drul = curve_extent_drul ();
+      Real height_f = curve_xy_drul[Y].length ();
+      Real width_f = curve_xy_drul[X].length ();
+      
       dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT];
 
-      ratio_f = abs (height_f / dx_f);
+      ratio_f = abs (height_f / width_f);
       if (ratio_f > height_damp_f)
        {
          Direction d = (Direction)(- dir_ * (sign (dy_f)));
          if (!d)
            d = LEFT;
          /* take third step */
-         Real damp_f = (ratio_f - height_damp_f) * dx_f / 3;
+         Real damp_f = (ratio_f - height_damp_f) * width_f / 3;
          /*
            if y positions at about the same height, correct both ends
          */
@@ -320,6 +331,10 @@ Slur::do_post_processing ()
   /*
     If, after correcting, we're close to stem-end...
   */
+  Drul_array<Real> snapy_f_drul;
+  snapy_f_drul[LEFT] = snapy_f_drul[RIGHT] = 0;
+  Drul_array<Real> snapx_f_drul;
+  snapx_f_drul[LEFT] = snapx_f_drul[RIGHT] = 0;
   do
     {
       if ((note_column_drul[d] == spanned_drul_[d])
@@ -330,17 +345,53 @@ Slur::do_post_processing ()
              <= snap_f))
        {
          /*
-           attach to stem-end
+           prepare to attach to stem-end
          */
          Stem* stem_l = note_column_drul[d]->stem_l_;
-         dx_f_drul_[d] = stem_l->hpos_f ()
+         snapx_f_drul[d] = stem_l->hpos_f ()
            - spanned_drul_[d]->absolute_coordinate (X_AXIS);
-         dy_f_drul_[d] = stem_l->extent (Y_AXIS)[dir_];
-         dy_f_drul_[d] += info_drul[d].interstaff_f_;
-         dy_f_drul_[d] += dir_ * 2 * y_gap_f;
+         snapy_f_drul[d] = stem_l->extent (Y_AXIS)[dir_];
+         snapy_f_drul[d] += info_drul[d].interstaff_f_;
+         snapy_f_drul[d] += dir_ * 2 * y_gap_f;
        }
     }
   while (flip (&d) != LEFT);
+
+  /*
+    only use snapped positions if sign (dy) will not change
+    and dy doesn't change too much
+    */
+  if (snapy_f_drul[LEFT] && snapy_f_drul[RIGHT]
+      && ((sign (snapy_f_drul[RIGHT] - snapy_f_drul[LEFT]) == sign (dy_f)))
+      && (!dy_f || (abs (snapy_f_drul[RIGHT] - snapy_f_drul[LEFT] - dy_f) 
+                   < abs (dy_f * snap_max_dy_f))))
+    {
+      do
+       {
+         dy_f_drul_[d] = snapy_f_drul[d];
+         dx_f_drul_[d] = snapx_f_drul[d];
+       }
+      while (flip (&d) != LEFT);
+  
+    }
+  else if (snapy_f_drul[LEFT]
+      && ((sign (dy_f_drul_[RIGHT] - snapy_f_drul[LEFT]) == sign (dy_f)))
+      && (!dy_f || (abs (dy_f_drul_[RIGHT] - snapy_f_drul[LEFT] - dy_f) 
+                   < abs (dy_f * snap_max_dy_f))))
+    {
+      Direction d = LEFT;
+      dy_f_drul_[d] = snapy_f_drul[d];
+      dx_f_drul_[d] = snapx_f_drul[d];
+    }
+  else if (snapy_f_drul[RIGHT]
+      && ((sign (snapy_f_drul[RIGHT] - dy_f_drul_[LEFT]) == sign (dy_f)))
+      && (!dy_f || (abs (snapy_f_drul[RIGHT] - dy_f_drul_[LEFT] - dy_f) 
+                   < abs (dy_f * snap_max_dy_f))))
+    {
+      Direction d = RIGHT;
+      dy_f_drul_[d] = snapy_f_drul[d];
+      dx_f_drul_[d] = snapx_f_drul[d];
+    }
 }
 
 Array<Offset>
index d0b193ff2f8fe7933dae7a95181590f135ffecb9..3cf95651a8dbef1977e1a90a65222a93036e7e8f 100644 (file)
@@ -92,14 +92,18 @@ slur_y_free = 0.75 * \interline;
 slur_x_minimum = 3.0 * \interline;
 
 % slope damping: keep dy/dx < slur_slope_damping
-slur_slope_damping = 0.35;
-slur_interstaff_slope_damping = 0.5;
+slur_slope_damping = 0.3;
+slur_interstaff_slope_damping = 0.6;
 % height damping: keep h/dx < slur_height_damping
-slur_height_damping = 0.45;
-slur_interstaff_height_damping = 0.7;
+slur_height_damping = 0.5;
+slur_interstaff_height_damping = 0.5;
 % snap to stem if slur ends closer to stem than
-slur_snap_to_stem = 1.5 * \interline;
+slur_snap_to_stem = 1.75 * \interline;
 slur_interstaff_snap_to_stem = 2.5 * \interline;
+% maximum dy change allowed by snapping
+slur_snap_max_slope_change = 0.5;
+slur_interstaff_snap_max_slope_change = 0.5;
+
 
 
 tie_x_minimum = \slur_x_minimum;
index 9c8cf8ecd1ac3fb5f6eb8ecb96af60fef8a0c057..0f997ad74c157197aeb26dde0c8577755b1c3881 100755 (executable)
@@ -23,14 +23,14 @@ fi
 #
 # and create links to here, if necessary
 #
-if [ ! -r $sources ]; then
-       (cd ..; ln -s `pwd` $sources)
-fi
-#
 sourcetree=`basename \`pwd\``
 (cd ..; rm -f $package 2>&1 > /dev/null)
 (cd ..; ln -s $sourcetree $package)
 #
+if [ ! -r $sources ]; then
+       (cd ..; ln -s `pwd` $sources)
+fi
+#
 mkdir -p $prefix/bin
 result=`echo $PATH | grep "$HOME/usr/bin"`
 if [ "x$result" = "x" ];then