From: Han-Wen Nienhuys Date: Sun, 18 Jul 2004 19:32:58 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.3.7~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=22155ad6e42b10743d26c31f32be0888476cf1ae;p=lilypond.git *** empty log message *** --- diff --git a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly index aa31630e4e..7d860f33a4 100644 --- a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly +++ b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly @@ -26,10 +26,10 @@ \typewriter { "http://sca.uwaterloo.ca/Mutopia/" } } > \fill-line < #(ly:export (string-append "It has been typeset and placed in the public " - "domain by" maintainer ".")) > + "domain by " maintainer ".")) > \fill-line < #(ly:export (string-append "Unrestricted modification and redistribution" - "is permitted and encouraged---copy this music" - "and share it!")) > + " is permitted and encouraged---copy this music" + " and share it!")) > > } } diff --git a/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ily b/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ily index 8e65b02184..e1b27c6741 100644 --- a/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ily +++ b/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ily @@ -169,7 +169,7 @@ rondo = \relative c' g4 r8 g''8[ e c] - << d2.(\trill + << d2._(\trill { s2 \grace { \override Stem #'stroke-style = #"grace" c16[ d] diff --git a/input/regression/new-slur.ly b/input/regression/new-slur.ly index 085ead29a7..bb9367eb9a 100644 --- a/input/regression/new-slur.ly +++ b/input/regression/new-slur.ly @@ -15,13 +15,9 @@ \override Slur #'print-function = #New_slur::print \override Slur #'height = ##f - \grace { - e=''16( - } - d8.[) c16] + \grace e=''16( d8.[) c16] d8.[ \grace f16( e16)] - s2 - + s2 << {c=''8.([ es16] bes4~bes )} \\ {r8 r r } @@ -45,7 +41,7 @@ c,,^( c'') c,,^( c') | b='2( a4) s4 - b='4.( c8) + | b='4.( c8) s2 | << c=''1_( { s2 \grace { b16[ c] } } >> \break diff --git a/lily/new-slur.cc b/lily/new-slur.cc index 4387115284..01b93d4d33 100644 --- a/lily/new-slur.cc +++ b/lily/new-slur.cc @@ -481,9 +481,8 @@ New_slur::set_end_points (Grob *me) scm_makfrom0str (scores[opt_idx].score_card_.to_str0 ())); #endif - Bezier b - = avoid_staff_line (me,common, extremes, scores[opt_idx].curve_); - + + Bezier b = scores[opt_idx].curve_; SCM controls = SCM_EOL; for (int i = 4; i--;) { @@ -613,6 +612,9 @@ New_slur::generate_curves (Grob *me, Grob **common, for (int i = 0; i < scores->size(); i++) { Bezier bez= get_bezier (me, (*scores)[i].attachment_, r_0, h_inf); + bez = avoid_staff_line (me, common, extremes, bez); + (*scores)[i].attachment_[LEFT] = bez.control_[0]; + (*scores)[i].attachment_[RIGHT] = bez.control_[3]; (*scores)[i].curve_ = bez; } } @@ -647,8 +649,12 @@ New_slur::avoid_staff_line (Grob *me, Grob **common, && (int (fabs (round (p))) % 2 != Staff_symbol_referencer::line_count (staff) % 2)) { + Direction resolution_dir = - get_grob_direction (me); + // (distance ? :sign (p - round(p))) + // TODO: parameter - Real newp = round (p) + get_grob_direction (me) * 5 * thick; + Real newp = round (p) + resolution_dir + * 5 * thick; Real dy = (newp - p) * staff_space / 2.0; bez.translate (Offset (0, dy)); } @@ -796,11 +802,17 @@ New_slur::score_encompass (Grob *me, Grob *common[], } } - if (edge - && ((l_edge && dir == UP) + if (dir * (y - infos[j].stem_) < 0) + { + Real stem_dem =score_param->STEM_ENCOMPASS_PENALTY ; + if ((l_edge && dir == UP) || (r_edge && dir == DOWN)) - && (dir * (y - infos[j].stem_) < 0)) - demerit += score_param->STEM_ENCOMPASS_PENALTY; + { + stem_dem /= 5; + } + + demerit += stem_dem; + } else if (!edge) { Interval ext; @@ -875,6 +887,7 @@ New_slur::score_slopes (Grob *me, Grob *common[], = (extremes[LEFT].stem_ && Stem::get_beam (extremes[LEFT].stem_)) || (extremes[RIGHT].stem_ && Stem::get_beam (extremes[RIGHT].stem_)); + Direction dir = get_grob_direction (me); Real dy = ys[RIGHT] - ys[LEFT]; for (int i = 0; i < scores->size (); i++) { @@ -882,10 +895,21 @@ New_slur::score_slopes (Grob *me, Grob *common[], - (*scores)[i].attachment_[LEFT]; Real slur_dy = slur_dz[Y_AXIS]; Real demerit = 0.0; - if (!has_beams) - /* 0.2: account for staffline offset. */ - demerit += score_param->STEEPER_SLOPE_FACTOR * ((fabs (slur_dy) - (fabs (dy) + 0.2)) >? 0); + demerit += ((fabs (slur_dy/slur_dz[X_AXIS]) + - score_param->MAX_SLOPE) >? 0) + * score_param->MAX_SLOPE_FACTOR; + + /* + 0.2: account for staffline offset. + */ + Real max_dy = (fabs (dy) + 0.2); + if (has_beams) + max_dy += 1.0; + + demerit += score_param->STEEPER_SLOPE_FACTOR * ((fabs (slur_dy) -max_dy) >? 0); + + demerit += ((fabs (slur_dy/slur_dz[X_AXIS]) - score_param->MAX_SLOPE)>?0) * score_param->MAX_SLOPE_FACTOR; if (sign (dy) == 0 &&