MIDI: Getting to Create, Play, Anything with Ubuntu!
Intro
MIDI support has been asked for mostly musically involved people who use Linux, and it hasn't come easily. Most of the HOW-TOs for setting up MIDIs don't even work, and I'd know. So, today, after almost a month of working towards it, I've finally been able to listen, play, and create MIDIs with ease. It's actually not very difficult; you just need the right packages and a loaded GM Soundfont.
Prerequisites
- A MIDI enabled sound card (most people have a SoundBlaster Audigy or Live! card-- if you have onboard sound, meaning the motherboard does the MIDI work, you'll need to use FluidSynth, which I'll talk about later).
- A fully working ALSA sound system.
- A fully working OSS sound system. (in case the upper doesn't work, you can use this and then do a sudo modprobe snd-seq-oss)
- The following ALSA packages installed (get these through apt-get/synaptic/aptitude): alsa-base, libasound, alsa-headers, libasound-dev, alsa-modules-2.4.26-1-686 (replace the 686 with 586, 386, k6, k7, etc. according to your system), alsa-oss, alsa-source.
- A program that plays MIDI files. (KMid is a nice one)
- The awesfx package if you are not using FluidSynth. (get this through apt-get)
Blood, Sweat, and Tears time (not really)
You've gotten past most of the work which took me the most time. Some of the packages you install may seem like overkill, but for people who use FluidSynth and have to compile it and other things, those packages are good to have just in case.
Do an lsmod in the terminal. It should return something like this
If you don't see any MIDI related modules (the important ones are snd_seq_midi,snd_emu10k1_synth,snd_emux_synth,snd_ seq_oss,snd_seq,snd_emu10k1,snd_rawmidi),
then that means ALSA hasn't been configured properly. Try sudo modprobe for these modules, and see what results.
Now, that you have MIDI devices working, go over to
http://www.hammersound.net, go to Sounds -> Soundfont Library -> Collections (this is over at the bottom). Now, find a GM library which you think will sound good, etc. I am using the Ultimate GM/GS Soundfont collection, which can be downloaded through
http://www.hammersound.net/cgi-bin/s...d=Ultimate.zip
Now, download it to your home directory. This one should be in a ZIP file (note: if it is in sfArk form, continue reading), so simply unzip it and there should be a sf2 file inside it. Go to the terminal and do a sfxload thenameofthefile.sf2. It should return to a new $ line, and that is good. Go into KMid and open up a MIDI and it should work. You can use Rosegarden 4 (apt-get install rosegarden4) to create MIDIs with ease and a bit of musical knowledge.
FLUIDSYNTH
FluidSynth is a software synthesizer, meaning there is no hardware involved since your card doesn't support SoundFont synthesis (otherwise, you shouldn't be doing this, hehe). It obviously doesn't relay as much quality as hardware does, but that's a small price to pay. You can find their homepage at
http://www.fluidsynth.org/.
It can also be easily installed through apt-get. Once it is installed, open up your terminal and do this: fluidsynth -m alsa_seq ./thenameofthefilehere.sf2. This will load the soundfont into your computer's memory.
Now, that wasn't difficult was it? Open up whatever MIDI program and you should be able to listen to your MIDIs.
SFARK
sfArk is a common compression method composers use to zip up their SoundFonts, and luckily, the company behind it has a Linux version of their utility. Download it at
http://melodymachine.com/sfark.htm. It is a command-line based utility, but again, easy to use. Just do this: sfarkxtc ./thenameofthefilehere.sfArk
That should decompress the sfArk and give you a .sf2 file. If it gives you any other kind (such as an EXE), that means you'll have to move onto another soundfont since this one won't be usable.
CONCLUSION
This hasn't been 100% tested, but it worked just fine for me and I hope it does for you as well. Post all of your errors, suggestions, comments, and I'll be happy to edit them into this. May your musical talent flourish with Ubuntu
Bookmarks