2012/5/15 Pierre Perol-Schneider <[email protected]>:
Do you mean for right hand (stroke) fingering? The following enables you to use -\A etc for strokefingering. The additional my-stroke-finger function isn't needed for this but gives better alignment of the characters when you have a succession of them:Hi Group,Sometimes I need to put a letter in front of a number as a fingering. Is there any possibility to declare "m" (for ex;) as a number so that I could code<a-m1> as a fingering ?
\version "2.15.32"
% shortcuts for stroke finger indications
% can't use a or p, so use upper case for all
P = #(define-music-function (parser location) ()
(apply make-music
(append
(list
'StrokeFingerEvent
'origin location)
(list 'digit 1))))
I = #(define-music-function (parser location) ()
(apply make-music
(append
(list
'StrokeFingerEvent
'origin location)
(list 'digit 2))))
M = #(define-music-function (parser location) ()
(apply make-music
(append
(list
'StrokeFingerEvent
'origin location)
(list 'digit 3))))
A = #(define-music-function (parser location) ()
(apply make-music
(append
(list
'StrokeFingerEvent
'origin location)
(list 'digit 4))))
% better alignment of stroke fingering in a succession of fingering
indications
#(define (my-stroke-finger::calc-text grob)
(let* ((digit (ly:event-property (event-cause grob) 'digit))
(text (ly:event-property (event-cause grob) 'text))
(finger (vector-ref (ly:grob-property grob 'digit-names)
(1- (max (min 5 digit) 1))))
(direction (ly:grob-property grob 'direction)))
(if (string? text)
text
(if (= direction 0)
finger
(make-combine-markup (cond
((= direction UP) (make-transparent-markup "p"))
((= direction DOWN) (make-transparent-markup "i")))
finger)))))
\relative c'' {
\set fingeringOrientations = #'(left)
\set strokeFingerOrientations = #'(up)
<c-1-\A > <c-\M > <c-\I > <c-\P >
\override StrokeFinger #'text = #my-stroke-finger::calc-text
<c-1-\A > <c-\M > <c-\I > <c-\P >
}
<<attachment: test.png>>
_______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
