artfwo / aalink Goto Github PK
View Code? Open in Web Editor NEWAsync Python interface for Ableton Link
License: GNU General Public License v3.0
Async Python interface for Ableton Link
License: GNU General Public License v3.0
As far as I can see, I have to provide a float tempo value when creating the Link object, e.g.
link = Link(120, loop)
link.enabled = True
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
After migrating from pybind11 to nanobind, this can happen when exiting aalink scripts, as the scheduler thread isn't always joined properly:
Traceback (most recent call last):
File "/home/art/aalink/build/./test.py", line 25, in <module>
asyncio.run(main())
File "/usr/lib64/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/asyncio/runners.py", line 123, in run
raise KeyboardInterrupt()
KeyboardInterrupt
terminate called without an active exception
Aborted (core dumped)
Detaching the thread instead of joining might lead to more segfaults, so the best solution here is probably resolving any potential cyclic dependencies to ensure that Scheduler destructor is invoked when link
is deleted.
See https://nanobind.readthedocs.io/en/latest/typeslots.html for some docs on resolving cyclic references.
To reproduce consisently, build in debug mode and increase the sleep timeout in scheduler thread to 100-500ms.
Hi, thanks for providing this library, the example worked out of the box for me.
Currently, my code listens to MIDI clock messages generated by Ableton to "slave" my code to Ableton.
Now I would like to use Link to replace MIDI clock syncing, so I use link.sync(1/24)
to get a clock-message-like signal, that works fine.
In addition, I would like to get the current beat count. I looked into the code and saw the functions to retrieve the attributes beat, time, phase, and so on. This enabled me to check, where on a given beat I am, e.g., 7.0 is precicely on the beat, 7.5 an 8th note after that, and so on.
But how do I determine, where in a given bar I am, e.g., that 7.0 is the 2 in a bar? It seems that beat
and the return value of sync
just counts from 0, but the relation to the beat is not fixed.
Thanks for any help,
Boris
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.