lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Catch direction operators


From: David Kastrup
Subject: Re: Catch direction operators
Date: Sun, 29 Sep 2013 11:39:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Urs Liska <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]