On 31/01/2023 20:23, Rajesh Baskar wrote: > Hi Jean, > > The solution you gave me works very good for whole notes. But if the notes > have stems then the stems are not removed. Please look at the LilyPond like > below.
Is this what you want?
\version "2.24.0"
\language english
boxify =
#(define-music-function (grob-path) (key-list?)
(define proc
(grob-transformer
'stencil
(lambda (grob orig)
(grob-interpret-markup
grob
#{
\markup \override #'(box-padding . 1.25)
\override #'(thickness . 1)
\box \stencil #orig
#}))))
#{ \override $grob-path . stencil = #proc #})
\header {
tagline = ##f
}
RedDotMarkup = \markup \with-color "#FF0000" \vcenter \fontsize #10 \musicglyph
"dots.dot"
RedDot =
\tweak text \RedDotMarkup
\tweak stencil
#(grob-transformer
'stencil
(lambda (grob original)
(ly:stencil-outline
(ly:text-interface::print grob)
original)))
\tweak staff-position #0
%%%%% These two lines addded
\single \hideNotes
\tweak transparent ##f
\etc
\score {\new Staff { \override Score.SpacingSpanner.strict-note-spacing = ##t
\set Score.proportionalNotationDuration = #(ly:make-moment
1/8)
\override Staff.MeasureCounter.staff-padding = #4.5
\set Staff.midiInstrument = #"acoustic grand"
\key c \major \numericTimeSignature \time 4/4
\clef bass \startMeasureCount f4 g a bf \once \hide
Accidental\RedDot bf4 \RedDot c'
f2 \stopMeasureCount \bar "||"}
\layout { \context { \Staff \consists Measure_counter_engraver
\boxify MeasureCounter } } }
As a meta-point, it is easier to reply if you post minimal examples
< https://lilypond.org/tiny-examples.html >. (Also, I don't know if
it's your mail client that does something strange, but for me,
some parts of your code are completey lacking indentation.)
Best,
Jean
OpenPGP_signature
Description: OpenPGP digital signature
