Contains
Contains(
type: EdgeType,
origin: EdgeOrigin = EdgeOrigin.ASSERTED,
anchor: TimingAnchor = TimingAnchor.ONSET,
displacement: Duration | None = None,
)From a LineGroup to the head of one of its lines: the line starts at the group’s origin plus the displacement. A group has no offset, so the anchor is always the origin and only displacement can be set. A Score’s CONTAINS edges are plain OmkEdges, not this class: a score is not a timing origin.
>>> from openmusickit.systems.wsmn.temporal.symbols import whole
>>> Contains(displacement=whole)
Contains(displacement=MetricalDuration(1, 1))
>>> Contains().displacement is None, Contains().type
(True, <EdgeType.CONTAINS: 'contains'>)Attributes
| Name | Description |
|---|---|
| origin | |
| meta | |
| id | |
| displacement | |
| type | |
| anchor |
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__()