Re: Progress on loose columns. (issue4841052)

2011-08-10 Thread mtsolo

I think I've hit loose column nirvana with this most recent patch set.
The only thing that I know I need to work on is the magic left_padding
number of 0.15 in spacing-loose-columns.cc .  I know this should be made
a property but I don't know where (I can implement it like it was
implemented in previous incarnations of this patch and tack it onto the
SpacingSpanner if people think that's a good idea).  Also, the name is
crappy: it is not padding per se in that it is not always added.
Rather, it is a distance tacked onto the horizontal length between two
between-columns after which loose columns start relaxing from their
tight spacing to their ideal spacing.  Perhaps this is in fact the
definition of padding, but I'm not sure.  Anyway, I'd appreciate
suggestions of (a) what to call this; and (b) what grob to stick it to
as a property.

Cheers,
MS

http://codereview.appspot.com/4841052/

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Progress on loose columns. (issue4841052)

2011-08-09 Thread mtsolo

Hey all,

I'm pretty sure this is the best way to get around the loose column
issue for now.

The problem (I think) is that some invisible BarLine grobs act as
alignment markers and thus can be slid well left of the two grobs they
were originally supposed to fall between.  A distinction needs to be
made between loose columns that are actually seen on the page and loose
columns that are used as spacing aids.  The current code assumes that
bar-lines are the only loose columns that can fall into this spacing-aid
category and simply omits them from the new algorithm.  It may be better
down the road to change the way volta brackets are attached to bounds
(there is a note in the volta-engraver to do this).

Cheers,
MS

http://codereview.appspot.com/4841052/

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Progress on loose columns. (issue4841052)

2011-08-09 Thread bordage . bertrand

What if we want a larger padding?
In your regtest, the clef collides with the third notehead when we set
the padding with:
\override Score.SpacingSpanner #'left-loose-column-padding = #2

There's also two trailing whitespaces.

Regards,
Bertrand


http://codereview.appspot.com/4841052/diff/6001/input/regression/loose-column-spacing.ly
File input/regression/loose-column-spacing.ly (right):

http://codereview.appspot.com/4841052/diff/6001/input/regression/loose-column-spacing.ly#newcode13
input/regression/loose-column-spacing.ly:13: \clef treble g'' fis,
trailing whitespace.

http://codereview.appspot.com/4841052/diff/6001/lily/spacing-loose-columns.cc
File lily/spacing-loose-columns.cc (right):

http://codereview.appspot.com/4841052/diff/6001/lily/spacing-loose-columns.cc#newcode140
lily/spacing-loose-columns.cc:140:
trailing whitespace.

http://codereview.appspot.com/4841052/

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Progress on loose columns. (issue4841052)

2011-08-09 Thread m...@apollinemike.com
On Aug 9, 2011, at 4:30 PM, bordage.bertr...@gmail.com wrote:

 What if we want a larger padding?
 In your regtest, the clef collides with the third notehead when we set
 the padding with:
 \override Score.SpacingSpanner #'left-loose-column-padding = #2
 

Hm...good question!  I've uploaded a new patch set that addresses this.
That said, if you want more padding, use \override Score.NonMusicalPaperColumn 
#'allow-loose-spacing = ##f.  It is a more elegant way to get a column into the 
spacing engine.


 There's also two trailing whitespaces.
 

Thanks for spotting these!  I'll scrub them.

Cheers,
MS
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Progress on loose columns. (issue4841052)

2011-08-09 Thread bordage . bertrand

LGTM (still one trailing whitespace in the regtest).

Bertrand

http://codereview.appspot.com/4841052/

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Progress on loose columns. (issue4841052)

2011-08-09 Thread n . puttock

Hi Mike,

The latest patch set breaks spacing-empty-bar.ly (we want
left-loose-column-padding to be 0 in this case), but apart from that it
looks great.

Cheers,
Neil


http://codereview.appspot.com/4841052/diff/14002/input/regression/loose-column-spacing.ly
File input/regression/loose-column-spacing.ly (right):

http://codereview.appspot.com/4841052/diff/14002/input/regression/loose-column-spacing.ly#newcode4
input/regression/loose-column-spacing.ly:4: texidoc = Lilypond spaces
loose columns correctly in
remove `Lilypond'

http://codereview.appspot.com/4841052/diff/14002/input/regression/loose-column-spacing.ly#newcode10
input/regression/loose-column-spacing.ly:10: \new Staff \relative c' {
\times 2/3 {g'4 a2}}
indent (two spaces)

\times 2/3 { g'4 a2 } }

http://codereview.appspot.com/4841052/diff/14002/input/regression/loose-column-spacing.ly#newcode11
input/regression/loose-column-spacing.ly:11: \new Staff \relative c' {
indent

http://codereview.appspot.com/4841052/

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Progress on loose columns. (issue4841052)

2011-08-06 Thread m...@apollinemike.com

On Aug 5, 2011, at 9:49 PM, Keith OHara wrote:

 mtsolo at gmail.com writes:
 
 
 I was assuming that a rod
 attaches to the right of the left `between-columns' and the left of the
 right one?  Is this not the case?
 
 
 I haven't tried the patch yet, but the rods of rods-and-springs measure from 
 the 
 reference points of the objects.  
 The left- and right- sides of columns have protrusions and holes.  Usually 
 the 
 rod length is based on the distance between reference points where the 
 skylines 
 of the columns just touch.
 


