Jump to content

Automatic beam subdivisions: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Beams can be subdivided automatically. By setting the property <code>subdivideBeams</code>, beams are subdivided at beat positions (as specified in <code>baseMoment</code>).
Beams can be subdivided automatically. By setting the property <code>subdivideBeams</code>, beams are subdivided at beat positions (as specified in <code>baseMoment</code>).


<lilypond version="2.24.0">
<lilypond version="2.24">
\new Staff {
\new Staff {
   \relative c'' {
   \relative c'' {
Line 28: Line 28:
</lilypond>
</lilypond>


[[Category:Automatic notation]]
[[Category:Connecting notes]]
[[Category:Connecting notes]]
[[Category:Rhythms]]
[[Category:Rhythms]]
[[Category:Connecting notes]]
[[Category:Automatic notation]]
[[Category:Included in the official documentation]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]

Latest revision as of 18:31, 16 December 2025

Beams can be subdivided automatically. By setting the property subdivideBeams, beams are subdivided at beat positions (as specified in baseMoment).

\version "2.24"

\new Staff {
  \relative c'' {
    <<
      {
        \voiceOne
        \set subdivideBeams = ##t
        b32[ a g f c' b a g
        b32^"subdivide beams" a g f c' b a g]
      }
      \new Voice {
        \voiceTwo
        b32_"default"[ a g f c' b a g
        b32 a g f c' b a g]
      }
    >>
    \oneVoice
    \set baseMoment = #(ly:make-moment 1/8)
    \set beatStructure = 2,2,2,2
    b32^"baseMoment 1 8"[ a g f c' b a g]
    \set baseMoment = #(ly:make-moment 1/16)
    \set beatStructure = 4,4,4,4
    b32^"baseMoment 1 16"[ a g f c' b a g]
  }
}