public static MDEvent Parsing(byte[] buffer, ref int offset, MDEvent bef_event) { int oldoffset = offset; int delta = StaticFunc.ReadDeltaTime(buffer, ref offset); if (buffer[offset] == 0xFF) { offset++; return(MetaEvent.MakeEvent(delta, buffer, ref offset, oldoffset)); } if (buffer[offset] < 0xF0) { return(MidiEvent.makeEvent(buffer[offset++], delta, buffer, ref offset, oldoffset, bef_event.EventType)); } return(SysEvent.MakeEvent(buffer[offset++], delta, buffer, ref offset, oldoffset)); }