lilypond-user
[Top][All Lists]
Advanced

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

Re: concatenate BarNumber and string (\")?


From: Lukas-Fabian Moser
Subject: Re: concatenate BarNumber and string (\")?
Date: Sat, 25 Sep 2021 17:10:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

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

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