\version "2.17.9"
% left-hand finger guide finger between notes #(define (gx slope character fingering) ;; Purpose ;; add ornamentation character before fingering symbol ;; Parameters ;; slope : angle of rotation around right centre ;; character : ornamentation character for fingering ;; fingering : fingering designation for note ;; Examples ;; (gx 0 #x2013 fingering) ;; unicode #x2011 <-> #x2015 are different length "-" punctuation (let ((music (make-music 'FingeringEvent))) (set! (ly:music-property music 'tweaks) (acons 'stencil (lambda (grob) (let* ((finger (ly:music-property fingering 'digit))(finger-stil (grob-interpret-markup grob (number->string finger)))
(finger-stil-ext (ly:stencil-extent finger-stil X)) (guide-char character)(guide-stil (grob-interpret-markup grob (markup #:char guide-char))) ;; first combine stencils without any rotation of the guide line in ;; order to get X and Y extent to use for final translation of the ;; combined stencil so that the fingering number is correctly aligned
(stil (ly:stencil-combine-at-edge guide-stil X 1 ;; combine stencils along X-axis on right finger-stil0.3)) ;; add padding to move guide slightly left from finger number
(stil-ext-X (ly:stencil-extent stil X)) (stil-ext-Y (ly:stencil-extent stil Y)) ;; now combine again with requested rotation (stil (ly:stencil-combine-at-edge(ly:stencil-rotate guide-stil slope 1 0) ;; rotate "slope" around right centre
X 1 ;; combine stencils along X-axis on right finger-stil0.3)) ;; add padding to move guide slightly left from finger number
;; Alter X-extents of combined stencil so that it ;; will be positioned with the number centered ;; over the note. (adj-stil ;; leave fingerings oriented to side alone (if (= 0 (ly:grob-property grob 'side-axis)) stil (ly:make-stencil (ly:stencil-expr stil) (coord-translate stil-ext-X(* 0.52 (- (cdr stil-ext-X) (interval-length finger-stil-ext))))
stil-ext-Y)))) adj-stil)) (ly:music-property music 'tweaks))) music)) % guide hyphen % <c-\ghy #-15 -1>4 c4^\ghy #45 ^2 c4-\ghy #-15 -3 c4_\ghy# -14 _4ghy = #(define-music-function (parser location slope fingering) (number? ly:music?)
(gx slope #x2010 fingering)) \relative c'{ \override Fingering.staff-padding = #'() \override Fingering.add-stem-support = ##f <c-1>4 <d-\ghy #15 -3> }
<<attachment: 2.17.10.png>>
<<attachment: 2.17.9.png>>
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user