File Format¶
Structure & Headers¶
The .lshw file format uses a mix of words and ASCII encoding to store information about a lightshow.
.lshw file. The main segments of a .lshw file are represented with the header ?? ?? ?? ?? ?#[name]#.
- The 4 ?? bytes in front are used to represent the length of the segment header.
- The ? byte is used to indicate the length of the segment's name (including the hashtags). Refer to the Strings section below.
Each segment contains multiple objects, which each contain multiple attributes storing their details.
Objects are headered in a similar format, but are then followed by 4 bytes to represent the bytelength of the object (inclusive of the 4 bytes)
Example
In the image above:
00 00 00 0B AA #patching#means 11 bytes are used for the character xAA (1) + string "#patching#" (10).x00 x00 x00 xF6means that the currentpatchobject has a bytelength of 246.
Strings¶
-
For strings of bytelength <=16, they are represented in the form of
?[string], where ? is equal to (xA0 + bytelength). -
For strings of longer bytelength,
0xDAfollowed by 2 bytes representing the bytelength are used.
Values¶
-
For attributes possessing values that are known to be within the range of 0-255 (e.g. fixture values), they are represented in typical ASCII representation (e.g.
255 = FF). -
For attributes with values that can be >255,
(0xCB + N)is used as a marker indicating2^(N-1)bytes after the marker will be the hex representation of the value. -
0xC2indicates false and0xC3indicates true.
Example
- xCD2710 = 10000
- xCD03E8 = 1000
These values recur in FX fields such as size, width, limits, and internal speed.
Lists¶
Certain attributes can be in the form of lists.
(0x90 + N)indicatesNelements in the list belonging to an attribute.0xDC ?? ??is used instead when the list contains too many elements for0x9?to represent (>15). Example - A palette usesDC 00 28for 40 items.(0x80 + N)indicatesNattributes for an object. It has also been seen used similarly to0x90.0xDEfollowed by two bytes appears where an object has too many elements for0x8?to represent (>15). Example - Cue FX entries useDE 00 18for 24 attributes.
Example
In the sample image, x8F after the patch bytelength header indicates that the patch object has 16 attributes.