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

List:       lilypond-user
Subject:    Re: bar number alignment
From:       Jean ABOU SAMRA <jean () abou-samra ! fr>
Date:       2019-05-26 8:42:09
Message-ID: 6E82DF43-B609-46F1-A477-95C48134B970 () abou-samra ! fr
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,
I'm the one who asked this question at first on -users-fr. Thank you very much for \
this nice tweaking! As bar numbers appearing at the end of a line should also be \
centered, I ultimately settled on this code :

\version "2.21.0"

\layout {
  \context {
    \Score
    \override BarNumber.break-visibility = ##(#t #t #t)
    %% barNumberVisibility = #(every-nth-bar-number-visible 3) % for purpose of \
demonstration -- uncomment if desired  \override BarNumber.stencil = \
#(make-stencil-circler 0.1 0.25 ly:text-interface::print)  \override \
BarNumber.self-alignment-X =  #(lambda (grob)
      (define bd (ly:item-break-dir grob))
        (cond
          ( (= bd 1) 0.8)
          ( (= bd 0) 0)
          ( (= bd -1) 0) )) 
  }
}

% now bar numbers are nicely aligned
\new StaffGroup <<
  { \repeat unfold 50 c'1 }
  { \repeat unfold 50 c'1 }
> > 

Many thanks for your help.
Best regards,
Jean Abou Samra.


> Le 26 mai 2019 Ã  09:08, Pierre Perol-Schneider <pierre.schneider.paris@gmail.com> \
> a écrit : 
> Close! Thank you Aaron. 
> I'd change the sign though : \override Score.BarNumber.self-alignment-X = #(lambda \
> (grob) (+ (ly:item-break-dir grob)))  Cheers,
> Pierre
> 
> 
> Le dim. 26 mai 2019 Ã  00:23, Aaron Hill <lilypond@hillvisions.com \
> <mailto:lilypond@hillvisions.com>> a écrit : On 2019-05-25 2:58 pm, Pierre \
> Perol-Schneider wrote:
> > Hi,
> > On the french list a user would like to get bar numbers -- every 3 bars 
> > --
> > center aligned exept when systems start.
> > Is there a way, such as \alterBroken for spanners, that could help ?
> > Snippet (with \alterBroken just as an example):
> > 
> > \version "2.21.0"
> > {
> > \override Score.BarNumber.break-visibility = ##(#t #t #t)
> > \set Score.barNumberVisibility = #(every-nth-bar-number-visible 3)
> > \override Score.BarNumber.stencil = #(make-stencil-circler 0.1 0.25
> > ly:text-interface::print)
> > \override Score.BarNumber.self-alignment-X = 0
> > 
> > %% wanted:
> > %\alterBroken self-alignment-X #(list 0 1) Score.BarNumber
> > 
> > \set Score.currentBarNumber = 1111
> > \repeat unfold 50 c'1
> > }
> > 
> 
> Would something like this help?
> 
> %%%%
> \override Score.BarNumber.self-alignment-X =
> #(lambda (grob) (- (ly:item-break-dir grob)))
> %%%%
> 
> 
> -- Aaron Hill
> 
> _______________________________________________
> lilypond-user mailing list
> lilypond-user@gnu.org <mailto:lilypond-user@gnu.org>
> https://lists.gnu.org/mailman/listinfo/lilypond-user \
> <https://lists.gnu.org/mailman/listinfo/lilypond-user> \
> _______________________________________________ lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user


[Attachment #5 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space;" class=""><div class="">Hi,</div><div \
class="">I'm the one who asked this question at first on -users-fr. Thank you very \
much for this nice tweaking!</div><div class="">As bar numbers appearing at the end \
of a line should also be centered, I ultimately settled on this code :</div><div \
class=""><br class=""></div><div class=""><div class=""><font face="Monaco" \
class="">\version "2.21.0"</font></div><div class=""><font face="Monaco" class=""><br \
class=""></font></div><div class=""><font face="Monaco" class="">\layout \
{</font></div><div class=""><font face="Monaco" class="">&nbsp; \context \
{</font></div><div class=""><font face="Monaco" class="">&nbsp; &nbsp; \
\Score</font></div><div class=""><font face="Monaco" class="">&nbsp; &nbsp; \override \
BarNumber.break-visibility = ##(#t #t #t)</font></div><div class=""><font \
face="Monaco" class="">&nbsp; &nbsp; %% barNumberVisibility = \
#(every-nth-bar-number-visible 3) % for purpose of demonstration -- uncomment if \
desired</font></div><div class=""><font face="Monaco" class="">&nbsp; &nbsp; \
\override BarNumber.stencil = #(make-stencil-circler 0.1 0.25 \
ly:text-interface::print)</font></div><div class=""><font face="Monaco" \
class="">&nbsp; &nbsp; \override BarNumber.self-alignment-X =</font></div><div \
class=""><font face="Monaco" class="">&nbsp; &nbsp; #(lambda (grob)</font></div><div \
class=""><font face="Monaco" class="">&nbsp; &nbsp; &nbsp; (define bd \
(ly:item-break-dir grob))</font></div><div class=""><font face="Monaco" \
class="">&nbsp; &nbsp; &nbsp; &nbsp; (cond</font></div><div class=""><font \
face="Monaco" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( (= bd 1) \
0.8)</font></div><div class=""><font face="Monaco" class="">&nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; ( (= bd 0) 0)</font></div><div class=""><font face="Monaco" \
class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ( (= bd -1) 0) ))&nbsp;</font></div><div \
class=""><font face="Monaco" class="">&nbsp; }</font></div><div class=""><font \
face="Monaco" class="">}</font></div><div class=""><font face="Monaco" class=""><br \
class=""></font></div><div class=""><font face="Monaco" class="">% now bar numbers \
are nicely aligned</font></div><div class=""><font face="Monaco" class="">\new \
StaffGroup &lt;&lt;</font></div><div class=""><font face="Monaco" class="">&nbsp; { \
\repeat unfold 50 c'1 }</font></div><div class=""><font face="Monaco" class="">&nbsp; \
{ \repeat unfold 50 c'1 }</font></div><div class=""><font face="Monaco" \
class="">&gt;&gt;</font></div></div><div class=""><br class=""></div><div \
class="">Many thanks for your help.</div><div class="">Best regards,</div><div \
class="">Jean Abou Samra.</div><div class=""><br class=""></div><br \
class=""><div><blockquote type="cite" class=""><div class="">Le 26 mai 2019 Ã  09:08, \
Pierre Perol-Schneider &lt;<a href="mailto:pierre.schneider.paris@gmail.com" \
class="">pierre.schneider.paris@gmail.com</a>&gt; a écrit :</div><br \
class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div \
class="">Close! Thank you Aaron. <br class=""></div><div class="">I'd change the sign \
though :  \override Score.BarNumber.self-alignment-X = #(lambda (grob) (+ \
(ly:item-break-dir grob))) <br class=""></div><div class="">Cheers,</div><div \
class="">Pierre<br class=""></div><div class=""><br class=""></div></div><br \
class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le&nbsp;dim. 26 \
mai 2019 Ã &nbsp;00:23, Aaron Hill &lt;<a href="mailto:lilypond@hillvisions.com" \
class="">lilypond@hillvisions.com</a>&gt; a écrit&nbsp;:<br \
class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2019-05-25 2:58 pm, \
Pierre Perol-Schneider wrote:<br class=""> &gt; Hi,<br class="">
&gt; On the french list a user would like to get bar numbers -- every 3 bars <br \
class=""> &gt; --<br class="">
&gt; center aligned exept when systems start.<br class="">
&gt; Is there a way, such as \alterBroken for spanners, that could help ?<br \
class=""> &gt; Snippet (with \alterBroken just as an example):<br class="">
&gt; <br class="">
&gt; \version "2.21.0"<br class="">
&gt; {<br class="">
&gt;&nbsp; &nbsp;\override Score.BarNumber.break-visibility = ##(#t #t #t)<br \
class=""> &gt;&nbsp; &nbsp;\set Score.barNumberVisibility = \
#(every-nth-bar-number-visible 3)<br class=""> &gt;&nbsp; &nbsp;\override \
Score.BarNumber.stencil = #(make-stencil-circler 0.1 0.25<br class=""> &gt; \
ly:text-interface::print)<br class=""> &gt;&nbsp; &nbsp;\override \
Score.BarNumber.self-alignment-X = 0<br class=""> &gt; <br class="">
&gt;&nbsp; &nbsp;%% wanted:<br class="">
&gt;&nbsp; &nbsp;%\alterBroken self-alignment-X #(list 0 1) Score.BarNumber<br \
class=""> &gt; <br class="">
&gt;&nbsp; &nbsp;\set Score.currentBarNumber = 1111<br class="">
&gt;&nbsp; &nbsp;\repeat unfold 50 c'1<br class="">
&gt; }<br class="">
&gt; <br class="">
<br class="">
Would something like this help?<br class="">
<br class="">
%%%%<br class="">
&nbsp; &nbsp;\override Score.BarNumber.self-alignment-X =<br class="">
&nbsp; &nbsp; &nbsp;#(lambda (grob) (- (ly:item-break-dir grob)))<br class="">
%%%%<br class="">
<br class="">
<br class="">
-- Aaron Hill<br class="">
<br class="">
_______________________________________________<br class="">
lilypond-user mailing list<br class="">
<a href="mailto:lilypond-user@gnu.org" target="_blank" \
class="">lilypond-user@gnu.org</a><br class=""> <a \
href="https://lists.gnu.org/mailman/listinfo/lilypond-user" rel="noreferrer" \
target="_blank" class="">https://lists.gnu.org/mailman/listinfo/lilypond-user</a><br \
class=""> </blockquote></div>
_______________________________________________<br class="">lilypond-user mailing \
list<br class=""><a href="mailto:lilypond-user@gnu.org" \
class="">lilypond-user@gnu.org</a><br \
class="">https://lists.gnu.org/mailman/listinfo/lilypond-user<br \
class=""></div></blockquote></div><br class=""></body></html>



_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


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

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