lilypond-user
[Top][All Lists]
Advanced

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

Re: measure numbers with letters


From: madMuze
Subject: Re: measure numbers with letters
Date: Sat, 22 Jul 2017 17:25:30 -0700 (MST)

Simon Albrecht-2 wrote
> {
>    c'1 \break
>    \once\override Score.BarNumber.text = "1A"
>    c'
> }
> does not work

In 2.18, I use

barNrSffx = #(define-music-function (parser location sffx lastNr) (string?
number?)
 #{
  \override Score.BarNumber.before-line-breaking = #(lambda (grob)
   (let*
    ( (barNrTxt (caadr (ly:grob-property grob 'text)))
     (barNr  (string->number barNrTxt))
     (barNrStr (string-append barNrTxt sffx)) )
    (ly:grob-set-property! grob 'text (if (or (<= barNr lastNr)
                    (= lastNr 0) )
                 barNrStr
                 barNrTxt )) ) )
 #}
)

in use::
% music for mm1-16, for instance, then
\set Score.currentBarNumber = 1
\barNrSffx "bis"  16 % mm1-16 again with ornaments; bar number will read
"2bis", &c.
% m17 follows and will be numbered "17" (with no suffix)

Perhaps this gives you a start. I think the tricky part is using "caadr" to
find the current BarNumber.text so it can be reused. I'm sure many people
with better knowledge and skills can improve upon this...

David



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/measure-numbers-with-letters-tp204595p204600.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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