Carl, thanks a lot for pointing me to a good starting point in the
LilyPond documentation
(https://lilypond.org/doc/v2.25/Documentation/notation/note-heads.html#easy-notation-note-heads<https://lilypond.org/doc/v2.25/Documentation/notation/note-heads.html#easy-notation-note-heads>)
and to the concept of scale degrees.
From there, it was quite straightforward - with a bit of AI assistance
😉- to change a few lines of code so that it fits my use case perfectly.
In my case, I leave |\easyHeadsOn| turned off.
\version "2.24.4"
#(define Scale_degree_colored_notes_engraver
(make-engraver
(acknowledgers
((note-head-interface engraver grob source-engraver)
(let* ((context (ly:translator-context engraver))
(tonic-pitch (ly:context-property context 'tonic))
(tonic-name (ly:pitch-notename tonic-pitch))
(grob-pitch
(ly:event-property (event-cause grob) 'pitch))
(grob-name (ly:pitch-notename grob-pitch))
(delta (modulo (- grob-name tonic-name) 7))
;; vector of colors indexed by scale degree (0–6)
(colors
(vector
(x11-color 'red)
(x11-color 'black)
(x11-color 'black)
(x11-color 'black)
(x11-color 'green)
(x11-color 'black)
(x11-color 'black)))
;; select color for this note
(note-color (vector-ref colors delta)))
;; set notehead color
(ly:grob-set-property! grob 'color note-color))))))
\layout {
ragged-right = ##t
\context {
\Voice
\consists \Scale_degree_colored_notes_engraver
}
}
\relative c' {
%\easyHeadsOn
c4 d e f
g4 a b c \break
\key a \major
a,4 b cis d
e4 fis gis a \break
\key c \minor
c,4 d es f
g4 as bes c \break
\key d \dorian
d,4 e f g
a4 b c d
}
Am 22.12.2025 um 21:43 schrieb Carl Sorensen:
On Mon, Dec 22, 2025, 3:12 PM Stephan Schöll <[email protected]> wrote:
Hi all
Some time ago, I started colouring the tonic and dominant notes in
my choir scores. I realised that this helps singers who do not
have advanced music reading skills enormously. In pop arrangements
in particular, individual voices often revolve around a ‘key
note’, e.g. tenor or alto around the dominant (similar to a horn
part in an orchestra ;-) ). The colours serve as an visual anchor
so it's easy/ier to find their "way home".
Two possibilities:
1. Why not look into shape notes? That's a known solution for
idicating sacle degree. It uses shape instead of color, so you can
even use black and white printing.
And it's built into LilyPond.
2. Look in the documentation at the easy note heads. They show you
how to get the scale degree. And once you get the degree, you can
change the color instead of the note head.
HTH,
Carl