Jump to content

Making cross-staff beams look better: Difference between revisions

From LilyPond wiki
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
m New category
Tags: Mobile edit Mobile web edit
 
(One intermediate revision by the same user not shown)
Line 33: Line 33:
[[Category:Workaround]]
[[Category:Workaround]]
[[Category:Version-specific]]
[[Category:Version-specific]]
[[Category:Snippet]]

Latest revision as of 23:37, 21 November 2025

Cross-staff beams may not look always good; this snippet demonstrates how to get better results.

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=508


\score {
  \new PianoStaff <<
   \new Staff = "RH" { \clef treble \time 3/4 s2.*2 }
   \new Staff = "LH" { \clef bass   \time 3/4 s2.*2 }
   \context Staff = LH
    \relative c' {
     \stemDown % Change into \stemUp to fix the bug
     c,8 [ g'
     \change Staff = RH
     d' a' e' b' ]
     % This makes the second beam look much better.
     \override Beam.concaveness = #0
     b [ e, a, d,
     \change Staff = LH
     g, c, ]
   }
  >>
}

% Prevent bad cropping.
\markup \null

\paper { tagline = ##f }