neoscore.western.tuplet

class neoscore.western.tuplet.Tuplet[source]

Bases: Spanner2D, PositionedObject, HasMusicFont

A polyrhythm indicator such as triplet or 3:4.

This tuplet indicator spans a group of notes labelling them as triplet or more complex polyrhythms such as 5:4.

At the centre of this line is the tuplet number. More complex ratios can be declared such as 7:8, 11:16, 12:14.

Optional parameters enable bracket visibility, and bracket direction.

__init__(start: PointDef, start_parent: PositionedObject, end: PointDef, end_parent: Optional[PositionedObject] = None, indicator_text: str = '3', include_bracket: bool = True, bracket_dir: DirectionY = DirectionY.DOWN, font: Optional[MusicFont] = None)[source]
Parameters
  • start – The starting point.

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

  • end – The spanner end point position. This must be to the right of the start position

  • end_parent – An object either in a Staff or a staff itself. The root staff of this must be the same as the root staff of start_parent. If omitted, the stop point is relative to the start point.

  • indicator_text – The tuplet indicator text drawn at the middle of the spanner. This should consist only of numbers and colons, for example “3” or “5:4”. Any other character will cause a ValueError to be raised.

  • include_bracket – Whether to draw a bracket spanning the tuplet

  • bracket_dir – The direction the line’s ending hook points.

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

property music_font: MusicFont

The music font used by this object.