lilypond-user
[Top][All Lists]
Advanced

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

## Re: dal niente hairpin - customize size

 From: David Nalesnik Subject: Re: dal niente hairpin - customize size Date: Sat, 18 Feb 2012 18:54:15 -0600

Hi Tiresia,

On Sat, Feb 18, 2012 at 3:53 PM, Tiresia GIUNO wrote:

\override Hairpin #'circled-tip = ##t

I find the circles a bit too small. Is there a way to customize the size
of the circles?

I can't find a convenient property to override the size of the circle, but you could fake it by adding a circle yourself to the hairpin.

I've come up with the following which might prove useful, though I haven't tested it extensively.  The arguments that the override takes are the radius and thickness of the circle you'd like to add.  The function would have to be expanded to deal with hairpins crossing a line break, but that's doable.

\version "2.15.16"

#(define (circ-tip radius thickness)
(lambda (grob)
(let* ((stencil (ly:hairpin::print grob))
(grow-direction (ly:grob-property grob 'grow-direction))
(len (interval-length (ly:stencil-extent stencil X)))
(diameter (* 2 radius)))

(set! stencil (ly:stencil-scale stencil (/ (- len diameter) len) 1))
(set! stencil
(ly:stencil-combine-at-edge
stencil
X (* -1 grow-direction)
(make-circle-stencil radius thickness #f)
(- thickness)))
(if (= 1 grow-direction)
(set! stencil (ly:stencil-translate-axis stencil diameter X))) ;; is there a way around this?

stencil)))

{
\once \override Hairpin #'stencil = #(circ-tip 0.4 0.1)
%\override Hairpin #'circled-tip = ##t
c'1\f\> ~
c' ~
c'8
r\!
}

Hope this helps,
David

reply via email to

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