|
From: | Thomas Morley |
Subject: | Re: centering text on a measure |
Date: | Tue, 4 Oct 2011 00:29:19 +0200 |
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?
I'm only a musician and music-teacher without any previous programming-experience, trying to learn scheme and to dive into lilypond-internals deeper and deeper. So excuse me if I remark some moonshine. :)
Regarding the idea of defining custom-properties I thought: What could be done with such a property? After defining a name, the needed type of argument and the description - give it functionality. At first, I thought about rebuilding an existent renamed property. But how?
This does nothing (of course not)!
Maybe I'm wrong, but I thought adding an interface could be the solution. If not, how to do?
I also don't know if it's possible to limit the grobs to be tagged with the 'markers property when using the 'grob-marker-interface, but probably it could be examinated.
Many thanks for all the fine functions you've created!!
Best,
Harm
[Prev in Thread] | Current Thread | [Next in Thread] |