How to get midi sound working in Ubuntu Studio

Hours of frustration over Rosegarden?  Here’s a step-by-step guide to getting midi sound working using timidity, fluidsynth, Qsynth and jack, qjackctl.

First of all Rosegarden is the hardest thing to get running, so I’ll start with the basics of getting midi to work.  Midi sounds go through ports with names such as 128,0 and 14:0

You can view these ports by downloading pmidi.  Do that now.  (It’s not optional in this tutorial).

  • sudo apt-get install pmidi

Now to view them, enter the following command

  • $ pmidi -l

Port     Client name                       Port name
14:0     Midi Through                      Midi Through Port-0
128:0     TiMidity                          TiMidity port 0
128:1     TiMidity                          TiMidity port 1
128:2     TiMidity                          TiMidity port 2
128:3     TiMidity                          TiMidity port 3

My system has a midi synthesizer that starts up at boot time and remains resident, using ports 128:0 to 128:3.  Chances are, you will just have 14:0 showing, but if you have ports with numbers 128:0, or 129:0 or 130:0, it indicates there is a synthesizer present.  Since I have timidity installed (please don’t install it if you don’t have it already, and I can play a midi file with $ timidity alleycat.mid

If you have available ports, we can use pmidi using a port number to play a midi file (chances are you don’t, so this command will not work for you yet, but remember it):

  • $pmidi -p 128:0 alleycat.mid

You can also run it to check the other ports to see if they work:

  • $pmidi -p 128:1  alleycat.mid

This is important, because pmidi allows you to access the specific port by name (well by number).  In this way, we can check other sound products that generate sound.   If you can get sound using the above steps, you have a synthesizer running.

Fluidsynth is the next thing we shall test, and it has a nice GUI front-end called QSynth.  So start up QSynth (from the menus) and have a look at the ports

  • $ pmidi -l

Port     Client name                       Port name
14:0     Midi Through                      Midi Through Port-0
128:0     TiMidity                          TiMidity port 0
128:1     TiMidity                          TiMidity port 1
128:2     TiMidity                          TiMidity port 2
128:3     TiMidity                          TiMidity port 3
129:0     FLUID Synth (3702)                Synth input port (3702:0)

On my system, I have an extra port: 129:0.  If you do not have an extra port, click on the setup button of qsynth, and in the audio tab, change the Audio Driver to alsa, and in the Midi tab, change the midi driver to alsa_seq.  Clicking OK will cause qsynth to restart.  After it restarts, check to see if you have an additional port again.

Once you get the extra port, try out the new port:

$ pmidi -p 129:0  alleycat.mid

Notice the difference in sound.  If you have no sound (which you probably do not if you never modified  qsynth before), you must load a sound font into qsynth.  Modify the setup of qsynth, in the Soundfonts tab, open up /usr/share/sounds/sf2/FluidR3_GM.sf2

Advertisements

About SunKing2

Former web developer, guitar player, started Piano 2012 -yes still doing it! Recovery, sobriety, mental health advocate.
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to How to get midi sound working in Ubuntu Studio

  1. How do we configure our MIDI keyboard with our MAC and GARAGEBAND?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s