On 3/24/26 2:16 PM, Lukas-Fabian Moser wrote:
Hi,
Am 24.03.26 um 21:59 schrieb Werner LEMBERG:
Is Lilypond-devel not appropriate for a feature request?
In this case: no, it's not the right mailing list, because the
original question isn't a feature request at all IMHO.
In most cases you can write a small Scheme function that does exactly
what you want, acting as a wrapper around existing LilyPond
functionality. For this reason you should always start asking a
question on 'lilypond-user' – the necessary Scheme code could then be
added to the LilyPond Wiki so that other people with similar demands
can quickly access a solution.
Thanks, Werner, for explaining what I meant by switching the mailing list.
As for the original question: Having numbers-with-letters in uppercase
is comparatively easy, this is just a transformation of the BarNumber
markup. Try:
\override Score.BarNumber.stencil =
#(lambda (grob)
(grob-interpret-markup
grob
(make-with-string-transformer-markup
(lambda (layout props str) (string-upcase str))
(ly:gr1 ob-property grob 'text))))
in your \layout { ... } block.
Thank you! I will try that.
The other request (containing letters A, B, C ...) is not yet clear to
me - Paul, can you give an example?
These usages are for indicating modifications of a score without
changing the original bar numbers.
The usual usage for my second request is to label the first bar "A", the
2nd bar "B", etc. and then go back to conventional bar numbering (using
Score.currentBarNumber )
The code I was given earlier was:
bnLet =
#(define-music-function
(parser location aLetter)
(string?)
#{
\once \override Score.BarNumber.stencil =
#(lambda (grob)
(let ((text (ly:grob-property grob 'text)))
(grob-interpret-markup grob
#{ \markup \sans $aLetter #})))
#})
setA = { \bnLet #"A" }
setB = { \bnLet #"B" }
etc.
It just lacks the auto-incrementing.
Paul