I'm writing some code that will when run, auto-starts playback of a midi sequence, and that the user can pause at any time by pressing a key. They key event handling works just fine, however, I'm getting a very bizarre error, where pausing the sequencer with:
public void pause() {
// if the sequencer is playing, pause its playback
if (this.isPlaying) {
this.sequencer.stop();
} else { // otherwise "restart" the music
this.sequencer.start();
}
this.isPlaying = !this.isPlaying;
}
resets the sequencer's tempo. The song/sequencer starts playing at 120000 MPQ (as loaded from my input) and gets reset to 500000 MPQ. Does anyone know why this might be happening? Thanks.