Ok, I finally had a little time to play around with the MIDI stuff some more today. Interestingly, it turns out that the "Real Time Sequencer" is in fact the default sequencer, and therefore the one that is being used by SoundSystem. Another interesting thing is that "Java Sound Sequencer" does not even show up in the list (perhaps it was removed in the latest version of Java??!)
I used the following code to generate some output about the MIDI devices:
try
{
MidiDevice device = null;
MidiDevice.Info[] midiDevices = MidiSystem.getMidiDeviceInfo();
System.out.println( midiDevices.length + "MIDI Devices:" );
for( int i = 0; i < midiDevices.length; i++ )
{
try
{
device = MidiSystem.getMidiDevice( midiDevices[i] );
}
catch( MidiUnavailableException e )
{
device = null;
}
System.out.println( " " + midiDevices[i].getName() );
if( device instanceof Synthesizer )
System.out.println( " *this is a Synthesizer instance" );
if( device instanceof Sequencer )
System.out.println( " *this is a Sequencer instance" );
}
}
catch( Exception e )
{
// Midi unavailable
}
System.out.println( "Default sequencer: " + sequencer.getDeviceInfo().getName() );
if( sequencer instanceof Synthesizer )
System.out.println( "Default sequencer is also a synthesizer" );
System.out.println( "Default synthesizer: " + synthesizer.getDeviceInfo().getName() );
if( synthesizer instanceof Sequencer )
System.out.println( "Default synthesizer is also a sequencer" );
Here is the JAva Console output I get:
6MIDI Devices:
USB Audio Device
Microsoft MIDI Mapper
USB Audio Device
Microsoft GS Wavetable SW Synth
Real Time Sequencer
*this is a Sequencer instance
Java Sound Synthesizer
*this is a Synthesizer instance
Default sequencer: Real Time Sequencer
Default synthesizer: Java Sound Synthesizer
So it looks like I won't be able to try using a different sequencer after all, since there is only one available.
On the other hand, I may be able to send the MIDI messages to the Microsoft GS Wavetable SW Synthesizer. Of course, that would only work on computers running versions of Microsoft Windows.
Hmm.. maybe I could find out what are the default software synthesizers on Linux, Mac, and Solaris, and have SoundSystem choose whichever one is available on the user's computer (or use the default Java Sound Synthesizer if none are found). Let me see if using a different Synthesizer corrects that delay bug...