lilypond-devel
[Top][All Lists]
Advanced

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

Re: issue #1493: Problem with horizontal beams (issue 337560043 by addre


From: torsten . haemmerle
Subject: Re: issue #1493: Problem with horizontal beams (issue 337560043 by address@hidden)
Date: Sat, 10 Feb 2018 05:37:39 -0800

Reviewers: lemzwerg, Dan Eble,


https://codereview.appspot.com/337560043/diff/1/lily/beam-quanting.cc
File lily/beam-quanting.cc (right):

https://codereview.appspot.com/337560043/diff/1/lily/beam-quanting.cc#newcode717
lily/beam-quanting.cc:717: if ((concaveness >= 10000) || (damping >=
10000))
On 2018/02/10 13:26:34, Dan Eble wrote:
If I interpret this correctly, you're trying to avoid a later division
when the
divisor is large.  That divisor is (concaveness + damping), so perhaps
this
should  be (concaveness + damping) >= threshold.

Hi Dan,

Thanks for the hint.
But while concaveness and damping play the same role in the damping
formula, they are still two separate things and therefore, I have kept
them separate on purpose.

If both concaveness and damping stay below 10000, the beams should not
be forced to be horizontal, even if the *sum* of concaveness and damping
exceeds 10000.

Torsten

Description:
issue #1493: Problem with horizontal beams

file: lily/beam-quanting.cc

In spite of infinite damping, due to numeric precision problems
(rounding/adding) the resulting beams arbitrarily still had a
remaining non-zero slope, sometimes even in the "wrong" direction.

In good TeX manner and in line with concaveness (already implemented),
we'll use a threshold value of 10000 for forcing horizontal beams.

Please review this at https://codereview.appspot.com/337560043/

Affected files (+1, -1 lines):
  M lily/beam-quanting.cc


Index: lily/beam-quanting.cc
diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc
index f3505772f1a70940c4deb9014d400b9158e485a2..a50b3d2cde329facb134e8242409860ad5d2eeaa 100644
--- a/lily/beam-quanting.cc
+++ b/lily/beam-quanting.cc
@@ -714,7 +714,7 @@ Beam_scoring_problem::slope_damping ()
   SCM s = beam_->get_property ("damping");
   Real damping = scm_to_double (s);
   Real concaveness = calc_concaveness ();
-  if (concaveness >= 10000)
+  if ((concaveness >= 10000) || (damping >= 10000))
     {
       unquanted_y_[LEFT] = unquanted_y_[RIGHT];
       musical_dy_ = 0;





reply via email to

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