From de6a1d211b1dc5ac5bce229cc3659f337b038c5d Mon Sep 17 00:00:00 2001 From: hanwen Date: Wed, 22 Sep 2004 16:12:36 +0000 Subject: [PATCH] * lily/beam-concave.cc (calc_concaveness): take absolute value of dy for scaling. This fixes various downbeams. * lily/beam-quanting.cc (best_quant_score_idx): --- ChangeLog | 8 ++++++++ lily/beam-concave.cc | 2 +- lily/beam-quanting.cc | 11 +++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8efee7fa34..741fc100e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-09-22 Han-Wen Nienhuys + + * lily/beam-concave.cc (calc_concaveness): take absolute value of + dy for scaling. This fixes various downbeams. + + + * lily/beam-quanting.cc (best_quant_score_idx): + 2004-09-22 Jan Nieuwenhuizen * scm/framework-tex.scm (header-to-file): Fix. diff --git a/lily/beam-concave.cc b/lily/beam-concave.cc index 22cfbb945c..07d0e3b335 100644 --- a/lily/beam-concave.cc +++ b/lily/beam-concave.cc @@ -80,7 +80,7 @@ calc_concaveness (Array const &positions, Direction beam_dir) scaling of concaveness doesn't matter much. */ if (dy) - concaveness /= dy; + concaveness /= fabs (dy); return concaveness; } diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index 7dea607660..00375335a8 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -70,7 +70,8 @@ struct Quant_score */ -int best_quant_score_idx (Array const & qscores) +int +best_quant_score_idx (Array const & qscores) { Real best = 1e6; int best_idx = -1; @@ -83,6 +84,13 @@ int best_quant_score_idx (Array const & qscores) } } + if (best_idx < 0) + { + programming_error ("Huh? No best beam quant score?"); + best_idx = 0; + } + + return best_idx; } @@ -275,7 +283,6 @@ Beam::quanting (SCM smob) int best_idx = best_quant_score_idx (qscores); - #if DEBUG_QUANTING SCM inspect_quants = me->get_property ("inspect-quants"); if (to_boolean (me->get_paper ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting"))) -- 2.39.5