Thank you, David.   Is it possible not to print other numbers other than the 
multiple of five's?

 
Blessing in+,
Ming.


>________________________________
> From: David Nalesnik <david.nales...@gmail.com>
>To: MING TSANG <tsan...@rogers.com> 
>Cc: "lilypond-user@gnu.org" <lilypond-user@gnu.org> 
>Sent: Sunday, April 29, 2012 6:53:38 PM
>Subject: Re: lilypond-user Digest, Vol 113, Issue 99
> 
>
>Hi,
>
>
>On Sun, Apr 29, 2012 at 8:37 PM, MING TSANG <tsan...@rogers.com> wrote:
>
>
>>
>>
>>
>>\version "2.15.37"
>>\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))
>>((markup->string text) (string->number text)))
>>(if (= (remainder (markup->string text) 5) 0)
>>(ly:grob-set-property! grob 'color red)
>>(ly:grob-set-property! grob 'color black))
>>stil))
>>\repeat unfold 41 { c1 }
>>}
>>
>>
>>I try replacing nmbr with (markup->string text) as suggest by David Nalesnik 
>>and I get the following error.  Appreciate help.
>
>
>This is how to do it:
>
>
> \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 (= (remainder nmbr 5) 0)
>                      (ly:grob-set-property! grob 'color red)
>                      (ly:grob-set-property! grob 'color black))
>                   stil))
>
>
>       \repeat unfold 41 { c1 }
>}
>
>
>Best,
>David
>
>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to