Have a feature request or suggestion? Post your idea here!

Post

11 follower Segui
2
Avatar

Sync CDJs with Ableton Live

https://www.youtube.com/watch?v=jXTiNU6RqOo

This background program syncs CDJs with Ableton Live or any other software what understands MIDI beat clock.
The CDJ_Clock listens to the Ethernet UDP protocol between the CDJs, calculates and sends out via USB an MIDI beat clock. The CDJ_Clock can be controlled with any MIDI controller. The synchronisation can be started exact to the next beat and sends out an MIDI continue signal. On the top left my MIDI-Clock box is viewing the beats and is used as a MIDI controller.

Georg Ziegler

Accedi per aggiungere un commento.

37 commenti

0
Avatar

So it's an external hardware box that connects to ethernet (to monitor the BPM traffic) and USB (to send the signal through MIDI-over-USB)?

Pulse 0 voti
Azioni per commenti Permalink
0
Avatar

The external hardware box on the top left of the video is used as an MIDI input tool, to view the beats and control an Revo IV via DMX when I am mixing live. It can be used with any software what can output an MIDI beat clock. Please see video https://www.youtube.com/watch?v=mJSMDS0ibco

The other part is a software written in C and based on Alex Godbeheres program https://www.youtube.com/watch?v=dcJP1105-vg

This program sniffes the Ethernet protocol of the CDJs and calculates the bpm and output the MIDI beat clock as virtual MIDI.

The program now is stable and can be synced on all CDJs, on the DJM (the DJM also sends out sync informations) or selective CDJs. It can be controlled via virtual MIDI-in like I do in the video with my MIDI Clock box or simple with the MIDI start/stop of the DJM. The MIDI source, channel and address can be selected by passing an argument at the start of the program. The beat clock can be started and stopped. When it stops it sends out an MIDI song pointer of the last 4/4 beat. When it starts again it waits for the next 1/4 beat and sends an MIDI song pointer and an MIDI continue. The song pointer is the last 4/4 beat. Via virtual MIDI-in the song pointer can be jumped 4 beats (1bar) or 32 beats (8bars) forward or backwards.

Here another video https://www.youtube.com/watch?v=iFwF3T2wz9I Sorry for the quality. In the video I use an outdated Macbook and it still works. 

If you are interrested please drop me an email on g.zi@gmx.de you will find me on facebook with my email address.

Georg Ziegler 0 voti
Azioni per commenti Permalink
0
Avatar

Thanks for the additional info -- at first I was concerned that it seemed a bit of a spammy post, but you've clearly put a lot of work into it and given that you're willing to post about it, I can tell you're passionate about the project.

Keep up the great work, I look forward to seeing what you do with it!

Pulse 0 voti
Azioni per commenti Permalink
0
Avatar

Curious -- how does it handle multiple CDJs-worth of traffic? What happens if a DJ starts mixing two tracks where the BPM is on, but the phrasing is off? Is it only detecting the deck assigned as "master"?

Pulse 0 voti
Azioni per commenti Permalink
0
Avatar

The CDJ Beat Clock can be started to listen only to one CDJ or to the DJM or all CDJs. You need to switch on the sync on the CDJs when the program is listening to all CDJs otherwise it will run out of beat. If you start the program listen only to the DJM it doesn't matter if some of the CDJs are out of sync. Then the master can be any CDJ or the DJM. 

Georg Ziegler 0 voti
Azioni per commenti Permalink
0
Avatar

Here a bit more background.

Connect your Macs Ethernet to the DJM Ethernet (or the hub connecting the CDJs)
You need to start the program as superuser because of opening the Ethernet.
Parameter: CDJ_Clock, Ethernet, MIDI-Channel, MIDI-Start, MIDI-Stop, SongPointer-Up SongPointer-Down, SongPointer-8barsUp, SongPointer-8barsDown, syncCDJ 
Open a terminal and start the program with sudo:
sudo ./CDJ_Clock en3 16 117 118 115 116 111 112 (en3 for MacBook Retina)

