Dance Studio » Advanced: File Format

The following is a brief description of the .dance file format and is intended only for developers who would like to read/write dance compatible files. Please note that all data is written with the Most Significant Byte (MSB) first (a.k.a.  Big-Endian) encoding. The terms word8, word16, word32, and word64 refer to 8, 16, 32, and 64-bit unsigned values. Similarly, int8...int64 refer to the signed equivalents of word8...word64.

FILE OFFSET SIZE (bytes) VALUE DESCRIPTION
0 1 FIXED: 0xDA File Type Identification and Verification
1 1 FIXED: 'N' File Type Identification and Verification
2 1 FIXED: 0XCE File Type Identification and Verification
3 1 FIXED: '\r' File Type Identification and Verification
4 1 FIXED: '\n' File Type Identification and Verification
5 1 FIXED: 'r' File Type Identification and Verification
6 1 FIXED: 'o' File Type Identification and Verification
7 1 FIXED: 'b' File Type Identification and Verification
8 1 FIXED: 'o' File Type Identification and Verification
9 1 FIXED: '\n' File Type Identification and Verification
10 1 FIXED: 'D' File Type Identification and Verification
11 1 FIXED: 'A' File Type Identification and Verification
12 1 FIXED: 'N' File Type Identification and Verification
13 1 FIXED: 'C' File Type Identification and Verification
14 1 FIXED: 'E' File Type Identification and Verification
15 1 FIXED: '\r' File Type Identification and Verification
16 4 VARIABLE: word32 The number of motors

For every eighth motor i:

FILE OFFSET SIZE (bytes) VALUE DESCRIPTION
18+i 1 VARIABLE: word8 TRUE/FALSE: are the given motors affected:
{ i+7,  i+6, i+5, i+3, i+2, i+1, i }

For every motor j:

FILE OFFSET SIZE (bytes) VALUE DESCRIPTION
   18
+ round up(number of motors/8)
+ sum[ bufer size motors 0...j-1 ]
4 VARIABLE: word32 The length of the buffer (should be zero for unaffected motors)
   22
+ round up(number of motors/8)
+ sum[ bufer size motors 0...j-1 ]
VARIABLE:
4*(size+1)
VARIABLE: 
{word32; int32[]}
The motor buffer in this format:
word32 size
int32[size] data

In the above, int32[size] denotes an array (list) containing size elements of type int32.

The first element in the array is the motor's initial position. All other elements denote a change in position.

Example:
{ 3, 5, 10, -8 }
3: the number of elements remaining
5: the initial position
10: the difference from 5
-8: the difference from 15
The above list would denote that the motor moved in the positions {5, 15, 7}.

NO COMMENTS

RECENT COMMENTS

Want to add a comment? Login or become a TeRK member now!