[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixes slope errors from incorrect X extents in Beam::print. (issue 5

From: k-ohara5a5a
Subject: Re: Fixes slope errors from incorrect X extents in Beam::print. (issue 5293060)
Date: Tue, 01 Nov 2011 04:19:29 +0000

This looks more reasonable.
I read through a few times until I had it figured out.
I left comments where I really needed either code comments or better
variable names.

Do you know the performance cost of turning on peters-prolongation?
File Documentation/changes.tely (right):
Documentation/changes.tely:68: \once \override Beam #'positions =
strict-prolongation is the one that returns y-positions at the ends of
the beam such that beams align-across-breaks
Documentation/changes.tely:70: \once \override Beam #'positions =
Despite the advertising, peters-prolungation does not lengthen beams,
nor anything else for that matter.  It returns y-positions for the ends
of the beam such that beams have similar-slope-across-breaks
File input/regression/ (right):
input/regression/ texidoc="Some classic
examples of broken beams, all taken from
How do we know if the test passes or not ? Suppose some future patch
changes the note-spacing or something.
File input/regression/ (right):
input/regression/ texidoc = "Beam quanting
accounds for beam overhang.
Here you really need to say what constitutes a successful test.  The
ends of the beam above the rests should rest on staff lines (or
otherwise be aligned to staff lines as shown in Ross p ...).
File lily/ (right):
lily/ void
Beam_scoring_problem::init_instance_variables ()
Logically, this is part of the constructor.
If you are splitting it just because the constructor is long, you need
to make some logical sorting of what goes in which part, or else it is
even harder to read than one long constructor.
lily/ consistent_broken_slope_ = false;
Can you make these tests and adjust the value of the boolean at the
point where you first read the property?
lily/ x_span_ = 0.0;
x_span_ is a single scalar, cumulatively summing the length of all the
segments the parent beam was broken-into.
lily/ common[a] = common_refpoint_of_array (stems,
beams[i], Axis (a));
Looks like one of these will be overwritten in the next loop.
lily/ const Interval x_pos = robust_scm2interval
(beams[i]->get_property ("X-positions"), Interval (0.0, 0.0));
positions of the endpoints of this beam segment, including any overhangs
lily/ local_x_span[d] = edge_stems[d] ?
edge_stems[d]->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0;
So local_x_span includes *only* the portion with normal stems,
differently from the other *x_span* variables.
lily/ is_knee_ = dirs_found[LEFT] &&
Why not UP and DOWN?
Are we still in the loop over broken portions?  If so, this will be left
set according to the last portion of a broken beam, not necessarily the
portion we are working on.
lily/ x_span_ += beams[i]->spanner_length ();
Ultimately from Beam::calc_x_positions(), so x_span_ is the total
length, including overhangs, of previous segments that the parent beam
was broken-into.
lily/ Beam_scoring_problem::Beam_scoring_problem
(Grob *me, Drul_array<Real> ys, bool consistent_broken_slope)
If 'ys' are finite, use them as starting points for y-positions of the
ends of the beam, instead of the best-fit through the natural ends of
the stems.

The boolean really means, if 'me' is a segment of a broken beam, then
beam 'me' together with my fellow broken-intos.
Maybe the boolean should be align-broken-segments or something.
lily/ if (do_initial_slope_calculations_)
Even if we made an earlier pass, and avoid the collisions and/or made a
pretty knee, the averaging in peters-prolungation messed up the results
so we would have to do it again.
lily/ and can either be quanted up or down.
Does this have something to do with X-extents, or Beam::print, or broken
File lily/ (right):
lily/ X-positions or left-bound-info and
right-bound-info.  These are
left-bound-info.X and right-bound-info.X
lily/ For those writing a new spanner, DO NOT use both
X-positions and
Why not just use the existing {left|right}-bound-info.X  for broken
beams ?
File scm/output-lib.scm (right):
scm/output-lib.scm:65: ;; calculates each slope of a broken beam
This might make people think beam::individual-slopes returns one or more
slopes, or iterates over segments of a broken beam.
Rather, it computes y-positions of the ends of the beam.  It does not
even look to see if the beam is actually a broken part of a larger beam.
scm/output-lib.scm:69: ;; calculates the slope of a beam as a single
Moreover, this function actively finds if the passed beam section is
part of a broken beam, and returns y-positions that will match the
neighboring segment(s).
scm/output-lib.scm:82: (let* ((quant1 (ly:beam::quanting grob '(+inf.0 .
-inf.0) #t))
quant1 are from beam-together
scm/output-lib.scm:89: (let* ((quant2 (ly:beam::quanting grob '(+inf.0 .
-inf.0) #f))
quant2 are from beam-alone
scm/output-lib.scm:96: (factor (/ (atan (abs slope1)) PI-OVER-TWO))
The trig function does not seem to have a direct geometric meaning, but
is used to build a weighting function going from 0 to 1 linearly as the
beam angle goes from 0 to 90 degrees.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]