Monday, June 15, 2009

DrumChuk: Wii Drumming With Ruby

I got an awesome e-mail.


I just wanted to thank you for all the Ruby/CoreMIDI hooks you've written and been involved with surrounding Archaeopteryx, as well as your late-night video demonstrating launching BoingBoing with a wiimote, which gave me probable cause to believe that a Ruby-based real-time wii instrument was possible.

I used your code as a starting point to build a Wii drum controller called DrumChuk, which is on GitHub here:

and there's a video of it in action here:

The goal was to make something really musical and expressive that didn't involve pushing different buttons to differentiate between notes -- DrumChuk uses the angle you hold your hand at when striking to map as many as 6 notes onto each hand. If you use buttons, you can get even more, making for a pretty big kit.

A couple of ghetto improvements I added to midi_in.rb to make it more manageable as a real-time instrument were some more detailed parsing of the MIDI stream from rbcoremidi, which often returns more than one MIDI frame per pull (which might've been the root cause of the occasional button misses you were experiencing in the video), as well as a timer to keep it from slamming the processor in the event loop (it's still plenty responsive, though).

Anyway, cheers.