sonosaurus / sonobus

Source code for SonoBus, a real-time network audio streaming collaboration tool.
https://sonobus.net
GNU General Public License v3.0
1.53k stars 110 forks source link

Feature Request: bridge Ableton Link over SonoBus #89

Open ericfont opened 3 years ago

ericfont commented 3 years ago

Frequently with SonoBus sessions I'm finding myself wanting to setup a loop with the other peers and keep my in sync with them. Currently I am forced to ask my peer to use a fixed bpm metronome, and then I create a midi clock on my computer with that bpm and feed that midi clock into your SooperLooper program to provide tempo synchronization so I can start and stop my loop quantize to that midi clock. But the limitation of that is having manually change my metronome bpm whenever my peer changes to a new bpm. And I have to manually make sure I start my midi clock in phase with them. I initially considered maybe trying to send the midi clock over the network, or using an auto beat detection to reconstruct the midi clock from the metronome audio...but that is a bit complicated and is limited to having one master control the tempo. But it turns out that there is a open protocol with Ableton Link that allows any peer to control the tempo changes and keeps everyone in sync...but it only works over LAN:

https://ableton.github.io/link/

I'd like to try getting Ableton Link to communicate with all peers on the SonoBus session, where sonobus acts as a networking bridge. SonoBus could forward any Ableton Link messages it receives to the other peer SonoBus instances, which could put the received messages on that peers LAN. SonoBus wouldn't do too much more beyond that and maybe being able to set the local metronome according to received Ableton Link messages and start & stop. Having Ableton Link control the metronome would also remove the need to spend bandwidth sending a channel of metronome audio to everyone, too.

Someone has a barebones Ableton Link for Juce I can use as a guide.

https://github.com/ianacaburian/AbletonLink_JuceSampler

But I was wondering if you had considered such a feature in your roadmap. I don't want to bloat your software by complicating it with unnecessary features, and I might be able have Ableton Link be an optional feature set at compile.

ericfont commented 3 years ago

Could also allow having the playback of an pre-recorded track start and stop in sync. (That doesn't necessarily require ableton link integration, though there is specific ableton link commands for that, as well as for informing others about intent to start/stop.)

essej commented 3 years ago

This could end up being a pretty complicated thing to get right, but valuable. Certainly I've considered some different approaches to synchronization... but have put off all of them until later because I know what a rabbit hole it will be...

ericfont commented 3 years ago

Sort of a workaround, but I quickly made a jack client for a simple converter from a metronome audio stream (such as from SonoBus metronome audio) to a midi beat clock:

https://github.com/ericfont/metronome-audio-to-midi

That midi beat clock can be fed into any program that accepts a midi beat clock for synchronization, such as sooperlooper.

Uses simple hysteresis. I need to improve to detect strong beat and weak beats and start and stop, but at least the basic functionality works.

berndkeul commented 3 years ago

i do something similar with the Max for life device Beatseeker

can I use this jack client on MacOS 10.13 ?

ericfont commented 3 years ago

You could use my metronome-audio-to-midi jack client in Mac provided that you have jack installed and you know how to compile (also it needs a curses library). Jack is a whole separate topic.

However, I don't want to oversell my converter program...it is very simple, simply detects if incomming audio exceeds a threshold to determine that a metronome click has started and then looks for that metronome audio being lower than a certain threshold for a certain number of milliseconds to determine that that metronome click is over. The main code is here: https://github.com/ericfont/metronome-audio-to-midi/blob/master/metronome-audio-to-midi.c#L82-L113

I should really port the program to PortAudio, that way it can be used by various non-jack environments such as Windows & Mac.

berndkeul commented 3 years ago

Hello Eric , I guess we played together at least once with Jason and Jesse ,

nice , I´m not a programmer but I do research the midi sync possibilities , I would you like to have chat an a private Sonobus group sometime ?

ericfont commented 3 years ago

I prefer just using this GitHub issue.

berndkeul commented 3 years ago

Hello , is there a way to test your converter ? I have MacOs High Sierra and Jack 0.91 installed , but I don't know how to open this Jack client .

Thank you

ericfont commented 3 years ago

Hello , is there a way to test your converter ? I have MacOs High Sierra and Jack 0.91 installed , but I don't know how to open this Jack client .

Thank you

I've tried to build a macOS version via GitHub Actions, though this is my first time using GitHub Actions so I probably did something wrong. I don't have a way to test it without a mac on hand, though please try downloading this build:

https://github.com/ericfont/metronome-audio-to-midi/releases/download/v0.1.2.7/metronome-audio-to-midi_macOS.7z

and extracting it and then open a terminal and change to the extracted directory's bin folder and run ./metronome-audio-to-midi

PowerUser64 commented 1 year ago

Having support for ableton link would be incredible and would make jamming with random people in 10000% easier. Syncing clocks is currently the most manual and tedious part of doing a jam session, and automating it would be a huge game-changer.

I'm thinking the way this would work is sonobus would host an ableton link client and sync it with the other members of the group. Then, you would connect to sonobus's ableton link client from your performance software.

This is simple in thought, but I think the real challenge might come from getting ableton link's data to go over the sonobus network, as it's not designed to do this by default.

Two ways I could see this being done are:

  1. Having a sonobus group clock separate from ableton link that gets synced between clients and then to ableton link
  2. Telling/hacking ableton link to go over the internet

I have not used the ableton link library to know how this could be done or how feasible it is, but these are my thoughts on how it could work.

DrConflict commented 10 months ago

Is this something that's still being considered/worked on or should we just forget this idea? Would be a really amazing addition to Sonobus for sure.

Zipdox2 commented 10 months ago

I think maybe implementing OSC would be a better idea, since Ableton is proprietary.

berndkeul commented 10 months ago

Osc is powerful and free , I would like to test

Ableton Link was working great last week on a gig with 3 synced machines …

Schönen Gruß

Bernd Keul

Gustav Heinemann- Ufer 112/9 50968 Köln Tel. 0221/324963 Mobil 0177/1628920 E-Mail: @.***

http://www.youtube.com/user/berndkeul

http://www.vimeo.com/user367470

Am 06.11.2023 um 15:50 schrieb Zipdox2 @.***>:

I think maybe implementing OSC would be a better idea, since Ableton is proprietary.

— Reply to this email directly, view it on GitHub https://github.com/sonosaurus/sonobus/issues/89#issuecomment-1795004450, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT4R4A7EAOLYUWOLVD6OVITYDD2J5AVCNFSM424A6HL2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZZGUYDANBUGUYA. You are receiving this because you commented.

DrConflict commented 10 months ago

Never heard of this OSC alternative. Either way, some sync protocol for online jams seems like a no brainer for Sonobus. Not sure why this hasn't been implemented to be honest.

Zipdox2 commented 10 months ago

Never heard of this OSC alternative. Either way, some sync protocol for online jams seems like a no brainer for Sonobus. Not sure why this hasn't been implemented to be honest.

https://en.wikipedia.org/wiki/Open_Sound_Control

Ableton also supports it

essej commented 10 months ago

Ableton Link was designed to sync things that are in the same physical location so that the sound comes out together at that shared single location. The solution for the distributed peer-to-peer thing is different and more along the lines of NinJam and independently controlled musically synced added latency , and that’s the direction of the stuff we have been planning. As for “not sure why this hasn’t been implemented”, it’s purely a matter of available time and other responsibilities!

DrConflict commented 10 months ago

Ableton Link was designed to sync things that are in the same physical location so that the sound comes out together at that shared single location. The solution for the distributed peer-to-peer thing is different and more along the lines of NinJam and independently controlled musically synced added latency , and that’s the direction of the stuff we have been planning. As for “not sure why this hasn’t been implemented”, it’s purely a matter of available time and other responsibilities!

Fair enough. It just seems odd that there isn't a sync protocol in an online jam app where syncing multiple people would be rather important. Anyway, I'm hoping something like this can be implemented in the near future. Since Sonobus seems to be one of the best online jam solutions currently available. Looking forward to the future of this app.

berndkeul commented 10 months ago

i have plans with it , too ,

we made a successful with midi clock over VDO NINJA , controlling drum machines on separate Sonobus channels , If you want we can make a test some time ...

berndkeul commented 10 months ago

https://vdo.ninja/midi

fmgdias commented 8 months ago

A huge game changer !!!

PowerUser64 commented 8 months ago

For folks interested in this, I did some experimenting and I managed to get Ableton Link to work over the internet via zerotier. Basically, you make a network and put all the computers on it that you want to connect to link, then you enable multicast on the network and you're good to go.

berndkeul commented 8 months ago

I would like to try this , but I have no clue , haha