lilypond-user
[Top][All Lists]
Advanced

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

Re: Image width issue


From: Jean Abou Samra
Subject: Re: Image width issue
Date: Fri, 3 Feb 2023 17:03:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

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


Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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