Hi
I am working on some Haydn piano music and want to distinguish between
urtext and my version music. (I plan to write out the variations I use when
I repeat.) A neat way to do it would be to change the colour of the staff
lines. I can't find a way that works. I can change the colour easily enough
at the beginning of the staff, but it doesn't seem possible to change it
thereafter. For what I want to achieve, it would be fine to start a new
staff but it would need to look like a continuation of a previous one. Here
is what I've tried so far. I'd like the final version to have two
contiguous bars where the staff colour matches what's indicated by the
markup.
Thanks in advance.
Paul
\version "2.22.0"

% Change staff color
musicA = {
    \new PianoStaff  <<
        { \new Staff = "right"  {
            \accidentalStyle modern-cautionary
            \override Staff.StaffSymbol.color = #blue
            { c'1-\markup "blue" }
          } \new Staff = "rong" { % Calling this one "right" too, doesn't
change anything.
              \override Staff.StaffSymbol.color = #magenta
            { c'1-\markup "Magenta" }
        }
        }
    >>
}
musicB = {
    \new PianoStaff  <<
        { \new Staff = "right"  {
            \accidentalStyle modern-cautionary
            \override Staff.StaffSymbol.color = #blue
            { c'1-\markup "blue" }
              \override Staff.StaffSymbol.color = #magenta
            { c'1-\markup "Magenta" }
        }
        }
    >>
}

\score {
    { \musicA \musicB }
     \layout { indent = #0
                  \context { \Staff \RemoveEmptyStaves }
     }
}

Reply via email to