Urs Liska <u...@openlilylib.org> writes: >>You can write: >> >>#(define-music-function (parser location item) >> (symbol-list-or-music?) >> (define (grob-colorize-dir grob) >> (let ((ev (event-cause grob))) >> (case (ly:event-property ev 'direction) >> ((1) red) >> ((-1) blue) >> (else '()))))) >> #{ \tweak color #grob-colorize-dir #item #}) > > Thanks, this works perfectly. > > I would like to add this to a Frescobaldi addition and later (once > 2.18 is out) to a LilyPond addition proposal. Do you have any > objections?
You can add it wherever you want. I don't see it making any sense as an addition to LilyPond proper as it is a rather special use case. It may still be nice as a snippet as it is simple, flexible, and powerful. The use cases also show \tweak as an internal workhorse for both tweaks and overrides. As a snippet, it makes sense _in_ 2.18 as it illustrates current programming techniques. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user