[Top][All Lists]

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

Re: Change color after a line break

From: Marc Hohl
Subject: Re: Change color after a line break
Date: Mon, 20 Jul 2015 10:17:56 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

Am 19.07.2015 um 11:03 schrieb David Kastrup:
David Kastrup <address@hidden> writes:

Marc Hohl <address@hidden> writes:

Thanks a lot! Just to check that I have understood the underlying
mechanism, I rewrote that according to

overrideColorForAll =
#(define-music-function (color) (color?)
#{ #@(map (lambda (dsc)
             (propertyOverride (list 'Score (car dsc) 'color) color))

which seems to do the trick as well without switching between Scheme
and LilyPond whithin overrideColorForAll.

If you want to avoid switching to LilyPond, you can of course replace
#{ address@hidden #} with (make-simultaneous-music ...).

make-sequential-music of course.  Doesn't usually make a difference, but
look at

     \override NoteHead.color = #red
     \override Stem.color = #red
   c'2 2

for a case where it _does_ make a difference.

Huh, wow.

So I rewrote the function, and just for the record, it is

overrideGrobColor =
#(define-music-function (color) (color?)
     (map (lambda (dsc)
            (propertyOverride (list 'Score (car dsc) 'color) color))

\relative c' {
   \overrideGrobColor #(x11-color 'blue)
   c4\pp\< d e f
   \break f1 \stopStaff
   \overrideGrobColor #(x11-color 'red)
   \grace { g16[( a g fis]) } g1\ff\!

Thanks a lot for your help and the detailed explanations!


reply via email to

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