[sdiy] MIDI Sys Ex packet length

ASSI Stromeko at nexgo.de
Sun May 24 20:52:01 CEST 2015

On Sunday 24 May 2015, 19:21:19, Richie Burnett wrote:
> If doing a flash update of firmware over conventional MIDI via System
> Exclusive is it wise to break the download into many smaller packets of
> say 128 or 256 bytes in length?

Yes, if only for the fact that Microsofts MIDI Class-Compliant USB drivers 
(and some device specific ones that were apparently using some of that code 
as a starting point) have a bug for messages larger than whatever the 
receive or send buffer size is set to.  If the SysEx message spans the 
buffer size, the part of the message in the second buffer will get corrupted 
(fatally for send as extra data gets inserted, non-fatally for receive as 
you get two messages that can be re-assembled).  The default buffer sizes 
have become large enough with Win7 so that this largely works for a lot of 
applications (Hermann Seib has implemented a function into MIDItrix that can 
reassemble messages that have been damaged by buffer tearing on receive).

> I was planning on using MIDI-Ox for Sys Ex flash updates, but I guess I
> could also incorporate the Sys Ex packets into a standard MIDI file that
> could be played back on any capable hardware?

Yes, doing it via SMF is generally a better idea, IMHO.  Even the Windows 
Media Player can play those correctly (getting it to play through the MIDI 
interface is another story, I forgot what version of WMF they started hiding 
this dialog in some dark corner of the control panel).

> Does anyone know if MIDI-Ox has any provision for resending packets if
> something like a CRC fails, or would I have to write my own program at the
> PC/Mac end to check for ack/nack and resend the necessary corrupted
> packets?

That isn't even specified for MIDI, you'd need to implement your own 
protocol riding on top of MIDI.  Having a good checksumming algorithm is 
mandatory for the above reasons, but automatic retransmission would require 
another program on the computer.

> I've already discovered that certain cheap Chinese USB to MIDI interfaces
> don't correctly handle MIDI messages containing more than 3 bytes!!! So
> they're a non-starter from the outset.

Some of the ones I have seen wouldn't send SysEx at all or only by accident.

+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:

More information about the Synth-diy mailing list