[icon]

GNU LilyPond

Welcome to the home of the GNU Music Typesetter

What is LilyPond
General information
Simple examples
Complex examples
Download
GNU/Linux binaries
Windows
Source code
Documentation
Tutorial
Manual
Glossary
other ...

Support
Mailing lists
Search
WikiWiki
FAQs

External sites
lilypond.org/development
lilypond.org/stable
ftp.lilypond.org
Mutopia
Other music online

Node:Beaming, Next:, Previous:Polyphony, Up:Reference Manual



Beaming

Beams are used to group short notes into chunks that are aligned with the metrum. LilyPond guesses where beams should be inserted. If you're not satisfied with the automatic beaming, you can specify which patterns to beam automatically. In specific cases, you can also enter the beams explicitly.

Automatic beams

In normal time signatures, automatic beams can start on any note but can only end in a few positions within the measure: beams can end on a beat, or at durations specified by the properties in Voice.autoBeamSettings. The defaults for autoBeamSettings are defined in scm/auto-beam.scm.

The value of autoBeamSettings is changed using \override and unset using \revert:

\property Voice.autoBeamSettings \override #'(BE P Q N M) = dur
\property Voice.autoBeamSettings \revert #'(BE P Q N M)
Here, BE is the symbol begin or end. It determines whether the rule applies to begin or end-points. The quantity P/Q refers to the length of the beamed notes (and `* *' designates notes of any length), N/M refers to a time signature (wildcards, `* *' may be entered to designate all time signatures).

For example, if you want automatic beams to end on every quarter note, you can use the following:

\property Voice.autoBeamSettings \override
    #'(end * * * *) = #(make-moment 1 4)
Since the duration of a quarter note is 1/4 of a whole note, it is entered as (make-moment 1 4).

The same syntax can be used to specify beam starting points. In this example, automatic beams can only end on a dotted quarter note.

\property Voice.autoBeamSettings \override
    #'(end * * * *) = #(make-moment 3 8)
In 4/4 time signature, this means that automatic beams could end only on 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times 3/8 has passed within the measure).

You can also restrict rules to specific time signatures. A rule that should only be applied in N/M time signature is formed by replacing the second asterisks by N and M. For example, a rule for 6/8 time exclusively looks like

\property Voice.autoBeamSettings \override
    #'(begin * * 6 8) =  ...

If you want a rule to apply to certain types of beams, you can use the first pair of asterisks. Beams are classified according to the shortest note they contain. For a beam ending rule that only applies to beams with 32nd notes (and no shorter notes), you would use (end 1 32 * *).

If a score ends while an automatic beam has not been ended and is still accepting notes, this last beam will not be typeset at all.

Automatic beaming is on by default, but can be switched off by setting Voice.noAutoBeaming to true. You you may find this necessary for a melody that goes with lyrics.

BUGS

It is not possible to specify beaming parameters for beams with mixed durations, that differ from the beaming parameters of all separate durations, i.e., you'll have to specify manual beams to get:

[picture of music]

It is not possible to specify beaming parameters that act differently in different parts of a measure. This means that it is not possible to use automatic beaming in irregular meters such as 5/8.

Manual beams

In some cases it may be necessary to override LilyPond's automatic beaming algorithm. For example, the auto beamer will not beam over rests or bar lines, If you want that, specify the begin and end point manually using a [ before the first beamed note and a ] after the last note:

  \context Staff {
    r4 [r8 g' a r8] r8 [g | a] r8
  }

[picture of music] Whenever an manual beam is busy, the automatic beamer will not produce anything.

Normally, beaming patterns within a beam are determined automatically. When this mechanism fouls up, the properties Voice.stemLeftBeamCount and Voice.stemRightBeamCount. can be used to control the beam subdivision on a stem. If you set either property, it's value will be used only once, and then it is erased.

  \context Staff {
    [f8 r16 f g a]
    [f8 r16 \property Voice.stemLeftBeamCount = #1 f g a]
  }

[picture of music]

The beam symbol (grob Beam , both for automatic and manual beams) can be tweaked through grob-properties height and staff-position. These specify vertical location and vertical span. Both are measured in half staff-spaces, staff-position=0 corresponds to the middle staff line.

Set height to zero, to get horizontal beams:

  \property Voice.Beam \set #'direction = #1
  \property Voice.Beam \set #'height = #0
  [a'8 e' d c]

[picture of music]

Here's how you'd specify a weird looking beam that instead of being horizontal, falls two staff spaces:

  \property Voice.Beam \set #'staff-position = #4
  \property Voice.Beam \set #'height = #-4
  [c8 c]

[picture of music]

Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to lilypond@packages.debian.org

Copyright (c) 1997--2001 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.4.12 (stable-branch) by

Anthony Fok <lilypond@packages.debian.org>, Tue Mar 12 01:35:39 2002 HKT.