From dec9b1c972b595cc9ba344a455485221d918cd43 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:04:31 +0000 Subject: [PATCH] lilypond-1.5.25 --- lily/gourlay-breaking.cc | 17 ++++++++++++----- lily/pitch.cc | 4 ++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 86914fcd0e..4c9ef7c9fa 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -64,7 +64,7 @@ Gourlay_breaking::do_solve () const Real worst_force = 0.0; - for ( int break_idx=1; break_idx< breaks.size (); break_idx++) + for (int break_idx=1; break_idx< breaks.size (); break_idx++) { /* start with a short line, add measures. At some point @@ -187,6 +187,10 @@ Gourlay_breaking::Gourlay_breaking () /* TODO: uniformity parameter to control rel. importance of spacing differences. + + TODO: + + mixing break penalties and constraint-failing solutions is confusing. */ Real Gourlay_breaking::combine_demerits (Column_x_positions const &prev, @@ -197,7 +201,7 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev, if (pc->original_l_) { SCM pen = pc->get_grob_property ("penalty"); - if (gh_number_p (pen)) + if (gh_number_p (pen) && fabs (gh_scm2double (pen)) < 10000) { break_penalties += gh_scm2double (pen); } @@ -212,9 +216,12 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev, /* If it doesn't satisfy constraints, we make this one really unattractive. - */ - demerit += 10; - demerit *= 100; + + add 20000 to the demerits, so that a break penalty + of -10000 won't change the result */ + demerit = (demerit + 20000) >? 2000; + + demerit *= 10; } return demerit; diff --git a/lily/pitch.cc b/lily/pitch.cc index 46013523fd..df4db48a8c 100644 --- a/lily/pitch.cc +++ b/lily/pitch.cc @@ -154,13 +154,13 @@ Pitch::str () const if (alteration_i_) s += String (accname[alteration_i_ + 2]); - if (octave_i_ > 0) + if (octave_i_ >= 0) { int o = octave_i_ + 1; while (o--) s += "'"; } - else if (octave_i_ <0) + else if (octave_i_ < 0) { int o = (-octave_i_) - 1; while (o--) -- 2.39.5