After starting the program it will show a list of all MIDI sources and connects to it (listen to it). You will see something like this:

3 sources
 source 0: Bus 1 <-- connected 
 source 1: Session 1 <-- connected 
 source 2: Teensy MIDI <-- connected 
Capture Device: en3   Filter: port 50001   Sync: CDJ4
MIDI Sync Start/Stop: Channel=16 Start=117 Stop=118 Up=115 Down=116 ShiftUp=111 ShiftDown=112

After starting a CDJ the program starts counting the beats and plots something like this:

noBeat=0, BPM:0.000000  Tick:50.000000  CDJdiff:-730670599019.351440  BPMdiff:0.000000 
MIDI-Clock STOP
Song Position Pointer = 0 
noBeat=0, BPM:141.671115  Tick:27.462402  CDJdiff:471.163086  BPMdiff:141.671115 
noBeat=0, BPM:141.668828  Tick:20.674489  CDJdiff:145.329590  BPMdiff:-0.002287 
noBeat=0, BPM:141.642047  Tick:17.259471  CDJdiff:-18.751465  BPMdiff:-0.026781 

If you want to assign a MIDI control simple press the button and the program will show the channel, address and on/off like this to use as a parameter for the CDJ Beat Clock:

Channel=16  NoteOn=116  Velocity=127 
Channel=16  NoteOff=116  Velocity=0 

You do not need any parameter when you start the program.The default is listen to DJM and Ehternet en0. If you connect the DJM to your computer the program will see it as a source. Pressing the MIDI start/stop button on the DJM will start or stop the CDJ Beat Clock.

In Ableton Live (link MIDI) the CDJ Beat Clock pops up as ProSync. You need to switch on Sync and Remote. Then switch on EXT (top left) for external sync to Ableton live.
The Remote is needed because of the MIDI song position pointer.


I will write also a documentation describing the setup and how it works in detail.

Georg Ziegler 0 voti
Azioni per commenti Permalink
0
Avatar

I forgot to mention, the CDJ Beat Clock can be used with any software what understands MIDI beat clock. With my MIDI Beat Counter (the small box on the top left) I can translate virtual MIDI (USB) to MIDI-DIN (round 5pol) to sync anything what can be connected with MIDI-DIN like the good old EFX-1000.

Georg Ziegler 0 voti
Azioni per commenti Permalink
0
Avatar

I saw that with the REVO4 video - very cool.

Thanks for sharing! Is this something you're planning on producing or kitting for users to purchase? Or just a project you're making open-source?

Pulse 0 voti
Azioni per commenti Permalink
0
Avatar

Yes, I think to produce the MIDI Beat Clock that also others can use it but doesn't know how to market it. I thought about to put it on a croudfunding platform but I am more an developer than a sales person.

I am mixing CD's for Sep, Aerobic and KamiBo and mix also live on fitness events (with CDJs and Push).

I think about to make something small that my MIDI Beat Clock can be used to train fitness teacher that they can hear the beats by viewing it with the Revo IV.

Georg Ziegler 0 voti
Azioni per commenti Permalink
1
Avatar

I have been communicating with Georg and have made a great deal of progress in figuring out the protocol. The code he posted needs to run as root, because it relies on putting the network interface in promiscuous mode and monitoring all traffic it can see. It turns out that is not necessary, since the beat packets are sent as UDP broadcasts. It is also possible to create a “virtual CDJ” by sending correctly formatted packets, and this causes the other devices to send you status packets with many extra details.

I have figured out how to tell which is the master player, the track BPM to two decimal places, the pitch at which the player is playing (and thus the effective BPM), the number of beats into the track we have reached, the current beat within the bar, and the number of beats until the next cue point in the track, among other things. You can find my code and analysis on github at the following link, and if I have some time I will look into porting some of this knowledge into Georg’s project: https://github.com/brunchboy/dysentery

