After SC2012 I thought a lot about this kind of stuff. I think while
most sync implementations are based on the fact, that computers are
precise enough to keep time if they know a common start time the
MandelClock implementation is more modeled after a musician that
constantly listens to a rhythmic leader (in a band often the drummer)
and tries to keep as close as possible to him by accelerating or
deaccelerating.
While the implementation itself is a little bit clumsy and sample
precision isn't possible we get some stuff for free:
- accelerandos and ritardandos just work for free, even if they happen
a little delayed
- The system is able to recover sync if lost: I tried this case:
A(Leader) and B(Follower) were connected through ethernet cable. A and
B were in sync. Unplug cable. As all clocks are ticking locally too
they're still in sync. A does a subtle tempo change. Clocks get out of
sync. Replug Ethernet cable. B catches up and is in sync again.
- subtle async (and changing async) is musical. Imagine everybody was
sample synced and everybody would have a sharp percussive envelope on
a downbeat. The signal would clip for a short time. With a subtle
async this doesn't happen. There might be a subtle phasing that
changes all the time, because followers constantly will fall slightly
out of sync and regain sync.
So while MandelClock might be a bad technical solution it works quite
well on a musical level. But only on LAN and on decent WIFIs. This
could be improved though (currently there is no real latency
compensation).
I implemented a follower for a OpenFrameworks project. It has no
Scheduler but I can get the current position of the clock on every
frame.
Currently it's a little bit locked behind the whole MandelHub package,
you can't just start the clock without everything else and there is a
OSC namespace and conventions and stuff. I'm behind of documenting
stuff but if there's some interest I can extract the protocol for the
clock sync stuff and post it here, so people can think about
implementations on their system.
If you use SuperCollider the best thing atm is just to:
MandelHub.start("Jaja");
or
MandelHub.join("JuJu");
as this will set the default TempoClock to a new TempoClock instance
that is controlled (and synced) by MandelHub.
The other main feature of MandelHub is MandelSpace, a shared
dictionary/hashmap (with built in scheduling of values) for which i
want to rewrite the network part after a good talk with Neil. Finding
a standard way for doing that might be interessting as well, and be
aware, that a concept like this can easily be extended for other
purposes, as you can trigger functions on value changes, etc.
Keep in mind: MandelHub is designed for live coding, so there is no
remote method invocation system (because we don't need that) built in.
As I see it BiLETools is all about that. So we must be careful: A
common solution might not be the best for everybody and could cripple
diversity in networked laptop performances.