Hack and / - Wii Will Rock Linux
The final Rock Band instrument is also my favorite—the drums. Although you could argue, I suppose, that the microphone is the closest to a real instrument in the game, the drums feel the most real to me. The big question, of course, was whether the drums registered in Linux. Upon connecting the drums to my machine, I had hope from the dmesg output:
[ 400.997524] usb 1-1: new full speed USB device
using uhci_hcd and address 7
[ 401.059524] usb 1-1: configuration #1 chosen
from 1 choice
[ 401.078667] input: Licensed by Nintendo of America
Harmonix Drum Controller for Nintendo Wii as
/devices/pci0000:00/0000:00:1d.0/usb1/1-1/
↪1-1:1.0/input/input14
[ 401.104320] input,hidraw0: USB HID v1.11 Gamepad
[Licensed by Nintendo of America Harmonix Drum
Controller for Nintendo Wii] on usb-0000:00:1d.0-1
It turns out the drums show up as a joystick device, just like the guitar. I ran jstest (as with the guitar), pointed to the new joystick device, hit a few of the drum pads, and was able to see that they definitely generated button events. Specifically, I saw that blue was button 0, green was button 1, red was button 2, yellow was button 3, and the foot pedal was button 4.
Now, although I could presumably use the drums with Frets on Fire, or really any game that supported joysticks, unfortunately, I wasn't able to find a free game for Linux that specifically used the drums. Instead, I found something arguably better: a free Linux drum kit program called Hydrogen that lets you create your own drum tracks and can interface with the keyboard or a MIDI device. Hydrogen was packaged for my distribution, or alternatively, you can download and build it from the official site. Unfortunately, the Wii drum kit doesn't act as a MIDI device, and Hydrogen isn't set up to accept input from a joystick. Hydrogen does allow you to use keys on the keyboard to activate different parts of the drum kit, so I had to figure out a way to map the joystick buttons to key events. Lucky for me, such an application already exists called joy2key. joy2key is a pretty basic program. You run the program on the command line and tell it which joystick to use and which keys to map to particular joystick buttons. Then, you can click on the application to bind it to, and it will send all joystick events to that particular window.
joy2key also already was packaged by my distribution, and after it installed, I simply had to choose to which keys to bind buttons. The first five drum types are activated in Hydrogen by the Z, S, X, C and D keys, respectively. So, first I launched Hydrogen, and then in a terminal, I typed:
joy2key -X -buttons d c s x z -dev /dev/input/js0 ↪-thresh 0 0 0 0 0 0 0 0 0 0 0 0
In addition to the -buttons option, the -X option tells joy2key to send X events. The -dev option points it to your joystick device, and the -thresh option sets the low and high thresholds to trigger events for each button. If you don't specify -thresh, joy2key prompts you to set the values each time you run it, and as these buttons are either on or off, I just set them to zero. After you run this command, your mouse icon should turn into a cross. Click on the Hydrogen window, and then joy2key will start sending events to Hydrogen.
The order of drum sounds and how they correspond to keys is set in the Hydrogen pattern editor (Figure 5). There are any number of different ways to arrange the sounds and button mappings, but probably the easiest order to keep straight sets the pattern editor as though you played across the Wii drum kit starting at the foot pedal. By default, this probably won't be set correctly to suit the joy2key settings, so click a particular drum sound to highlight it, and then press the up/down arrows on the top of that column to rearrange its order. On the bottom, put Kick, then a Snare, then a Hi Hat (like Open HH), then a Tom, then a Cymbal (Crash). Once you have arranged these sounds, hit some of the drum pads on the drum kit, and you should hear their corresponding sounds on your computer. Go ahead, play a drum solo or two to get accustomed to the current pattern.
Hydrogen is a complicated enough program to warrant its own article, but here are some of the many things you can do now that the Wii drum set works with it. For one, Hydrogen includes a number of different drum set samples from which you can choose, and you even can create your own, so you can experiment with a lot of different sounds for your drums. In addition, you also can use your drum set when recording different beat patterns. Finally, if you want, you could just hook up your computer to a loud set of speakers and start playing. Hydrogen includes a mixer for each sound, so you can adjust the relative volumes.
Well, if you weren't already tempted to buy a set of Rock Band instruments just for your Wii, now you have another excuse...er, reason...why you need them. It's a testament to how far Linux has progressed that you can get random devices like these working on your computer with minimal effort. As for me, I'm going to switch up the drum patterns in Hydrogen so that they feature more cowbell.
Kyle Rankin is a systems architect; and the author of DevOps Troubleshooting, The Official Ubuntu Server Book, Knoppix Hacks, Knoppix Pocket Reference, Linux Multimedia Hacks, and Ubuntu Hacks.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Designing Electronics with Linux
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Dynamic DNS—an Object Lesson in Problem Solving
- New Products
- Using Salt Stack and Vagrant for Drupal Development
- Validate an E-Mail Address with PHP, the Right Way
- Build a Skype Server for Your Home Phone System
- A Topic for Discussion - Open Source Feature-Richness?
- Tech Tip: Really Simple HTTP Server with Python
- Why Python?
- Not free anymore
2 hours 5 min ago - Great
5 hours 52 min ago - Reply to comment | Linux Journal
6 hours 55 sec ago - Understanding the Linux Kernel
8 hours 15 min ago - General
10 hours 45 min ago - Kernel Problem
20 hours 48 min ago - BASH script to log IPs on public web server
1 day 1 hour ago - DynDNS
1 day 4 hours ago - Reply to comment | Linux Journal
1 day 5 hours ago - All the articles you talked
1 day 7 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?





Comments
excuse me I got the rock
excuse me
I got the rock band 2 wii drums and I got the double bass attachment and a double cymbal expansion
do you think hydrogen will seperate these ass seperate sounds as the game does in the freestyle mode or will it just be interpreted as yellow and blue
also I got ubuntu 8.10 (Intrepid Ibex) so this maybe different...but I'm having a hard time opening jstest and joy2key