Hi,

Am 25.09.21 um 16:30 schrieb padovani:

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.

It would be possible to deal with the stencil, but at that point, it's already "some graphic", not an easily modifiable string or markup.

You could hook into barNumberFormatter:

\version "2.23.4"

#(define* (my-bar-number-function . all-parameters)
   (let ((standard-barnumber
          (apply robust-bar-number-function all-parameters)))
     #{ \markup \concat { #standard-barnumber "\"" } #} ))


\layout {
  \set Score.barNumberFormatter = #my-bar-number-function
}

{
  \repeat unfold 120 c'4
}

I'm cheating a bit here: The bar number formatter functions are called with a bunch of arguments which I don't want to see here. So I hide them in a catch-all parameter using Guile's feature of optional function arguments.

Here, robust-bar-number-function is the standard choice for bar numbers, as can be seen in ly/engraver-init.ly (and its definition is in scm/translation-functions.scm).

Lukas


Reply via email to