lilypond-user
[Top][All Lists]
Advanced

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

Changing every grob's color in a staff


From: Maurizio Tomasi
Subject: Changing every grob's color in a staff
Date: Fri, 11 Nov 2005 17:41:28 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hello to everybody,

  I am writing separate parts of Schubert's "Salve Regina" 
for my chorus. I would like to include every staff in the 
scores, but use a black color for the part itself and a 
gray color for the others.

So, for instance, the score for tenor voices should use a 
black color for the tenor staff and gray color for sopranos, 
altos and basses.

My first try was to write a function that set manually the 
color for each possible grob in the Staff and Voice context,
but this is boring and not elegant at all.

My next idea was to write a Scheme function which changes 
the color property of each grob in a Staff, but I have 
problem in implementing it. I used something like:

#(define (gray-grob grob grob-origin context)
  (set! (ly:grob-property grob 'color) (x11-color 'grey)))

...

\new Staff {

        \set Staff.instrument = "Contralti"

        \applyoutput #gray-grob

        (notes...)
}

but unfortunately \applyoutput works on the first grob 
only. How could I tell Lilypond to use "gray-grob" on 
every grob on the staff?

Thanks in advance,
  Maurizio Tomasi.






reply via email to

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