Hi Lilypond users,
I am currently experimenting with colored background markers (red
semitransparent box behind the staff lines), to make repetitions more
visible. A minimal example is below. It will not be optimal, a)
\startGroup \stopGroup around notes is a bit unintuitive for future
use, but as of now I don't know a way other than spanners. Ideally I
would have to write down just one command and bind my markers to the
bar lines.
I have to look more into Scheme - and here's the issue. The arguments
x-left and x-right don't make their way into
"HorizontalBracket.shorten-pair".
Here's the error message: "warning: the property 'shorten-pair' must be
of type 'pair of numbers', ignoring invalid value '(x-left . x-right)'"
Minimal code:
Thank you! My strong assumption is, it's a scope issue.
\version "2.25.80"
colorSpan =
#(define-music-function (x-left x-right color)
(number? number? color?)
#{
\once\override HorizontalBracket.stencil =
#(grob-transformer 'stencil
(lambda (grob orig)
(let* ((X-ext (ly:stencil-extent orig X))
(Y-ext (cons -4 4)))
(stencil-with-color (ly:round-filled-box X-ext Y-ext 0)
color)))) \once\override HorizontalBracket.layer = #-10
\once\override HorizontalBracket.outside-staff-priority = ##f
\once\override HorizontalBracket.Y-offset = #0
\once\override HorizontalBracket.shorten-pair = #'( x-left .
x-right) #})
\relative c' {
\colorSpan #-4 #4 #(rgb-color 1.0 0.8 0.8)
b \startGroup c \stopGroup d e | c e f d | f c d a
}