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: Mon, 3 Oct 2011 13:46:42 -0500

Hi Harm,

On Mon, Oct 3, 2011 at 10:08 AM, Thomas Morley <address@hidden> wrote:

Hi David,

setting 'markers to a list is a great idea and I've never got warnings or wrong output.

Your definition should be putted in the LSR as soon as it's updated to 2.14.


I'm glad that it works and you think it can be useful!
 

One tiny thing I noticed testing the code: It's possible to call 'markers from different voices and staffs, even if I use: \once \override Voice ...

This might be a feature. Or is it a problem? I'm not sure.


 I don’t know what if anything could be done about the behavior you noticed -- that a tag can cross between voices and staves.  (The one thing it can’t do is cross between systems.)  I don’t know if there’s a way to extract information about a grob’s context relying on the ‘all-elements grob-array as a starting point as I've done here. That said, I don’t think this behavior is a bad thing -- you just have to be careful to use a given tag only once per system.

After your suggestion, I experimented some with creating my own interface and adding it to the interface-list of various grobs.  This creates an interface with a single property ('markers), and then adds it to every grob's description.

#(define add-custom-interface! (ly:add-interface 'grob-marker-interface "Marker for grob" '(markers)))

#(define all-custom-grob-descriptions
   (for-each
     (lambda (x)
       (let ((interfaces
               (ly:assoc-get 'interfaces
                 (ly:assoc-get 'meta
                   (cdr x)))))
         (set! interfaces (append! interfaces '(grob-marker-interface)))))
     all-grob-descriptions))

I don't know enough about the inner workings of LilyPond to understand the benefits of making an interface.  Is it so that, in this case, I could limit which grobs are able to be tagged with the 'markers property?

Thanks for all of your suggestions!

-David


reply via email to

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