Jump to content

Beam endings in Score context: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m New category
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Beam-ending rules specified in the <code>Score</code> context apply to all staves, but can be modified at both <code>Staff</code> and <code>Voice</code> levels:
Beam-ending rules specified in the <code>Score</code> context apply to all staves, but can be modified at both <code>Staff</code> and <code>Voice</code> levels:


<lilypond version="2.24.0">
<lilypond version="2.24">
\relative c'' {
\relative c'' {
   \time 5/4
   \time 5/4
Line 37: Line 37:
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Rhythms]]
[[Category:Rhythms]]
[[Category:Snippet]]

Latest revision as of 23:21, 21 November 2025

Beam-ending rules specified in the Score context apply to all staves, but can be modified at both Staff and Voice levels:

\version "2.24"

\relative c'' {
  \time 5/4
  % Set default beaming for all staves
  \set Score.baseMoment = #(ly:make-moment 1/8)
  \set Score.beatStructure = 3,4,3
  <<
    \new Staff {
      c8 c c c c c c c c c
    }
    \new Staff {
      % Modify beaming for just this staff
      \set Staff.beatStructure = 6,4
      c8 c c c c c c c c c
    }
    \new Staff {
      % Inherit beaming from Score context
      <<
        {
          \voiceOne
          c8 c c c c c c c c c
        }
        % Modify beaming for this voice only
        \new Voice {
          \voiceTwo
          \set Voice.beatStructure = 6,4
          a8 a a a a a a a a a
        }
      >>
    }
  >>
}