Kieren MacMillan
2018-11-17 01:35:58 UTC
Hi all,
In the snippet below, you’ll see that I’m attempting to override Fingering in a custom context to add a caret (^) on top of the [formatted] finger number to make it into a scale degree.
The "padding" between the caret and the number isn’t relative, as I would like it to be: it should always be some fraction of the font height (either x-height or m-height or M-height or similar). Is there a way to accomplish this? Bonus points if the top of the caret and the baseline of the numbers remain the same even when using lowercase numerals.
Thanks,
Kieren.
%%% SNIPPET BEGINS
\version "2.19.80"
\layout {
\context {
\Voice
\name UrlinieVoice
\inherit-acceptability "UrlinieVoice" "Voice"
\stemUp
\override Beam.positions = #'(7 . 7)
\override NoteHead.duration-log = #1
\override Fingering.padding = #1
\override Fingering.stencil = #(lambda (grob)
(let ((text (ly:grob-property grob 'text)))
(grob-interpret-markup grob
(markup #:text
#:override '(baseline-skip . 1.75)
#:center-column ("^" text)))))
}
}
stuff = \fixed c'' { g8[-5 f-4 e-3 d-2 c-1] }
\new UrlinieVoice \stuff
\new UrlinieVoice \with { \override Fingering.font-size = #4 } \stuff
%%% SNIPPET ENDS
________________________________
Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: ***@kierenmacmillan.info
In the snippet below, you’ll see that I’m attempting to override Fingering in a custom context to add a caret (^) on top of the [formatted] finger number to make it into a scale degree.
The "padding" between the caret and the number isn’t relative, as I would like it to be: it should always be some fraction of the font height (either x-height or m-height or M-height or similar). Is there a way to accomplish this? Bonus points if the top of the caret and the baseline of the numbers remain the same even when using lowercase numerals.
Thanks,
Kieren.
%%% SNIPPET BEGINS
\version "2.19.80"
\layout {
\context {
\Voice
\name UrlinieVoice
\inherit-acceptability "UrlinieVoice" "Voice"
\stemUp
\override Beam.positions = #'(7 . 7)
\override NoteHead.duration-log = #1
\override Fingering.padding = #1
\override Fingering.stencil = #(lambda (grob)
(let ((text (ly:grob-property grob 'text)))
(grob-interpret-markup grob
(markup #:text
#:override '(baseline-skip . 1.75)
#:center-column ("^" text)))))
}
}
stuff = \fixed c'' { g8[-5 f-4 e-3 d-2 c-1] }
\new UrlinieVoice \stuff
\new UrlinieVoice \with { \override Fingering.font-size = #4 } \stuff
%%% SNIPPET ENDS
________________________________
Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: ***@kierenmacmillan.info