Skip to content

Commit

Permalink
Removing begin and end in player
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubobubobubobubo committed Jul 15, 2024
1 parent 0092520 commit 95b541f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/shrimp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def exit():


clock._start()
clock.add(func=lambda: clock.play(now=True), time=clock.now, passthrough=True)
clock.add(func=lambda: clock.play(now=True), time=clock.next_bar, passthrough=True, once=True)

# == TEST AREA FOR THE PATTERN SYSTEM ======================================================

Expand Down
8 changes: 4 additions & 4 deletions src/shrimp/time/clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
class TimePos:
"""A class to represent a time position in a musical context."""

bar: int
beat: int
phase: float
bar: int = 1
beat: int = 0
phase: float = 0

def __eq__(self, other):
if not isinstance(other, TimePos):
Expand Down Expand Up @@ -93,7 +93,7 @@ class Clock(Subscriber):
Threads are used to ensure that the clock runs in the background and does not block the main thread.
"""

def __init__(self, tempo: int | float, grain: float = 0.0001, delay: int = 0.0):
def __init__(self, tempo: int | float, grain: float = 0.0001, delay: int = 0):
super().__init__()
self._clock_thread: threading.Thread | None = None
self._stop_event: threading.Event = threading.Event()
Expand Down

0 comments on commit 95b541f

Please sign in to comment.