lilypond-user
[Top][All Lists]
Advanced

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

left-aligning grobs to other grobs


From: David Nalesnik
Subject: left-aligning grobs to other grobs
Date: Tue, 8 Mar 2011 11:44:44 -0600

Hi, all --

Attached is a function which started out as an attempt to get tempo
indications to line up with the left edge of the time signature.  It's
been generalized so that you can left-align any grob responsive to
'extra-offset to the closest grob of a specified type in that system
(as far as I can tell so far -- you could even left-align a notehead
to a barline, if you were so inclined...)

It locates the closest grob by first searching all of the grobs in a
system for every instance of the target type, then selecting the one
that is closest horizontally.  (For example, if you want to align
something to a barline, the function would determine where all the
barlines are, then choose the nearest one).

I have several questions:

(1) Is there a way to locate the nearest grob more efficiently, so the
routine doesn't have to search the entire system?

(2) Is there a way to exclude grobs that are in the same system, but
on a different staff?  I've looked at the 'staff-symbol property, but
it's empty in some cases.

(3) Does anybody have any suggestions how to improve the coding?  I'm
enjoying learning Scheme, but my approach is rather hit-and-miss!

Best,
David

Attachment: grob_left_align.ly
Description: Text Data

Attachment: image.png
Description: PNG image


reply via email to

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