You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While it is hard to discern, there is a limit in CoreMIDI on the size of a packet in a MIDIPacketList. The docs only say:
The maximum size of a packet list is 65536 bytes. Large sysex messages must be sent in smaller packet lists.
Note also that the length field of MIDIPacket is only a UInt16. The actual packet size limit is smaller than that, after subtracting out the MIDIPacket and MIDIPacketList overheads from the max size of the list.
PacketBuffer will attempt to create a MIDIPacketList with a single MIDIPacket, large enough to accommodate however big a data object is passed in. If used with very large messages (think 80k sysex!) - PacketBuffer will build the structures, but the resulting thing will be corrupted, as it can't really hold a message that big.
PacketBuffer should at least make it clear in the docs that there is a limit on size.
How did I find this? I'm sending 80k sysexs (to control a synth) from a WebMIDI app.... and in Firefox on Mac it crashes the browser completely and instantly! I don't know who to blame for the crash... but the 80k byte array gets passed:
If the data is too big to fit, then MIDIPacketListAdd returns null (as per CoreMIDI header files)... this will cause the computation of current_packet_offset to be some giant value.
While it is hard to discern, there is a limit in CoreMIDI on the size of a packet in a MIDIPacketList. The docs only say:
Note also that the length field of MIDIPacket is only a UInt16. The actual packet size limit is smaller than that, after subtracting out the MIDIPacket and MIDIPacketList overheads from the max size of the list.
PacketBuffer will attempt to create a MIDIPacketList with a single MIDIPacket, large enough to accommodate however big a data object is passed in. If used with very large messages (think 80k sysex!) - PacketBuffer will build the structures, but the resulting thing will be corrupted, as it can't really hold a message that big.
PacketBuffer should at least make it clear in the docs that there is a limit on size.
How did I find this? I'm sending 80k sysexs (to control a synth) from a WebMIDI app.... and in Firefox on Mac it crashes the browser completely and instantly! I don't know who to blame for the crash... but the 80k byte array gets passed:
The text was updated successfully, but these errors were encountered: