Oh forgot there was a script attach to the other ly file - here is the
color file for the note heads.
Dearly regards Darkijah
\version "2.22.1" \language "english" % Color
%{Jehovah's Rainbow to recall the destruction of the world wide flood,
Notes with Colors for Learners depending on Pitch or names,
Low to highest vibration: C=Red D=Orange E=Yellow F=Green G=Lightblue A=Blue B=Violet
the function used in this example even makes it possible to distinguish enharmonics.%}
%Association list of pitches to colors âC# âD# âE# âF# âG# âA# âB#:
#(define color-mapping(list
(cons (ly:make-pitch 0 0 FLAT) (x11-color 'red3))
(cons (ly:make-pitch 0 0 NATURAL) (x11-color 'red3))
(cons (ly:make-pitch 0 0 SHARP) (x11-color 'red3))
(cons (ly:make-pitch 0 1 FLAT) (rgb-color 0.953 0.471 0.125))
(cons (ly:make-pitch 0 1 NATURAL) (rgb-color 0.953 0.471 0.125))
(cons (ly:make-pitch 0 1 SHARP) (rgb-color 0.953 0.471 0.125))
(cons (ly:make-pitch 0 2 FLAT) (rgb-color 1 0.804 0))
(cons (ly:make-pitch 0 2 NATURAL) (rgb-color 1 0.804 0))
(cons (ly:make-pitch 0 2 SHARP) (rgb-color 1 0.804 0))
(cons (ly:make-pitch 0 3 FLAT) (x11-color 'green4))
(cons (ly:make-pitch 0 3 NATURAL) (x11-color 'green4))
(cons (ly:make-pitch 0 3 SHARP) (x11-color 'green4))
(cons (ly:make-pitch 0 4 FLAT) (rgb-color 0.273 0.669 0.666))
(cons (ly:make-pitch 0 4 NATURAL) (rgb-color 0.273 0.669 0.666))
(cons (ly:make-pitch 0 4 SHARP) (rgb-color 0.273 0.669 0.666))
(cons (ly:make-pitch 0 5 FLAT) (x11-color 'blue))
(cons (ly:make-pitch 0 5 NATURAL) (x11-color 'blue))
(cons (ly:make-pitch 0 5 SHARP) (x11-color 'blue))
(cons (ly:make-pitch 0 6 FLAT) (x11-color 'VioletRed4))
(cons (ly:make-pitch 0 6 NATURAL) (x11-color 'VioletRed4))
(cons (ly:make-pitch 0 6 SHARP) (x11-color 'VioletRed4))))
%Compare pitch and alteration (not octave).
#(define (pitch-equals? p1 p2)(and
(= (ly:pitch-alteration p1) (ly:pitch-alteration p2))
(= (ly:pitch-notename p1) (ly:pitch-notename p2))))
#(define (pitch-to-color pitch)
(let ((color (assoc pitch color-mapping pitch-equals?)))(if color(cdr color))))
#(define (color-notehead grob)(pitch-to-color(ly:event-property (event-cause grob) 'pitch)))
% script end- - ---------------------------------------------------------------------------------------------
% (Rød-c red) (Orange-d orange) (Gul-e yellow3) (Grøn-f green4) (Blå-g blue) (Mørkeblå-a darkblue) (Violet-b violet)
% \override Beam.color = #(x11-color "medium turquoise")
% \override Accidental.color = #(rgb-color 1 0.3 0.3)
% \override NoteHead.color = #(rgb-color 0.5 0.5 0.5)
% \override Stem.color = #(rgb-color 0.8 0.8 0)
%instrument = \markup \with-color #green "Instrument"
% \markup { \with-color #red contain }
%{Red%} % #(rgb-color 0.898 0.098 0.141)
%{Orange%} % #(rgb-color 0.953 0.471 0.125)
%{Yellow%} % #(rgb-color 0.996 0.875 0)
%{Green%} % #(rgb-color 0 0.616 0.239)
%{Teal%} % #(rgb-color 0.298 0.855 0.988)
%{Blue%} % #(rgb-color 0.20 0.286 0.62)
%{Violet%} % #(rgb-color 0.694 0.325 0.62)
%{teal%} #(rgb-color 0 0.502 0.502)
%{
\layout { \context { \Staff
%\remove "Time_signature_engraver"
\override TimeSignature #'stencil = #point-stencil }}
\score { \new Staff \relative d' { \cadenzaOn
\override NoteHead.color = #color-notehead
cf c cs df d ds ef e es ff f fs gf g gs af a as bf b bs cf c cs}}
\score { \new Staff \relative d' { \cadenzaOn \easyHeadsOn \override NoteHead.font-size = #2
\override NoteHead.color = #color-notehead
cf c cs df d ds ef e es ff f fs gf g gs af a as bf b bs cf c cs}}
\relative { \cadenzaOn \override NoteHead.color = #color-notehead
c d e f g a b c d e f g a b c d e f g a b c }
\relative { \cadenzaOn \override NoteHead.color = #color-notehead \easyHeadsOn \override NoteHead.font-size = #2
c d e f g a b c d e f g a b c d e f g a b c}
\score { \new Staff \relative d' { \cadenzaOn \easyHeadsOn \override NoteHead.font-size = #2
\override NoteHead.color = #color-notehead
d\ldn ds\lds e\len es\les f\lfn fs\lfs g\lgn gs\lgs a\lan as\las b\lbn bs\lbs c\lcn cs\lcs d\ldn ds\lds e\len es\les f\lfn fs\lfs g\lgn gs\lgs a\lan as\las b bs c cs d ds e es f fs g gs a as}}
%}
%{
\version "2.22.0"
lyricBlack= { \revert LyricText.color }
lyricRed = { \override LyricText.color = #red }
verse = \lyrics
{
Black text \lyricRed Red Text \lyricBlack Black Text
}
\score {
<<
\new Staff \new Voice=tune \relative c'' { a4 a a a | a a2. }
\lyricsto tune \verse
>>
}
%}