Skip to content

Commit

Permalink
Streamline PatternPlayer.play()
Browse files Browse the repository at this point in the history
  • Loading branch information
josephine-wolf-oberholtzer committed Feb 27, 2025
1 parent 33e1323 commit 2240fbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion supriya/patterns/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def play(
Optional[Coroutine],
]
] = None,
clock: Optional[BaseClock],
clock: BaseClock,
quantization: Optional[Quantization] = None,
target_bus: Optional[Bus] = None,
target_node: Optional[Node] = None,
Expand Down
5 changes: 2 additions & 3 deletions supriya/patterns/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
from ..clocks import (
BaseClock,
CallbackEvent,
Clock,
ClockContext,
OfflineClock,
Quantization,
)
from ..contexts import Bus, Context, ContextObject, Node
Expand Down Expand Up @@ -256,7 +254,8 @@ def play(
)
if until:
self._clock.schedule(self._stop_callback, event_type=2, schedule_at=until)
self._clock.start(initial_time=at)
if not self._clock.is_running and hasattr(self._clock, "start"):
self._clock.start(initial_time=at)

def stop(self, quantization: Optional[Quantization] = None) -> None:
with self._lock:
Expand Down

0 comments on commit 2240fbe

Please sign in to comment.