]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/cross-staff-stems.ly
edf4fbf77b4db758733ff2658e6e7a52f18b9f6b
[lilypond.git] / Documentation / snippets / new / cross-staff-stems.ly
1 \version "2.15.42"
2
3 \header {
4   lsrtags = "staff-notation, tweaks-and-overrides, contexts-and-engravers"
5   texidoc = "
6 This snippet shows the use of the @code{Span_stem_engraver}
7 and @code{\crossStaff} to connect stems across staves automatically.
8 The stem length need not be specified, as the variable distance
9 between noteheads and staves is calculated automatically.
10 "
11   doctitle = "Cross staff stems"
12 }
13
14 \layout {
15   \context {
16     \PianoStaff
17     \consists #Span_stem_engraver
18   }
19 }
20
21 {
22   \new PianoStaff <<
23     \new Staff {
24       <b d'>4 r d'16\> e'8. g8 r\!
25       e'8 f' g'4 e'2
26     }
27     \new Staff {
28       \clef bass
29       \voiceOne
30       \autoBeamOff
31       \crossStaff { <e g>4 e, g16 a8. c8} d
32       \autoBeamOn
33       g8 f g4 c2
34     }
35   >>
36 }