clocks

class Action(event_id: int, event_type: int)

Bases: object

class AsyncClock

Bases: BaseClock[AsyncClockCallback]

An async clock.

cancel(event_id: int) Action | None
async start(initial_time: float | None = None, initial_offset: float = 0.0, initial_measure: int = 1, beats_per_minute: float | None = None, time_signature: tuple[int, int] | None = None) None
async stop() None
class AsyncClockCallback(*args, **kwargs)

Bases: Protocol

__call__(state: ClockCallbackState, *args: Any, **kwargs: Any) Awaitable[float | tuple[float, TimeUnit] | None] | float | tuple[float, TimeUnit] | None

Call self as a function.

class AsyncOfflineClock

Bases: AsyncClock

at(initial_time: float | None = None, initial_offset: float = 0.0, initial_measure: int = 1, beats_per_minute: float | None = None, time_signature: tuple[int, int] | None = None) AsyncGenerator[AsyncOfflineClock, None]
async start(initial_time: float | None = None, initial_offset: float = 0.0, initial_measure: int = 1, beats_per_minute: float | None = None, time_signature: tuple[int, int] | None = None) None
async stop() None
class BaseClock

Bases: Generic[C]

cancel(event_id: int) Action | None
change(beats_per_minute: float | None = None, time_signature: tuple[int, int] | None = None) int | None
cue(procedure: C, quantization: '8M' | '4M' | '2M' | '1M' | '1/2' | '1/2T' | '1/4' | '1/4T' | '1/8' | '1/8T' | '1/16' | '1/16T' | '1/32' | '1/32T' | '1/64' | '1/64T' | '1/128' | None = None, *, args: Sequence[Any] | None = None, event_type: int = EventType.SCHEDULE, kwargs: dict[str, Any] | None = None) int
cue_change(quantization: '8M' | '4M' | '2M' | '1M' | '1/2' | '1/2T' | '1/4' | '1/4T' | '1/8' | '1/8T' | '1/16' | '1/16T' | '1/32' | '1/32T' | '1/64' | '1/64T' | '1/128' | None = None, *, beats_per_minute: float | None = None, time_signature: tuple[int, int] | None = None) int
reschedule(event_id: int, schedule_at: float = 0.0, *, time_unit: TimeUnit = TimeUnit.BEATS) int | None
schedule(procedure: C, schedule_at: float = 0.0, *, args: Sequence[Any] | None = None, event_type: int = EventType.SCHEDULE, kwargs: dict[str, Any] | None = None, time_unit: TimeUnit = TimeUnit.BEATS) int
schedule_change(schedule_at: float = 0.0, *, beats_per_minute: float | None = None, time_signature: tuple[int, int] | None = None, time_unit: TimeUnit = TimeUnit.BEATS) int
property beats_per_minute : float
property is_running : bool
property name : str | None
property slop : float
property time_signature : tuple[int, int]
class CallbackCommand(event_id: int, event_type: int, quantization: '8M' | '4M' | '2M' | '1M' | '1/2' | '1/2T' | '1/4' | '1/4T' | '1/8' | '1/8T' | '1/16' | '1/16T' | '1/32' | '1/32T' | '1/64' | '1/64T' | '1/128' | None, schedule_at: float, time_unit: supriya.clocks.TimeUnit | None, args: tuple | None, kwargs: dict | None, procedure: supriya.clocks.AsyncClockCallback | supriya.clocks.ClockCallback)

Bases: Command

class CallbackEvent(event_id: int, event_type: int, seconds: float, measure: int | None, offset: float | None, procedure: supriya.clocks.AsyncClockCallback | supriya.clocks.ClockCallback, args: tuple | None, kwargs: dict | None, invocations: int)

Bases: Event

class ChangeCommand(event_id: int, event_type: int, quantization: '8M' | '4M' | '2M' | '1M' | '1/2' | '1/2T' | '1/4' | '1/4T' | '1/8' | '1/8T' | '1/16' | '1/16T' | '1/32' | '1/32T' | '1/64' | '1/64T' | '1/128' | None, schedule_at: float, time_unit: supriya.clocks.TimeUnit | None, beats_per_minute: float | None, time_signature: tuple[int, int] | None)

Bases: Command

class ChangeEvent(event_id: int, event_type: int, seconds: float, measure: int | None, offset: float | None, beats_per_minute: float | None, time_signature: tuple[int, int] | None)

Bases: Event

class Clock

Bases: BaseClock[ClockCallback]

A threaded clock.

cancel(event_id: int) Action | None
start(initial_time: float | None = None, initial_offset: float = 0.0, initial_measure: int = 1, beats_per_minute: float | None = None, time_signature: tuple[int, int] | None = None) None
stop() None
class ClockCallback(*args, **kwargs)

Bases: Protocol

__call__(state: ClockCallbackState, *args: Any, **kwargs: Any) float | tuple[float, TimeUnit] | None

Call self as a function.

class ClockCallbackState(current_moment, desired_moment, event)

Bases: NamedTuple

class ClockState(beats_per_minute, initial_seconds, previous_measure, previous_offset, previous_seconds, previous_time_signature_change_offset, time_signature)

Bases: NamedTuple

class Command(event_id: int, event_type: int, quantization: '8M' | '4M' | '2M' | '1M' | '1/2' | '1/2T' | '1/4' | '1/4T' | '1/8' | '1/8T' | '1/16' | '1/16T' | '1/32' | '1/32T' | '1/64' | '1/64T' | '1/128' | None, schedule_at: float, time_unit: supriya.clocks.TimeUnit | None)

Bases: Action

class Event(event_id: int, event_type: int, seconds: float, measure: int | None, offset: float | None)

Bases: Action

__ge__(other)

Return a >= b. Computed by @total_ordering from (not a < b).

__gt__(other)

Return a > b. Computed by @total_ordering from (not a < b) and (a != b).

__le__(other)

Return a <= b. Computed by @total_ordering from (a < b) or (a == b).

__lt__(other: object) bool

Return self<value.

class EventType(*values)

Bases: IntEnum

CHANGE = 0
SCHEDULE = 1
class Moment(beats_per_minute: float, measure: int, measure_offset: float, offset: float, seconds: float, time_signature: tuple[int, int])

Bases: object

class OfflineClock

Bases: BaseClock[ClockCallback]

An offline clock.

at(initial_time: float | None = None, initial_offset: float = 0.0, initial_measure: int = 1, beats_per_minute: float | None = None, time_signature: tuple[int, int] | None = None) Generator[OfflineClock, None, None]
start(initial_time: float | None = None, initial_offset: float = 0.0, initial_measure: int = 1, beats_per_minute: float | None = None, time_signature: tuple[int, int] | None = None) None
stop() None
class TimeUnit(*values)

Bases: IntEnum

BEATS = 0
MEASURES = 2
SECONDS = 1