3.2.99 stem-interface

The stem represents the graphical stem. In addition, it internally connects note heads, beams, and tremolos. Rests and whole notes have invisible stems.

The following properties may be set in the details list.


List of stem lengths given beam multiplicity.


List of normal minimum free stem lengths (chord to beams) given beam multiplicity.


List of extreme minimum free stem lengths (chord to beams) given beam multiplicity.


Default stem lengths. The list gives a length for each flag count.


How much a stem in a forced direction should be shortened. The list gives an amount depending on the number of flags and beams.

User settable properties:

avoid-note-head (boolean)

If set, the stem of a chord does not pass through all note heads, but starts at the last note head.

beaming (pair)

Pair of number lists. Each number list specifies which beams to make. 0 is the central beam, 1 is the next beam toward the note, etc. This information is used to determine how to connect the beaming patterns from stem to stem inside a beam.

beamlet-default-length (pair)

A pair of numbers. The first number specifies the default length of a beamlet that sticks out of the left hand side of this stem; the second number specifies the default length of the beamlet to the right. The actual length of a beamlet is determined by taking either the default length or the length specified by beamlet-max-length-proportion, whichever is smaller.

beamlet-max-length-proportion (pair)

The maximum length of a beamlet, as a proportion of the distance between two adjacent stems.

default-direction (direction)

Direction determined by note head positions.

direction (direction)

If side-axis is 0 (or #X), then this property determines whether the object is placed #LEFT, #CENTER or #RIGHT with respect to the other object. Otherwise, it determines whether the object is placed #UP, #CENTER or #DOWN. Numerical values may also be used: #UP=1, #DOWN=-1, #LEFT=-1, #RIGHT=1, #CENTER=0.

duration-log (integer)

The 2-log of the note head duration, i.e., 0 = whole note, 1 = half note, etc.

flag (unknown)

A function returning the full flag stencil for the Stem, which is passed to the function as the only argument. The default ly:stem::calc-stencil function uses the flag-style property to determine the correct glyph for the flag. By providing your own function, you can create arbitrary flags.

flag-style (symbol)

A symbol determining what style of flag glyph is typeset on a Stem. Valid options include '() for standard flags, 'mensural and 'no-flag, which switches off the flag.

french-beaming (boolean)

Use French beaming style for this stem. The stem stops at the innermost beams.

length (dimension, in staff space)

User override for the stem length of unbeamed stems.

length-fraction (number)

Multiplier for lengths. Used for determining ledger lines and stem lengths.

max-beam-connect (integer)

Maximum number of beams to connect to beams from this stem. Further beams are typeset as beamlets.

neutral-direction (direction)

Which direction to take in the center of the staff.

no-stem-extend (boolean)

If set, notes with ledger lines do not get stems extending to the middle staff line.

stem-end-position (number)

Where does the stem end (the end is opposite to the support-head)?

stemlet-length (number)

How long should be a stem over a rest?

stroke-style (string)

Set to "grace" to turn stroke through flag on.

thickness (number)

Line thickness, generally measured in line-thickness.

Internal properties:

beam (layout object)

A pointer to the beam, if applicable.

details (list)

Alist of parameters for detailed grob behavior.

More information on the allowed parameters can be found by inspecting ‘lily/slur-scoring.cc’, ‘lily/beam-quanting.cc’, and ‘lily/tie-formatting-problem.cc’. Setting debug-tie-scoring, debug-beam-scoring or debug-slur-scoring also provides useful clues.

note-heads (unknown)

A list of note head grobs.

positioning-done (boolean)

Used to signal that a positioning element did its job. This ensures that a positioning is only done once.

rests (unknown)

A list of rest objects.

stem-info (pair)

A cache of stem parameters.

tremolo-flag (layout object)

The tremolo object on a stem.

This grob interface is used in the following graphical object(s): Stem.

Internals Reference