lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lilypond-user Digest, Vol 246, Issue 40


From: Jeff Olson
Subject: Re: lilypond-user Digest, Vol 246, Issue 40
Date: Sat, 13 May 2023 17:30:02 -0600
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0

On 5/13/2023 2:07 PM, lilypond-user-request@gnu.org wrote:
Il 13/05/23 15:47, Jean Abou Samra ha scritto:
[...]
\version "2.24.1"

circleB =
\once \override NoteHead.stencil =
#(grob-transformer
  'stencil
  (lambda (grob original)
    (grob-interpret-markup
     grob
     #{
        \markup \with-outline \stencil #original
        \overlay {
          \stencil #original
          \align-on-other #X
            #CENTER \stencil #original
            #CENTER \draw-circle #1.5 #0.1 ##f 
          }
     #})))

{
  \circleB c'' \circleB c'' \circleB c''2
  \circleB c''1 \circleB c''8 \circleB a'8
  \circleB b'16 \circleB c''16 \circleB b'16 \circleB a'16
  \circleB f'2
}

You can then add \with-color "red" before \draw-circle or do other transformations.

Jean

Jean,

I tried adapting your circleB with a fill to do something like staffHighlight but with a more focused spotlight effect, especially for notes outside the staff on ledger lines where staffHighlight ordinarily doesn't go.    Here's my adaptation (with the original stencil last, so the note itself is not obliterated by the fill):

\version "2.24.1"
circleB =
\once \override NoteHead.stencil =
#(grob-transformer
  'stencil
  (lambda (grob original)
    (grob-interpret-markup
     grob
     #{
        \markup \with-outline \stencil #original
        \overlay {
          \align-on-other #X
            #CENTER \stencil #original
            #CENTER \with-color "#fcc" \draw-circle #3.5 #0.1 ##t
          \stencil #original
          }
     #})))

{  \circleB e a d' \circleB g' b' e'' }


But filling the circle obscures the staff and ledger lines (unlike the staffHighlight effect) making the circled note ambiguous (see first staff in image below).

The only workaround I know is to do an overlay of the whole score with its un-decorated self, like this (second staff in image below).

\markup { \overlay {
  \score {  \new Voice { \circleB e a d' \circleB g' b' e'' } }
  \score {  \new Voice { e a d'  g'  b' e'' } }
} }


Here's the image of the two results.  The circle highlight obliterates the ledger and staff lines:

two results

I see the circle also has no extent so it gets clipped in the png.  That I can workaround. 

But how can I get the circle placed behind the staff (as in the second result) without doing an unwieldy overlay of the whole score?

Jeff



reply via email to

[Prev in Thread] Current Thread [Next in Thread]