PlaySMF (Plays SMF files after resetting)

PlaySMF is a Standard MIDI File (*.mid) player that appropriately resets the synthesizer before playing the file. This program is written in Java.

Introduction

Even though there are several programs that can play MIDI files using external sound modules, few resets them appropriately before playing a MIDI file. Roland SC-88Pro Yamaha MU100Bs Roland MT-32 Unfortunately not all MIDI files have reset sequences embedded, so they sound different depending on whatever the state that the sound module was left with. Moreover there are several pre-GM synthesizers that require special reset sequences. To provide consistent sound, this program appropriately resets your synthesizer before playing a MIDI file.

Additionally this program supports the OpenJDK's software synthesizer by aceepting the option to load the SoundFont file (*.sf2). With appropriate soundfont the software synth does somewhat acceptable job.

Supported Resetting Methods

Downloads

This is a public domain software. Verified only on Linux with Oracle JDK 7u45 and OpenJDK 7u45. IBM Java 1.7.0 SR5 for Linux also works, but there are pointless debug messages coming out from the JVM when accessing MIDI resources. This program should work on other platforms as well.

Examples

As this is a Java application you'll probably want to have a small shell script like this:

#!/bin/sh
java -jar /path/to/PlaySMF.jar "$@"

Save it as PlaySMF.

If you want to see the list of available devices use -l:

% PlaySMF -l
Dev 0 OpenJDK Gervill 1.0
    Software MIDI Synthesizer
    Source: 0 Sink: Unlimited
Dev 2 ALSA (http://www.alsa-project.org) UX16 [hw:2,0,0] 3.7.10-1.16-desktop
    UX16, USB MIDI, UX16
    Source: 0 Sink: Unlimited
Dev 3 Oracle Corporation Real Time Sequencer Version 1.0
    Software sequencer
    Source: Unlimited Sink: Unlimited

In this case device 0 is a software synth bundled with the Java runtime. Yamaha UX16 Device 2 is the YAMAHA UX16 USB-MIDI adapter. Device 3 is a pseudo sequencer device. To inhibit filtering devices that do not act as Sinks, specify -la instead of -l.

To play MIDI files using the synthesizer connected to the UX16 adapter:

% PlaySMF -p 2 -r sc88 song1.mid song2.mid

Here sc88 is specified as the reset sequence. See Supported Resetting Methods for what can be specified here. If you omit the -r option no reset sequence is sent.

When the software synthesizer is to be used, you can (and should) specify a soundfont using the -s option:

% PlaySMF -s /usr/share/sounds/sf2/8MBGMSFX.SF2 song1.mid ...

All options are:

PlaySMF [-p dev] [-r gm|gs|sc88|xg|mu100|doc|mt32|fb01] [-s soundfont.sf2] [-l|-la] 1.mid 2.mid ...

Useful links

  1. GitHub repo [github.com] for this software.
  2. ASeqView [alsa-project.org] Displays MIDI sequence with the keyboard.