How to Play a Midi File

From Freespire

Jump to: navigation, search

Home-->Documentation-->Hints & Tips-->How to Play a Midi File in Freespire!

First go to CNR at the following addresses (or search for "timidity") http://www.linspire.com/lindows_products_details.php?product_id=19849 http://www.linspire.com/lindows_products_details.php?product_id=7344 Download both packages.

Next you will need to download Sound Fonts.

Go to the following web page: http://www.personalcopy.com/home.htm

On the left side, in the menu, click on : Soundfonts for Linux. Then download the Unison.sf2 file on your desktop, for example.

Uncompress it and save the font itself in /etc/timidity/

Next edit the timidity.cfg file (found at /etc/timidity/timidity.cfg) with Kate or your text editor of choice.

Then comment out the line concerning freepats if you have it (last line) by ading # and a space

    # source /etc/timidity/freepats.cfg

Next add at the last line this command:

    soundfont /etc/timidity/Unison.sf2

If you want to use another soundfont, just follow the instrucions and modify only the path to the soundfont! And don't forget to comment (with # and space) the fonts you don't want to use!!

Timidity is not a simple midi player. It's a synthesizer transforming the midi into wave sound in order to render it on a computer that lacks midi support. You can consider it a midi software emulator. Once Timidity and the sound fonts are installed you simply open the console and type:

    su timidity

The following text will appear:

    TiMidity++ version 2.13.2 -- MIDI to WAVE converter and player
    Copyright (C) 1999-2004 Masanao Izumo <iz@onicos.co.jp>
    Copyright (C) 1995 Tuukka Toivonen                                                               
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

At this point you are now capable of playing a midi file by typing the following in the console:

    timidity mymidifile.mid.

Timidity, however, also has a gui. To use the gui simply type the following in a console:

    timidity -ig

Note: Timidity has an alternate gui,

    timidity -ia

If you desire, you can create a short cut that allow you to open timidity with a mouse click.

Open Kate, or your text editor of choice and past the following text into the blank document.

    [Desktop Entry]
    Encoding=UTF-8
    Name= MIDI Reader Timidity
    Comment=Play Midi files
    Exec=timidity -ig 
    Terminal=false
    Type=Application
    StartupNotify=false
    MimeType=audio/midi;
    Categories=Application;AudioVideo;
    Icon=
    #NoDisplay=true

Now, save this document to : /usr/share/applications/ under the name of timidity.desktop.

Last: just right click on the executable file you created and copy it to where you can easily find it (desktop, my documents, or wherever you want!) and change the icon if you desire.


Once Timidity installed, you can let it manage all your midi sound by opening it as an Alsa based program.

Just open a terminal and type the following command :

/usr/bin/timidity -iA -B2,8 -Os -EFreverb=0

This will start Timidity as a background program. Any application using midi sounds will be then managed by Timidity.


And if you want to get this command to automatically load when the computer starts, follow the instructions :

- Open with a text editor this file : /etc/init.d/alsa-utils - At the end of the document, add the following

echo "starting timidity" timidity=/usr/bin/timidity $timidity -iA -B2,8 -Os -EFreverb=0 > /dev/null &

If everything goes fine, your Alsa based midi applications will work immediately when the system starts!


If you're blocked by a denied permission, it is not a problem. Just copy the file to your Desktop.

Open it, and modify it.

Then open a root terminal and copy the file.

Something like that :

cp /home/"your name"/Desktop/alsa-utils /etc/init.d/

The original file will then be overwriten.


Thanks to steveblotman who first posted this in the Freespire forums.

Personal tools