lilypond-user
[Top][All Lists]
Advanced

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

Re: lilypond-user Digest, Vol 113, Issue 99


From: David Nalesnik
Subject: Re: lilypond-user Digest, Vol 113, Issue 99
Date: Mon, 30 Apr 2012 12:59:29 -0500

Hi Ming,

On Mon, Apr 30, 2012 at 11:23 AM, MING TSANG <address@hidden> wrote:
Thank you, David.   Is it possible not to print other numbers other than the multiple of five's?

To to this, you only need to change one line of Harm's function (see below):
 

 \relative c'' {

       \override Score.BarNumber #'break-visibility = #'#(#f #t #t)
       \override Score.BarNumber #'stencil =
                 #(lambda (grob)
                   (let* ((stil (ly:text-interface::print grob))
                          (text (ly:grob-property grob 'text))
                          (nmbr (string->number (markup->string text))))
          ;; if you change 5 to 3 in the line below, you'll get a bar line every three bars; if you change it to 10, every ten     
          ;; bars; etc.
  
                   (if (= (remainder nmbr 5) 0)
                      (ly:grob-set-property! grob 'color red)
                      (ly:grob-set-property! grob 'color black))
                   stil))

       \repeat unfold 41 { c1 }
}
Hope this helps!
David 


reply via email to

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