Hi everyone,
I’d like to display the pitch name (letter + octave number) above each note
in a given music expression — for example:
• C₄ above c'
• G₄ above g'
I can manually do this using markups, like:
c'4^\markup { \raise #2 \concat { "C" \sub "4" } }
But I’m wondering:
Is there a way to define a music function (or engraver) that can
automatically generate this label for each note in a music expression?
Ideally, I’d also like some flexibility — for example:
• The ability to customize the output markup format in the future (e.g.,
adjusting \raise, \concat, \sub, or the font styling).
Here’s a minimal example showing what I do manually right now:
```lilypond
\version "2.24.4"
music = {
c'4 g'4
}
music_with_noteNames = {
c'4^\markup { \raise #2 \concat { "C" \sub "4" } }
g'4^\markup { \raise #2 \concat { "G" \sub "4" } }
}
\score {
\new Staff {
\clef treble
\key c \major
\time 4/4
% Goal: transform \music into the version below automatically
\music_with_noteNames
}
}
```
[image: image.png]
Thanks in advance for any help or ideas!
Warm regards,
Peter