I am trying to add a half bracket with "r.h." next to it in my score, indicating that notes inside the bracket are to be played with the right hand. Here is an example measure from the Fugue No. 1 in C Major from the Well-Tempered Clavier Book I:
\language "english"
#(define-markup-command (piano-hand-bar-down layout props text) (markup?)
#:properties ((bar-length 6))
"Draw a piano hand half-bracket."
(interpret-markup layout props
#{
\markup { \tiny \italic { #text } \path #0.1 #`(
(moveto -1 ,bar-length)
(lineto -2 ,bar-length)
(lineto -2 0)
)}
#}))
#(define-markup-command (piano-hand-bar-up layout props text) (markup?)
#:properties ((bar-length 6))
"Draw a piano hand half-bracket."
(interpret-markup layout props
#{
\markup { \tiny \italic { #text } \path #0.1 #`(
(moveto -1 ,(- 1 bar-length))
(lineto -2 ,(- 1 bar-length))
(lineto -2 1)
)}
#}))
\parallelMusic fugueOneVoiceOne,fugueOneVoiceTwo,fugueOneDynamics,fugueOneVoiceThree,fugueOneVoiceFour {
r2 r8 g'-3 a-4 b-3 | % 15
d'8-2 g-5~ g16 a-5 g-4 f-3 e8-2 e-1 fs-2 g-2~ |
s2 s8 \crescTextCresc s16\< s16\! s4 |
b8-1
-\tweak extra-offset #'(1 . -3.9)
-\markup \override #'(bar-length . 7)
{ \piano-hand-bar-up "r.h." }
e-3 a,-1 d4-1 g,8-1 d'4-1 |
r8 g,-5 a-3 b-1 c8.-3 d32-2 c-3 b8-4 e-1 |
}
\header {
title = "Test Piece"
}
\new PianoStaff <<
\set PianoStaff.connectArpeggios = ##t
\new Staff = "up" {
<<
\new Voice = "first" \relative {
\voiceOne
\fugueOneVoiceOne
}
\new Voice = "second" \relative {
\voiceTwo
\fugueOneVoiceTwo
}
>>
}
\new Dynamics {
\fugueOneDynamics
}
\new Staff = "down" {
\clef "bass"
<<
\new Voice = "third" \relative {
\voiceThree
\fugueOneVoiceThree
}
\new Voice = "fourth" \relative {
\voiceFour
\fugueOneVoiceFour
}
>>
}
>>
This seems to do the job, and is fairly easy to place wherever needed. However, the staves are moved apart a significant amount, which is to accommodate the mark before it is moved by the extra-offset
tweak. Here is the output without the mark:
...and with the mark:
Does anyone know of a good way to place the symbol without affecting the rest of the layout? Or a better way to add this symbol to begin with?