In the section about arpeggios in the documentation, there is an
example of cross-staff arpeggios in a PianoStaff context:
@lilypond[quote,ragged-right,fragment,relative=1,verbatim]
\new PianoStaff <<
\set PianoStaff.connectArpeggios = ##t
\new Staff { <c' e g c>\arpeggio }
\new Staff { \clef bass <c,, e g>\arpeggio }
>>
@end lilypond
There should also be something there about how to accomplish this in
other kinds of contexts as well. There is one example in the LSR of
arpeggios between voices in the same staff, and building on that, I
made the following, more general example.
The same can be accomplished in contexts other than
@code{PianoStaff} if the @code{Span_arpeggio_engraver} is included
in the Score context.
@lilypond[quote,ragged-right,verbatim]
\score {
\new StaffGroup {
\set Score.connectArpeggios = ##t
<<
\new Staff \relative c' {
<e g>4\arpeggio
}
\new Staff \relative c {
\clef bass
<c e>4\arpeggio
}
>>
}
\layout {
\context {
\Score
\consists "Span_arpeggio_engraver"
}
}
}
@end lilypond
My questions are:
1. Is it correct that the Span_arpeggio_engraver should be included in
the Score context? I've tried to include it in StaffGroup, but that
has no effect: the arpeggios just disappear.
2. Is there a more elegant way to write the example? E.g. to avoid the
\layout section?
Eyolf