Playing a USB midi keyboard on Ubuntu Linux

I purchased a USB MIDI keyboard (the Alesis Q25) for use with my musical Tesla coil, but also wanted to use it to learn to play the keyboard/piano when traveling with my laptop.

The MIDI keyboard has no synthesizer of it’s own, so you need a computer that will take the MIDI data stream and play (synthesize) the actual sounds of a piano or other instrument so that you can “hear” what you are playing.

There are many pieces of complicated software on Linux that will allow you to compose music with a MIDI keyboard, but all I wanted was the ability to hit a key on my keyboard and have it make music.

The easiest set of software I found to do this was vmpk (virtual midi piano keyboard) combined with Qsynth (a GUI interface to fluidsynth). I started up qsynth and vmpk at the same time. Then I used the “edit->connections” menu on vmpk to set my MIDI keyboard as the incomming connection, and the “FLUID Synth (Qsynth1)” as the output connection.

To set up qsynth I hit the “setup” button and then in the MIDI tab selected the “alsa_seq” as the MIDI Driver and “qsynth” as the MIDI Client Name ID (ALSA/CoreMidi).
I also enabled the soundfront from the /user/share/sounds/sf2 folder.
I don’t know why I had to use vmpk to make this linkup between the keyboard and Qsynth, but so far I haven’t found an easy way to tell Qsynth to just listen to midi events from the keyboard directly. On the plus side, you can use the virtual keyboard that vmpk displays on the screen to play notes if you don’t actually have a physical USB MIDI keyboard.

4 thoughts on “Playing a USB midi keyboard on Ubuntu Linux

  1. first thank you for the post!!
    I’ve downloaded both softwares but i have problem with the installment.
    if its easy can somebody tell me what commands to run for that?
    Thank you..

  2. I have installed qsynth in ubuntu. but when i open the app it shows failed to create the audio driver(jack). kindly please help me

  3. in Ubuntu 20.04:
    sudo apt install qsynth
    sudo apt install jackd (may be already installed)
    plug in keyboard (alesis Q40, in my case)
    start qsynth
    Click Setup… button
    On the midi tab, click enable MIDI
    Select MIDI Driver: alsa_seq
    Click OK
    start QJackctl (which is jackd)
    click Connect button
    On the ALSA tab:
    select your keyboard on the left panel (Q40 in my case)
    select Fluid Synth on the right panel (not sure why this name?)
    click Connect button – a line between the two should appear
    With any luck, your keyboard should now play through QSynth
    When I tried it just now it took me a few minutes to realise my sound was muted!

    PS: I tried to use VMPK and gave up…. couldn’t make it work. Probably for the same reason as not realising I had muted the sound – who knows?

Leave a Reply

Your email address will not be published. Required fields are marked *