[sdiy] MIDI Sys Ex packet length

Richie Burnett rburnett at richieburnett.co.uk
Sat May 30 18:05:01 CEST 2015


Hi guys,

Thanks for all the great advice about sysex transfers, the perils of USB 
MIDI and firmware flashing.

The device I'm using has a flash page size of 256 instruction and the 
program memory is 24-bits wide, so that's 768 x 8-bit bytes or rather 878 x 
7-bit MIDI "bytes".  That sounded a bit on the large side of each sysex 
packet, hence the enquiring about sysex packet sizes.  Although, I'm fully 
aware that some synths just dump many tens of KBytes of sysex in one packet.

I've done extensive playing about using MIDI-OX with three different USB 
MIDI interfaces to send some test sysex messages of different lengths and 
receive them back in a loopback test.  And so far I haven't been able to get 
any of the three interfaces to work reliably in a loopback test with sysex 
data over a handful of bytes in length.  I really had no idea that USB MIDI 
was so f****d up.  Give me back an old Soundblaster card with MIDI on the 
joystick port, pleeeeeeease!!!!!!!!!!!

>From what I've been reading online the basic loopback test with a 5-pin DIN 
MIDI cable connected between MIDI in and MIDI out of the interface seems to 
be expecting too much from most USB MIDI interfaces.  From what I can tell 
the interfaces can handle either transmitting or receiving sysex, but not 
doing two things at the same time!  Is there some instrinsic reason for this 
behaviour in the USB MIDI definition?  One shared sysex buffer for either Tx 
or Rx, maybe?

I must say I find the whole thing unbelievable in this day and age where, 
(for another project,) I've got continuous serial comms to and from a PC at 
3Mbits/s over USB and it doesn't drop a bit in 64MBytes of data, even 
without using flow-control.  MIDI is almost a hundred times slower, how can 
it not work reliably!?!?

-Richie,


-----Original Message----- 
From: MTG
Sent: Sunday, May 24, 2015 10:07 PM
To: synth-diy at dropmix.xs4all.nl
Subject: Re: [sdiy] MIDI Sys Ex packet length

What I do, and I think it's pretty common, is to send the amount of data
that matches the flash sector size of the target. In my case that's 512
bytes. Then one typically sets the pause in MIDI-OX for that F7 to delay
the amount of time for the flash write.  I recommend to my users 150ms.
Never had an issue/failure/brick ever.

Now MIDIOX on the other hand is a bit of a brute. I always struggle with
the port settings. I ended up writing my own. It wasn't that bad but
took a while to get solid. Your USB endpoint size will determine how
many of those 4-byte packets you get at a time on your micro. And you
will find an empty one too on occasion.  I found that out on Win7 or 8,
can't remember. That's not well addressed by the spec that I could find
but no issues once I discovered it. I posted a question about it on
midi.org.

GB






More information about the Synth-diy mailing list