Drawing circles around note heads: Difference between revisions

No edit summary
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Here is how to circle a note.
A circle can be drawn around a note head by providing a custom Scheme function to temporarily override the <code>stencil</code> property.


<lilypond version="2.24">
<lilypond version="2.24">
%LSR contributed by Valentin http://lists.gnu.org/archive/html/lilypond-user/2010-10/msg00523.html
% LSR originally contributed by Valentin
% LSR http://lists.gnu.org/archive/html/lilypond-user/2010-10/msg00523.html


circle =
circle = \tweak NoteHead.stencil
\once \override NoteHead.stencil = #(lambda (grob)
  #(lambda (grob)
     (let* ((note (ly:note-head::print grob))
     (let* ((note (ly:note-head::print grob))
           (combo-stencil (ly:stencil-add
           (combo-stencil (ly:stencil-add
Line 13: Line 14:
             (ly:stencil-extent note X)
             (ly:stencil-extent note X)
             (ly:stencil-extent note Y))))
             (ly:stencil-extent note Y))))
  \etc


{ \circle c'' }
{ \circle c'' }
Line 18: Line 20:


[[Category:Editorial annotations]]
[[Category:Editorial annotations]]
[[Category:Included in the official documentation]][[Category:Snippet]]
[[Category:Scheme]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]