lilypond-user
[Top][All Lists]
Advanced

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

Re: Flared hairpin flare


From: Aaron Hill
Subject: Re: Flared hairpin flare
Date: Sun, 17 Nov 2019 19:12:17 -0800
User-agent: Roundcube Webmail/1.3.8

On 2019-11-17 6:40 pm, Andrew Bernard wrote:
Hi Aaron,

What if I want to change this for each different length? Really long
ones and medium long ones, for example. Ideally I'd just like to be
able to specify a percentage or absolute offset where the flare
starts, for each different hairpin. That would be the simplest.

Something like:

\flare 0.05 % percent of length start

elbowed-hairpin is already relative (i.e. percentage-based) to the width and height of the hairpin.

If you need absolute, you could do a little math based on the estimated width of the normal hairpin stencil:

%%%%
\version "2.19.83"

abs-hairpin = #(define-scheme-function (elx ely) (number? number?)
  (lambda (grob)
    (let* ((sten (ly:hairpin::print grob))
           (xex (ly:stencil-extent sten X))
           (yex (ly:stencil-extent sten Y))
           (width (interval-length xex))
           (height (/ (interval-length yex) 2))
           (x (- 1 (/ elx width)))
           (y (- 1 (/ ely height))))
      (elbowed-hairpin `((0 . 0) (,x . ,y) (1 . 1)) #t))))

{
  \override Hairpin.height = 2
  \override Hairpin.stencil = \abs-hairpin 1.5 1
  c''4^\> \repeat unfold 2 { c'' } c''\!
  c''4^\< \repeat unfold 4 { c'' } c''\!
  c''4^\> \repeat unfold 6 { c'' } c''\!
  c''4^\< \repeat unfold 8 { c'' } c''\!
}
%%%%

Haven't tested this much with broken spanners, so there may need to be additional work.


-- Aaron Hill

Attachment: abs-hairpin.cropped.png
Description: PNG image


reply via email to

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