|
From: | David Nalesnik |
Subject: | Re: Coloring of key signature accidentals based on their pitch |
Date: | Tue, 18 Aug 2015 17:34:35 -0500 |
Thanks David!Yes, it provides the exactly the desired result!
With this kind of approach, where the note height in the staff is being used instead of
the pitch of the note, the Staff.keySignature.stencil needs to be redefined on each clef change:\override Staff.KeySignature.stencil =
#(key-signature::special-print treble-key-signature-colors)
\override Staff.KeyCancellation.stencil =
#(key-signature::special-print treble-key-signature-colors)
\clef treble\override Staff.KeySignature.stencil =
#(key-signature::special-print bass-key-signature-colors)
\override Staff.KeyCancellation.stencil =
#(key-signature::special-print bass-key-signature-colors)
\clef bassWould there be any idea in developing the idea even a bit further, and to connect the accidentals in the signature toSo instead of
their pitch in stead of their vertical position?
\override Staff.KeySignature.stencil =
#(key-signature::special-print `((4 . ,green) (-3 . ,red) (1 . ,blue)))
\override Staff.KeyCancellation.stencil =
#(key-signature::special-print `((-3 . ,magenta) (1 . ,cyan)))One could have something more explicit which would work with all clefs, like
#(define key-signature-colors `(
(ly:make-pitch 2 3 SHARP) . ,green)
(ly:make-pitch 1 3 SHARP) . ,green)
(ly:make-pitch 0 3 SHARP) . ,green)
(ly:make-pitch -1 3 SHARP) . ,green)
(ly:make-pitch 2 3 FLAT) . ,red)
(ly:make-pitch 1 3 FLAT) . ,red)
(ly:make-pitch 0 3 FLAT) . ,red)
(ly:make-pitch -1 3 FLAT) . ,red)
(ly:make-pitch 2 0 SHARP) . ,blue)
(ly:make-pitch 1 0 SHARP) . ,blue)
(ly:make-pitch 0 0 SHARP) . ,blue)
(ly:make-pitch -1 0 SHARP) . ,blue)
(ly:make-pitch 2 0 FLAT) . ,blue)
(ly:make-pitch 1 0 FLAT) . ,blue)
(ly:make-pitch 0 0 FLAT) . ,blue)
(ly:make-pitch -1 0 FLAT) . ,blue)
(ly:make-pitch 2 3 NATURAL) . ,magenta)
(ly:make-pitch 1 3 NATURAL) . ,magenta)
(ly:make-pitch 0 3 NATURAL) . ,magenta)
(ly:make-pitch -1 3 NATURAL) . ,magenta)
(ly:make-pitch 2 0 NATURAL) . ,cyan)
(ly:make-pitch 1 0 NATURAL) . ,cyan)
(ly:make-pitch 0 0 NATURAL) . ,cyan)
(ly:make-pitch -1 0 NATURAL) . ,cyan)
))
\override Staff.KeySignature.stencil =
#(key-signature::special-print key-signature-colors)
\override Staff.KeyCancellation.stencil =
#(key-signature::special-print key-signature-colors )
?
key-sig-color-by-pitch.ly
Description: Text Data
key-sig-color-by-position.ly
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |