Playing a MIDI file (advanced)

Purpose. Plays a single MIDI file. Allows to select the sequencer, the synthesizer or MIDI port or dumping to the console.


java MidiPlayer -l

java MidiPlayer [ -s ] [ -m ] [ -d devicename ] [ -c ] [ -S sequencername ] midifile



list the availabe MIDI devices, including sequencers


play on the MIDI port

-d devicename

play on the named MIDI device


dump on the console

-S sequencername

play using the named Sequencer


the name of the MIDI file that should be played

All options may be used together. No option is equal to giving -s.

Bugs, limitations. This example requires the JDK1.5 or later.

Source code.,,, gnu.getopt.Getopt