|
From: | Andrew Bernard |
Subject: | Re: Hairpin endings |
Date: | Sun, 23 Apr 2017 20:34:27 +1000 |
Hi Nathan,
On Fri, Apr 21, 2017 at 12:54 PM, Nathan Ho <address@hidden> wrote:
> On 2017-04-21 05:39, David Nalesnik wrote:
>>
>> Instead of using a markup, why not use ly:line-interface::line
>> (available from 2.19.27)? This gets thickness from the grob--and any
>> other line attributes you want, so you can create dashed hairpins,
>> whatever. There's no need adjust thickness in this case.
>
>
> Hi David,
>
> Thanks for the info. I still prefer markups for this kind of thing because
> more people understand them and they're (somewhat) better documented. Less
> ly:foo stuff I have to look up, the better. Good to know the proper way
> though!
>
OK, I see.
Anyway, in case anyone wonders, here is how your function would look:
\version "2.19.59"
#(define ((open-hairpin left-open right-open) grob)
(let* ((stencil (ly:hairpin::print grob))
(X-ext (ly:stencil-extent stencil X))
(Y-ext (ly:stencil-extent stencil Y))
(width (interval-length X-ext))
(height (interval-length Y-ext)))
(ly:stencil-translate
(ly:stencil-add
(ly:line-interface::line
grob
0 (* height (- 0.5 (* 0.5 left-open)))
width (* height (- 0.5 (* 0.5 right-open))))
(ly:line-interface::line
grob
0 (* height (+ 0.5 (* 0.5 left-open)))
width (* height (+ 0.5 (* 0.5 right-open)))))
(cons 0 (interval-start Y-ext)))))
{
c'1\> c'1 c'1\!
\once \override Hairpin.stencil = #(open-hairpin 1.0 0.5)
c'1\> c'1 c'1\!
\once \override Hairpin.stencil = #(open-hairpin 0.5 0.0)
c'1\> c'1 c'1\!
\override Hairpin.style = #'dashed-line
\once \override Hairpin.stencil = #(open-hairpin 1.0 0.5)
c'1\> c'1 c'1\!
\once \override Hairpin.stencil = #(open-hairpin 0.5 0.0)
c'1-\tweak thickness 3 \> c'1 c'1\!
}
%%%
-David
_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user
open-hairpin.jpg
Description: JPEG image
[Prev in Thread] | Current Thread | [Next in Thread] |