neoscore.western.accidental

class neoscore.western.accidental.Accidental[source]

Bases: MusicText

A visual accidental.

__init__(pos: PointDef, parent: PositionedObject, accidental_type: AccidentalType | str, font: Optional[MusicFont] = None)[source]
Parameters
  • pos – Position relative to parent

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

  • accidental_type – Which accidental to draw. For extended accidentals, an arbitrary string SMuFL glyph name may be provided.

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

property accidental_type: AccidentalType | str

The accidental variant.

Can be set to either a standard accidental type or an arbitrary SMuFL glyph name.

Setting this automatically updates the displayed glyph.