]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/snippets/new/cross-staff-stems.ly
Imported Upstream version 2.16.0
[lilypond.git] / Documentation / snippets / new / cross-staff-stems.ly
diff --git a/Documentation/snippets/new/cross-staff-stems.ly b/Documentation/snippets/new/cross-staff-stems.ly
new file mode 100644 (file)
index 0000000..ed36504
--- /dev/null
@@ -0,0 +1,36 @@
+\version "2.16.0"
+
+\header {
+  lsrtags = "staff-notation, tweaks-and-overrides, contexts-and-engravers"
+  texidoc = "
+This snippet shows the use of the @code{Span_stem_engraver}
+and @code{\crossStaff} to connect stems across staves automatically.
+The stem length need not be specified, as the variable distance
+between noteheads and staves is calculated automatically.
+"
+  doctitle = "Cross staff stems"
+}
+
+\layout {
+  \context {
+    \PianoStaff
+    \consists #Span_stem_engraver
+  }
+}
+
+{
+  \new PianoStaff <<
+    \new Staff {
+      <b d'>4 r d'16\> e'8. g8 r\!
+      e'8 f' g'4 e'2
+    }
+    \new Staff {
+      \clef bass
+      \voiceOne
+      \autoBeamOff
+      \crossStaff { <e g>4 e, g16 a8. c8} d
+      \autoBeamOn
+      g8 f g4 c2
+    }
+  >>
+}