Dear Michael, Jean,

thank you for the help and the suggestions, and for replying so quickly!
Now, I'll read accurately Jean's site! :-)


Il 13/05/23 15:47, Jean Abou Samra ha scritto:

Le samedi 13 mai 2023 à 14:13 +0200, Luca Rossetto Casel a écrit :

Hello everyone,

I'm working on an example for a musicological paper. I was requested to highlight some notes drawing a colored circle around them. I found the snippet

and I tried to adapt it to my needs... but without success (I didn't ever studied Scheme, but I'd like to learn how to use it: all I was able to do is to change the color of the circle /and/ the notehead).

How can I change the color of the circle, leaving the notehead black?

Thanks in advance!!!

Re "I'd like to learn how to use Scheme": are you aware of ?

With that being said, this can be refactored to use markup, making it perhaps more familiar for someone without Scheme background:

|\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.


Reply via email to