lilypond-user
[Top][All Lists]
Advanced

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

Re: centering text on a measure


From: David Nalesnik
Subject: Re: centering text on a measure
Date: Thu, 22 Sep 2011 17:20:11 -0500

Hi Harm,

On Tue, Sep 20, 2011 at 6:58 PM, harm6 <address@hidden> wrote:

Hi David,

testing your newest code I've got no errors any more! But sometimes there is
a strange behaviour.

Testing the attached code I receive centerTest-1.pdf with an offset of the
red Line in the first score, that I can't explain.  [ . . . ] If I comment out the second voice, the output is ok (apart from the lines) and surprisingly the red line of the first score is moved to the correct position! (centerTest-2.pdf).  
 
Can you confirm this?

Unfortunately, I can't!  When I run the ,ly file exactly as you send it, I don't get the same problem with the red line: it's centered between LeftEdge and BarLine.  I get the same result in 2.14.2 and 2.15.8.  I can't duplicate the problem you're seeing no matter how I comment the file.

The fact that the red line appears below the note means it hasn't been moved at all (there would have been an error instead in the first version of the function).  The function thinks that either (a) one or both of the grobs you want to use to center the red line aren't there (in this case, LeftEdge and BarLine); or (b) they don't appear in a left-to-right order.  I can't see how either of these situations would apply here -- no matter what you comment in or out.

I've attached a file with an addition for testing which will display a message on the console if the function rejects any of the input.  It will tell you if both grobs are present in the system, and if so, which one isn't suitable to use for alignment.

In the second score the
second voice seems to override the settings of the first.


This is because it has decided that the stems in the other voice are closer.  I really don't know how to fix this :(

If there were some way to add a tag to a grob (not just a music _expression_), this would all be much simpler.  Something like this:

\once \override Stem #'tag = #"hello"

Then, you could add the same tag to another grob, and center the TextScript (or whatever) between the two grobs having the tag "hello".  There would never be any "wrong decisions" on the part of the function.  Is such a thing possible?   I think this could be a very useful program feature.

Anyway, thank you for all the work you've put into testing this!

Best,
David



 

Attachment: centerGrobBetween_rev2.ly
Description: Binary data


reply via email to

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