lilypond-devel
[Top][All Lists]
Advanced

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

Re: fix Issue 2462. (issue 108280044 by address@hidden)


From: janek . lilypond
Subject: Re: fix Issue 2462. (issue 108280044 by address@hidden)
Date: Thu, 03 Jul 2014 06:56:20 +0000

Reviewers: Keith, franio.kropka.b,

Message:
Updated description.

On 2014/07/03 04:42:48, Keith wrote:
This does make sense, but if you change the basic rules of a Spring
(allowing
the natural length to be less than the minimum-distance constraint, so
it stays
at the minimum length until the line is considerably stretched) you
should try
to make the change consistently everywhere ?

Yes, that's what i'm aiming for.  However, as you remember, some of
these
changes produce unwanted side-effects - for example, we would have to
find
another way of implementing that 0.3.  Removing this single line fixes
some
of the problems (without any bad side effects, as far as i know), so i
thought
that we could start with this, and then work on making the rest of the
code
work correctly.

I'm working on this with my cousin Franek, and he has a patch that aims
to be
a bigger cleanup of the springs - unfortunately, there is some bug in it
(extra
space is inserted after time signature, for example in
beam-rest-extreme.ly).
Maybe you could help us with debuggin that?  The patch is in
frax/springs branch
of my github fork:

https://github.com/janek-warchol/lilypond/tree/frax/springs




https://codereview.appspot.com/108280044/diff/1/lily/spring.cc
File lily/spring.cc (right):

https://codereview.appspot.com/108280044/diff/1/lily/spring.cc#newcode87
lily/spring.cc:87: distance_ = max (min_distance_, distance_ * r);
On 2014/07/03 04:42:48, Keith wrote:
maybe  *= r;

yeah, probably.

https://codereview.appspot.com/108280044/diff/1/lily/spring.cc#newcode120
lily/spring.cc:120: avg_distance = max (min_distance + 0.3,
avg_distance);
On 2014/07/03 04:42:48, Keith wrote:
Logically, this would be removed as well, except that it also adds
0.3.  When
you tried removing this line, you said there were unwanted
side-effects. What
cases needed the extra 0.3 of space?

0.3 is needed to "slow down" approaching min_distance_, for example in
beam-rest-extreme.ly - because of the accidentals and suspended notes,
the min_distance_ is bigger than distance_, which means that even for
"natural" (ragged-right) spacing the springs would be set to the min
distance (making the accidentals touch previous notes).  We want to add
some space, so that the accidentals will touch previous notes only when
there is a significant compressing force.

Of course, the way in which this is done is really not very good.

It would be much better to include it in
padding parameters, than to have this deeply-hidden offset.

Absolutely, that's what we're planning to do.

Description:
When objects like lyrics are added to the PaperColumns, LilyPond inserts
rods between these columns to ensure that the objects won't overlap.
However, the ideal distance should remain unchanged.  For example, in

\layout {
  ragged-right = ##f
}
\relative f' { \repeat unfold 8 a4 }
\addlyrics { \repeat unfold 4 la \repeat unfold 4 straight }

notes in 2nd measure have long lyrics attached to them - min_distance_
of the springs between these columns should be adjusted, but distance_
(the ideal distance) should not: it should be the same as for notes
with short lyrics.  When the line is stretched so much that the minimum
distances are not involved, the springs between notes in both measures
should behave (almost) identical.


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

Affected files (+0, -1 lines):
  M lily/spring.cc


Index: lily/spring.cc
diff --git a/lily/spring.cc b/lily/spring.cc
index f4123b9891527abc9c8633c7abe3f48a1c77fd6f..3963ee44529a5c9cc1565372825bb52ad63d41c6 100644
--- a/lily/spring.cc
+++ b/lily/spring.cc
@@ -182,21 +182,20 @@ void
 Spring::set_blocking_force (Real f)
 {
   if (isinf (f) || isnan (f))
     {
       programming_error ("insane blocking force");
       return;
     }

   blocking_force_ = -infinity_f;
   min_distance_ = length (f);
-  distance_ = max (distance_, min_distance_);
   update_blocking_force ();
 }

 void
 Spring::set_default_strength ()
 {
   set_default_stretch_strength ();
   set_default_compress_strength ();
 }






reply via email to

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