Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player times are not synchronized #268

Open
taconi opened this issue Oct 12, 2024 · 0 comments
Open

Player times are not synchronized #268

taconi opened this issue Oct 12, 2024 · 0 comments

Comments

@taconi
Copy link

taconi commented Oct 12, 2024

When I try to play two players with different tempos, they end up playing out of sync with each other.

How to reproduce the bug?

Install the latest version from the repository (also happens with the pypi version sardine-system==0.4.0 )

Dependency

pip install git+https://github.com/Bubobubobubobubo/sardine@5e1e5920a3dd7f82e7ad04051f877f85ada00cf9

Works as expected

This example below plays correctly, both playing at the same time:

Pa * d('dr:7 dr dr dr ', p=1)  # metronome

Pb * d('crow ...', p=1)

Same working example with @swim

@swim
def metronome(p=1, i=0):
    D('dr:7 dr dr dr', i=i)
    again(metronome, p=p, i=i+1)

@swim
def head(p=1, i=0):
    D('crow ...', i=i)
    again(head, p=p, i=i+1)

Not synchronized

Now the example without synchronization.

The metronome will not be changed, only the player will hit the tempo head.

His time will be divided by two and will be filled with silence to try to keep time in mind.

Pa * d('dr:7 dr dr dr ', p=1)  # metronome

Pb * d('crow ... ....', p=1/2)

Same example without synchronization with @swim:

@swim
def metronome(p=1, i=0):
    D('dr:7 dr dr dr', i=i)
    again(metronome, p=p, i=i+1)

@swim
def head(p=1/2, i=0):
    D('crow ... ....', i=i)
    again(head, p=p, i=i+1)

Expected behavior

The head (crow) should accompany dr:7, play at the same time

tempo 1 x 2 x 3 x 4 x
'dr:7 dr dr dr ', p=1 dr:7 dr dr dr
'crow ...', p=1 crow . . .
'crow ... ....', p=1/2 crow . . . . . . .
  • x: countertime
  • .: silence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant