public void playStop() { if (sequence != null) { if (playState == PLAYING || playState == PAUSED) { sequencer.stop(); sequencer.close(); playState = STOPPED; } } }
public void close() { System.out.println("midi closing"); if (synthesizer != null) { synthesizer.close(); } if (sequencer != null) { sequencer.close(); } sequencer = null; synthesizer = null; instruments = null; channels = null; }