Subdividing beams

The beams of consecutive 16th (or shorter) notes are, by default, not subdivided. That is, the beams of more than two stems stretch unbroken over entire groups of notes. This behavior can be modified to subdivide the beams into sub-groups by setting the property subdivideBeams to true (#t). When set, a number of beamlets between two consecutive stems are removed at intervals multiple beams will be subdivided at intervals to match the metric value of the subdivision. Properties minimumBeamSubdivisionInterval and maximumBeamSubdivisionInterval allow configuring limits of automatic beam subdivision: the minimum rhythmic interval at which to subdivide beams and the number of beamlets removed depending on the interval respectively. If the numerator of maximumBeamSubdivisionInterval is not a power of 2, the smaller rhythmic intervals considered for subdivision are maximumBeamSubdivisionInterval divided by powers of 2 and stay greater than or equal to minimumBeamSubdivisionInterval. If maximumBeamSubdivisionInterval < minimumBeamSubdivisionInterval, then the depths of beam subdivision are limited to maximumBeamSubdivisionInterval, but not the frequency/intervals, therefore possibly deviating from the correct expected metric value. If respectIncompleteBeams is set to true (##t), the depth of the subdivision (number of beams) reflects the longest possible subdivision interval within the remaining length of the beam from the current stem. However, the last two stems of the beam are exempt from this rule.

\relative c'' {
  c32[ c c c c c c c]

  \set subdivideBeams = ##t
  c32[ c c c c c c c]

  % Set minimum beam subdivision interval to 1/8 just for this beam
  \once \set minimumBeamSubdivisionInterval = \musicLength 8
  c32[ c c c c c c c]

  % Set maximum beam subdivision interval to 1/16 just for this beam
  \once \set maximumBeamSubdivisionInterval = \musicLength 16
  c32[ c c c c c c c]

  % Set maximum beam subdivision interval to 3/8 just for this beam
  \once \set maximumBeamSubdivisionInterval = \musicLength 8*3
  [ \repeat unfold 16 c64 ] r2.

  % Set maximum beam subdivision interval to 1/64 to limit subdivision depth,
  % despite not being metrically correct
  \once \set minimumBeamSubdivisionInterval = \musicLength 32
  \once \set maximumBeamSubdivisionInterval = \musicLength 64
  [ \repeat unfold 32 c128 ] r2.

  % Shorten beam by 1/32
  c32[ c c c c c c] r32

  % Shorten beam by 3/32
  c32[ c c c c] r16.

  % Respect the incomplete beams of the previous two examples
  \set respectIncompleteBeams = ##t
  c32[ c c c c c c] r32
  % no visual change here as last two stems are exempt from this
  % special rule
  c32[ c c c c] r16.
}

[image of music]


LilyPond snippets v2.25.20 (development-branch).