On 2020-10-04 1:54 am, Andrew Bernard wrote:
Here's a custom dynamic I need (the usual New Complexity
complications...):
pptopppdashText = \markup {
\line { pp \normal-text > ppp― }
}
pptopppdash =
\tweak DynamicText.self-alignment-X #LEFT
#(make-dynamic-script pptopppdashText)
The greater than sign is my naive attempt to include a hairpin. The
question is, how could one put a 'proper' hairpin, with a view to
being able to make it longer?
Here's a way to do hairpins in markup:
%%%%
\version "2.20.0"
#(define CRESC RIGHT)
#(define DECRESC LEFT)
#(define-markup-command
(hairpin layout props grow-direction)
(number?)
#:properties ((circled-tip #f)
(height 2/3)
(width 2)
(thickness 1))
(define (layout-property prop) (ly:output-def-lookup layout prop))
(let ((line-thickness (layout-property 'line-thickness))
(staff-space (layout-property 'staff-space)))
(set! height (* height staff-space))
(set! width (* width staff-space))
(set! thickness (* thickness line-thickness)))
(let ((tip-direction (- grow-direction))
(radius (* height 0.525))
(sten empty-stencil))
(if circled-tip (set! width (- width (* 2 radius))))
(set! sten
(make-connected-path-stencil
`((,(* tip-direction width) ,height)
(0 ,(* 2 height)))
thickness 1 1 #f #f))
(if circled-tip
(set! sten
(ly:stencil-combine-at-edge
sten X tip-direction
(ly:stencil-translate-axis
(make-circle-stencil radius thickness #f)
height Y)
(- thickness))))
sten))
"mp<f>opp" =
\tweak self-alignment-X #LEFT
#(make-dynamic-script #{
\markup \dynamic \override #'(width . 3) {
mp \hairpin #CRESC
f \override #'(circled-tip . #t)
\hairpin #DECRESC
pp
} #})
{ b'2( \"mp<f>opp" c''16 b' a' b' a'4) }
%%%%
-- Aaron Hill