+ Real staffline_f = paper ()->rule_thickness ();
+ Real interbeam_f = paper ()->interbeam_f (multiple_i_);
+ Real internote_f = paper ()->internote_f ();
+ Real beam_f = paper ()->beam_thickness_f ();
+
+ // enge floots
+ Real epsilon_f = staffline_f / 8;
+
+ /*
+
+ Damped and quantised slopes, esp. in monotone scales such as
+
+ [c d e f g a b c]
+
+ will soon produce the minimal stem-length for one of the extreme
+ stems, which is wrong (and ugly). The minimum stemlength should
+ be kept rather small, in order to handle extreme beaming, such as
+
+ [c c' 'c] %assuming no knee
+
+ correctly.
+ To avoid these short stems for normal cases, we'll correct for
+ the loss in slope, if necessary.
+
+ [TODO]
+ ugh, another hack. who's next?
+ Writing this all down, i realise (at last) that the Right Thing to
+ do is to assign uglyness to slope and stem-lengths and then minimise
+ the total uglyness of a beam.
+ Steep slopes are ugly, shortened stems are ugly, lengthened stems
+ are ugly.
+ How to do this?
+
+ */
+
+ Real dx_f = stems_.top ()->hpos_f () - stems_[0]->hpos_f ();
+ Real damp_correct_f = paper ()->get_var ("beam_slope_damp_correct_factor");
+ Real damped_slope_dy_f = (solved_slope_f_ - slope_f_) * dx_f
+ * sign (slope_f_);
+ damped_slope_dy_f *= damp_correct_f;
+ if (damped_slope_dy_f <= epsilon_f)
+ damped_slope_dy_f = 0;
+
+ DOUT << "Beam::set_stemlens: \n";
+ Real x0 = stems_[0]->hpos_f ();
+ Real dy_f = 0;
+ // urg
+ for (int jj = 0; jj < 10; jj++)
+ {
+ left_y_ += dy_f * dir_;
+ quantise_left_y (dy_f);
+ dy_f = 0;
+ for (int i=0; i < stems_.size (); i++)
+ {
+ Stem *s = stems_[i];
+ if (s->transparent_b_)
+ continue;