Sync and Tempo Master

The DJM 2000 nexus has a mode for its touchscreen which allows you to see and control which players are synced and which is the tempo master, and of course individual players can take over being master as well. This section describes the packets used to implement these features.

Sync Control

To tell a player to turn Sync mode on or off, send a packet like the one shown below to port 50001 of the target device, with the player number that you are pretending to be as the value of D, and set the value of S to 0x10 if you want the player to turn on Sync, and 0x20 if you want it to leave Sync mode.

0123456789abcdef5173707431576d4a4f4c2a0010Device Name (padded with 00)012000Dlenr000000D000000S
Sync control packet.

Since this packet uses subtype 00, the length sent in lenr has the value 0008, reflecting the eight bytes which follow it.

Tempo Master Assignment

To tell a player to become tempo master, the same type of packet shown above is used, with a value of 01 for S. This will cause the player to behave as if the DJ had pressed its Master button, following the steps described in the next section. This packet can be sent to a CDJ or DJM mixer.

Tempo Master Handoff

When a player or mixer is to become tempo master, regardless of whether this was initiated by pressing its Master button or by receipt of the packet described in the preceding section, the same process is followed.

If there is currently no tempo master, the device simply becomes master, and starts sending status packets with appropriate values of F and Mm (mixer status packets only have F in them).

If another player is currently tempo master, however, a coordinated handoff takes place. The device that wants to become tempo master first sends a takeover request packet like the one shown below to port 50001 of the current tempo master, with the player number of the device wanting to become master as the value of D:

0123456789abcdef5173707431576d4a4f4c260010Device Name (padded with 00)012000Dlenr000000D
Tempo master takeover request packet.

Since this packet uses subtype 00, the length sent in lenr has the value 0004, reflecting the four bytes which follow it.

The current tempo master will agree to the handoff by sending a packet like the following to port 50001 of the device that sent the takeover request, with the its own device number as the value of D:

0123456789abcdef5173707431576d4a4f4c270010Device Name (padded with 00)012000Dlenr000000D00000001
Tempo master takeover response packet.

Since this packet uses subtype 00, the length sent in lenr has the value 0008, reflecting the eight bytes which follow it.

Once that is done, the outgoing master will continue to report itself as the master according to its status packets (bit 5 of F , and for CDJs, the value of Mm) but it will announce to the world that the handoff is taking place by sending the device number of the device that is about to become tempo master as the value of Mh. (See the mixer and CDJ status packet diagrams for the locations of these bytes.)

As soon as the device becoming tempo master sees its device number in Mh in the status packets from the outgoing tempo master, it starts reporting itself as the tempo master using F and, for CDJs, Mm in its own status packets.

And as soon as the outgoing tempo master sees the new master has asserted this role in its status packets, it stops reporting itself as tempo master in its own status packets, goes back to sending the value ff in Mh, and sets its Syncn value to be one greater than the Syncn value reported by any other player on the network (although mixers do not report this value at all). This concludes the (rather Baroque) handoff protocol.

Unsolicited Handoff

While working on synchronizing Pro DJ Link devices with Ableton Link, I accidentally discovered that there is another way the tempo master role can be handed off. If the device that is currently tempo master is stopped (not playing a track), and it sees another device that is both synced and playing, it will set Mh to the device number of the synced, playing device, telling it to become the new master. As soon as the device named by Mh sees that status packet, it should take over the role as described in the second-to-last paragraph of the previous section, even though it did not start the process.