The media player is always tricky with JavaME. Some devices requires you to prefetch() while others will crash if you do. Some likes realize() while others don't. So it's best to use multiple try/catch blocks with prefetch() and realize() etc. It's possible that your try block fails because of prefetch(). So try this:
public final class Dmgcpu implements Runnable {
private Player player = null;
private static MIDIControl synth = null;
private void initSound() {
try {
player = Manager.createPlayer(Manager.MIDI_DEVICE_LOCATOR);
} catch (Exception e) {}
try {
player.realize();
} catch (Exception e) {}
try {
player.prefetch();
} catch (Exception e) {}
try {
synth = (MIDIControl) player.getControl("javax.microedition.media.control.MIDIControl");
} catch (Exception ex) {}
if (synth!=null) {
synth.setProgram(0, -1, instSound_a);
//synth.shortMidiEvent(0xC0, instSound_a, 0);
//sound test
synth.shortMidiEvent(0x90 + channel, note[i], volume * MASTER_VOLUME);
thread_sleep(300);
synth.shortMidiEvent(0x80 + channel, note[i], 0);
}
}
More info about media-player: http://indiegamemusic.com/help.php?id=1