Blog/MIDI Keyboard setup on Linux

Getting a MIDI keyboard turned out to have been hands down one of the best purchases for my study/office this year; even though it's only got three octaves, it's definitely still a lot of fun to play.

Not only does it reduce the friction between going to a different room to fire up the ol' 88 key digital piano, it's also massively helped in composing for game jams.

Getting it set up on my Linux workstation wasn't difficult either; for programs such as MuseScore (>= 3.5.0) and LMMS, all you need to do is to plug it in.

In fact if you want to keep it connected for free play/riffing along to playlists, series theme songs etc., you can just keep LMMS open with a keyboard connected to a piano roll track.

A track using the Sf2 Instrument Plugin for free play/riffing. Some extra physical octaves would have been nice for MeatLoaf, though

Another less fiddly option is getting a FluidSynth server running, which isn't much work either. To do so, you simply need to install Qsynth (apt install qsynth on Debian).

Opening QSynth will start up a FluidSynth server process, along with the GUI to interface to it. You'll then need to connect the MIDI keyboard to the this FluidSynth server, which you can find with aconnect:

xdl@wintermute:~$ aconnect -i -o
client 0: 'System' [type=kernel]
    0 'Timer           '
    1 'Announce        '
client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'
client 32: 'microKEY2' [type=kernel,card=4]
    0 'microKEY2 MIDI 1'
client 128: 'FLUID Synth (8657)' [type=user,pid=8657]
    0 'Synth input port (8657:0)'

With the -i and -o flag, it prints out all the possible input and output clients, so in my case I'll do aconnect 32 128, connecting the KORG microkey to the FluidSynth server.

At this point, your keyboard should be making noises (hooray!); if not, you could try setting the soundfont (a collection of samples from a particular instrument) file; my Ubuntu distribution had a preinstalled piano soundfont that sounds decent enough:

Setting the soundfont through QSynth

You can also get some free orchestral, guitar and piano soundfonts from Soundfonts 4u. Have fun!