+2004-09-15 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/slur-scoring.cc (score_edges): add exp(slope*dir*leftright)
+ factor in edge attraction. This reflects that the left edge may
+ have a larger gap for an ascending up-slur.
+
2004-09-14 Jan Nieuwenhuizen <janneke@gnu.org>
* buildscripts/guile-gnome.sh: Update with tarball [pre]releases.
2004-09-13 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/slur-scoring.cc (score_edges): don't be so picky for
+
* ly/property-init.ly (hideStaffSwitch): remove turnOff.
* scripts/convert-ly.py (conv): change Both to Neutral in property
Real free_slur_distance_;
Real free_head_distance_;
Real extra_encompass_free_distance_;
-
+ Real edge_slope_exponent_;
Real head_slur_distance_max_ratio_;
Real head_slur_distance_factor_;
Interval slur_head_extent_;
Real neighbor_y_;
Real staff_space_;
-
+
Bound_info ()
{
stem_ = 0;
= get_detail (details, ly_symbol2scm ("head-slur-distance-max-ratio"));
score_param->free_slur_distance_
= get_detail (details, ly_symbol2scm ("free-slur-distance"));
+ score_param->edge_slope_exponent_
+ = get_detail (details, ly_symbol2scm ("edge-slope-exponent"));
}
configuration.attachment_[RIGHT][Y_AXIS],
configuration.attachment_[LEFT][Y_AXIS]);
- if (dir * (infos[j].get_point (dir) - line_y) > 0)
+ if ( 1 ) // dir * infos[j].get_point (dir) > dir *line_y )
{
- Real d = fabs (infos[j].get_point (dir) - y);
+
+ Real closest =
+ dir * (dir * infos[j].get_point (dir)
+ >? dir *line_y
+ );
+ Real d = fabs(closest - y);
+
convex_head_distances.push (d);
- }
+ }
}
-
int n = convex_head_distances.size();
if (convex_head_distances.size() <= 2)
{
+ // Real min_edge_dist = 1e6;
for (int j = 0; j < edge_distances.size(); j++)
{
avg_distance += edge_distances[j];
n++;
}
+
}
/*
}
}
+/*
+ TODO: should make edge penalties dependent on the direction that the
+ slur-end is pointing.
+ */
void
score_edges (Grob *me, Grob *common[],
Slur_score_parameters * score_param,
for (int i = 0; i < scores->size (); i++)
{
Direction d = LEFT;
+ Slur_score &config = scores->elem_ref (i);
+ Offset dz = config.attachment_[RIGHT] - config.attachment_[LEFT];
+ Real slope = dz[Y_AXIS] / dz[X_AXIS];
do
{
- Real y = scores->elem (i).attachment_[d][Y_AXIS];
+ Real y = config.attachment_[d][Y_AXIS];
Real dy = fabs (y - base_attach[d][Y_AXIS]);
Real factor = score_param->edge_attraction_factor_;
&& !Stem::get_beaming (extremes[d].stem_, -d)
)
demerit /= 5;
-
+
+ demerit *= exp (dir * d * slope
+ * score_param->edge_slope_exponent_ );
+
(*scores)[i].score_ += demerit;
#if DEBUG_SLUR_QUANTING
(*scores)[i].score_card_ += to_string ("E%.2f", demerit);