Hi Harm,

On Mon, Oct 3, 2011 at 10:08 AM, Thomas Morley <
thomasmorle...@googlemail.com> 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
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to