Dear LilyPonders,
I wanted to use a great coloring function by Urs Liska, but ran into a
problem with using systemStartDelimiterHierarchy.
If I color a music section, the SystemStart of the next system after
that section isn't displayed properly.
Anybody an idea how to solve this?
Attached an example.
\version "2.19.17"
colorGrob =
#(define-music-function (parser location my-grob my-color color-on)
(symbol? color? boolean?)
;; check for the boolean argument
(if color-on
;; either set the color for the grob type
#{
\temporary \override #my-grob #'color = #my-color
#}
;; or revert it
#{
\revert #my-grob #'color
#}))
colorGrobs =
#(define-music-function (parser location my-grob-list my-color color-on)
(symbol-list? color? boolean?)
(if (null? my-grob-list)
;; issue an empty music expression
#{ #}
#{
% color the first grob type of the current list
\colorGrob #(car my-grob-list) #my-color #color-on
% recursively call itself with the remainder
% of the current list.
\colorGrobs #(cdr my-grob-list) #my-color #color-on
#}))
colorMusic =
#(let ((grob-names (map car all-grob-descriptions)))
(define-music-function (parser location my-color music)
(color? ly:music?)
#{
\colorGrobs #grob-names #my-color ##t
#music
\stopStaff
\colorGrobs #grob-names #my-color ##f
\startStaff
#}))
colA = #(define-music-function(parser location music)(ly:music?)
#{
\colorMusic #(rgb-color 0.72 0 0.196) #music
#})
music = {\repeat unfold 40 a4}
\new StaffGroup {
<<
\set StaffGroup.systemStartDelimiterHierarchy =
#'(SystemStartBar (SystemStartBrace (SystemStartBracket a b)))
\new Staff \colA { <<{\voiceTwo a a\music \music}\new Voice \relative c''\colA {\music }>>}
\new Staff {\music \music}
>>
}
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user