The project I linked to also offers an executable jar file that allows you to see all the packets that are being sent, what values are changing, and whether or not we already think we understand them. So you can help notice new patterns and figure out additional useful information.

James Elliott 1 voto
Azioni per commenti Permalink
0
Avatar

Great job Georg and James! I'm very interested, it would be awesome to be able to sync my MIDI hardware with the music coming for the CDJs.

I don't think you need to dig to much to understand the protocol, as long as the sw gets a MIDI master clock from the CDJs that's all we need :)

Let me know if I can help somehow, I have 2x CDJ2000 Nexus and some MIDI hardware, I might help you testing.

An interesting development would be to port the code to something like an Arduino+Ethernet shield or a Raspberry Pie, to make a simple box that connects the CDJs to a purely hardware MIDI setup without using the computer.

Cheers,

J

Julia O 0 voti
Azioni per commenti Permalink
0
Avatar

Thanks, Julia! I agree it would be cool for someone to build a tool on Arduino or Raspberry Pie. It’s exactly the idea of supporting projects like that which motivated me to create my detailed article about what I have learned, expressed as diagrams and equations, rather than code: Packet Analysis 

I have also started another open-source library to make it easy to synchronize any program running in the Java VM environment, which is my primary focus (that is where my light show software lives): https://github.com/brunchboy/beat-link

James Elliott 0 voti
Azioni per commenti Permalink
0
Avatar

I'd like to have a try withCDJ Clock or one of the other tool.

Since I don't have a pioneer djm mixer (I have an A&H mixer) I'd like to know if it's possible to get the midi clock directly out of the cdjs with any of these tools or do they work only with a djm in the network?

Julia O 0 voti
Azioni per commenti Permalink
0
Avatar

There is no need for the DJM. It serves as a nice backup source of beat packets when no CDJ is playing, but all of these projects work fine without the DJM. As a side note, I published the first complete release of beat-link yesterday, so people can start using it to implement a Java version of CDJ Clock, if they like. Also, I know that Georg is examining it, and thinking about directions to extend CDJ Clock. But CDJ Clock already works to sync Ableton Live, as long as you are willing to run it as root, so that is probably the fastest place for you to start.

James Elliott 0 voti
Azioni per commenti Permalink
0
Avatar

Diongo did a great work with this one and he moved this sgnificantly forward :-) still having his testing code from "night one" :-D a museum piece :-))
What I am now into is the nfs that the players are opening for sharing the music over link... would be an interresting addition to this project.

Marek 0 voti
Azioni per commenti Permalink
0
Avatar

I cannot follow, please can you explain the project?
Who is Diongo and which project do you mean?

Georg Ziegler 0 voti
Azioni per commenti Permalink
0
Avatar

Read the readme of dysentery - Diongo analysed the packet structure and created the original virtualcdj.
All of these prolink projects are doing a great work bridging the gap between cdj and the rest of the audio world :-) thanks guys!

Marek 0 voti
Azioni per commenti Permalink
0
Avatar

I am definitely eager to get track information to display and help coordinate light shows. This seems to be available over TCP connections to the players (the last section of the dysentery analysis document describes what I saw by mirroring a switch port to watch communication between two players). Diogo is going to look into if he can do the same kind of trick with that when he has a chance.

I also wrote up some research on the format of the rekordbox database, but that is going to be complicated; it is a proprietary database format, and probably more trouble to try to decode than it is worth.

I am not going to write anything that tries to access music data, though. That just opens up all kinds of rights issues and risks making big companies angry, and I have no use for it in my projects anyway. The DJs are playing the music, I am just trying to make beautiful shows that are synchronized with it.

James Elliott 0 voti
Azioni per commenti Permalink
0
Avatar

Imho accessing your music on your usb drive is not very controversial (agree that its not the main focus of the sync) :-) can imagine that I can read the dat file for each file and read/display the waves which are part of the analysis file ;-) at least so far I was able to modify the wave dispalyed on the cdj...

