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: David Nalesnik
Subject: Re: Coloring of key signature accidentals based on their pitch
Date: Tue, 18 Aug 2015 08:20:02 -0500

Hi Heikki,

On Mon, Aug 17, 2015 at 7:47 AM, Heikki Junes <address@hidden> wrote:

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

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.
 
In the attached file, I've recoded the print routine in Scheme, adding the ability to color individual alterations based on their position relative to the central line (= 0).  Note that signatures for KeySignature and KeyCancellation are handled independently.

I ran out of steam before I duplicated everything in the C++ function, but hopefully this will give you what you need.

Best,
David 

Attachment: key.ly
Description: Text Data


reply via email to

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