[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re:
From:       Philippe ZELLER <peliphi () gmail ! com>
Date:       2021-03-28 13:31:50
Message-ID: CA+5dANdX6e-hJMrj5c28R576R9dhdYXTLHrZ1P-UMmudZndY4Q () mail ! gmail ! com
[Download RAW message or body]

Dear Aaron,
I found a solution. : trick the "hideEveryOtherBarLine" mechanism so it
believes the bar number where the extra "|." bar is located is odd.

%%%%%%%%
a2. |
b2 \fermata  _"Fine"  \set Score.currentBarNumber = #55  \bar "|."  r4
\set Score.currentBarNumber = #55  |
a2 b4 |
%%%%%%

Without the double change of bar numbers the "|." bar is made transparent
by \hideEveryOtherBarLine .

Thanks a lot again :-)
Philippe

Le dim. 28 mars 2021 à 01:54, Philippe ZELLER <peliphi@gmail.com> a écrit :

> 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,
> Philippe
>
> Le 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
>
>

[Attachment #3 (text/html)]

<div dir="ltr">Dear Aaron,<div>I found a solution. : trick the \
&quot;hideEveryOtherBarLine&quot; mechanism so it believes the bar number where the \
extra &quot;|.&quot; bar is located is \
odd.</div><div><br></div><div>%%%%%%%%</div><div>a2. |  </div><div>b2 \fermata   \
_&quot;Fine&quot;   \set Score.currentBarNumber = #55   \bar &quot;|.&quot;   r4  \
</div><div>\set Score.currentBarNumber = #55   |<br></div><div>a2 b4 \
|</div><div>%%%%%%</div><div><br></div><div>Without the double change of bar numbers \
the &quot;|.&quot; bar is made transparent by \hideEveryOtherBarLine

.  </div><div><br></div><div>Thanks a lot again \
:-)</div><div>Philippe</div></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">Le  dim. 28 mars 2021 Ã   01:54, Philippe ZELLER &lt;<a \
href="mailto:peliphi@gmail.com">peliphi@gmail.com</a>&gt; a écrit  \
:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear \
Aaron,  <div>this is brilliant ! I&#39;m impressed as I would never have been able to \
write code like this myself.</div><div>Plus : your solution is compatible with \
multiMeasureRests.</div><div><br></div><div>Yet another challenge for you though :-) \
:</div><div>In the middle of the piece there is a \bar &quot;|.&quot; occurring after \
the second beat, and when using your custom engraver this barline becomes \
invisible.</div><div>How can I make it visible again ?</div><div><br></div><div>Best \
regards,</div><div>Philippe  </div></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">Le  sam. 27 mars 2021 Ã   21:52, Aaron Hill &lt;<a \
href="mailto:lilypond@hillvisions.com" \
target="_blank">lilypond@hillvisions.com</a>&gt; a écrit  :<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">On 2021-03-27 1:04 pm, Philippe ZELLER wrote:<br> \
&gt; Dear lilypond fellow users,<br> &gt; it sometimes occurs in barock music that \
only every other barline is<br> &gt; visible, (see e.g. Haendel&#39;s Salomo, choir \
at the end of Act II ) or <br> &gt; that<br>
&gt; every other barline is printed in reduced size.(see e.g. Bach Mass in<br>
&gt; H-moll, nr 27 &quot;dona nobis pacem&quot; ).<br>
&gt; Is there a way to get this result in lilypond ?<br>
&gt; <br>
&gt; I first tried<br>
&gt; \set Score.barLineVisibility = #(every-nth-bar-number-visible 2)<br>
&gt; that I made up after an equivalent syntax for barNumber, but to no <br>
&gt; avail.<br>
&gt; Maybe I didn&#39;t put it in the right context ?<br>
&gt; <br>
&gt; Finally I used a rather complicated procedure based on<br>
&gt; global = {<br>
&gt;           \repeat unfold 24 { s2. \once \override Staff.BarLine.transparent <br>
&gt; =<br>
&gt; ##t   s2. \once \override Staff.BarLine.transparent = ##f }<br>
&gt;              }<br>
&gt; which works but is not fully compatible, for example it does not work <br>
&gt; with<br>
&gt; multiMeasureRests.<br>
&gt; <br>
&gt; Many thanks in advance for your suggestions !<br>
<br>
An engraver should be able to do the work:<br>
<br>
%%%%<br>
\version &quot;2.22.0&quot;<br>
<br>
hideEveryOtherBarLine =<br>
#(lambda (ctx)<br>
     (define (bar-num)<br>
      (ly:context-property ctx &#39;currentBarNumber))<br>
     (make-engraver<br>
      (acknowledgers<br>
        ((bar-line-interface trans grob source)<br>
         (if (= 0 (modulo (bar-num) 2))<br>
           (ly:grob-set-property! grob &#39;transparent #t))))))<br>
<br>
\new Staff<br>
\with { \consists \hideEveryOtherBarLine }<br>
\repeat unfold 10 { b&#39;1 }<br>
%%%%<br>
<br>
<br>
-- Aaron Hill</blockquote></div>
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic