User Tools

Site Tools


create_sequence:sequence_understanding

This is an old revision of the document!


Sequences Understanding

IMPORTANT NOTE

This article assumes you're running FreeStyler on a PC using a little endian processor (x86 core) You may have to consider swapping the data on a big endian processor (need cross check)

What is a sequence file (*.chb)

The sequence file is generated by the sequence editor. See the sequence editor for further information. This file contains the DMX values and other informations to allow Freestyler to play back your scenes.

Structure of the sequence file

The sequence file is divided as below:

Word0: Number of steps contained in the file

0x0200: Sequence has 2 steps

Then all steps are added with the following syntax:

all steps are using 1618 words (1 + 1 + 1536 + 79)

Word1: Time for the fade (multiplier for 500ms)

0x0100: (fade time is 500 ms)
0x0300: (fade time is 1500 ms)

Word2: Time for the scene (multiplier for 100 ms)

0x0A00: (scene time is 1000 ms)
0x0D00: (scene time is 1300 ms)

Word3 to Word1539 (included): 3 words per DMX channel where

  • First word is the DMX value for the channel
From 0x0000 to 0xFF00 
(0x0100, 0x0200, …, 0x7F00, 0x8000, …, 0xFE00, 0xFF00)
  • Second word is the usage of the DMX channel
0x0100 = Fade
0x0200 = Snap
0x0300 = OFF
  • Third word seems to be unused for now
Always 0x0000

Word1540 to Word1617 (included): Behavior not understood. Values are not changing whether cues or buttons are used. I have today no clues for that.

How can I see/edit the sequence file content

Get an Hex editor such as PSPad for example and open the file in HEX format.

HEX content of the sequence file

In this example, the sequence has 5 steps. 0x0500

In step1

  • Fade time is 500ms 0x0100
  • Scene time is 1000ms 0x0A00
  • Channel1 is 255 snap 0xFF00 0x0200 0x0000
  • Channel2 is 255 fade 0xFF00 0x0100 0x0000
  • Channel3 is 255 fade 0xFF00 0x0100 0x0000
  • Channel4 is 255 snap 0xFF00 0x0200 0x0000
  • Channel5 is 255 fade 0xFF00 0x0100 0x0000
  • Channel6 is 255 snap 0xFF00 0x0200 0x0000
  • Channel7 is 255 fade 0xFF00 0x0100 0x0000
  • Channel8 is 255 snap 0xFF00 0x0200 0x0000
  • Channel9 and follow are unused
Edited on June 12th, 2013:

I use FreeStyler Version 3.5.2. After having analyzed the Sequence file, the format has slighty changed. Below is the new detailed format.

First, I run Windows 7 64 bits Enterprise, it might be important to notice. I do not have time to crosscheck with other platform right now, but I would be surprised wether the format was platform dependant. So it will be likely the same format for other versions of Windows.

So here it is.

The size of a Sequence File vary depending on the number of sequences recorded in it. Here we must distinguish between the real size of the file, and the size occupied on the disk (right click on the file in an explorer, and click on details, you will see the two values). I consider only the real size of the file, not the space occupied on the disk To make sure, you can download an Hex Editor and open your file, it will display the data regarding the real file size.

The size of a Sequence File, in Octets and in Decimal is calculated like this:

14120 + ( (Number of steps - 1) * 7042) Thus, for a Sequence File containg one step, we have: 14120 + ((1 - 1) * 7042 ) = 14120 + (0 * 7042) = 14120

2nd example, for a Sequence File containing 2 Steps, we calculate: 14120 + ((2 - 1) * 7042 ) = 14120 + (1 * 7042 ) = 21162

Last example, for a Sequence File containing 5 Steps, we calculate: 14120 + ((5 - 1) * 7042 ) = 14120 + (4 * 7042 ) = 14120 + 28168 = 42288

To confirm, here are 3 file details, 1, 2 and 5 steps Sequence Files:

Let's have a look at the Sequence File containing only one Step with an Hex Editor:

The end of file is at address (hexadecimal) $3727, which makes in decimal 14119. Thus we have position zero to 14119, bingo we have our 14120 octets.

Now, how is a Sequence File organized inside ?

