Paul Morris <p...@paulwmorris.com> writes: > David Kastrup wrote >> Looks fine. \colorizeDir is not actually being used as a tweak here, >> but then that makes pretty little sense anyway. > > Ok, I've added it here: > http://lsr.dsi.unimi.it/LSR/Item?id=889 > > Since it requires 2.17 I had to comment out the whole thing, and add a > single note to get the LSR to accept it.
Might make more sense to add it to LilyPond's own snippet base, I guess. Obviously, we have no limitations how new any snippets may be there. > I also split colorizeDir up into two parts, as shown below. This seemed > easier to understand and avoids (re-)defining grob-colorize-dir for every > grob that gets colored. Let me know if that's not a good call. Well, I try keeping the global name space uncluttered, but if you see an actual potential for use outside of \colorizeDir, that's certainly a small price to pay. > #(define (grob-colorize-dir grob) > (let ((ev (event-cause grob))) > (case (and ev (ly:event-property ev 'direction)) > ((1) red) > ((-1) blue) > (else '())))) > > colorizeDir = > #(define-music-function (parser location item) > (symbol-list-or-music?) > #{ \tweak color #grob-colorize-dir #item #}) -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user