Dear LilyPond Community,

I hope you’re all doing well! I’m currently working on an educational lead
sheet project using LilyPond, and I’d like to ask for your advice on a
formatting challenge involving the ChordNames context.

⸻

🎯 The Goal

I’d like to overlay custom Roman numeral-style text labels (such as I, IV,
V) directly near chord names, in a way that visually represents functional
harmony (e.g., C = I, G = V in C major).
• These labels are manually defined; they don’t need to be automatically
parsed from chords.
• The goal is flexible overlaying, meaning these text labels could
potentially become any custom text, not just Roman numerals.

⸻

🧩 The Key Challenge
• I want to insert each label directly in sync with the chord symbol.
• Ideally, I’d like to overlay a semi-transparent, large, colored text
(e.g., in red at 50% opacity).
• The chord symbol should remain fully visible and untouched, and the
overlay should not shift or interfere with chord spacing.
• I want to avoid placing text manually on notes (e.g., using ^\markup on
melody pitches), as that’s impractical for longer lead sheets.
• I’d prefer a solution where I can write something like:

g1^\degreeMarkup "V"

in the context of:

theChords = \chordmode {
  c1  % C major
  g1 ^\degreeMarkup "V"   % G major
}

or define a function that extends or customizes ChordNames behavior.

⸻

🧪 Minimal Example

\version "2.24.4"

theChords = \chordmode {
  c1  % C major
  g1  % G major
}

melody = \relative c' {
  <c e g e>1
  <d g b g>1
}

\score {
  <<
    \new ChordNames {
      \theChords
      % Ideally: add "I" and "V" labels over/next to the C and G chords
here.
      % I hope to overlay these in a semi-transparent large red font.
    }

    \new Staff {
      \clef treble
      \key c \major
      \time 4/4
      \melody
    }
  >>

  \layout {
    indent = 0
  }
}



⸻

❓ Question for the Community

Is there a clean way to overlay a large custom text markup (e.g., “I”, “V”,
or any label) near or above the chords in ChordNames, while preserving
spacing and avoiding manual positioning on notes?

Thanks so much in advance!

Warm regards,
Peter

Attachment: test_ChordName_markups.ly
Description: Binary data

Reply via email to