On 2021-09-25 7:30 am, padovani wrote:
Hi,
I'm working with an algorithmic transcription of some sounds. I'm using
a
1/4 TimeSignature with custom barlines and would like to concatenate a
seconds quote (") to the BarNumber...
Do you have any tips on how to do that?
It seems that I should deal with BarNumber.stencil, but I'm not getting
how
to concatenate the printed number to an arbitrary string.
Any suggestions?
grob-transformer on BarNumber.text would be ideal, but that property
does not support a callback.
You could do the transform yourself either within a stencil callback or
using before-line-breaking:
%%%%
asdf = {
\override Score.BarNumber.break-visibility = #all-visible
\time 1/4 \repeat unfold 9 b'4
}
{
\override Score.BarNumber.stencil =
#(lambda (grob)
(let ((text (ly:grob-property grob 'text)))
(grob-interpret-markup grob
#{ \markup \concat { #text "\"" } #})))
\asdf
}
{
\override Score.BarNumber.before-line-breaking =
#(lambda (grob)
(let ((text (ly:grob-property grob 'text)))
(ly:grob-set-property! grob 'text
#{ \markup \concat { #text "\"" } #})))
\asdf
}
%%%%
-- Aaron Hill