neoscore.western.hairpin

class neoscore.western.hairpin.Hairpin[source]

Bases: MusicPath, Spanner2D

A crescendo/diminuendo hairpin spanner.

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: DirectionX = DirectionX.RIGHT, width: Optional[Unit] = None, font: Optional[MusicFont] = None)[source]
Parameters
  • pos – The starting point.

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

  • end_pos – The stopping point.

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

  • direction – The direction of the hairpin, where LEFT means diminuendo (>) and RIGHT means crescendo (<).

  • width – The width of the wide hairpin. Defaults to 1 staff unit.

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

property music_font: MusicFont

The music font used by this object.

property direction: DirectionX

The direction of the hairpin.

LEFT means diminuendo (>) and RIGHT means crescendo (<).

elements: List[PathElement]