quant penalty dependent on how much the line is in the gap.
* input/regression/grace-stem-length.ly: new file.
* lily/beam-quanting.cc (score_forbidden_quants): remove
interquant check. The penalty of 1000 is much too harsh, and the
inter case should be caught by check-staff-line-in-gap check.
* lily/new-slur.cc: cleanup, split in functions.
* lily/new-slur.cc (score_encompass): variable head-distance penalty.
* lily/new-slur.cc (print): use debug-slur-quanting paper var.
2004-07-18 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/beam-quanting.cc (score_forbidden_quants): make forbidden
+ quant penalty dependent on how much the line is in the gap.
+
+ * input/regression/grace-stem-length.ly: new file.
+
* lily/beam-quanting.cc (score_forbidden_quants): remove
interquant check. The penalty of 1000 is much too harsh, and the
inter case should be caught by check-staff-line-in-gap check.
--- /dev/null
+\header {
+
+ texidoc = "Stem lengths for grace notes should be shorter than
+normal notes, if possible. They should never be longer, even if that
+would lead to beam quanting program. "
+
+ }
+\version "2.3.6"
+
+\paper {
+ raggedright = ##t
+
+% "debug-beam-quanting" = ##t
+}
+\relative c'' {
+ << { d8.\noBeam d16 } \\ >> \grace { d16 } c8.[ b16]
+ << { c16[ b] } \\ >>
+
+ \grace { c16[ b] } d4
+% \override Beam #'inspect-quants =#'(2.8 . 2.5)
+% \grace { c16[ b] } d4
+
+ }
+
Direction d = LEFT;
Real dem = 0.0;
+
do
{
for (int j = 1; j <= beam_counts[d]; j++)
borderline cases. If we do 2.0, then the upper outer line
will be in the gap of the (2,sit) quant, leading to a
false demerit.
- */
- Real gap1 = y[d] - stem_dir * ((j-1) * beam_translation + thickness / 2 - slt/2.2 );
+ */
+ Real gap1 = y[d] - stem_dir * ((j-1) * beam_translation + thickness / 2 - slt/2.2 );
Real gap2 = y[d] - stem_dir * (j * beam_translation - thickness / 2 + slt/2.2);
Interval gap;
for (Real k = - radius ;
k <= radius + BEAM_EPS; k += 1.0)
if (gap.contains (k))
- dem += extra_demerit;
+ {
+ Real dist = fabs (gap[UP]-k) <? fabs (gap[DOWN] - k);
+
+ /*
+ this parameter is tuned to grace-stem-length.ly
+ */
+ Real fixed_demerit = 0.4;
+
+ dem += extra_demerit
+ * (fixed_demerit +
+ (1-fixed_demerit) * (dist / gap.length())* 2);
+ }
}
}
while ((flip (&d))!= LEFT);
/*
For broken beams this doesn't work well. In this case, the
- slope esp. of the first part of a broken beam should predict
- where the second part goes.
- */
+ slope esp. of the first part of a broken beam should predict
+ where the second part goes.
+ */
me->set_property ("least-squares-dy",
- scm_make_real (pos[RIGHT] - pos[LEFT]));
+ scm_make_real (pos[RIGHT] - pos[LEFT]));
}
else
{
if (!has_beams)
/*
0.2: account for staffline offset.
- */
+ */
demerit += score_param->STEEPER_SLOPE_FACTOR * (dir * (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;