Le 18/05/2022 à 15:44, Rip _Mus a écrit :
Good morning,
I really appreciate your solutions and I'm trying to impress box only
on some systems of the score.
So I'm trying to do something like \once \override
Score.System.stencil = ...
But there is no response. I've tried also with \overrideProperty, but
nothing happens.
Do you have any advice for me?
Because there is actually only one system when you do the \override.
It spans the whole score. You can't \override a grob's properties once
it has been created, and the System was created at the very beginning.
It is only much later that it is broken into several smaller systems.
You could use \alterBroken if it supported callbacks, but it doesn't
(well, they may or may not work or work partially depending on internal
details) so you need to do the work yourself:
\version "2.22.2"
#(define ((box-system-parts thickness padding parts) grob)
(let ((my-index (list-index (lambda (g)
(eq? g grob))
(ly:spanner-broken-into
(ly:grob-original grob)))))
(if (memv my-index parts)
(box-stencil
(ly:make-stencil
'()
(ly:grob-extent grob grob X)
(ly:grob-extent grob grob Y))
thickness
padding)
'())))
\layout {
\context {
\Score
\override System.stencil =
#(box-system-parts
0.2 ; thickness
0.3 ; padding
'(0 2 3))
}
}
\repeat unfold 5 {
c'1
\break
}
Valentin's approach could also be adapted to do this.
Best,
Jean