neoscore.western.slur

class neoscore.western.slur.Slur[source]

Bases: MusicPath, Spanner2D

A slur, also usable as a tie.

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: Optional[PositionedObject] = None, direction: DirectionY = DirectionY.UP, height: Optional[Unit] = None, arch_length: Optional[Unit] = None, font: Optional[MusicFont] = None, brush: Optional[BrushDef] = None, pen: Optional[PenDef] = None)[source]
Parameters
  • pos – The starting point.

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

  • end_pos – The stopping point.

  • end_parent – The parent for the ending position. If None, defaults to self.

  • direction – The vertical direction the slur arches.

  • height – The ascent or descent of the curve given in absolute value. If omitted, a reasonable default is derived from other properties.

  • arch_length – The x-offset of the outer ascent or descent curve control points. Smaller values give tighter arches. If omitted, a reasonable default is derived from other properties

  • 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.

elements: List[PathElement]