\version "2.16.2" % 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))) (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-stil 0.2)) ;; 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)) ;; 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.5 (- (cdr stil-ext-X) (interval-length finger-stil-ext)))) stil-ext-Y)))) adj-stil)) (ly:music-property music 'tweaks))) music)) % guide-neutral % 4 c4^\gn^2 c4-\gn-3 c4_\gn_4 gn = #(define-music-function (parser location fingering) (ly:music?) (gx 0 #x2013 fingering)) % guide-down % 4 c4^\gd^2 c4-\gd-3 c4_\gd_4 gd = #(define-music-function (parser location fingering) (ly:music?) (gx 20 #x2013 fingering)) % guide-up % 4 c4^\gu^2 c4-\gu-3 c4_\gu_4 gu = #(define-music-function (parser location fingering) (ly:music?) (gx -20 #x2013 fingering)) % guide slope % 4 c4^\gsl #45 ^2 c4-\gsl #-15 -3 c4_\gsl# -14 _4 gsl = #(define-music-function (parser location slope fingering) (number? ly:music?) (gx slope #x2013 fingering)) % guide slope unicode % 4 c4^\gsl #45 ##x2012 ^2 c4-\gsl #-15 ##x2013 -3 c4_\gsl #-14 ##x2014 _4 gsn = #(define-music-function (parser location slope unicode fingering) (number? number? ly:music?) (gx slope unicode fingering)) % guide slope character % 4 c4^\gsl #45 ##\+ ^2 c4-\gsl #-15 ##\! -3 c4_\gsl #-14 ##\! _4 gsc = #(define-music-function (parser location slope character fingering) (number? char? ly:music?) (gx slope (char->integer character) fingering)) \relative c'' { 2 | 2 | \set fingeringOrientations = #'(left) 2 | }