|
From: | Philippe ZELLER |
Subject: | Re: |
Date: | Sun, 28 Mar 2021 15:31:50 +0200 |
Dear Aaron,this is brilliant ! I'm impressed as I would never have been able to write code like this myself.Plus : your solution is compatible with multiMeasureRests.Yet another challenge for you though :-) :In the middle of the piece there is a \bar "|." occurring after the second beat, and when using your custom engraver this barline becomes invisible.How can I make it visible again ?Best regards,PhilippeLe sam. 27 mars 2021 à 21:52, Aaron Hill <lilypond@hillvisions.com> a écrit :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
[Prev in Thread] | Current Thread | [Next in Thread] |