# Improving synchronisation for collaborative live-coding

**URL:** <https://in-thread.sonic-pi.net/t/improving-synchronisation-for-collaborative-live-coding/2029>\
**Category:** Support, Help & Resources\
**Created:** [February 21, 2019, 2:51am UTC](https://in-thread.sonic-pi.net/t/improving-synchronisation-for-collaborative-live-coding/2029 "2019-02-21T02:51:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bubo](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/bubo/32/786_2.png) [@Bubo](https://in-thread.sonic-pi.net/u/Bubo)\
**Post date:** [February 21, 2019, 2:51am UTC](https://in-thread.sonic-pi.net/t/improving-synchronisation-for-collaborative-live-coding/2029/1 "2019-02-21T02:51:24Z")

</div>

Hey! I’m trying to setup a musical piece that would involve 7-8 people live-coding together using [Troop](https://github.com/Qirky/Troop). If you don’t know this tool, it works pretty well already and it allows you to collaborate and code with other people through network, by sharing the same buffer of text.

However, we try to use it to synchronise multiple players in the same room. That means that delay is pretty easily noticeable when playing around with rhythmical loops, or with long arrays of notes. Approximatively 50% of the time, we are able to synchronise it in such a way that the delay is pretty much not noticeable due to the multiplication of the sound sources in the same sonic space.

The rest of the time, we hear a very — very — precise delay that could correspond to an eight or sixteenth note. It must mean that we are still in sync but that every computer started just a few milli-seconds too late or too soon.

Is there anything built in Sonic-Pi that could allow us to optimize this synchronisation by making Sonic-Pi more reactive? The person I was running the tests with was suggesting to change the audio buffer size. Do you know how we could do so? Or any other hack?

Thank your for your help! I hope that we’ll be able to figure it out and synchronize everything so we can enjoy collaborative live-coding.

---

<div class="post-metadata">

**Author:** ![jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jonny](https://in-thread.sonic-pi.net/u/jonny)\
**Post date:** [October 27, 2023, 4:36pm UTC](https://in-thread.sonic-pi.net/t/improving-synchronisation-for-collaborative-live-coding/2029/2 "2023-10-27T16:36:40Z")

</div>

Interesting. First thoughts - internet time & clock, latency, buffer and device configas you mention.

Also wondering if possible to try an A|B test with ninjam. this probably won’t help much, but may be interesting to see if synchronicity is achieved there.

Other than that not sure if jack/ jacktrip could help, or be tested.

will try this when I can (with more devices;)

ps: these may help

> [@Sonic Pi 4: Optimal Performance For Livecoding](https://in-thread.sonic-pi.net/t/sonic-pi-4-optimal-performance-for-livecoding/6803):
>
> Hello----it’s likely that what I’m about to ask has been covered, probably several times over, so I won’t be upset if someone gently directs me to a Sticky Note or series of them or whatever. I’m interested in doing Livecoding with Sonic Pi. I have a Pi 4 with stock-standard Raspbian on it. Is there any advice out there on how to optimize this machine for best performance for a decent length Livecoding session—in terms of avoiding lag, optimal sound quality, maybe some kind of accompanying vi…

> [@Live midi and audio latency reduction](https://in-thread.sonic-pi.net/t/live-midi-and-audio-latency-reduction/3094):
>
> Hi again, I’ve been experimenting with use\_real\_time midi triggers and live\_audio, but have been rather disappointed by the latency - it feels like several tens of ms. Does anybody have any advice for how to reduce latency? In DAWs, this would typically be accomplished by reducing buffer sizes etc., but I couldn’t find any configuration for this in Sonic Pi. My set-up: Mac OS X Mavericks on a 2016 MBP, Apogee Element 88 audio interface connected via firewire, Roland Octapad + drum triggers a…
