lilypond-user
[Top][All Lists]
Advanced

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

Re: Coloring of key signature accidentals based on their pitch


From: Heikki Junes
Subject: Re: Coloring of key signature accidentals based on their pitch
Date: Mon, 17 Aug 2015 15:47:47 +0300


2015-08-17 15:34 GMT+03:00 David Kastrup <address@hidden>:
Heikki Junes <address@hidden> writes:

> Hi,
>
> in Lilypond 2.19.25 notes and accidental before notes can be colored based
> on their pitch:
>
> \override NoteHead.color = #color-notehead
> \override Accidental.color = #color-notehead

Uh, no?

> Here is an example on NoteHeads:
>
> http://www.lilypond.org/doc/v2.19/Documentation/snippets-big-page#pitches-coloring-notes-depending-on-their-pitch

You are aware that this example defines color-notehead itself?  It is
not predefined in LilyPond.

Exactly. With this scheme code it is possible to have color-by-pitch.
 
> What I am looking for is to be able to color the individual key signature
> accidentals based on their pitch.
>
> Currently, key signature seems to be a single grob (?) so that only one
> color can be assigned to it:
>
> \override Staff.KeySignature #'color = #red

Key signature is a single grob.  Your best bet probably is recoding the
print routine in lily/key-signature-interface.cc in Scheme (it appears
rather straightforward) and then add the desired color changes to it.
The alternative, namely calling the print routine and post-processing
the stencil is probably less robust against future changes in LilyPond.

This recoding the print routine in scheme sound exactly the kind of solution I was looking at.
Then that scheme code could be updated with a scheme script in the preamble of a .ly file,
which would allow "\override Staff.KeySignature #'color = #color-keysignature".

I would be very grateful, if somebody for whom this recoding is an easy job
could take a catch on this idea.

Best regards,
Heikki Junes


reply via email to

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