Re: color change working in only upper staff (solved)

2022-07-21 Thread Jim Cline
sorry to all who had responded to this question (with better solutions 
than mine).  For some reason I didn't get notified of these posts so I 
didn't see them until now.






Re: color change working in only upper staff (solved)

2022-07-21 Thread Jim Cline
I discovered one needs to override the color change within each voice, 
rather than in the staff definition.  Probably it's somewhere in the 
documentation, though I could not find it.  Here is the working version:


\version "2.20.0"

upper = \relative c'' {
  \override Fingering.color = #red
  \clef treble
  \key g \major
  \time 3/4


a-1 cis' \tuplet 3/2 {8~ }


}

lower = \relative c {
  \override Fingering.color = #red
  \clef bass
  \key g \major
  \time 3/4

<< { \override Fingering.color = #red f'1}-2\\{\override Fingering.color = 
#red r4. e32-1 cis-2 a-4 f-1 d2-2}>>




}

\score {
  \new PianoStaff <<
\set PianoStaff.instrumentName = #"Piano  "
\new Staff = "upper" \upper
\new Staff = "lower" \lower
  >>
  \layout { }
  \midi { }
}





Re: color change working in only upper staff

2022-07-18 Thread Pierre Perol-Schneider
Hi William, hi Jim,

Le lun. 18 juil. 2022 à 16:38, William Rehwinkel <
will...@williamrehwinkel.net> a écrit :

> Hey Jim,
>
> To be honest, I'm not sure why the example you posted doesn't work, but I
> was able to find a workaround by using \contexts to apply the override to
> each staff, like so.
>
Using << { } // { } >> creates additional voices, so that pevious
oveerides  cannot apply

> \version "2.20.0"
>
> upper = \relative c'' { % remove \override
>   \clef treble
>   \key c \major
>   \time 4/4
>
> a-1 cis' \tuplet 3/2 {8~ }
>
>
> }
>
> lower = \relative c { % remove \override
>   \clef bass
>   \key c \major
>   \time 4/4
>
> <<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>
>
> }
>
> \score {
>   \new PianoStaff <<
> \set PianoStaff.instrumentName = #"Piano  "
> \new Staff = "upper" \upper
> \new Staff = "lower" \lower
>   >>
>   *\layout { *
> *\context {*
> *\Staff*
> *\override Fingering.color = #red*
> *}*
> *  }*
>   \midi { }
> }
>
Staff context is not needed here (see
https://lilypond.org/doc/v2.20/Documentation/internals/fingering_005fengraver
)

Here's a modified code with few shorcuts:

\version "2.20"

upper = \relative { %% <= c'' not needed
  %\override Fingering.color = #red
  %\clef treble %% <= default clef, not needed
  \key c \major
  %\time 4/4 %% <= default time signature, not needed
  a'-1 cis'  \tuplet 3/2 { 8~ q q } %% <= shorter chords
}

lower = \relative { %% <= c not needed
  %\override Fingering.color = #red
  \clef bass
  \key c \major
  %\time 4/4 %% <= default time signature, not needed
  << { f'1-2 } \\ { r4. e32-1 cis-2 a-4 f-1 d2-2 } >>
}

\score {
  \new PianoStaff <<
%\set PianoStaff.instrumentName = #"Piano  " %% <= see hereunder
\new Staff = "upper" \upper
\new Staff = "lower" \lower
  >>
  \layout {
\context {
\Voice
\override Fingering.color = #red
}
\context {
\PianoStaff
instrumentName = #"Piano"
\override InstrumentName.padding = #2 %% <= more accurate than
spaces
}
  }
  \midi { }
}

Cheers,
Pierre


Re: color change working in only upper staff

2022-07-18 Thread Pierre Perol-Schneider
Hi William, hi Jim,


Le lun. 18 juil. 2022 à 16:38, William Rehwinkel <
will...@williamrehwinkel.net> a écrit :

> Hey Jim,
>
> To be honest, I'm not sure why the example you posted doesn't work, but I
> was able to find a workaround by using \contexts to apply the override to
> each staff, like so.
>
Using << { } // { } >> creates addition


> \version "2.20.0"
>
> upper = \relative c'' { % remove \override
>   \clef treble
>   \key c \major
>   \time 4/4
>
> a-1 cis' \tuplet 3/2 {8~ }
>
>
> }
>
> lower = \relative c { % remove \override
>   \clef bass
>   \key c \major
>   \time 4/4
>
> <<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>
>
> }
>
> \score {
>   \new PianoStaff <<
> \set PianoStaff.instrumentName = #"Piano  "
> \new Staff = "upper" \upper
> \new Staff = "lower" \lower
>   >>
>   *\layout { *
> *\context {*
> *\Staff*
> *\override Fingering.color = #red*
> *}*
> *  }*
>   \midi { }
> }
>
>
> On 7/18/22 09:36, Jim Cline wrote:
>
> Hi David, thanks, I have attached a 1-measure example that illustrates the
> problem.  The upper staff is showing the requested color for the
> fingering.  I can see now that it has to do with the <<{}\\{}>> construct.
> The override does not apply to objects within << >> apparently.  Any
> suggestions will be appreciated.  regards, Jim
>
>
>
> \version "2.20.0"
>
> upper = \relative c'' {
>   \override Fingering.color = #red
>   \clef treble
>   \key c \major
>   \time 4/4
>
> a-1 cis' \tuplet 3/2 {8~ }
>
>
> }
>
> lower = \relative c {
>   \override Fingering.color = #red
>   \clef bass
>   \key c \major
>   \time 4/4
>
> <<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>
>
> }
>
> \score {
>   \new PianoStaff <<
> \set PianoStaff.instrumentName = #"Piano  "
> \new Staff = "upper" \upper
> \new Staff = "lower" \lower
>   >>
>   \layout { }
>   \midi { }
> }
>
> --
> William Rehwinkel
> william@williamrehwinkel.nethttps://williamrehwinkel.net
>
>


Re: color change working in only upper staff

2022-07-18 Thread William Rehwinkel

Hey Jim,

To be honest, I'm not sure why the example you posted doesn't work, but 
I was able to find a workaround by using \contexts to apply the override 
to each staff, like so.


\version "2.20.0"

upper = \relative c'' { % remove \override
  \clef treble
  \key c \major
  \time 4/4

a-1 cis' \tuplet 3/2 {8~ }


}

lower = \relative c { % remove \override
  \clef bass
  \key c \major
  \time 4/4

<<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>

}

\score {
  \new PianoStaff <<
    \set PianoStaff.instrumentName = #"Piano  "
    \new Staff = "upper" \upper
    \new Staff = "lower" \lower
  >>
*\layout { **
**    \context {**
**    \Staff**
**    \override Fingering.color = #red**
**    }**
**  }*
  \midi { }
}


On 7/18/22 09:36, Jim Cline wrote:
Hi David, thanks, I have attached a 1-measure example that illustrates 
the problem.  The upper staff is showing the requested color for the 
fingering.  I can see now that it has to do with the <<{}\\{}>> 
construct.
The override does not apply to objects within << >> apparently.  Any 
suggestions will be appreciated.  regards, Jim




\version "2.20.0"

upper = \relative c'' {
  \override Fingering.color = #red
  \clef treble
  \key c \major
  \time 4/4

a-1 cis' \tuplet 3/2 {8~ }


}

lower = \relative c {
  \override Fingering.color = #red
  \clef bass
  \key c \major
  \time 4/4

<<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>

}

\score {
  \new PianoStaff <<
    \set PianoStaff.instrumentName = #"Piano  "
    \new Staff = "upper" \upper
    \new Staff = "lower" \lower
  >>
  \layout { }
  \midi { }
}


--
William Rehwinkel

will...@williamrehwinkel.net
https://williamrehwinkel.net


Re: color change working in only upper staff

2022-07-18 Thread Francesco Napoleoni
> lower = \relative c {
>\override Fingering.color = #red

This line could be changed to read

>\override Staff.Fingering.color = #red

which “speaks” to the right context.

You could also replace the two \override with something like this:

> \score {
>\new PianoStaff <<
>  \set PianoStaff.instrumentName = #"Piano  "
>  \override PianoStaff.Fingering.color = #red

which affects all the Staff contexts included.

Cheers
Francesco Napoleoni






Re: color change working in only upper staff

2022-07-18 Thread Jim Cline
Hi David, thanks, I have attached a 1-measure example that illustrates the 
problem.  The upper staff is showing the requested color for the 
fingering.  I can see now that it has to do with the <<{}\\{}>> construct.
The override does not apply to objects within << >> apparently.  Any 
suggestions will be appreciated.  regards, Jim




\version "2.20.0"

upper = \relative c'' {
  \override Fingering.color = #red
  \clef treble
  \key c \major
  \time 4/4

a-1 cis' \tuplet 3/2 {8~ }


}

lower = \relative c {
  \override Fingering.color = #red
  \clef bass
  \key c \major
  \time 4/4

<<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>

}

\score {
  \new PianoStaff <<
\set PianoStaff.instrumentName = #"Piano  "
\new Staff = "upper" \upper
\new Staff = "lower" \lower
  >>
  \layout { }
  \midi { }
}\version "2.20.0"

upper = \relative c'' {
  \override Fingering.color = #red
  \clef treble
  \key c \major
  \time 4/4

a-1 cis' \tuplet 3/2 {8~ }


}

lower = \relative c {
  \override Fingering.color = #red
  \clef bass
  \key c \major
  \time 4/4
  
<<{f'1}-2\\{r4. e32-1 cis-2 a-4 f-1 d2-2}>>

}

\score {
  \new PianoStaff <<
\set PianoStaff.instrumentName = #"Piano  "
\new Staff = "upper" \upper
\new Staff = "lower" \lower
  >>
  \layout { }
  \midi { }
}

Re: color change working in only upper staff

2022-07-18 Thread David Kastrup
Jim Cline  writes:

> I want to change the fingering color to red in my piano score.
> Using
>
> upper = \relative c'' {
>\override Fingering.color = #red
>
> for the upper staff works, but adding the same for the lower staff
>
> lower = \relative c {
>   \override Fingering.color = #red
>
> leaves the fingering in black in the lower staff.  The compiler gives
> no error message about it.  I tried commenting out the first override
> to see if that has some effect on the second one, but no.

You need to come up with an actually compiling full example showing the
problem.  The above is not useful and most certainly does not show
anything related to the actual problem.

-- 
David Kastrup



color change working in only upper staff

2022-07-18 Thread Jim Cline

I want to change the fingering color to red in my piano score.
Using

upper = \relative c'' {
   \override Fingering.color = #red

for the upper staff works, but adding the same for the lower staff

lower = \relative c {
  \override Fingering.color = #red

leaves the fingering in black in the lower staff.  The compiler gives no 
error message about it.  I tried commenting out the first override to see 
if that has some effect on the second one, but no.