Automatic beams

By default, beams are inserted automatically:

\relative c'' {
  \time 2/4 c8 c c c
  \time 6/8 c8 c c c8. c16 c8
}

[image of music]

If these automatic decisions are not satisfactory, beaming can be entered explicitly; see Manual beams. Beams must be entered manually if beams are to be extended over rests.

If automatic beaming is not required, it may be turned off with \autoBeamOff and on with \autoBeamOn:

\relative c' {
  c4 c8 c8. c16 c8. c16 c8
  \autoBeamOff
  c4 c8 c8. c16 c8.
  \autoBeamOn
  c16 c8
}

[image of music]

Note: If beams are used to indicate melismata in songs, then automatic beaming should be switched off with \autoBeamOff and the beams indicated manually. Using \partCombine with \autoBeamOff can produce unintended results. See the snippets for more information.

Beaming patterns that differ from the automatic defaults can be created; see Setting automatic beam behavior.

Predefined commands

\autoBeamOff, \autoBeamOn.

Selected Snippets

Beams across line breaks

Line breaks are normally forbidden when beams cross bar lines; this behavior can be changed using enabling Beam.breakable.

\relative c'' {
  \override Beam.breakable = ##t
  c8 c[ c] c[ c] c[ c] c[ \break
  c8] c[ c] c[ c] c[ c] c
}

\paper { tagline = ##f }

[image of music]

Changing beam knee gap

Kneed beams are inserted automatically when a large gap is detected between the note heads. This behavior can be tuned through the auto-knee-gap property. A kneed beam is drawn if the gap is larger than the value of auto-knee-gap plus the width of the beam object (which depends on the duration of the notes and the slope of the beam). By default auto-knee-gap is set to 5.5 staff spaces.

{
  f8 f''8 f8 f''8
  \override Beam.auto-knee-gap = 6
  f8 f''8 f8 f''8
}

[image of music]

Partcombine and \autoBeamOff

The function of \autoBeamOff when used with \partCombine can be difficult to understand. It may be preferable to use

\set Staff.autoBeaming = ##f

instead to ensure that auto-beaming is turned off for the entire staff. Use this at a spot in your score where no beam generated by the auto-beamer is still active.

Internally, \partCombine works with four voices – stem up single, stem down single, combined, and solo. In order to use \autoBeamOff to stop all auto-beaming when used with \partCombine, it is necessary to use four calls to \autoBeamOff.

{
  % \set Staff.autoBeaming = ##f % turns off all auto-beaming

  \partCombine {
    \autoBeamOff   % applies to split up-stems
    \repeat unfold 4 a'16
    % \autoBeamOff % applies to combined stems
    \repeat unfold 4 a'8
    \repeat unfold 4 a'16
    % \autoBeamOff % applies to solo
    \repeat unfold 4 a'16
    r4
  } {
    % \autoBeamOff % applies to split down-stems
    \repeat unfold 4 f'8
    \repeat unfold 8 f'16 |
    r4
    \repeat unfold 4 a'16
  }
}

[image of music]

See also

Notation Reference: Manual beams, Setting automatic beam behavior.

Installed Files: scm/auto-beam.scm.

Snippets: Rhythms.

Internals Reference: Auto_beam_engraver, Beam_engraver, Beam, BeamEvent, BeamForbidEvent, beam-interface, unbreakable-spanner-interface.

Known issues and warnings

The properties of a beam are determined at the start of its construction and any additional beam property changes that occur before the beam has been completed will not take effect until the next, new beam starts.


LilyPond Notation Reference v2.25.21 (development-branch).