-
- Prevent interference from stafflines and beams. See Documentation/tex/fonts.doc
-
- */
-void
-Beam::quantise_left_y (bool extend_b)
-{
- /*
- we only need to quantise the start of the beam as dy is quantised too
- if extend_b then stems must *not* get shorter
- */
- SCM q = get_elt_property ("slope-quantisation");
-
-
- /*
- ----------------------------------------------------------
- ########
- ########
- ########
- --------------########------------------------------------
- ########
-
- hang straddle sit inter hang
- */
-
- Real space = stems_[0]->staff_line_leading_f ();
- Real internote_f = space /2;
- Real staffline_f = paper_l ()->get_var ("stafflinethickness");
- Real beam_f = paper_l ()->get_var ("beam_thickness");;
-
- /*
- [TODO]
- it would be nice to have all allowed positions in a runtime matrix:
- (multiplicity, minimum_beam_dy, maximum_beam_dy)
- */
-
- Real straddle = 0;
- Real sit = beam_f / 2 - staffline_f / 2;
- Real hang = space - beam_f / 2 + staffline_f / 2;
-
- /*
- Put all allowed positions into an array.
- Whether a position is allowed or not depends on
- strictness of quantisation, multiplicity and direction.
-
- For simplicity, we'll assume dir = UP and correct if
- dir = DOWN afterwards.
- */
- // isn't this asymmetric ? --hwn
-
- // dim(left_y_) = internote
- Real dy_f = get_direction () * left_y_ * internote_f;
-
- Real beamdx_f = stems_.top ()->hpos_f () - stems_[0]->hpos_f ();
- Real beamdy_f = beamdx_f * slope_f_ * internote_f;
-
- Array<Real> allowed_position;
- if (q == gh_symbol2scm ("normal"))
- {
- if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2))
- allowed_position.push (straddle);
- if ((multiple_i_ <= 1) || (abs (beamdy_f) >= staffline_f / 2))
- allowed_position.push (sit);
- allowed_position.push (hang);
- }
- else if (q == gh_symbol2scm ("traditional"))
- {
- // TODO: check and fix TRADITIONAL
- if ((multiple_i_ <= 2) || (abs (beamdy_f) >= staffline_f / 2))
- allowed_position.push (straddle);
- if ((multiple_i_ <= 1) && (beamdy_f <= staffline_f / 2))
- allowed_position.push (sit);
- if (beamdy_f >= -staffline_f / 2)
- allowed_position.push (hang);
- }
-
-
- Interval iv = quantise_iv (allowed_position, space, dy_f);
-
- Real quanty_f = dy_f - iv[SMALLER] <= iv[BIGGER] - dy_f ? iv[SMALLER] : iv[BIGGER];
- if (extend_b)
- quanty_f = iv[BIGGER];
-
- // dim(left_y_) = internote
- left_y_ = get_direction () * quanty_f / internote_f;
-}