How to setup a MIDI-Keyboard in Ubuntu

I finally got myself a small (actually, it’s tiny) MIDI-Masterkeyboard for “tinkling the ivories”, which is a wonderful passion for lazy afternoons. Isn’t it cute:

I decided to get an Akai LPK 25, which doesn’t use much space, is cheap and quite sufficient for my purposes. In order to use it with Linux, one has to follow a few steps in order to get some sound out of that instrument. First of all, one needs to setup a real time kernel, because otherwise, one would have small delays, which is quite annoying. With the standard kernel, the delay on my machine was up to 30 milliseconds, which does not sound much but it is too much to be ignored. In order to install the real time kernel, type:

sudo apt-get install linux-image-2.6.31-9-rt

Then, reboot your system and choose the new kernel in the Grub menu at the startup. Further more, MIDI in Ubuntu is unfortunately not just plug and play. One has to setup the JACK Audio Connection Kit, which is described nicely here.

Then, one can install a software synthesizer like Hexter, which is basically a software model of the Yamaha DX7 synthesizer. Install it by typing:

sudo apt-get install hexter

At last, one has to wire everything together by the use of the Jack Control Center. Therefore, launch the control center and Hexeter. Switch to Jackd and choose the “Alsa Midi” Tab in the Connections menu. Then simply connect the LPK25 keyboard on the left hand side to the hexeter DX7 emulator on the right hand side. Thats it. More advanced setups with Rosegarden or LMMS will be described as soon as I figure it out how to use them.