9

Suppose I want to use eighth notes which differ widely in pitch, so that half of the eighth notes fall in a bass clef and half of them are best represented in a treble clef. Is there a way to use one beam to connect these notes on two different staves in Lilypond?

2

2 Answers 2

5

A Voice can change Staff (the respective Staff has to exist at that point of time, if necessary by using \skip as appropriate).

Try

\new PianoStaff <<
  \new Staff = "treble" {
    \new Voice {
      \repeat unfold 8 { \change Staff = "treble" c''16
             \change Staff = "bass" c,16
               }
    }
  }
  \new Staff = "bass" \with { \clef "bass" } { \skip 1 }
>>

which gives cross-staff beaming

2

Yes, this is possible, but there are some quirks you may encounter:

upper = \relative c' {
                      g''8  \change Staff = "LH" g,,,
 \change Staff = "RH" a'''  \change Staff = "LH" fis,,,
 \change Staff = "RH" b'''  \change Staff = "LH" e,,,,
 \change Staff = "RH" c'''' \change Staff = "LH" d,,,,

}
lower = \relative c {
\clef bass
 s2
}
\score {
 \new PianoStaff <<
  \new Staff = "RH" \upper
  \new Staff = "LH" \lower
 >>
}

Trying to enter notes onto a context that already stopped.

Hm, a warning:

warning: cannot find context to switch to
 \change Staff = "RH" b'''  
                            \change Staff = "LH" e,,,,

This means that the Staff named "LH" did not "exist" where another Staff was trying to reference it. So we need to keep both staves "alive." A spacer rest does nicely:

upper = \relative c' {
                      g''8  \change Staff = "LH" g,,,
 \change Staff = "RH" a'''  \change Staff = "LH" fis,,,
 \change Staff = "RH" b'''  \change Staff = "LH" e,,,,
 \change Staff = "RH" c'''' \change Staff = "LH" d,,,,

}
lower = \relative c {
\clef bass
 s2 s2 % (or s1)
}
\score {
 \new PianoStaff <<
  \new Staff = "RH" \upper
  \new Staff = "LH" \lower
 >>
}

Filling out the context with spacer rests.

You can control the when and where of beaming, as well. For when, see 1.2.4 Automatic beams > Selected Snippets > Changing beam knee gap: \override Beam.auto-knee-gap = #6; for where, you can specifically move the beams:

upper = \relative c' {
                      g''8  \change Staff = "LH" g,,,
 \change Staff = "RH" a'''  \change Staff = "LH" fis,,,
 \override Beam.positions = #'( -4.5 . -4.5 )
 \change Staff = "RH" b'''  \change Staff = "LH" e,,,,
 \change Staff = "RH" c'''' \change Staff = "LH" d,,,,

}
lower = \relative c {
\clef bass
 s2 s2 % (or s1)
}
\score {
 \new PianoStaff <<
  \new Staff = "RH" \upper
  \new Staff = "LH" \lower
 >>
}

Changing what the beams look like across staves.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.