Tag Archive > Osculator

DTXplorer drum kit goes Processing

Ricki » 09 September 2009 » In Java, Processing, Uncategorized » 6 Comments

This my DTXplorer drumkit getting feed into MidiPipe onto Osculator and finally ends up in Processing. Now thats beat detection!
YouTube Preview Image
YouTube Preview Image

I have taken some time to get my Yamaha DTXplorer electronic drums to communicate nicely with my Mac, finally it worked out and I can now “harvest” the sweet, sweet MIDI coming from the drums. Im no Moby, so believe me when I say these last one and a half days of frustrations was not to immortalize the sound of my drumming. It was, of course to get the data into Processing. A friend of mine is a DJ and he wanted us to experiment with playing “live” drums along with the turntables. Furthermore, to make some sort of visualization that would be 100% true to the beat. This is very hard I found out, there are a lot of good sound libraries with beat detection out there, but they are never plug n’ play. You need to tweak your code for every single song and even that is no guarantee for a consistent output. I came up with a pretty straight forward solution, if we were to use the electronic drums anyway we could just as well use the MIDI for the beat detection and then have the turntables control the colors.

I found out that I needed a few different applications and a MIDI cable before I got the signal all the way through. First off is the ESI MidiMate cable, I actually had the old model, but I think it was broken and could not handle if the MIDI in was not connected to a ground plane. It was 295 Danish Kroner ( ≈$55 ). Then I needed MidiPipe. This a free application developed by Nico Wald and it is brilliant! Should I ever make any money with this setup I will run to a browser and donate some money to Nico.
The idea with MidiPipe is that it “hijacks” every single MIDI port it can detect on the system, you then drag the one you need to the pipe(ESI MIDIMATE Port 1 turn up in MidiPipe the second I connected it to the drumkit) you can then drag other stuff into the pipe. I dragged in “AList” from the “Modifier” and that gave me just what it says, a list of all midi signals passing through MidiPipe.

MidiPipe is a life-saver

MidiPipe is a life-saver

This was a cool way of testing out the drums. Lastly I dragged a “MIDI out” into the Pipe, more about that in a second. Then I went out and finally bought that license for OSCulator. Osculator have been running my Wiimote, iPhone, Arduino and Make controller for the last year and I have been to lazy/cheap to just buy the license. Well Osculator is a $15 minimum, but Camille asks people nicely to pay $39, which I did, of course, having used his software for about a year now. What Osculator can do is just to much to explain here… I needed it to translate my MIDI into OSC (because OSC is the new MIDI :) ) and then relay the rewritten data to a port on localhost using UDP. This was done so I could have some control over the data, also I now get something along the lines of “snare – on – 0.6″ (thats the pad sending the message, that it was “on”/hit and the strength it was hit with) into Processing instead of some MIDI byte I have to bitwise shift around to get any data from it, it just makes debugging easier and sending something through Osculator opens a world of other possibilities.

It is just crazy how many features there can be in such a simple application

It is just crazy how many features there can be in such a simple application

A note here, when I started Osculator, MidiPipe noticed Osculator was listening on port 8000 and stuffed that piece of information into the “MIDI out” I mentioned earlier, now I could just select it there. So now my MIDI came in through MidiPipe, was listed for me to see and then relayed on to Osculator. In Osculator I caught each MIDI event and by selecting the signal and going Osculator – Edit – Demux, I could split the signal into its components and rebroadcast them as OSC messages on the network. For handling OSC Protocol stuff in Processing Andreas Schlegel did a really great library, you can get it here along with some other goodies Andreas made.

I now had 8 different OSC messages, one for each drum pad, cymbal and foot pedal (Im going to do the high hat pedal later on) that I can read out in Processing. I did a small sketch as you see in the video and just started the “play along” feature on my DTXplorer kit, with some “Hard Rock” :) selected and and the computers microphone recording.

And as always if there is some code or help You need just leave a mail or comment.

A version not completely compressed by the geniuses over at youtube

Continue reading...

Tags: , , , , , , , ,