I'm serialising a midi buffer and sending it as a UPD datagram from a Mac to a Linux machine. To serialize the midibuffer I am copying the data from the MidiBuffer's Array<uint8> data member into a MemoryBlock using copyFrom() like so:
FWIW none of that stuff is platform-specific. If it's getting messed up then it's most likely somewhere else in your code that's corrupting it.
But do pay attention to the very clear comment saying that you shouldn't rely on the format of that Array to be consistent - it could change at any time and could vary between platforms (although currently it doesn't)
Yup! problem was in my code. My offsets were using data that had varying sizes on different platforms. Fixed that and everything works great.
Thanks for the reassurance.
I saw the comment saying i shouldn't rely on the data format in the MidiBuffer and am aware that might change. Any suggestion how one could quickly serialise a MidiBuffer? The AudioSampleBuffer copyFrom() , getReadPointer() and setDataToReferTo() are very helpfull for this kind of thing. With MidiBuffer you are sort of stuck with the Array<uint8> data member and the very clear warning that this is bad.