neoscore.western.flag

class neoscore.western.flag.Flag[source]

Bases: MusicText

A simple flag glyph determined by a duration and direction

__init__(pos: PointDef, parent: PositionedObject, duration: Duration, direction: DirectionY, font: Optional[MusicFont] = None)[source]
Parameters
  • pos – The position of this flag. When parent is a stem end point this should typically be ORIGIN.

  • parent – If no font is given, this or one of its ancestors must implement HasMusicFont.

  • duration – The duration corresponding to the flag. This controls the flag glyph rendered.

  • direction – The direction of the flag

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

property duration: Duration
property direction: DirectionY
classmethod vertical_offset_needed(duration: Duration) int[source]

Find the space needed in a stem using a flag of a given duration

The value is given in pseudo-staff-units.