public static String[] getInstruments() {
Synthesizer synthesizer = null;
try {
synthesizer = MidiSystem.getSynthesizer();
synthesizer.open();
synthesizer.loadAllInstruments(synthesizer.getDefaultSoundbank());
} catch (MidiUnavailableException ex) {
ex.printStackTrace();
}
Instrument in[] = synthesizer.getLoadedInstruments();