Usage

Getting Started
If you haven't used before, you'll see the name of one of the example midi files I included in the black window. Click the play button to play it. Move the mouse pointer around from button to button to get a brief tooltip description of what each button does when clicked on.
Click on the KMidi logo at the upper left to make the bottom panel visible. There you'll see a black window, the channel meter, which shows a bar graph of notes being played on the 16 midi channels. To its left is a patchset selector and a song selector. Click on the song selector to see a list of the other example midi files I included with the distribution. Click on another, if you like, to play it.
Click on the Info button to see information about the midi file you're playing and Karaoke lyrics (if the midi file has any).
Click the playlist button to look around your filesystem for midi files and compose your own list of files to play. Unless you click off the filter button, only midi files will be shown (regardless of whether they have a .mid or .kar suffix). Double click a filename on the left part of the screen to add the file to your playlist (shown on the right).
Don't be surprised or chagrined if some midi files produce little or no sound. as distributed has a pitifully small number of instrument patches. Sorry about that. Please see the section of this document on how to obtain patchsets on the net.

Playlists
Click on the eject button to open the playlist manager. At the left you'll see the content of the directory you were in the last time you edited your playlist. At the right you see your current playlist. Select a midi file on the left to append to the playlist by double clicking on it. Or single click, then click on Add.
The only files shown on the left are midi files. Compressed midi files will not be recognized, unfortunately, so if you've used, say, gzip to compress the files, you'll want to click off the Filter button at the bottom. Then all files become visible. does not decide whether a file is a midi file or not by looking at the name; instead, it reads a bit of the file to see whether it appears to be a midi file. So there's no need to name your midi files with a .mid suffix.
Toward the bottom of the screen are your current playlists. When you first start, there will be only one, called default with the sample midis from the distribution. You change the contents of this by clicking once on the name default (if it is not already selected) then clicking File Save to replace the contents of the playlist file with your current playlist. Or click File Append to concatenate your current playlist onto the end of a playlist file. To create a new playlist, click File Save as ... instead and fill in the new name you've chosen into the little box that appears. Double click on the name of a playlist to replace your current playlist with the contents of the one you've saved. This can also be done from the front panel by single clicking on the name of a playlist in the Select Playlist box.
Remove a playlist by clicking on its name, then clicking File Remove .
The vertical bar separating the directory list from the playlist can be dragged from left to right with the mouse. The horizontal bar separating these from the playlist names can be dragged up and down.

Midi file names
The names of midi files you see on the front panel may differ slightly from the actual file names. For readability, replaces any _ in the midi file name by spaces and chops off the .mid/ .MID ending if present.

Configuring
Clicking the configure button on the panel takes you to a configure screen where you can choose the background color of the panel's two windows and the led color. At the moment, the color used for percussion in the channel meter is not configurable - it's always yellow.

Patchsets
On the bottom panel at the top left you'll find the patchset selector. For as distributed, you'll see three patchset options: piano + guitar, piano, and guitar. There isn't any real point to selecting the piano or guitar patchsets; the choices are there merely as an illustration. When you acquire a bunch of patchsets, you can set things up so as to switch between them from the panel. Here is how to do that:
For each patchset, create a cfg file describing the patches and their banks and instrument (midi program) numbers. Then in the file timidity.cfg, enter a line source filename and a preceding line if n, where filename is the name you gave to the file describing the patches, and n is the line where filename will appear in 's panel in the select patchset box. Clicking on this name will select the patchset. The numbering of the patchsets starts with number 0.
In cfg files, the banks/drumsets and names of patches must be given, since those that are not declared will not be loaded from files (GUS patch files or sound fonts) even though the patches are available. This way it's easy to exclude certain patches from a sound font so as to load better ones from a subseqently loaded font. Just don't declare them before you've asked to load the font.
When the same patch of the same bank or drumset is declared more than once, only the first declaration counts. So put your best fonts first.
There is a utility sf2cfg to construct a cfg file for a sbk/sf2 sound font, which spits out all the patches that are present in the font. Also, I've included sample cfg files for chaos8m.sf2 and chaos12m.sf2.

Polyphony
Do you hear dropouts in the music? It's possible for to get behind in doing the many calculations required to adjust the pitch of instrument patches, filter the signal, combine notes, and so on. If this happens, you may be able to improve the situation by using the spinbox on the lower panel to the right. This adjusts the maximum number of polyphonic voices used at the same time. When you lower the maximum polyphony, you lighten 's burden at the cost of some chorus or reverb effect being lost, or some notes being cut short or actually being omitted altogether. (In some circumstances, generates extra notes to approximate the effect of midi chorus and reverberation.)

Effects
Effects modify the sound in various ways, some of which I'm not too clear about. There are four ways effects may be requested and two ways you can control them.
A midi song may specify an effect for all the instruments playing on any particular one of the 16 midi channels. Or, it may specify several effects for several channels. When you click down the panel's eff button, the signal is filtered to approximate the midi effects: chorus, reverberation, celeste, and phaser. But there won't be any effects unless the song in the midi file asks for them. Two of the standard midi effects, harmonics and brightness, are not yet implemented by filters. (The filters were coded by Nicolas Witczak.)
When you don't click down the eff button, you still get some chorus and reverberation on channels where it's requested, but it's done in a different way. Now, instead of using filters, extra notes are generated. They are detuned slightly for chorus effect and delayed slightly for reverberation. There are also some adjustments made to note envelopes and vibrato. With eff turned off, you get no channel celeste or phaser effects.
A second way effects may be requested is by a patch. That is, an instrument patch may contain a suggested chorus and/or reverb level. AWE patches generally do specify effects, but Gravis-Forte patches don't. (That's why AWE patchsets tend to sound a bit fruity.) Effects requested this way are done by the ghost note method, and are unaffected by the eff button.
Thirdly, you may request effects. Notice the four checkboxes at the right of the panel. Each has three states: normal (the default), extra, and off. The middle two checkboxes control chorus and reverb. If they are set to normal, effects are treated as described above. Set to extra, extra notes are generated for chorus or reverb for all instruments and all channels, and this is in addition to the effects filters if they are requested by clicking eff. When they are set to off, no extra chorus or reverb notes are generated.
Finally, effects may be requested by midi system exclusive message in a midi file -- sysexes. These are intended to control the hardware of specific synthesizers. does a certain amount of decoding of sysexes for Roland GS synths and Yamaha XG synths and does its best to modify the sound accordingly. Chorus, reverb, and variations on these are done by the ghost note method and can be switched off with the checkboxes just mentioned. However, when the celeste variation of chorusing is requested in an XG sysex, this invokes Witczak's celeste filter, provided the eff button is clicked on.

Command Line Options
Except for giving the names of one or more midi files on the command line, the material in this section is probably not very useful to know about. If you have a need for these options, you'd probably prefer to use the command line version of this program: timidity.
kmidi options filename
Use "-" as filename to read a MIDI file from stdin

Options:
-o filename 	 Place output on filename, which may be a file, device, or HP-UX audio server, depending on the output mode selected with the -O option. The special filename ``-'' causes output to be placed on stdout.
-O mode 	 Selects the output mode from the compiled-in alternatives. mode must begin with one of the supported output mode identifiers. Run TiMidity with the -h option to see a list.
-s freq 	 Set sampling frequency to freq (Hz or kHz) Not all sound devices are capable of all frequencies -- an approximate frequency may be selected, depending on the implementation.
-a 	 Enable the antialiasing filter. Samples are run through a lowpass filter before playing, which reduces aliasing noise at low resampling frequencies.
-f 	 Enable fast decay mode. Toggles fast envelopes. Some MIDI files sound better when notes decay slower -- it gives the impression of reverb.
-p n 	 Sets polyphony (maximum number of simultaneous voices).
-A n 	 Amplify volume by n percent (may cause clipping)
-C n 	 Sets the ratio of sampling and control frequencies. This determines how often envelopes are recalculated -- small ratios yield better quality but use more CPU time.
-E 	 Turns on Witczak's effect filters for chorus, reverb, phaser, and celeste.
-# n 	 Select patch set
-L dir 	 Append dir to search path
-c file 	 Read extra configuration file
-I n 	 Use program n as the default
-P file 	 Use patch file for all programs
-D n 	 Play drums on channel n
-Q n 	 Ignore channel n
-F 	 Enable fast panning
-U 	 Unload instruments from memory between MIDI files
-i mode 	 Select user interface (see below for list)
-B n 	 Set number of buffer fragments
-h 	 Display the help message

Available output modes (-0)
-O d 	 dsp device
-O w 	 RIFF WAVE file
-O r 	 raw waveform data

Output format options (append to -O)
`8' 	 8-bit sample width
`1' 	 16-bit sample width
`U' 	 uLaw encoding
`l' 	 linear encoding
`M' 	 monophonic
`S' 	 stereo
`s' 	 signed output
`u' 	 unsigned output
`x' 	 byte-swapped output

Available interfaces (append to -i)
q 	 interface
d 	 dumb interface

Interface options (append to -i ? option)
`v' 	 more verbose (cumulative)
`q' 	 quieter (cumulative)
`t' 	 trace playing
-i 	 mode Select user interface (see below for list)