Exemple #1
0
  public void playStop() {

    if (sequence != null) {
      if (playState == PLAYING || playState == PAUSED) {
        sequencer.stop();
        sequencer.close();
        playState = STOPPED;
      }
    }
  }
Exemple #2
0
 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;
 }