I'm using Lilypond 2.20 on Ubuntu to engrave scores for the instrument pipa.
Slurs with arrow is a very common notation in many east Asian music pieces. It sounds similar to glissando in some degree, but not completely the same. The official Lilypond does not offer this out of box. I found some usable code from a German-speaking Lilypond forum. The code is pasted below.
The slur-with-arrow looks already handsome. I'd like the arrow head to be a bit more catching (bigger, and with a solid yet curved arrow head), and the slur line could be thicker too. My question is, how to modify the code below to achieve this? This might be a hardcore Lisp question.....My hat off to the original author of this code.
Here is a folk song from Taiwan containing many usages of this Asian glissando played on a pipa. Pay attention to the musican's left hand, the horizontal movement on a fret demonstrates how to play this kind of glissando. I haven't seen this on classical guitars yet. Very beautiful tunes:
\version "2.20.0"
slurArrow =
\once \override Slur.stencil =
#(lambda (grob)
(let* ((slur-dir (ly:grob-property grob 'direction))
(right-bound (ly:spanner-bound grob RIGHT))
(right-bound-stem (ly:grob-object right-bound 'stem))
(right-bound-stem-dir
(if (ly:grob? right-bound-stem)
(ly:grob-property right-bound-stem 'direction)
#f))
(c-ps (ly:grob-property grob 'control-points))
(frst (car c-ps))
(thrd (caddr c-ps))
;;; corr-values are my choice
(corr (cond ((not right-bound-stem-dir)
'(0 . 0))
((= slur-dir (* -1 right-bound-stem-dir))
(cons -0.4 (* 0.2 slur-dir)))
(else '(-0.4 . 0.2))))
(frth (offset-add (cadddr c-ps) corr)))
(ly:grob-set-property! grob 'control-points
(append (list-head c-ps 3) (list frth)))
(let* ((orig (ly:grob-original grob))
(siblings (ly:spanner-broken-into orig)))
(if (or (null? siblings)
(equal? grob (car (last-pair siblings))))
(let* ((default-stil (ly:slur::print grob))
(default-stil-lngth
(interval-length (ly:stencil-extent default-stil X)))
(delta-x-cps (- (car frth) (car frst)))
(diff (- default-stil-lngth delta-x-cps))
(delta-iv
(cons (- (car frth) (car thrd)) (- (cdr frth) (cdr thrd))))
(radians->degree (lambda (radians) (/ (* radians 180) PI)))
(ang (radians->degree (atan (cdr delta-iv) (car delta-iv))))
(arrowhead (ly:font-get-glyph (ly:grob-default-font grob)
"arrowheads.open.01"))
(rotated-arrowhead (ly:stencil-rotate arrowhead ang 0 0))
(arrowhead-lngth
(interval-length (ly:stencil-extent rotated-arrowhead X))))
(ly:stencil-add
default-stil
(ly:stencil-translate
rotated-arrowhead
;; Ugh, 3.8 found by trial and error
(cons (+ diff (/ arrowhead-lngth 3.8) (car frth))
(+ (cdr frth) 0)))))
(ly:slur::print grob)))))
\relative c'' {
\slurArrow
c'4( c \bar "" \break c c)
\slurArrow
\slurDown
c4( c c c)
\slurArrow
\stemUp
\slurUp
c4( c d a)
%% maybe add:
% \shape #'((0 . 0)(0 . 0)(0 . -0.5)(0 . -0.5)) Slur
\slurArrow
\slurDown
c4( a) \slurArrow f( d)
}