# Lilypond finger placement brackets

In music sheets intended for beginner harpists it's very common that the fingering includes not only the numbers but also brackets that indicate which fingers are positioned at the same time, replacements, etc. Here is one example:

I'd like to know what would be the best way to achieve a similar effect in Lilypond.

\version "2.19.52"
variable = {
\once \override TextSpanner.style = #'line
\once \override TextSpanner.to-barline = ##f
\once \override TextSpanner.bound-details =
#(
(left
(text . ,#{ \markup { \draw-line #'( 0 . -.5) } #})
(Y . 0)
(attach-dir . -3)
)
(right
(text . ,#{ \markup { \draw-line #'( 0 . -.5) } #})
(Y . 0)
(attach-dir . 3)
)
)
}

\relative c' {
\key c \major
\time 3/4
\partial 4
\variable
\once \override TextSpanner.rotation = #'(4 1.9 0)
a'8_3\startTextSpan b_2 \variable \once \override TextSpanner.rotation = #'(-4.5 -4.5 0)
c4-1\stopTextSpan\startTextSpan b-2 a_3 \variable \once \override TextSpanner.rotation = #'(3 -0.2 0)
g_4\stopTextSpan\startTextSpan a_3 b-2 \variable \once \override TextSpanner.rotation = #'(-7 -2.5 0)
c-1\stopTextSpan\startTextSpan g_2 f_3
e2_4\stopTextSpan
}


It's a bit hacky, but it gets the job done.

As always, manual fiddling required to get it the way you want to look. ;)

One possibility is to include LilyPond's fingering capabilities (-4, for instance, after a pitch) and the analysis bracket capability found at the LilyPond Snippet Repository.

\version "2.19.47"

\layout {
\context {
\Voice
\consists "Horizontal_bracket_engraver"
}
}
\relative c'' {
c4-1\startGroup b4-2 a4-3 g4-4\stopGroup |
}
`

• Unfortunately this example didn't work for me. First, it's a piano staff and with your example even though I added the code to the first staff the group appeared below the bass clef. Second, for the replacements there is an intersection between different groups and if I start a group and then start another group, stop the first, and then stop the second, the way it was interpreted was a small group inside a larger group. – Bani Sep 12 '16 at 3:27