This has been bugging me for a long time, I've been trying to create a Drum Machine app, but unfortunately, I have to wait for one sound to finish before another one will play. There is also a delay even if you simultaneously press one button. Is it possible to play two at once, or at least stop one sound to play another one when pressed? The midlet itself is slow anyway any optimisation tips?

There are 6 drumpad objects in the canvas.

Java Code:
package com.rightgoodent.media.soundeditor;

import javax.microedition.lcdui.Graphics;
import javax.microedition.media.Manager;
import javax.microedition.media.Player;

public class DrumPad extends Thread {


private int pad_x,pad_y,pad_width,pad_height,pad_firstx,pad_firsty;
String fname;
Player midiPlayer;

    DrumPad(int px,int py,int pw,int ph,String fn){
    pad_x = px;
    pad_y = py;
    pad_width = pw;
    pad_height = ph;
    pad_firstx = px;
    pad_firsty = py;
    fname = fn;
    try {
      midiPlayer = Manager.createPlayer(getClass().getResourceAsStream("resources/"+ fname), "audio/midi");
      midiPlayer.prefetch();
      midiPlayer.realize();
    }
      catch (Exception e) {
      System.err.println(e);
        }
    }
    public void pressEvent(int x, int y) {
    if (x>pad_x && x<(pad_x+pad_width)&& y>pad_y && y<(pad_y+pad_width))
        {
        pad_x +=6;
        pad_y +=8;
        if (midiPlayer != null) {
          try {
        midiPlayer.setTimeBase(midiPlayer.getTimeBase());
        midiPlayer.start();
        Thread.sleep(50);
        midiPlayer.stop();
    }
              catch (Exception e) {
      System.err.println(e);
        }
        }
    }
    }
    public void releaseEvent(int x, int y){
        pad_x = pad_firstx;
        pad_y = pad_firsty;
        
    }
    public void paint (Graphics g){
        g.fillRect(pad_x, pad_y, pad_width, pad_height);
    }
}