---------- Forwarded message ----------
> From: Niols <
address@hidden>
> To:
address@hidden> Date: Wed, 15 Apr 2020 01:13:11 +0200
> Subject: Bar numbers “repeat aware” for music for dancing
> Hello everyone,
>
> This is my first message on this mailing list and I hope I do it
> correctly.
Welcome!
> For such tunes, we are not so interested in the “usual” printed bar
> numbers, but rather in the bar numbers (“repeat aware”) from the dance.
> In particular, a repeat in the music does not mean a repeat in the
> dance: if the first eight bars are repeated in the music, I would like
> the bar numbers to go from 1 to 8 and then directly to 17.
>
> I am unsure how to deal with that in an automated and clean way.
I'm not aware of an automated way.
On the other hand, I find that it is not really much trouble to just reset the bar numbers as you need to. You're already writing code for \repeat volta and \alternative and possibly \bar "||" and so forth, so what is one additional line of code to reset the bar number?
> Also, I would want to not print one bar number but all the bar numbers
> within the repeat. If the first eight bars are repeated, I would like to
> print 1 9, 2 10, 3 11, etc. This is less a priority for me but I guess
> it is linked to the same problem. Would you have pointers for that too?
So, here is a function I use to show duplicate bar numbers.
You pass in the starting bar number, and the number of repeated bars.
Also, the ones I use for triple and quadruple numbers.
Usage:
\set Score.currentBarNumber = #42
\set Score.barNumberFormatter = #(double-bar-number 16)
#(define (double-bar-number increase-amount)
(lambda (barnum measure-pos alt-number context)
#{
\markup
\override #'(baseline-skip . 2)
\center-column {
#(robust-bar-number-function barnum measure-pos alt-number context)
#(robust-bar-number-function
(+ increase-amount barnum) measure-pos alt-number context)
}
#}
)
)
#(define (triple-bar-number increase-amount)
(lambda (barnum measure-pos alt-number context)
#{
\markup
\override #'(baseline-skip . 2)
\center-column {
#(robust-bar-number-function barnum measure-pos alt-number context)
#(robust-bar-number-function
(+ increase-amount barnum) measure-pos alt-number context)
#(robust-bar-number-function
(+ increase-amount (+ increase-amount barnum)) measure-pos alt-number context)
}
#}
)
)
#(define (triple-bar-number-plus-offset increase-amount offset-amount)
(lambda (barnum measure-pos alt-number context)
#{
\markup
\override #'(baseline-skip . 2)
\center-column {
#(robust-bar-number-function barnum measure-pos alt-number context)
#(robust-bar-number-function
(+ increase-amount barnum) measure-pos alt-number context)
#(robust-bar-number-function
(+ increase-amount (+ increase-amount (+ barnum offset-amount))) measure-pos alt-number context)
}
#}
)
)
#(define (quadruple-bar-number increase-amount)
(lambda (barnum measure-pos alt-number context)
#{
\markup \override #'(baseline-skip . 2)
{
\center-column {
#(robust-bar-number-function barnum measure-pos alt-number context)
#(robust-bar-number-function
(+ increase-amount
(+ increase-amount barnum)) measure-pos alt-number context)
}
\center-column {
#(robust-bar-number-function
(+ increase-amount barnum) measure-pos alt-number context)
#(robust-bar-number-function
(+ increase-amount
(+ increase-amount
(+ increase-amount barnum))) measure-pos alt-number context)
}
}
#}
)
)
>
> Thank you in advance for your time!
>
> Best regards,
> — Nicolas “Niols” Jeannerod
>