coloring notes with more voices in a staff

2024-03-18 Thread Go77

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

2024-03-19 Thread Go77

Dear William, Aaron and Pierre,

thank you so much for your quick reply.

I ended up writing it using the hint by Aaron like this (which I find 
makes writing the individual voices easier and also 'flipping' the color 
over to the other voice):


/\version "2.24.3"
\relative c'
  {
 f2( g4.)
 << { \override NoteHead.color = #red
  g8 | f4 f4 g8 a a4 | a2. } \\
    { d,8 | d4 d4 e8 f f4 | f2( e4) } >>
 a8 r

   }
/

which gives:

Thanks again,
Joop


On 18-03-2024 19:06, Pierre Perol-Schneider wrote:

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




draw box around score

2024-03-22 Thread Go77

Hi all,

I tried to find how to draw a box around a piece of music. Looked 
through the manual, snippets etc, but didn't find out how to do this 
yet. See below what I mean. Any suggestions?


Joop



Re: draw box around score

2024-03-22 Thread Go77

Hello Leo,

I tried your suggestion, but it doesn't put the box around the header. I 
would like to include the header as well. Something with page formatting 
maybe?


Joop

On 22-03-2024 15:09, Leo Correia de Verdier wrote:

Sorry, I got a fudged quote-apostrophe in last answer. It should be:

\markup \box \score { c'1 }


22 mars 2024 kl. 15:06 skrev Leo Correia de Verdier 
:

Hi Joop!

Do you mean something like
\markup \box \score { c’1 }

HTH
/Leo


22 mars 2024 kl. 14:40 skrev Go77 :


Hi all,

I tried to find how to draw a box around a piece of music. Looked through the 
manual, snippets etc, but didn't find out how to do this yet. See below what I 
mean. Any suggestions?

Joop









Re: draw box around score

2024-03-22 Thread Go77

Ah, perfect!

This works, Valentin.

Thanks!
Joop

On 22-03-2024 20:47, Valentin Petzel wrote:

Or rather

#(define-markup-command (book-title layout props) ()
(interpret-markup
 layout props
 (ly:output-def-lookup layout 'bookTitleMarkup empty-markup)))

\markup \box \column {
   \override
   #'(
 (header:title . "The title")
 (header:composer . "The composer")
   )
   \book-title
   \score { c'1 }
}

Cheers,
Valentin

Am Freitag, 22. März 2024, 20:46:16 CET schrieb Valentin Petzel:

Hello Joop,

this would be hard to do, as this is tied to the page breaking algorithm.
Rather directly draw your header in your markup:

#(define-markup-command (book-title layout props) ()
(interpret-markup
 layout props
 (ly:output-def-lookup layout 'bookTitleMarkup empty-markup)))

\markup \box \center-column {
   \override
   #'(
 (header:title . "The title")
 (header:composer . "The composer")
   )
   \book-title
   \score { c'1 }
}

Cheers,
Valentin

Am Freitag, 22. März 2024, 19:32:05 CET schrieb Go77:

Hello Leo,

I tried your suggestion, but it doesn't put the box around the header. I
would like to include the header as well. Something with page formatting
maybe?

Joop

On 22-03-2024 15:09, Leo Correia de Verdier wrote:

Sorry, I got a fudged quote-apostrophe in last answer. It should be:

\markup \box \score { c'1 }


22 mars 2024 kl. 15:06 skrev Leo Correia de Verdier
:

Hi Joop!

Do you mean something like
\markup \box \score { c’1 }

HTH
/Leo


22 mars 2024 kl. 14:40 skrev Go77 :


Hi all,

I tried to find how to draw a box around a piece of music. Looked
through the manual, snippets etc, but didn't find out how to do this
yet. See below what I mean. Any suggestions?

Joop