Synaesthesia, also known as “Piano Hero” [Linux FTW]

Last year, a friend of mine showed me this cool program he found called “Synaesthesia.” It is, as the title reads, “Piano Hero.” Notes fall from the top to the bottom of the screen and when they collide with the bottom, you must hit the appropriate  key on your piano / keyboard / MIDI controller. It is a VERY cool tool for training, practicing, and learning new songs. As someone that is not particularly skilled at sight-reading music (I do better learning aurally), any way to get new songs loaded into my brain is welcome.

We inherited a Yamaha Clavinova 350 last year as well, which has been really terrific for practicing; I was previously using a 2/3 size electric piano that was showing its age. I picked up an M-Audio Fast Track Pro interface off of eBay for about  $50, and so I can now use the Clavinova as a MIDI controller!

My big Win last week, though, which happens to be what this post is about, is getting it to not only work in Linux (not so hard) but getting the Clavinova to function as the MIDI controller for it (somewhat challenging).

Synaesthesia in Linux

The solution is a single word: Wine. The program doesn’t use any fancy pants libraries — I think it was coded in C++ or some other relatively non-proprietary language (unlike the increasingly more prevalent .NET libs, which have moderate functionality in Wine). Getting it running is as simple as:

  1. Download the Windows version from the Synaesthesia website
  2. Unzip to a location of your choice (eg. ~/games/synth/)
  3. Right click on the .exe and click “Open with Wine”

Done. The program should load, and you should be able to play in (computer) keyboard mode.

One side note — if you are unable to hear any of the notes, it’s likely because you need a MIDI synthesizer running. In the past, I used to use Timidity, but I had some conflicts with that. The newer versions may work better — caveat operor. I snagged QSynth (available in the Ubuntu Software Center) and loaded up a Steinway sound font I found, and it worked fine. (Side note: I had to adjust the gain to 4 in QSynth — your mileage may vary, depending on the sound font you use).

Hooking Up the MIDI Interface

This part was a little more complicated, but not impossible.

For this to be “easy”, you need to be using the most recent version of Ubuntu (10.04 LTS, aka Lucid Lynx). The reason is that it natively uses a realtime kernel, which is required for jackd. Jackd is required for pretty much anything cool in audio. You’ll need the JackD control panel (I don’t know if it automatically loads with 10.04 — I already had it installed). You’ll also need some kind of USB-Midi interface.

If you have not yet upgraded, but want to try and rough it anyways — grab the linux-rt and jackd packages from Synaptic, reboot and select your linux-rt option in Grub. It should work, at that point. I was able to get JackD working in 9.10 that way.

The program “Jack Control” (found under “Sound & Video”) needs to be running before anything else happens. When it loads, it will pop open 3 windows, one of which (the top one in the screen cap) has a bunch of status messages; it will let you know if it did not load correctly. Jackd natively supports USB Audio, and should auto-detect your USB-MIDI device when you plug it in. The bottom-most window in the screen cap is where you’ll route your connections.

Once Jackd is running, plug in the USB-MIDI device, then check under the MIDI tab. There should be a USB option there. You’ll also need to load up your MIDI synthesizer software (I use QSynth, as I mentioned earlier). That synthesizer should also show up in that panel. Linking them together is as simple as selecting USB-MIDI out (in the left side) and QSynth MIDI in (on the right side) and clicking “connect.” Tapping a few keys on your MIDI controller should now send MIDI events (ie. you should hear notes being played).

Assuming that is correct, go ahead and load up Synaesthesia again, you should be able to play it, using our MIDI controller to play notes! Win!