Home

GStreamer, MIDI (and Ubuntu)

So, you have all your old MIDI files lying around and you decide to play them through Totem or another GStreamer based player. What happens? They sound... flat.

Ah, no problem you think, I'll just set up Timidity to use the neat soundfont I have lying around that sounds like my old SoundBlaster card and everything will be peachy, but no, GStreamer doesn't support soundfonts cause it doesn't use timidity but wildmidi - what to do?

Or: How to convert soundfonts to GUS patches for use in wildmidi/gstreamer.

There's a neat little tool called Unsf included in Greg Lee's gt - a stripped down version of Timidity - that can convert a soundfont to a GUS patch usable by wildmidi and therefore GStreamer, so let's get started with the conversion!

First, go to where you want the GUS patch (and its files) - this path shouldn't contain spaces - then download the latest version of gt (I hear there's a version 1.0, but 0.4 is the latest I can find):

cd /where/you/want/the/GUS/files
wget ftp://ling.lll.hawaii.edu/pub/greg/gt-0.4.tar.gz

Now, let's extract it somewhere and build it:

tar -xzf gt-0.4.tar.gz
cd gt-0.4
./configure
cd utils
make

Now, let's convert the soundfont to a GUS patch (remember to replace /path/to/your/soundfont.sf2 with the actual path to your soundfont):

cd ../../GUS
../utils/unsf -F /path/to/your/soundfont.sf2

Now we need to fix the config file that unsf wrote to include the path to where your GUS patch is:

echo -e "dir $PWDn" > wildmidi; cat *.cfg >> wildmidi

Now let's "install" that config file:

sudo cp wildmidi /etc/wildmidi.cfg

There! You're done!

For a nice athentic old school midi sound, I recommend the following soundfont (you need to register to download though): http://www.sf2midi.com/soundfonts/file-detail/roland-sc-55-sf2-3033.html

 | License: CC0 Public Domain
« Howto: Deus Ex: Human Revolution in Ubuntu/LinuxFind the 32bit deb package from your 64bit system »
There are  on this post. Add yours?
By activating and using the Disqus feedback service, you agree to their privacy policy.