This is wonderful, Kieren.
What about letters without numbers, which is why I started this thread?
I will see if I can modify your code to get that. Letters only shouldn't
require decrementing bar numbers.
Paul
On 12/23/25 8:54 AM, Kieren MacMillan wrote:
and this at least removes the fragility around decrementing the bar number:
%%% SNIPPET BEGINS
\version "2.25.25"
\layout {
system-count = 3
}
increaseBarNumber =
#(define-music-function (par loc addm) (integer?)
(make-apply-context
(lambda (context)
(let* ((where (ly:context-property-where-defined context
'currentBarNumber))
(cbn (ly:context-property where 'currentBarNumber)))
(ly:context-set-property! where 'currentBarNumber (+ addm cbn))))))
altBNs = {
\set Score.alternativeNumberingStyle = #'numbers-with-letters
\set Score.startRepeatBarType = "|"
\set Score.endRepeatBarType = "|"
\omit Score.VoltaBracket
}
regBNs = {
\unset Score.alternativeNumberingStyle
\undo \omit Score.VoltaBracket
\set Score.startRepeatBarType = ".|:"
\set Score.endRepeatBarType = ":|."
}
music = \relative c' {
\override Score.BarNumber.break-visibility = ##(#f #t #t)
\set Score.currentBarNumber = #46
c4 d e f
c4 d e f |
\altBNs
\repeat volta 5 {
{ c4 d e f }
\increaseBarNumber #-1
\alternative {
{ c4 d e f }
{ c4 d e f }
{ c4 d e f }
{ c4 d e f }
{ c4 d e f }
}
}
\regBNs
c1
\repeat volta 2 {
c1
\alternative {
{ c1 }
{ c1 }
}
}
c1 \bar "|."
}
{ \music }
%%% SNIPPET ENDS
__________________________________________________
My work day may look different than your work day. Please do not feel obligated
to read or respond to this email outside of your normal working hours.