|
From: | Jan-Peter Voigt |
Subject: | Re: change barline type with time signature change |
Date: | Wed, 27 Feb 2013 12:22:18 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 |
Hi Kieren, hi David K.,applyContext is good for doing somethind conditionally anywhere in the music stream:
cond = ##t mod = \with { \override NoteHead #'color = #red } \relative c' {c4 e g b \applyContext #(lambda (context) (if cond (ly:context-mod-apply! context mod))) c a f d c1
}I think, for your idea of automatically changing properties in a context, you will need an engraver. One thing to consider is writing a scheme-function-provider with define-scheme-function, that returns an engraver using a provided condition-function and a provided context-mod-function. To reduce the scheme-scarriness, this engraver-provider could use parameters for the context-property to watch and the contaxt-mod to apply in the case of a change. Of course, the more generic this shall be, the less scheme can be hidden from the user. If the changed property shall be used in the action, that is triggered, a scheme function cannot be avoided, I think.
I will think about this and will see, if I can make a demo of this. Cheers, Jan-Peter Am 26.02.2013 21:59, schrieb Kieren MacMillan:
Hi David,Isn't that what \applyContext is for, without the need for any engraver?I don't know — is it? How about giving an example, so we can see if it is. Thanks, Kieren. _______________________________________________ lilypond-user mailing list address@hidden https://lists.gnu.org/mailman/listinfo/lilypond-user
[Prev in Thread] | Current Thread | [Next in Thread] |