public void send(MidiMessage message, long deltaTime) {
        System.out.println("New MIDI message");
        Event event = null;
        ByteArrayInputStream bais = new ByteArrayInputStream(message.getMessage());
        DataInputStream dis = new DataInputStream(bais);
        try {
            dis.mark(2);
            int status = dis.readUnsignedByte();
            int length = 0;
            //check running status
            if (status < 0x80) {
                status = oldStatus;
                dis.reset();
            }
            if (status >= 0xFF) {//MetaEvent
                int type = dis.readUnsignedByte();
                length = MidiUtil.readVarLength(dis);
                event = MidiUtil.createMetaEvent(type);
            } else if (status >= 0xF0) { //System Exclusive -- Not Supported
                System.out.println("SysEX---");
                length = MidiUtil.readVarLength(dis);
            } else if (status >= 0x80) { //MIDI voice event
                short selection = (short) (status / 0x10);
                short midiChannel = (short) (status - (selection * 0x10));
                VoiceEvt evt = (VoiceEvt) MidiUtil.createVoiceEvent(selection);
                evt.setMidiChannel(midiChannel);
                event = evt;
                if (event == null) {
                    throw new IOException("Read Error");
                }
            }
            if (event != null) {
                event.setTime((int) deltaTime);
                event.read(dis);
            }
            oldStatus = status;
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
        this.notifyListeners(event);
    }