fbpx
Skip to main content

MIDI Forum

XMF Specification a...
 
Notifications
Clear all

XMF Specification ambiguity

2 Posts
2 Users
0 Reactions
12.3 K Views
Marco
Posts: 1
New Member
Topic starter
 

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.

 
Posted : 01/09/2020 12:44 pm
Clemens Ladisch
Posts: 324
 

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.

 
Posted : 03/09/2020 12:55 am
Share: