lilypond-user
[Top][All Lists]
Advanced

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

Re: Box around MeasureCounter


From: Rajesh Baskar
Subject: Re: Box around MeasureCounter
Date: Mon, 22 Nov 2021 11:24:22 -0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

Aaron,

I had another question. The MeasureCounter boxify function does not work if we change the staff to Rhythmic staff.

\version "2.22.0"

boxify =
#(define-music-function
  (grob-path) (key-list?)
  (define proc (grob-transformer 'stencil
   (lambda (grob orig) (grob-interpret-markup grob #{
    \markup \override #'(box-padding . 0.25)
            \override #'(thickness . 2)
            \box \stencil #orig #}))))
  #{ \override $grob-path . stencil = #proc #})
\include "english.ly" \header {tagline = "" }
\score {\new RhythmicStaff {
  \override Score.SpacingSpanner.strict-note-spacing = ##t
  \set Score.proportionalNotationDuration = #(ly:make-moment 1/4)
  \set Staff.midiInstrument = #"Grand Piano"
  \key c \major \numericTimeSignature
  \time 4/4
  \clef treble
  \startMeasureCount
  \hideNotes b2 c
  \unHideNotes a c'4 g
   \stopMeasureCount
  \bar "||"}
        \layout {
              \context {
                     \Staff
                     \consists Measure_counter_engraver
                    \boxify MeasureCounter
                        }
                }
        \midi { \tempo 4 =92}
}

On 11/18/2021 11:43 AM, Rajesh Baskar wrote:

Aaron,

Thank you so much, this worked perfectly.


On 11/17/2021 7:50 PM, Aaron Hill wrote:
%%%%
\version "2.20.0"

boxify =
#(define-music-function
  (grob-path) (key-list?)
  (define proc (grob-transformer 'stencil
   (lambda (grob orig) (grob-interpret-markup grob #{
    \markup \override #'(box-padding . 0.25)
            \override #'(thickness . 2)
            \box \stencil #orig #}))))
  #{ \override $grob-path . stencil = #proc #})

\new Staff
\with {
  \consists Measure_counter_engraver
  \boxify MeasureCounter
}
{
  \boxify Staff.Clef
  \startMeasureCount
  fis'4 g'8 a' \once \boxify Accidental bes'2 cis''4 d''2.
  \stopMeasureCount
}
%%%%

reply via email to

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