[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 17:50:46 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
David Kastrup <address@hidden> writes:
> Thomas Morley <address@hidden> writes:
>
>>>>>You can write:
>>>>>colorizeDir =
>>>>>#(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.
Actually, it's oversimplified. It has to have
(case (and ev (ly:event-property ev 'direction))
or it will bomb out in the cases of coloring grobs not traceable to a
music event.
--
David Kastrup
- Re: Catch direction operators, (continued)
- Re: Catch direction operators, Urs Liska, 2013/09/29
- Re: Catch direction operators, David Kastrup, 2013/09/29
- Re: Catch direction operators, David Kastrup, 2013/09/29
- Re: Catch direction operators, Urs Liska, 2013/09/29
- Re: Catch direction operators, David Kastrup, 2013/09/29
- Re: Catch direction operators, Urs Liska, 2013/09/29
- Re: Catch direction operators, David Kastrup, 2013/09/29
- Re: Catch direction operators, Thomas Morley, 2013/09/29
- Re: Catch direction operators, David Kastrup, 2013/09/29
- Re: Catch direction operators,
David Kastrup <=
Re: Catch direction operators, MING TSANG, 2013/09/29