TimedEdge

TimedEdge(
    type: EdgeType,
    origin: EdgeOrigin = EdgeOrigin.ASSERTED,
    anchor: TimingAnchor = TimingAnchor.ONSET,
    displacement: Duration | None = None,
)

An edge that places its target in time relative to its source.

The target starts at the anchor of the source (its onset or its offset) plus a signed displacement; None means no displacement, so the target coincides with the anchor.

Attributes

Name Description
type
origin
meta
id
anchor
displacement

Methods

Name Description
nudge Nudges the displacement of this edge in the specified direction by the specified amount.
__repr__

nudge

nudge(direction: NudgeDirection, amount: Duration)

Nudges the displacement of this edge in the specified direction by the specified amount.

The displacement is a signed Duration: negative means the target starts before the anchor.

>>> from openmusickit.systems.wsmn.temporal.symbols import quarter, half
>>> edge = Branch()
>>> edge.nudge(NudgeDirection.FORWARD, quarter)
>>> edge.nudge(NudgeDirection.BACKWARD, half)
>>> edge.displacement
MetricalDuration(-1, 4)

Raises

Name Type Description
TemporalCompatibilityError if amount belongs to a different temporal system than the current displacement.

__repr__

__repr__()