coloring notes with more voices in a staff
Hi, I'm trying to color the note heads of a single voice in a staff. I tried to do that with the following code: /\version "2.24.3" \relative c { f'2( g4.) << { d8 | f4 f4 g16 a } { \override NoteHead.color = #red g8 | d4 d4 e16 f \revert NoteHead.color } >> a8 r4 } / This results in the noteheads of /both /voices being colored instead of only the upper one (in this case): So, is there any way to achieve my goal of coloring only the upper notes? Joop
Re: coloring notes with more voices in a staff
Dear Joop, Use \tweak color #red , like so \version "2.25.6" \relative c { f'2( g4.) << { d8 | f4 f4 g16 a } { \tweak color #red g8 | d4 d4 e16 f } >> a8 r4 } Thanks, -William On 3/18/24 12:41, Go77 wrote: Hi, I'm trying to color the note heads of a single voice in a staff. I tried to do that with the following code: /\version "2.24.3" \relative c { f'2( g4.) << { d8 | f4 f4 g16 a } { \override NoteHead.color = #red g8 | d4 d4 e16 f \revert NoteHead.color } >> a8 r4 } / This results in the noteheads of /both /voices being colored instead of only the upper one (in this case): So, is there any way to achieve my goal of coloring only the upper notes? Joop -- William Rehwinkel - Oberlin College and Conservatory '24 will...@williamrehwinkel.net PGP key: https://ftp.williamrehwinkel.net/pubkey.txt OpenPGP_signature.asc Description: OpenPGP digital signature
Re: coloring notes with more voices in a staff
On 2024-03-18 9:41 am, Go77 wrote: Hi, I'm trying to color the note heads of a single voice in a staff. I tried to do that with the following code: /\version "2.24.3" \relative c { f'2( g4.) << { d8 | f4 f4 g16 a } { \override NoteHead.color = #red g8 | d4 d4 e16 f \revert NoteHead.color } >> a8 r4 } / This results in the noteheads of /both /voices being colored instead of only the upper one (in this case): So, is there any way to achieve my goal of coloring only the upper notes? Since you did not use \\ within the << >>, there is no implicit voice creation. As it stands, you only have one voice. You can review the documentation ([1] and [2]) for more information on creating voice contexts. [1]: https://lilypond.org/doc/v2.24/Documentation/learning/i_0027m-hearing-voices [2]: https://lilypond.org/doc/v2.24/Documentation/learning/explicitly-instantiating-voices -- Aaron Hill
Re: coloring notes with more voices in a staff
Hi Joop, I'd forget voices and do: \version "2.24.3" nr = \tweak color #red \etc \relative c { f'2( g4.) 8 | <\nr d f>4 q <\nr e g>16 <\nr f a> a8 r4 } HTH, cheers, Pierre Le lun. 18 mars 2024 à 18:44, Go77 a écrit : > Hi, > > I'm trying to color the note heads of a single voice in a staff. I tried > to do that with the following code: > > > > > > > > > > > *\version "2.24.3" \relative c {f'2( g4.) << { d8 | f4 > f4 g16 a }{ \override NoteHead.color = #red g8 | > d4 d4 e16 f \revert NoteHead.color } >> a8 r4 } * > > This results in the noteheads of *both *voices being colored instead of > only the upper one (in this case): > > So, is there any way to achieve my goal of coloring only the upper notes? > > Joop > > >