]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/cross-staff-chords---beaming-problems-workaround.ly
99cfca7e1891f645143609e1fcf3905bea62c49f
[lilypond.git] / Documentation / snippets / cross-staff-chords---beaming-problems-workaround.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.14.2"
8
9 \header {
10   lsrtags = "chords, keyboards, tweaks-and-overrides, workaround"
11
12   texidoc = "
13 Sometimes it is better to use stems from the upper staff for creating
14 cross-staff chords, because no problems with automatic beam collision
15 avoidance then arise.  If the stems from the lower staff were used in
16 the following example, it would be necessary to change the automatic
17 beam collision avoidance settings so that it doesn't detect collisions
18 between staves using @code{\\override Staff.Beam #'collision-voice-only
19 = ##t}
20
21 "
22   doctitle = "Cross-staff chords - beaming problems workaround"
23 } % begin verbatim
24
25
26 \new PianoStaff <<
27   \new Staff = up
28     \relative c' {
29       <<
30         { r4
31           \override Stem #'cross-staff = ##t
32           \override Stem #'length = #19 % this is in half-spaces,
33               % so it makes stems 9.5 staffspaces long
34           \override Stem #'Y-offset = #-6 % stems are normally lengthened
35               % upwards, so here we must lower the stem by the amount
36               % equal to the lengthening - in this case (19 - 7) / 2
37               % (7 is default stem length)
38           e e e }
39         { s4
40           \change Staff = "bottom"
41           \override NoteColumn #'ignore-collision = ##t
42           c, c c
43         }
44       >>
45     }
46   \new Staff = bottom
47     \relative c' {
48       \clef bass
49       \voiceOne
50       g8 a g a g a g a
51     }
52 >>