lilypond-devel
[Top][All Lists]
Advanced

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

Re: proposed enhancement to vertical stretching logic


From: Reinhold Kainhofer
Subject: Re: proposed enhancement to vertical stretching logic
Date: Sat, 5 Jul 2008 23:04:48 +0200
User-agent: KMail/1.9.9

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Mittwoch, 2. Juli 2008 schrieb Joe Neeman:
> On 7/1/08, Reinhold Kainhofer <address@hidden> wrote:
> > Am Mittwoch, 25. Juni 2008 schrieb Joe Neeman:
> >> However, I think that LilyPond´s spring algorithms
> >> are already close to the ones you are describing. Have a look in
> >> simple-spacer.cc -- it is reasonably self-contained. Unfortunately,
> >> these spring algorithms aren´t used in the vertical stretching step,
> >> which is completely naive; they are only used in horizontal and vertical
> >> spacing (ie. between systems, not within them).
> >
> > I've now had a quick look and think that the springs-and-rods problem
> > solver needs to be inserted in
> > Align_interface::align_elements_to_extents.
>
> Actually, I think that it would be better to unify the stretching with
> the system placement that is currently done in layout-page-layout.scm.
> That is, I think that we should space the whole page as one big
> rod-and-spring problem. This would require some significant surgery,
> but I think it is the right approach.

While I absolutely agree, doing it properly is way above my head (in 
particular, since the vertical spacing also deals heavily with all sorts of 
Lilypond internals) I now started to tweak the Align_interface::stretch 
function, so that I at least can play around with the settings and get a 
feeling how things should really work.

I've now re-implemented the stretch method with parameters that should exactly 
reproduce the current stretching (i.e. equal amounts of space are inserted), 
but now uses the springs-and-rods problem. My only problem is that I cannot 
get the springs-and-rods problem to return spring positions different from 
the initialization values... In other words, no stretching is done at all!

Since the Lilypond does not contain any comments or other documentation 
whatsoever, I simply don't know how using the Simple_spacer class should 
work... Can someone please take a look at the attached patch and tell me what 
I'm doing wrong!

(if you are wondering, why I'm reimplementing the current broken way of 
spacing: Currently, I use the minimum distance as ideal spring length so that 
the same amount of space should be inserted between each staff, but if I 
simply replace the ideal sprint length with the staff extents, it will space 
staves equally; That will come a little later, first I need to understand how 
the spacer works at all!)

> > 2) To work properly also with rhythmic staves and tab staves, I think
> > that the
> > springs should go only from the end of one staff to the beginning of the
> > next, as otherwise the staff extends will already take away some of the
> > vertical space that should be equally distributed. How do I get the staff
> > extents?
>
> I guess you need to find the StaffSymbol somehow...

How can I do that? At this point of the code, I only have access to the 
VerticalAxisGroup. How do I get the staff symbol it is associated with?

Cheers,
Reinhold

- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIb+H0TqjEwhXvPN0RAtv+AKCNO0rSlomO+AZyxybnfys+d1uRuQCgjY6q
7R4HbtrlsPk39w6gRDBfI2U=
=Zlqe
-----END PGP SIGNATURE-----

Attachment: 0001-Non-working-attempt-to-make-inter-system-spacing-use.patch
Description: Text Data

Attachment: vertical-page-layout1.ly
Description: Text Data


reply via email to

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