@Override
    public void send(MidiMessage incomingMessageWrapper, long timestamp) {
        byte[] midiMessage = incomingMessageWrapper.getMessage();

        command = midiMessage[0] & 0xFF;
        if (command >= 144 && command <= 159) {  //note on
            synth.noteOn(midiMessage[1] & 0xFF, midiMessage[2] & 0xFF);
        } else if (command >= 128 && command <= 143) {  //note off
            synth.noteOff(midiMessage[1] & 0xFF, midiMessage[2] & 0xFF);
        }
    }