Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I am reverse engineering a data file (from a synthesizer).

It seems that e.g. -1 is written as FF FF FF FF, so in four bytes. while +1 is written as 00 00 01 (--), so only three bytes.

Is something like this common? I only heard about either a 3 or 4 byte format, but not 3 OR 4 depending on the sign.

And is there some way to handle this in C#? BitConverter class is a bit too limited for this.

share|improve this question

closed as unclear what you're asking by Robert Harvey, Bart van Ingen Schenau, GlenH7, DougM, Dynamic Jul 8 '14 at 21:33

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
If you're referring to MIDI data, it is indeed composed of variable-length messages. You'll just have to deal with that, probably by checking the first byte for FF. – Robert Harvey Jul 7 '14 at 19:36
    
I have to admit my question is not very good and actually, it's not MIDI but I reversed engineerd it wrongly. HOwever, I accepted the answer and leave the question, because the answer fits the questions well as it stands this way. Btw, I have the MIDI specification and it is clear enough. – Michel Keijzers Jul 7 '14 at 21:12
    

1 Answer 1

up vote 2 down vote accepted

I'm going to assume you already have a copy of the MIDI 1.0 Specification (latest version), and have digested it thoroughly. (If you haven't, that's your first homework assignment.)

Manufacturers of MIDI synthesizers are usually good about publishing their dump file formats, to make it easier for third-party vendors to write programming utilities and librarians. If the manufacturer of your synth is still in business, asking them POLITELY for a copy of their specification will almost certainly work quite well, and the resulting document will answer ALL of your questions.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.