helio-fm / helio-sequencer

Libre music sequencer for desktop and mobile platforms
https://helio.fm
GNU General Public License v3.0
3.09k stars 115 forks source link

Feat - support clock syncronization protocols #268

Open PowerUser64 opened 1 year ago

PowerUser64 commented 1 year ago

Currently, Helio does not offer any way I am aware of to sync clocks with other applications or hardware. There are a number of protocols that exist for syncing clocks between applications that Helio could support to make it easier to use Helio with other software and hardware.

Here are some commonly-usedclock synchronization protocols:

  1. MIDI Clock
  2. MIDI Machine Control (MMC)
  3. Ableton Link
  4. JACK Transport

The first two items of this list are part of the MIDI standard and can be used to sync things such as arpeggiators on hardware synthesizers with a software clock, as well as syncing software with software. Much like MIDI as a whole, it is very simple.

Ableton Link is an open-source technology that "synchronizes musical beat, tempo, and phase across multiple applications running on one or more devices" (quoting the readme). It uses networking to accomplish this.

JACK Transport is an API for syncing an application's timeline with JACK Transport, which is a part of the JACK Audio Connection Kit. It is very easy to use once you get JACK running, and most DAWs use it because it functions like a timeline. It

Of the options presented above, Ableton Link and JACK Transport are my favorites, as they seem to be the most flexible and are generally the easiest to use. There could be other clock synchronization protocols I'm not aware of that would be worth supporting too. Adding support for some or all of these clock sync protocols would greatly improve Helio's ability to be used with other applications.


PS: For testing or seeing how any of these work in practice, bespoke synth is a FOSS software package that supports the first three of these. Ardour supports 1, 2, and 4. Zrythm supports 4, but support for 1 and 2 is planned for release soon.

Note that in bespoke synth, there is an offset slider on the abletonlink module for changing the tempo offset in milliseconds. I've found this slider to be very helpful when doing things with ableton link that require syncing to a specific measure. Being able to set it to arbitrary positive or negative values (to shift the clock by even multiple measures) can be very useful too.

PowerUser64 commented 1 year ago

I should also mention MIDI Timecode (MTC), I'm not sure of its relation to the other MIDI-driven clock syncing protocols, but it's something else to be aware of.