Skip to content

File Format

Structure & Headers

The .lshw file format uses a mix of words and ASCII encoding to store information about a lightshow.

LightShark notation
Sample of contents of the Patching segment of a .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 xF6 means that the current patch object 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, 0xDA followed 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 indicating 2^(N-1) bytes after the marker will be the hex representation of the value.

  • 0xC2 indicates false and 0xC3 indicates 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) indicates N elements in the list belonging to an attribute.
  • 0xDC ?? ?? is used instead when the list contains too many elements for 0x9? to represent (>15). Example - A palette uses DC 00 28 for 40 items.
  • (0x80 + N) indicates N attributes for an object. It has also been seen used similarly to 0x90.
  • 0xDE followed by two bytes appears where an object has too many elements for 0x8? to represent (>15). Example - Cue FX entries use DE 00 18 for 24 attributes.

Example

In the sample image, x8F after the patch bytelength header indicates that the patch object has 16 attributes.