lilypond-user
[Top][All Lists]
Advanced

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

Re: Hairpin endings


From: Andrew Bernard
Subject: Re: Hairpin endings
Date: Sun, 23 Apr 2017 20:34:27 +1000

Hi David and Nathan,

Apologies for a tardy response.

Sincere thanks to both of you for your work on this. It's really useful to me. I prefer using the ly:line-interface::line version because of the way it inherits the grob properties.

David, you naturally asked for the use cases I have for this, because it is very non-standard, for sure. There are several situations where this comes up in the scores I set. One common case is where the composer indicates a very long cresc. or decresc. between levels with open hairpins near an absolute mark such as ff, rather than cluttering page after page with immensely long hairpins. The attached snippet of an image gives some idea of this.

Once more, sincere thanks and appreciation.

Next thing to do is to achieve the half dashed/half solid appearance - or can this be done already, in the same way that slurs can?

Andrew





On 22 April 2017 at 05:34, David Nalesnik <address@hidden> wrote:
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

Attachment: open-hairpin.jpg
Description: JPEG image


reply via email to

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