Prior to begin, an important note for those who would like to develop. All data is recorded on a “Word” basis. One Word = two Octets = two times 8 bits = 16 bits. The MSB (Most Significant Byte) is stored firts, followed by the LSB (Last Significant Byte). This means, if ever you record the value “2”in decimal, this makes “0002” in hexadecimal (1 Word = 2 Bytes = 4 Hex quartets), it makes “0000000000000010” in binary (Two Bytes = 16 bits). The value will be stored into the file as “0200”. This is Windows, an so it was in DOS time. I am not sure about what format is used with Mac Intosh Systems.

So, let's go ahead. Another screenshot with the Hex Editor, at the begining of the Sequence File containing only ONE Step:

Values “5A 00 5A 00” are always the same, so let's say it is a constant defining a “Sequence File” format.

Addresses $00000004-5 we have value 0200. Remember, this makes “0002”. This is the “Number of STEPS” contained in this Sequence File. Thus we have 2 Steps in this file… what ? I recorded only ONE Step !

FreeStyler always record an additional Step when you save your Sequence File

This is why, when we load the Sequence Editor from this Sequence File, we can see Step 1/2. FreeStyler “prepare” the next step, and keep in mind the preceding recorded values, allowing you to add another Step, changing only the new values, and keeping the scene status as it was previously (this might be confusing, just remember that FreeStyler records an additional Step with the last values recorded).

Addresses $00000006-7 we have “0300”, giving 0003. This is the “Fade Time” in units of 500 milliseconds, it makes 1500 millisecond, thus Fading Time is 1 second and half for this Step.

Addresses $00000008-9 we have value “0B00”, giving 000B in hexadecimal, giving 11 in decimal. This is for the Speed of the Step, in units of 100 milliseconds. 11 times 100 give 1100, thus the Speed for this Step will be 1100 milliseconds. The picture below confirm this:

From now onward, we will have 3 Words (6 octets) per DMX channel, starting by Channel 1.

It sounds that Channel zero must not be used.

So, we can find up to 511 groups of 3 words, one group per DMX Channel:

First Word =⇒ Not Significant, maybe reserved for future use.

For the 1st Channel, the value for this first Word is “0100”. For all the remaing channels it will be “0000”. This will be always the case, should you consider a one Step Sequence file, or any number of Steps.

Second Word =⇒ The Value that will be sent to this channel.

Third Word =⇒ One value among 3 possibilities for this DMX channel:

  1. 0100 for Fade
  2. 0200 for Snap
  3. 0300 for Off.

And so on, the following Word is the first Word for the next DMX Channel.

After all the 511 Channels have been passed, we find a bunch of Data. I do not know what is it intended to, but this will not change.

To make it short, for a Sequence File containing One Step, the format from the beginning of the file is:

  • 2 Words containing the data “5A005A00”. Constant.
  • 2 Words containing the number of Steps + 1 (0200 in our example).
  • 2 Words containing the number of 500 millisecond units for Fade Time, 0300 in the example.
  • 2 Words containing the number of 100 millisecond units for the Scenne Speed, 0B00 in our example.
  • 511 groups of 3 Words, one group per Channel. The first one (address 0000000A) is “01 00 FF 00 01 00”
  • A bunch of data, with unknown signification, which content does not vary providing we do not add Steps (we do not modify the file size). I mean, providing you create a file with, for instance, 3 steps, you can modify any value, DMX and/or Fade/Snap/Off mode, within the 3 Steps (Actually 4 with the additional Step ceated by FreeStyler). Your modifications will be successfuly understood by FreeStyler when it loads your new Sequence File.

In the screenshot above, for DMX Channel 1, we send the value 255 (FF00 gives 00FF), and the following value “01 00” says that it will be sent in “Fade Mode”.

Next DMX Channel, number 2, is (address 00000010) 00 00 FF 00 01 00:

firsts 00 00 is unused (the same for all the channels).

FF 00 means we sent the value 255 (FF) to the Channel 2.

01 00 means we are in fade mode.

To be continued, we will see the organization for the Sequence Files containing mode than 1 Step.

create_sequence/sequence_understanding.1371074933.txt.gz · Last modified: 2013/06/12 22:08 by zenbass

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki