On 2021-03-27 1:04 pm, Philippe ZELLER wrote:
Dear lilypond fellow users,
it sometimes occurs in barock music that only every other barline is
visible, (see e.g. Haendel's Salomo, choir at the end of Act II ) or
that
every other barline is printed in reduced size.(see e.g. Bach Mass in
H-moll, nr 27 "dona nobis pacem" ).
Is there a way to get this result in lilypond ?
I first tried
\set Score.barLineVisibility = #(every-nth-bar-number-visible 2)
that I made up after an equivalent syntax for barNumber, but to no
avail.
Maybe I didn't put it in the right context ?
Finally I used a rather complicated procedure based on
global = {
\repeat unfold 24 { s2. \once \override Staff.BarLine.transparent
=
##t s2. \once \override Staff.BarLine.transparent = ##f }
}
which works but is not fully compatible, for example it does not work
with
multiMeasureRests.
Many thanks in advance for your suggestions !
An engraver should be able to do the work:
%%%%
\version "2.22.0"
hideEveryOtherBarLine =
#(lambda (ctx)
(define (bar-num)
(ly:context-property ctx 'currentBarNumber))
(make-engraver
(acknowledgers
((bar-line-interface trans grob source)
(if (= 0 (modulo (bar-num) 2))
(ly:grob-set-property! grob 'transparent #t))))))
\new Staff
\with { \consists \hideEveryOtherBarLine }
\repeat unfold 10 { b'1 }
%%%%
-- Aaron Hill