The MIDI Forum

0
Votes
Undo
  1. Marco
  2. MIDI Specifications
  3. Tuesday, 01 September 2020
  4.  Subscribe via email
Section 2.1 of the XMF Specification says "TreeEnd is the offset from the start of the XMF file to the last byte of the tree".
This would seem to indicate that if a tree starts at say offset 100, and is 100 bytes in length, then TreeEnd would be 199, which is the offset of the last byte.
However the diagram that follows appears to show TreeEnd pointing at the beginning of the next resource, which in my above example would mean TreeEnd equals 200.

Which of these two interpretations is correct? I'm seeing some files in the wild that conform to the text, and other files that conform to the diagram.
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
The diagram does not show individual bytes, so it is not clear where exactly the arrow points to. So you'd have to go from the text, which is unambiguous.
(And this is an unusual construction; most begin/end values in other file formats indeed use begin+length=end.)

When writing files, you should conform to the text. When reading files, you should be able to handle both.
Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!