lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Box around system


From: Jean Abou Samra
Subject: Re: Box around system
Date: Wed, 18 May 2022 16:02:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]