lilypond-user
[Top][All Lists]
Advanced

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

Re: Reading a property


From: David Nalesnik
Subject: Re: Reading a property
Date: Wed, 1 Apr 2015 12:25:56 -0500

Hi Klaus,

On Wed, Apr 1, 2015 at 9:13 AM, Klaus Blum <address@hidden> wrote:
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.

_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

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