Hari's Corner
Humour, comics, tech, law, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and thenThree steps to MIDI on Linux
Filed under:
Tutorials and HOWTOs by
Hari
Posted on Fri, Feb 17, 2006 at 18:49 IST (last updated: Sun, Jun 28, 2009 @ 10:56 IST)
- Install TiMidity++. If you are a Debian user, this package is available in the official repositories. Other binary versions may be available. You can also compile from source. Instructions and download location available at the TiMidity website. Binary packages for select distros:
- Get some good sound patches. Debian users can use Freepats. But I recommend the eaw patches which are of higher quality. No Debian packages are available, but luckily you can just download it and extract it in any location. You can download the tar.gz here. Just extract it into your home directory. Let's say
/home/hari/eawpats
. - Replace the default TiMidity++ timidity.cfg file (rename the old file to something like timidity.conf.old) with the one in the
/home/hari/eawpats/linuxconfig
folder. Just edit it to make sure the location points to the directory where you extracted the EAW patches. The config file is located usually in the/etc/timidity/
folder in Debian. I don't know about other distros. Here is how the file looks like. Just change the dir setting to whichever location you extracted the EAW patches to:dir /home/hari/eawpats/
source gravis.cfg
source gsdrums.cfg
source gssfx.cfg
source xgmap2.cfg
#mid -> wav: timidity input.mid -Ow1S -s 44100 -o output.wav
timidity filename.mid
from the command line and enjoy the music! If timidity fails with an error message, just check the timidity.cfg file to make sure the path to your patches directory is correct. The EAW patches are excellent and much better than the freepats package in Debian, so the extra trouble to download and install it is worth it.
Now you have got MIDI playback. What if you want to use TiMidity++ as your ALSA sequencer device? Well, for this you have to issue this command from the command line:
timidity -iA -B8,2 -Os
This basically means that you are running timidity as an ALSA sequencer device (-iA) and you've set the buffer fragmensts to 8,2 (-B8,2) and the output device as ALSA (-Os). There you go. Now you can play MIDI files from KDE also. Don't forget to check out the TiMidity++ man and documentation pages as well.
You must run the above command every time you boot Linux if you want to use TiMidity++ as an ALSA back end so that you can play MIDI files from KDE (KMid) without using the timidity command line every time. The added advantage is that you can use MIDI composing tools like NoteEdit or Rosegarden without any additional setup because ALSA automatically recognizes the MIDI devices. So I recommend that you add this command to your startup scripts.
Hope this is clear. If you have any feedback or questions about this, please drop a comment here.
Comments closed
The blog owner has closed further commenting on this entry.
1 comment(s)
Comment by Alternate software MIDI synth in Linux (visitor) on Mon, Feb 12, 2007 @ 16:18 IST #