[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reading a property
From: |
Klaus Blum |
Subject: |
Reading a property |
Date: |
Wed, 1 Apr 2015 07:13:49 -0700 (MST) |
Dear LilyPond fellows,
how can I read a property?
For example, after having applied
\override HorizontalBracket.line-thickness = #0.5
is there an easy way to access that value?
I know that it will work like this:
colorSpan =
#(define-music-function (parser location y-lower y-upper color)
(number? number? color?)
#{
\once\override HorizontalBracket.stencil =
$(lambda (grob)
(let* (
(thick (ly:grob-property grob 'line-thickness 1))
... do other stuff ...
(ly:make-stencil (list 'color color
(ly:stencil-expr (ly:round-filled-box X-ext Y-ext 0))
X-ext Y-ext))))
#})
But that only works "inside" this replacement function. Am I missing the
obvious?
I'm trying to expand what has been started with snippet 960:
http://lsr.di.unimi.it/LSR/Item?id=960
This is how far I've come:
ColorSpan-Showcase.ly
<http://lilypond.1069038.n5.nabble.com/file/n173954/ColorSpan-Showcase.ly>
ColorSpan-Showcase.pdf
<http://lilypond.1069038.n5.nabble.com/file/n173954/ColorSpan-Showcase.pdf>
ColorSpan-Example.ly
<http://lilypond.1069038.n5.nabble.com/file/n173954/ColorSpan-Example.ly>
ColorSpan-Example.pdf
<http://lilypond.1069038.n5.nabble.com/file/n173954/ColorSpan-Example.pdf>
Now I'm looking for a way to turn it into some easy-to-use functions.
Also, I will try to apply that to David Nalesnik's code from this thread:
http://lilypond.1069038.n5.nabble.com/box-around-notes-td35581.html
Any suggestions are welcome!
Cheers,
Klaus
--
View this message in context:
http://lilypond.1069038.n5.nabble.com/Reading-a-property-tp173954.html
Sent from the User mailing list archive at Nabble.com.
- Reading a property,
Klaus Blum <=