From: Jan Nieuwenhuizen Date: Fri, 16 Jul 1999 11:20:58 +0000 (+0200) Subject: patch::: 1.1.60.jcn2 X-Git-Tag: release/1.1.61~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3b764dbab9c6ba03a1a5c2caa0c3046e96a6f596;p=lilypond.git patch::: 1.1.60.jcn2 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 --- diff --git a/NEWS b/NEWS index f685548b28..9af9e4c235 100644 --- 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 8fb1eb1a4b..bf57a9aacf 100644 --- 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 8dc0dc50e8..d2754bc3fa 100644 --- 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. diff --git a/buildscripts/set-lily.sh b/buildscripts/set-lily.sh index 6446b9624f..65b4f7b4f3 100755 --- a/buildscripts/set-lily.sh +++ b/buildscripts/set-lily.sh @@ -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 . diff --git a/configure.in b/configure.in index 10a18a76b2..1355b73bf5 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/flower/include/direction.hh b/flower/include/direction.hh index 33792a4849..ffd262f6a8 100644 --- a/flower/include/direction.hh +++ b/flower/include/direction.hh @@ -24,7 +24,9 @@ enum Direction SMALLER=-1, BIGGER=1, START = -1, - STOP = 1 + STOP = 1, + X=1, + Y=-1, }; inline Direction diff --git a/input/bugs/spacing.ly b/input/bugs/spacing.ly index 70d831405a..e69de29bb2 100644 --- a/input/bugs/spacing.ly +++ b/input/bugs/spacing.ly @@ -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 index 0000000000..bc9692d281 --- /dev/null +++ b/input/bugs/spanners.ly @@ -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; + } +} diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 77094004d3..fcf83877e2 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -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 diff --git a/lily/bezier.cc b/lily/bezier.cc index 2ebf23c2ea..d72163f24a 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -21,6 +21,16 @@ #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 (); diff --git a/lily/bow.cc b/lily/bow.cc index 588c7f9c74..a72e2fe433 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -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 +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 Bow::get_controls () const diff --git a/lily/include/bezier.hh b/lily/include/bezier.hh index 1d18331a40..1122e2c8cc 100644 --- a/lily/include/bezier.hh +++ b/lily/include/bezier.hh @@ -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 curve_extent_drul_; }; diff --git a/lily/include/bow.hh b/lily/include/bow.hh index dd3426ce10..58f7d5fb2c 100644 --- a/lily/include/bow.hh +++ b/lily/include/bow.hh @@ -34,6 +34,7 @@ protected: Array get_controls () const; virtual Array get_encompass_offset_arr () const; virtual Interval do_height () const; + Drul_array curve_extent_drul () const; Drul_array dy_f_drul_; Drul_array dx_f_drul_; diff --git a/lily/main.cc b/lily/main.cc index abc2f5d169..a5a222b2e5 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -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"; diff --git a/lily/slur.cc b/lily/slur.cc index 474712e8d5..025b17da6b 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -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 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 snapy_f_drul; + snapy_f_drul[LEFT] = snapy_f_drul[RIGHT] = 0; + Drul_array 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 diff --git a/ly/params.ly b/ly/params.ly index d0b193ff2f..3cf95651a8 100644 --- a/ly/params.ly +++ b/ly/params.ly @@ -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; diff --git a/stepmake/bin/package-zet.sh b/stepmake/bin/package-zet.sh index 9c8cf8ecd1..0f997ad74c 100755 --- a/stepmake/bin/package-zet.sh +++ b/stepmake/bin/package-zet.sh @@ -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