View RSS Feed

Andy

MIDI Bulk Dumps

Rate this Entry
Sounds a bit rude, doesn't it!

I have tested and verified now that the MIDI bulk dump format for the Yamaha consoles, once converted from 7-bit to 8-bit is in fact the same format the setup files are. This opens up possibilities for sending and receiving large amounts of data without having to save and load files. Not sure of the practical applications just yet, but it's interesting, nonetheless.

The data is formatted as 8 bytes of 7-bit data which needs to be converted to 7 bytes of 8-bit data.

Byte(0) = 7 MSBs of the following 7 bytes, big-endian style. i.e. Bit 6 = MSB for Byte(1), Bit 5 = MSB for Byte(2), etc.

Byte(1)..Byte(7) = Bulk data without the MSB.

Yamaha gives us the conversion formula in the owners manual:
Code:
 
[Recovery from bulk data to actual data]
d[0..6]: actual data b[0..7]: bulk data for(I=0; I<7; I++){
b[0] <<= 1; d[I] = b[I+1]+(0x80 & b[0]);
}
In reality, it's a bit trickier. The console sends out groups of bulk data bytes which need to be strung together to get the final converted set of bytes.

Each group has a header and a footer which need to be stripped off. The format of the header is detailed in the manual, and the footer is the usual F7 that's at the end of all sysex messages.
The number of bytes in each group is a 16-bit integer contained in the header at position 4 and 5. (little-endian)

So in vb.net, it looks like the following code. BulkDataLen is the size of each chunk. BulkData() is the incoming sysex of all the chunks, and RealData() is the converted data.
Code:
BulkPos = 0
RealPos = 0
 
Do
Dim BulkDataLen As Integer = (Int(BulkData(BulkPos + 4)) << 7) + BulkData(BulkPos + 5) For Ofs As Integer = 12 To BulkDataLen + 5 Step 8
For i = 0 To 6
BulkData(BulkPos + Ofs) <<= 1 RealData(RealPos + i) = BulkData(BulkPos + Ofs + i + 1) + (BulkData(BulkPos + Ofs) And &H80)
Next RealPos += 7
Next Ofs BulkPos += BulkDataLen + 8 ' Skip the next header
Loop Until BulkPos > (BulkData.Count - 8)
Seems to work.

Updated 12-08-2009 at 07:11 AM by Andy

Categories
Programming

Comments

  1. guessi -
    guessi's Avatar
    would that mean, one could emulate the synchronization like studio manager does?
    a software that gets all the data from the desk, changes some things, even stays "online" to do that...?
  2. Andy -
    Andy's Avatar
    Quote Originally Posted by guessi
    would that mean, one could emulate the synchronization like studio manager does?
    a software that gets all the data from the desk, changes some things, even stays "online" to do that...?
    Absolutely. From what I can tell, that is the way that SM does it's synchronization. You can only sync 1 piece of information at a time, so you would have to request each scene, each libary, and so on. Seems like it would take a long time, so I'm not sure if SM has a "SUPER BULK" mode where it sends ALL scenes in one shot instead of 1 at a time. Would be easy to find out, but for now I'm pretty sure that the data in the Bulk Dump matches the scene file info after you've converted it.