-
Notifications
You must be signed in to change notification settings - Fork 3
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
Creating the link object *sometimes* changes the tempo. #7
Comments
It might be a problem with the underlying Link library. I think a workaround for this could be adding a small delay between instantiating Link and setting link.enabled. |
Thanks for the advice, that was very helpful. Indeed, a delay of 500ms does the job (while 200ms does not). For future reference:
Cheers, Boris |
@bolau i'd like to report this upstream, on which system does it happen for you? also does this only happen with Ableton Live or other Link-enabled apps? |
Hi Artem,
Expected result: the second instance should adopt the tempo of the already running instance. What actually happens: In roughly 70% of the trials, the second adopts the tempo of the first. But in roughly 30% of the trials, the tempo changes to that of the second instance. If I uncomment the line containing the sleep, the latter does not happen anymore and I get the expected result. import asyncio
import time
import sys
from aalink import Link
async def main():
loop = asyncio.get_running_loop()
tempo = int(sys.argv[1])
link = Link(tempo, loop)
# await asyncio.sleep(0.5)
link.quantum = 4
link.enabled = True
print(dir(link))
while True:
r = await link.sync(1)
print(link.tempo)
asyncio.run(main()) I hope this is clear. The issue happens with Ableton but also with two instances of the same script using aalink. Best, Boris |
Thanks @bolau ! So far I'm unable to reproduce it with pure C++ minimal example, but I can consistently reproduce it with your example in Python. So it might be that the issue is actually with aalink (even though it's rather strange, since Python only calls the appropriate C++ counterparts). I'll keep looking into it! Cheers, |
As far as I can see, I have to provide a float tempo value when creating the Link object, e.g.
Most of the time, this doesn't change the tempo in the linked Ableton, but adjusts to the tempo that is currently set in Ableton. But sometimes it is the other way around, and the tempo in Ableton is changed to the value provided in the constructor, roughly 10% of my trials. Is there a way of controlling this?
I tried using strange values like None, float('nan'), but that just yields an error message or non-working code, respectively. I also tried proving -1 or 0 as tempo, but that causes the same behavior as using 20 (sometimes setting Ableton's tempo to 20, or not changing the tempo most of the time).
What can I do?
Thanks for any help,
Best, Boris
The text was updated successfully, but these errors were encountered: