[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BarNumber-value?
From: |
Thomas Morley |
Subject: |
BarNumber-value? |
Date: |
Mon, 30 Apr 2012 00:55:48 +0200 |
Hi,
in 2.14.2 I used a function to manipulate the BarNumber-stencil. It
calls the value of the BarNumber as a string, via (ly:grob-property
grob 'text).
This doesn't work no longer with the latest devel-versions. (Due to
the changes in Issue 2059 ?)
(ly:grob-property grob 'text) now returns, e.g. (#<procedure
line-markup (layout props args)> ("2"))
How to do with 2.15.36?
Below a simplified example.
\version "2.14.2"
\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 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 }
}
Cheers,
Harm
- BarNumber-value?,
Thomas Morley <=