Dear Pierre

Indeed, very helpful.

I also chieved coloring of notes, stems, etc. I did not want to color
lines, clef... but it works similar to what you suggest, but the solution
you proposed I did not know. Any suggestion allows me to learn more and
more about LP.

I will post my solution soon based on all input so far as it has a specific
purpose.

Thank you
Roland



On Sun, May 24, 2020, 10:51 Pierre Perol-Schneider <
pierre.schneider.pa...@gmail.com> wrote:

> Hi Roland,
>
> Le dim. 24 mai 2020 à 10:34, R.H. <roland.huettm...@gmail.com> a écrit :
>  ...
>
>> Let us assume you want the top or bass voice to be in another color.
>> Here, the way you created it seems to make this difficult to do, for
>> example to assign a different color to note heads of different voices --
>> independently of left or right hand fingering.
>>
> ...
>
> See: http://lsr.di.unimi.it/LSR/Item?id=443
> Ex.:
>
> \version "2.20.0"
>
> #(define (override-color-for-all-grobs color)
>   (lambda (context)
>    (let loop ((x all-grob-descriptions))
>     (if (not (null? x))
>      (let ((grob-name (caar x)))
>       (ly:context-pushpop-property context grob-name 'color color)
>       (loop (cdr x)))))))
>
> sop = { c''8 8 8 8 8 8 8 8 }
> alt = { c'8 8 8 8 8 8 \change Staff = LH \stemUp 8 8  }
> bas = { \clef F c8 8 8 8 8 }
>
> \new PianoStaff <<
>   \new Staff = RH <<
>     \new Voice { \voiceOne \sop }
>     \new Voice
>       \with { \applyContext #(override-color-for-all-grobs (x11-color
> 'red)) }
>       { \voiceTwo \alt }
>   >>
>   \new Staff = LH \bas
> >>
>
> HTH, cheers,
> Pierre
>

Reply via email to