\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) (rgb-color 1 0 0)) (cons (ly:make-pitch 0 0 NATURAL) (rgb-color 1 0 0)) (cons (ly:make-pitch 0 0 SHARP) (rgb-color 1 0 0)) (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) (rgb-color 0 1 0)) (cons (ly:make-pitch 0 3 NATURAL) (rgb-color 0 1 0)) (cons (ly:make-pitch 0 3 SHARP) (rgb-color 0 1 0)) (cons (ly:make-pitch 0 4 FLAT) (rgb-color 0.298 0.855 0.988)) (cons (ly:make-pitch 0 4 NATURAL) (rgb-color 0.298 0.855 0.988)) (cons (ly:make-pitch 0 4 SHARP) (rgb-color 0.298 0.855 0.988)) (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) (rgb-color 0.6 0 0.9)) (cons (ly:make-pitch 0 6 NATURAL) (rgb-color 0.6 0 0.9)) (cons (ly:make-pitch 0 6 SHARP) (rgb-color 0.6 0 0.9)))) %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 } %Colors used From other note program where you had some few colors to choose from. %{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) % (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)) %{ \layout { \context { \Staff \remove "Time_signature_engraver" \override TimeSignature #'stencil = #point-stencil }} \score { \new Staff \relative d' { \cadenzaOn \override NoteHead.color = #color-notehead \override NoteHead.font-size = #6 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 = #6 \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 \override NoteHead.font-size = #6 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 = #6 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 = #6 \override NoteHead.color = #color-notehead d ds e es f fs g gs a as b bs c cs \bar "" \break d ds e es f fs g gs a as b bs c cs \bar "" \break d ds e es f fs g gs a as}} %} %{ \version "2.22.0" lyricrevert= { \revert LyricText.color } lyricRed = { \override LyricText.color = #red } verse = \lyrics { Black text \lyricRed Red Text \lyricrevert Black Text } \score { << \new Staff \new Voice=tune \relative c'' { a4 a a a | a a2. } \lyricsto tune \verse >> } %}