neoscore.western.beam

class neoscore.western.beam.Beam[source]

Bases: MusicPath

A rhythmic beam connecting groups of notes.

This is a single beam - for multiple layers of beams (e.g. 2 for 16th notes), multiple of these must be stacked on top of each other. See BeamGroup for a reasonable implementation of this.

While this is a path, it requires a music font from which to derive its appearance.

__init__(pos: PointDef, parent: PositionedObject, end_pos: PointDef, end_parent: PositionedObject, font: Optional[MusicFont] = None, brush: Optional[BrushDef] = None, pen: Optional[PenDef] = None)[source]
Parameters
  • pos – The starting (left) position of the beam

  • parent – The parent for the starting position. If no font is given, this or one of its ancestors must implement HasMusicFont.

  • end_pos – The ending (right) position of the beam

  • end_parent – The parent for the ending position. Must be a staff or in one.

  • font – If provided, this overrides any font found in the ancestor chain.

  • brush – The brush to fill shapes with.

  • pen – The pen to draw outlines with.