Btw how about implementing the ableton link? - isn't the sync and latency compensation handled by its api and so easier to sync than midi? Or its jus syncing ableton --> linked device?

Marek 0 voti
Azioni per commenti Permalink
0
Avatar

Ableton’s Link looks interesting, but so far they are only offering it as an iOS library, and you have to sign a non-disclosure agreement which is incompatible with open-source software, so I haven’t been able to do anything with it yet. I am hoping they will open it up more someday.

You’ve already figured out how to access and adjust the waveform images in the files? Interesting!

James Elliott 0 voti
Azioni per commenti Permalink
0
Avatar

Ah true. Forgot its ios only :-(
The wave is very simple - at least the small one. The big one is there too but havent worked with this one much.
Got just a proof of concept of pushing there some peak when I tried for the first time.
https://goo.gl/photos/vU9HSYF6VgHH942B6
But without read access to the file on the usb its useless.. :(

Marek 0 voti
Azioni per commenti Permalink
0
Avatar

You mean Diogo Santos, yes I have read that, thanks. The VJ-Forum is not working anymore.

When you can write to the display of a CDJ, it can be used to write any status to the display like from a virtual CDJ or the song position pointer of Ableton Live.

At the moment if I am recording from the CDJs I do not get the track names, simple the waveform. I am interrested to get the track names from the CDJs and pass it to Ableton Lives waveforms or at least a list of all tracks played during a session in one file with status which CDJ have played what and when to get the track names correct in the complete mix.

At the moment CDJ Clock uses MIDI position pointer to move bar wise inside Ableton Live. The MIDI position pointer cannot address more than 30 min (exactly 1024 bars, the lenght depend on the bpm). To switch to time code needs to calculate the correct time for the bars. I am struggling a bit with that. Ableton Link could be a better alternative but is related only to Ableton Live. With MIDI everything can be synced.  

Georg Ziegler 0 voti
Azioni per commenti Permalink
0
Avatar

Its not writing to the display - its modifying the information that the CDJ reads. I doubt its possible to drive the display remotely. The cdj os just reads the files and is quite dumb - you wouldn't be able to make any display changes on the fly - it happens only during loading of the file.

To reading and passing that track name - I am really not sure if this information is packed in the network communication. Assuming that the track title is displayed on the LINKED devices, it means that these devices do have access to the file sharing service within the pro link hence instead of passing the full string etc., its much more bandwidth economic just to pass the filename (maybe filename of the DAT file which contains full path to the audio file) or some rekordbox ID and let the linked player read all the information from the analysis file or from the rekordbox database placed on the usb drive. In other words, I wouldn't limit the research to finding the track title in the packets, I'd look for a specific filename as on the usb drive, to see how the players handle file manipulation reading of these data. Once found, the virtual cdj could also read the shared files so you get access to the big and small waves [PWAV and PWV2], grid [PQTZ] and cues [PCPT] and pass it wherever needed. But for this, we need to know the nfs exports.. :)

Marek 0 voti
Azioni per commenti Permalink
0
Avatar

Marek and Georg, I have found where the CDJs send track metadata information (title, artists, etc.) to each other without needing to mount the USB or rekordbox database and access the file itself. This is described in section 5.1 of the dysentery Packet Analysis document (on pages 13 and 14 if you follow that link, or you can download the whole PDF here).

As I mentioned in the document, this is communicated via direct TCP connections between the players, so to see it I had to configure a switch to mirror all packets sent between them to the port on which I was running a traffic capture.

I have pointed this out to Diogo, and we are hoping he will be able to use it to figure out how to add this TCP connection to the virtual CDJ, so we can open such connections and send the right bytes on them to get the other players to send us the track metadata, and we can figure out how to properly interpret it.

James Elliott 0 voti
Azioni per commenti Permalink