java midi latencia

Estoy tratando de crear una aplicación Java que pueda reproducir notas en la computadora después de detectar un dispositivo midi.

Una vez que obtengo el dispositivo midi deseado, estoy configurando el receptor al que el transmisor del dispositivo enviará mensajes MIDI.

    device.getTransmitter().setReceiver( new MyReceiver()) ; 

class MyReceiver se parece a:

public class MyReceiver implements Receiver {
   MidiChannel[] channels ;
    public MyReceiver (){
        try {
            Synthesizer synthesizer = MidiSystem.getSynthesizer();
            synthesizer.open();
            channels = synthesizer.getChannels();
            channels[0].programChange( 22 ) ;
        }catch ( Exception e ) {
            e.printStackTrace() ; 
        }
    }
public void  noteOff ( int nota ) {
        channels[0].noteOff(nota);
    }
public void noteOn ( int nota ) {
        channels[0].noteOn( nota , 100);    
}

public void send(MidiMessage msg, long timeStamp ) {

        byte[] b = msg.getMessage (); 

        String tmp = bits ( b [0] ) ; 
        int message = convertBits ( tmp ) ;
        int note1 = convertBits ( bits ( b [ 1 ] ) ) ; 

        // note on in the first channel
        if ( message == 144 ) { 
            noteOn( note1 ) ; 
        }

        // note off in the first channel  
        if ( message == 128 ) { 
            noteOff( note1 ) ; 
        }

    }
      public String bits(byte b)
      {
           String bits = "";
           for(int bit=7;bit>=0;--bit)
           {
                bits = bits + ((b >>> bit) & 1);
           }

           return bits;
      }
      public int  convertBits  ( String bits ) {
          int res = 0 ; 
          int size = bits.length () ; 

          for ( int i = size-1 ; i >= 0 ; i -- ){

               if ( bits.charAt( i ) == '1' ) {

                   res +=  1 <<(size-i-1) ;  
               }
          }
          return res ; 
      }
    public void close() {}
}

Cuando ejecuto mi código y comienzo a jugar en mi dispositivo midi, obtengo una latencia alta (no puedo escuchar notas al instante).

¿Como puedo solucionar este problema