lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Overwrite key signature with numbers


From: Robert Mengual
Subject: Overwrite key signature with numbers
Date: Mon, 2 Oct 2023 14:21:37 +0200

Hi, I am trying to overwrite the key signature for my custom music notation so that instead of displaying the sharp and flat icons, it shows a given number and the alteration. So, for example, E Major would show 4# instead of ####.

I have been able to get the desired output by hardcodeing it using the markup function. However, I am not finding a way to conditionally render the number and alteration depending on the key. Could somebody help me? 

Here is my tiny hardcoded example, with a screenshot:

image.png

\version "2.23.6"

\layout {
\context {
\Staff
\override KeySignature.stencil = #ly:text-interface::print
\override KeySignature.text = \markup {
\combine
\halign #-1 \lower #1 \musicglyph "four"
\halign #-5 \musicglyph "accidentals.sharp"
}
}
}

\relative {
\clef bass
\key e \major
cis dis e
} 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]