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
> <[email protected]> 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 <[email protected]
> <mailto:[email protected]>> 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
> [email protected] <mailto:[email protected]>
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> <https://lists.gnu.org/mailman/listinfo/lilypond-user>
> _______________________________________________
> lilypond-user mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/lilypond-user
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user