Ninjam is a fantastic invention. It allows for people to connect from across the world via the internet and play music. How is the internet latency compensated? Well, the interval is stretched and expressed as a musical measure of time in beats in relation to a master tempo streamed from a Ninjam server. How beautiful.
I get the feeling that Ninjam is made for those people playing so-called traditional instruments; think guitars, bass, piano, cello etc. However, i have a need to jam on Ninjam using Ableton live. Of course, synchronisation becomes a big issue - even the slightest jolt of the internal metronome on Live, and the whole feel and rhythm is completely out, and also very difficult to correct without stopping the sequencer. Additionally, everything drifts out of time - always.
I am aware of the fact that there is a Windows version of the Ninjam client that generates a MIDI beat clock signal from the master ninjam metronome, allowing for a tight synchronisation between a host sequencer and the Ninjam interface.
But i have not found such a tool for Mac OS X.
I have constructed a simple Max/MSP patch that acts as a "quick fix" to the problem by generating a MIDI beat clock signal.
How does it work? Let us review some important facts about Ninjam and MIDI beat clock.
Ninjam always works with an interval divided up into a given number of beats based on a master metronome. I assume that all parties hear this master metronome in some form if they are wanting to; otherwise, what is the point of Ninjam if we are all out of sync. Thus, it can be said that the master metronome is the tempo authority when it comes to all parties in a jam. The metronome outputs at a rate of one click per quarter note. The client knows the current tempo of the Ninjam metronome. This tempo does not change all the time.
MIDI beat clock operates as an analogy of a tempo speed (ie. unlike timcode). MIDI beat clock generates / accepts 24 pulse per quarter note (and sends the byte 248 this often).
So. The audio output of the metronome stream from Ninjam is fed into the patch. A threshold is set, above which signifies a pulse. This threshold will trigger a 248 byte once per quarter-note click from the Ninjam metronome. This byte is then echoed 23 times and fed into a MIDI output. The interval between the echoes is calculated based on the master BPM tempo in the Ninjam client.
This system may not always be perfect. However, because the patch is simply reacting to the metronome and not generating its own metronome counter so to speak, the MIDI clock stream is constantly adjusting and on average it actually sounds relatively good. There is no audible drift over long periods of time because of this self-correcting sort of mechanism.
Finally, the start byte (250) is always latched out on a quarter note pulse from the Ninjam metronome.
The MIDI beat clock signal can be internally routed to Ableton Live for example.
The major limitation with this setup is that the signal one transmits to other Ninjam users must be mono.
Download the patch / collective here: http://milkcrate.com.au/_other/downloads/max_patches/ninjammer.zip