Crate API

rusty_link

rustylink is a Rust wrapper of abllink, which is a C 11 extension made by Ableton for their C++ codebase. This library attempts to be unopinionated and plain in copying the functionality of abl_link, while providing Rust's safety guarantees.

Ableton Link is a technology that synchronizes musical beat, tempo, phase, and start/stop commands across multiple applications running on one or more devices. Applications on devices connected to a local network discover each other automatically and form a musical session in which each participant can perform independently: anyone can start or stop while still staying in time. Anyone can change the tempo, the others will follow. Anyone can join or leave without disrupting the session.

Implementation

Example

This crate includes a Rust port of the Ableton Link 'link_hut' example written in C. See it here.

Safety

The callback functions / closures set with set_num_peers_callback, set_tempo_callback and set_start_stop_callback are handled by the underlying Link C++ library and may be run at any time. Data races and hidden mutations can occur if a closure has captured local variables and uses them at the same time as other code.

Feedback

Pull requests and feedback in the github discussion section is very welcome!

License

Ableton Link is dual licensed under GPLv2+ and a proprietary license.

This means that this wrapper is automatically under the GPLv2+ as well. A copy of the license is distributed with the source code.

If you would like to incorporate Link into a proprietary software application, please contact Ableton at link-devs@ableton.com.

Credits

Thanks to Magnus Herold for his implementation. I made this library to learn about FFI in Rust and I started it as a fork of his. His library is great and adds a number of additional mappings, such as the ones to Clock in Ableton's C++ code. This crate on the other hand is purely built on Ableton's own C Wrapper, and requires addidional functions to be implemented in pure Rust, if these are required by the user.

Some code for splitting closures has been borrowed from ffihelpers with altered functionality. Thanks to Michael F Bryan for his work. Pull request to ffihelpers pending.

Links

I also made a multi-platform Ableton Link wrapper for Flutter, called f_link, based on what I learned in this project.