Thanks Keith!
Do you know where these reference points are specified?

Cheers
MS
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Progress on loose columns. (issue4841052)

2011-08-06 Thread Keith OHara

On Sat, 06 Aug 2011 01:52:27 -0700, m...@apollinemike.com 
m...@apollinemike.com wrote:


Do you know where these reference points are specified?



No, but the extents of each glyph are calculated relative to the reference 
points,
so from the extents we can figure how long to make the rods to prevent the 
glyphs from touching, etc.


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Progress on loose columns. (issue4841052)

2011-08-05 Thread mtsolo

Reviewers: ,

Message:
Hey all,

This patch makes some headway into the loose column problem, but I am
running into a problem with the length of the rod placed for the loose
column.  Could C++ people with a bit of time please apply this patch,
look at the result, and then look at the pretty print it issues.  You'll
see that the rod is wider than the clef and, yet, when the spacing
finishes, the gap is smaller than the rod.  I was assuming that a rod
attaches to the right of the left `between-columns' and the left of the
right one?  Is this not the case?

Thanks for your help!
~Mike

\version 2.13.36
\new PianoStaff 
 \new Staff \relative c' { \times 2/3 {g'4 a2}}
 \new Staff \relative c' {
   \clef bass fis,,8 cis'
   \override Staff . Clef #'color = #red
   \override Staff . Clef #'layer = #100
   \clef treble a'' fis,
 }



Description:
Progress on loose columns.

Please review this at http://codereview.appspot.com/4841052/

Affected files:
  M lily/spacing-determine-loose-columns.cc
  M lily/spacing-loose-columns.cc


Index: lily/spacing-determine-loose-columns.cc
diff --git a/lily/spacing-determine-loose-columns.cc  
b/lily/spacing-determine-loose-columns.cc
index  
79551ecac37d5d06aaed4ea40175c413179a1ae2..047a4f44dbf51ec7793b9d822496a1d2a582f8d0  
100644

--- a/lily/spacing-determine-loose-columns.cc
+++ b/lily/spacing-determine-loose-columns.cc
@@ -176,7 +176,7 @@ Spacing_spanner::set_distances_for_loose_col (Grob *me,  
Grob *c,

   Rod r;
   r.distance_ = dists[LEFT] + dists[RIGHT];
   r.item_drul_ = next_door;
-
+printf (this is the length of the rod: %4.4f this is the width of the  
clef: %4.4f\n,r.distance_,robust_relative_extent  
(c,next_door[LEFT],X_AXIS).length ());

   r.add_to_cols ();
 }

Index: lily/spacing-loose-columns.cc
diff --git a/lily/spacing-loose-columns.cc b/lily/spacing-loose-columns.cc
index  
fb5e326369e5caaf79c6e19a4d5ff95ca793126b..de730e1329a42fee01c103efdaab833565fb9cbb  
100644

--- a/lily/spacing-loose-columns.cc
+++ b/lily/spacing-loose-columns.cc
@@ -162,13 +162,20 @@ set_loose_columns (System *which, Column_x_positions  
const *posns)


   Grob *finished_right_column = clique.back ();

+  Real total_pushing = 0.0;
+  for (vsize j = clique.size () - 2; j  0; j--)
+total_pushing += clique_spacing[j];
+
+  Real permissable_distance = clique.back ()-relative_coordinate  
(common, X_AXIS) - robust_relative_extent (clique[0], common,  
X_AXIS)[RIGHT];

+  Real scale_factor = permissable_distance / total_pushing;
+
   for (vsize j = clique.size () - 2; j  0; j--)
 {
   Paper_column *clique_col = dynamic_castPaper_column *  
(clique[j]);


   right_point = finished_right_column-relative_coordinate  
(common, X_AXIS);


-  Real distance_to_next = clique_spacing[j];
+  Real distance_to_next = clique_spacing[j] * scale_factor;

   Real my_offset = right_point - distance_to_next;




___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Progress on loose columns. (issue4841052)

2011-08-05 Thread Keith OHara
 mtsolo at gmail.com writes:

 
 I was assuming that a rod
 attaches to the right of the left `between-columns' and the left of the
 right one?  Is this not the case?
 

I haven't tried the patch yet, but the rods of rods-and-springs measure from 
the 
reference points of the objects.  
The left- and right- sides of columns have protrusions and holes.  Usually the 
rod length is based on the distance between reference points where the skylines 
of the columns just touch.


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel