pmidi(1) A midi file player for ALSA.


pmidi [ -pclient:port ] [ -l ] [ -ddelay ] file...


The pmidi command reads in the specified midi files and plays them through the ALSA sequencer. You can specify on the command line which sequencer port that you wish to use. Use the -l option to get a list of possible sequencer ports for your machine.


Specify the ALSA port to send the midi file to.
List the possible output ports that could be used.
Delay after song ends. This is used to prevent the last note of a song being chopped off early. The default is two seconds.

Port numbers

You can specify client:port numbers in the ALSA_OUTPUT_PORTS environment variable. You can also supply a comma (or space if quoted correctly) separated list of client:port numbers. This will allow you to play midi files that use more than 16 channels.


pmidi song.mid song2.mid
pmidi -p "64:0, 64:1" song.mid


Before you start you need to have ALSA installed and configured correctly. This man page cannot cover all general ALSA topics, but here are a few things to check when things do not seem to be working.

Checking ALSA

First check that the correct sequencer modules are loaded for your sound card:
For a card with an external Midi connection, you need to load snd-seq-midi.
For the OPL2/3 internal synthesiser you need to load snd-synth-opl3.
For the AWE32/64 internal synthesiser you need to load snd-synth-emu8000.
For the SB Live! internal synthesiser you need to load snd-synth-emu10k1.
(Let me know of any more)
If you have an AWE32/64 or SB Live! you will need to load the sounds with sfxload in the same way as for the standard kernel drivers.
If you have the OPL3 FM synthesiser you will have to load the FM instruments with sbiload. See note below.
Make sure that the synth in the mixer is turned up and unmuted if appropriate.

Before use

Because you may have more than one sound card and each sound card may have several MIDI connections, you have to tell pmidi which one to use.

First find out what the possibilities are for your system:

If you run:

pmidi -l
it will give you a list of the possible devices that it can play to. On my system I get:
PortClient namePort name
64:0Rawmidi 0 - EMU10K1 MPU-401 (UEMU10K1 MPU - 401 (UART)
65:0Emu10k1 WaveTableEmu10k1 Port 0
65:1Emu10k1 WaveTableEmu10k1 Port 1
65:2Emu10k1 WaveTableEmu10k1 Port 2
65:3Emu10k1 WaveTableEmu10k1 Port 3
128:0FLUID Synth (28152)Synth input port (28152)
129:0Client-129TiMidity port 0
129:1Client-129TiMidity port 1

Any of the port numbers in the first column can be used with pmidi. In the example above the first one is the external Midi port, the next four are the internal wave table synthesiser. Then there are two software synthesisers running, FluidSynth ( and Timididy.

If you don't see anything listed then check that the correct ALSA modules are loaded as in the section "Checking ALSA".


Port to use in playing midi file.


Steve Ratcliffe <[email protected]>