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
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user




_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to