Skip to content

Requiring EOX for creating a SysEx message is not spec compliant #363

@rdoursenaud

Description

@rdoursenaud

Specification

The MIDI specification states, page 5 (emphasis added by me):
"Exclusive messages [...] can be terminated either by an End of Exclusive (EOX) or any other Status byte (except Real Time messages)."

Rationale

Currently, the parser does not interpret these SysEx messages and drops them!
It is also impossible to create a SysEx message without EOX from hex or string.

IMHO Since EOX (0xF7) is just another Status byte, it should not be part of the SysEx message.

My understanding of "An EOX should always be sent at the end of a System Exclusive message" in the specification is that the sender is responsible for adding the EOX after a SysEx message, not that it is part of it!

I’d be happy to contribute a patch if you approve of these potentially breaking changes.

Examples

mido.parse_all(bytes.fromhex("f000801212"))

Current result: [Message('note_off', channel=0, note=18, velocity=18, time=0)]
Expected result: [Message('sysex', data=(0,), time=0), Message('note_off', channel=0, note=18, velocity=18, time=0)]

mido.Message.fromhex("f000")

Current result: ValueError: invalid sysex end byte 0
Expected result: Message('sysex', data=(0,), time=0)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions