Proteus Segment Format
There are 12 bytes per segment.
The typical segment has the following structure.
Byte 1
SD_Time . Contains the mantissa of the segment time.
Bits 0 and 1 of SD_XtraBits (byte 7 below) contain the exponent.Base 4
Resolution : 0.1, 0.4, 1.6 or 6.4 seconds (depending on exponent)
Range : 0.1 sec. To 27.2 min. (segment times < 0.5s not recommended)
e.g. Segment time = 3m : 20s = 200s = 2000 10th seconds
2000 > 255 so divide by 4 (2000 / 4 = 500) and increment the exponent (=1).
Keep dividing by 4 until quotient < 256.
500 / 4 = 125 . increment the exponent (=2)
125 is less than 256 so SD_Time = 125
SD_XtraBit : set exponent bits to 2 = 102:
|
x
|
x
|
x
|
x
|
x
|
x
|
1
|
0
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Byte 2
SD_LFO1_Strt. . Contains the 8 most significant bits (MSbs) of the 9 bit "LFO1 Start" frequency value. The least significant bit (LSb) is placed in bit 2 of SD_XtraBits.
Resolution : 10th Hz
Range : 0.1 to 51.1 Hz
e.g. LFO1 start frequency = 27.5 Hz = 275 10th Hz
275 = 100010011 (binary)
8 MSb's = 10001001 = 137 = SD_LFO1_Strt
The LSb = 1 so .
SD_XtraBits : set bit 2 to 1:
|
x
|
x
|
x
|
x
|
x
|
1
|
1
|
0
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Byte 3
SD_LFO1_Fin. . Contains the 8 MSbs of the 9 bit "LFO1 Finish" frequency value. The LSb is placed in bit 3 of SD_XtraBits.
Resolution : 10th Hz
Range : 0.1 to 51.1 Hz
e.g. LFO1 start frequency = 6.2 Hz = 62 10th Hz
62 = 000111110 (binary)
8 MSb's = 00011111 = 31 = SD_LFO1_Fin
The LSb = 0 so .
SD_XtraBits : set bit 2 to 0:
|
x
|
x
|
x
|
x
|
0
|
1
|
1
|
0
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Byte 4
SD_LF1_Brite. . Contains the Brightness values for the channel 1 light frames.
Range : 0 to 15 Hz with 0 = off : 15 = full brightness
The 4 MSbs hold the encoded finish value and the 4 LSbs hold the encoded start value.
e.g. LF1 finishing brightness = 15 = 11112 : LF1 starting brightness = 3 = 00112
Shift . LF1 finish value to the 4 Most Significant bits (multiply by 16) = 15*16 =240 = 111100002
Add LF1 starting value (00112)
SD_LF1_Brite = 111100112 = 243
Byte 5
SD_LF2_Brite. . Contains the Brightness values for the channel 2 light frames.
Range : 0 to 15 Hz with 0 = off : 15 = full brightness
The 4 MSbs hold the encoded finish value and the 4 LSbs hold the encoded start value.
e.g. LF2 finishing brightness = 7 = 01112 : LF2 starting brightness = 13 = 11012
Shift . LF1 finish value to the 4 most significant bits (multiply by 16) = 7*16 = 112 = 011100002
Add LF1 starting value (11012)
SD_LF2_Brite = 011111012 = 125
Byte 6
SD_Pitch. . Contains segment sound pitch frequency (start and finish) information Other LSbs are placed in bits 4-7 of SD_XtraBits.
Resolution : 10 Hz
Range : 10 to 630 Hz (values below 40 Hz not recommended)
Encoding example...
Start pitch frequency = 200 Hz : Finish pitch frequency = 250 Hz
To encode SD_Pitch & SD_XtraBits use the following technique.
Divide Start pitch frequency by 10 : 200 / 10 = 20
Convert to a 6 bit binary number = 0101002
Use four MSb's of 6 bit value to encode four LSb's of SD_Pitch byte.
SD_Pitch set to:
|
x
|
x
|
x
|
x
|
0
|
1
|
0
|
1
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
|
|
|
|
|
|
|
|
|
|
Use two LSb's to encode bits 4 and 5 of SD_XtraBits
|
x
|
x
|
0
|
0
|
0
|
1
|
1
|
0
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Divide Finish pitch frequency by 10 : 250 / 10 = 25
Convert to 6 bit binary number = 0110012
Use four MSb's of the 6 bit number to encode four MSb's of SD_Pitch
SD_Pitch set to
|
0
|
1
|
1
|
0
|
0
|
1
|
0
|
1
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Use two LSb's to encode bits 6 and 7 of SD_XtraBits
|
0
|
1
|
0
|
0
|
0
|
1
|
1
|
0
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Byte 7
SD_XtraBits. . Set along with above bytes
Byte 8
SD_Ctl1. Contains Segment control bits.
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Bit assignments:
-
0) Sound Table Pointer (Lo bit)
-
1) Sound Table Pointer (Hi bit)
These two bits point to one of four sound tables which will be used when the segment is run.
-
2) Soft Off Sound . If the bit is set then the system will perform a soft-off of the sound at the end of the current segment. If the sound is already off nothing will be done.
-
3) Soft On Sound . If the bit is set then the system will perform a soft-on of the sound at the beginning of the current segment. If the sound is already on nothing will be done.
-
4) Soft Off Lights . If the bit is set then the system will perform a soft-off of the light frames (LFs) at the end of the current segment. If the lights are already off nothing will be done.
-
5) Soft On Lights . If the bit is set then the system will perform a soft-on of the light frames at the beginning of the current segment. If the lights are already on nothing will be done.
-
6) Binaural beats active ... If set then the audio pitch in the right channel will be shifted upwards from the left channel by an amount equal to the value of LFO #1. This is intended to be used with a sine wave audio signal but can be used with other waveforms.
-
7) Last segment of session. If set then the current session will end after this segment has timed out.
Byte 9
SD_Ctl2. Contains more Segment control bits.
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Bit assignments
-
0) Light Frames Active . If the bit is cleared then the LFs will be off during the segment.
-
1) Sound Active . If the bit is cleared then the sound will be off during the segment.
-
2) Synchronize Channel 1 and 2. Setting this bit will cause LFs and sound modulation do be in phase (This bit has no effect if the "Dual LFOs" bit is set . see SD_Ctl3).
-
3) Sound modulation active (The amplitude of the internal sound will be modulated in time with the LFO frequency of each channel)
-
4) Special LF1 segment. if set the current segment will ignore any LFO1 frequency information and use the value set by the Supplemental Command. This allows setting the LFO1 frequency to a very specific value and holding it throughout the segment(s). see Special Segment Encoding below.
-
5) Special sound segment. if set the current segment will ignore any Pitch frequency info of this segment and use the value set by the Supplemental Command. This allows setting the Pitch to a very specific frequency and holding it throughout the segment(s). see Special Segment Encoding below.
-
6) No BioFd Ctrl : No Biofeedback control. If set then any ThoughtStream data received will be ignored during this segment. This bit is cleared by default so each segment will be influenced by ThoughtStream data if it is being received.
-
7) Special LF2 segment. if set the current segment will ignore any LFO2 frequency information and use the value set by the Supplemental Command. Allows setting the LFO2 frequency to a very specific value and holding it throughout the segment(s). see Special Segment Encoding below. If the Dual Light Frame frequencies bit is cleared (bit 0 of SD_Ctl3. see below) then this bit will have no effect and the channel 2 LFs will follow the channel 1 LF rate.
Also note. Code versions prior to 2.0 and code version 2.2 and greater have a operating mode called the monochromatic mode which allows the Proteus to behave like some earlier monochromatic devices. If this feature is active then channel 2 will follow channel 1 and all information regarding channel 2 will be ignored. The monochromatic mode is indicated by a flashing left decimal point on the Proteus unit when it is displaying "Pxx", "Uxx", "Usr" or "PC". The mode has to be toggled manually by pressing the middle and bottom button simultaneously.
Byte 10
SD_Ctl3. Contains a third byte of Segment control bits.
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Bit assignments
-
0) Dual Light Frame frequencies .Set this bit for Dual Light Frame frequencies, i.e. Channel 1 and 2 LFOs will run independently. If cleared then both channels run at the value specified by LFO #1.
-
1) Dual Binaural Beats (BB) . When selected two sets of binaural tones will be generated.
Two tones will be generated in the left ear. The first is the value of the segment PITCH frequency as set with the SD_Pitch and SD_XtraBits bytes above. This is the base frequency for the first binaural beat. The second tone is the base frequency for the second binaural beat and is a multiple of the first frequency (1/2 ; 2/3 ; 3/4 ; 4/3 ; 3/2 and 2/1) as specified by a Supplemental Command segment.
The two audio tones in the right headphone will be shifted upwards from the left channel by an amount equal to the LFO #1 value and LFO #2 value.
Example: audio pitch is set to 200 Hz , LFO #1 is set to 12.0 Hz, , LFO #2 is
set to 8.0 Hz , BB2/BB1 = 1.5. The left ear will hear 200 Hz and 200 * 1.5 =
300 Hz while the right ear will hear 200+12 = 212 Hz and 300 + 8 = 308
Hz.
The base frequency ratio can be set using the menu bar . Utilities, Edit
Supplemental Commands. This value can be dynamically set during a session
by inserting a Supplemental Command segment into a session with the box
labeled "BB2 / BB1" checked. If no Supplemental Command is added to the
session the default Supplemental Command will be used. This value also can
be adjusted using the menu bar . Utilities, Edit Supplemental Commands.
Adjust the BB2 to BB1 ratio, check the "BB2 / BB1" box and check the
"Update defaults setting" box. With the Proteus in "PC" mode click on the
"Send to Proteus" box and the default settings will be updated. Whenever the
Proteus is asked to process dual binaural beats without a Supplemental
Command segment it will look to this default segment for a value. This also
applies if the "Do Spcl LF1" , "Do Spcl LF2" and "Do Spcl Snd" boxes are
check in a session segment.
-
2) LFO2 finish frequency LSb.
-
3) LFO2 start frequency LSb.
-
4) Not used
The following three bits are used to designate the type of segment is being processed.
-
5) Special segment bit.
-
6) Special segment bit.
-
7) Special segment bit.
000x xxxx = Standard session segment
001x xxxx = Biofeedback Control Segment #1 (see below)
010x xxxx = Biofeedback Control Segment #2 (see below)
011x xxxx = Supplemental Command Segment (see below)
Byte 11
|
x
|
x
|
x
|
x
|
x
|
1
|
x
|
x
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
SD_ LFO2_Strt. . Contains the 8 MSbs of the 9 bit "LFO2 Start" frequency value. The least significant bit (LSb) is placed in bit 2 of SD_Ctl3 (above).
Resolution : 10th Hz
Range : 0.1 to 51.1 Hz
e.g. LFO2 start frequency = 42.0 Hz = 420 10th Hz
420 = 110100100 binary
8 MSb's = 11010010= 210 = SD_LFO2_Strt
The LSB = 0 so . bit 2 of SD_Ctl3 set to 0:
|
x
|
x
|
x
|
x
|
x
|
0
|
x
|
x
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Byte 12
SD_ LFO2_ Fin. . Contains the 8 MSbs of the 9 bit "LFO2 Finish" frequency value. The least significant bit (LSb) is placed in bit 3 of SD_Ctl3 (above).
Resolution : 10th Hz
Range : 0.1 to 51.1 Hz
e.g. LFO2 start frequency = 16.5 Hz = 165 10th Hz
165 = 010100101 binary
8 MSb's = 01010010 = 82 = SD_LFO2_Fin
LSB = 1 so . bit 3 of SD_Ctl3 set to 1:
|
x
|
x
|
x
|
x
|
1
|
0
|
x
|
x
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Variant Segment formats
There are three variant segment formats which can be used in session files. Two are used with the biofeedback controller and one supplemental command segment.
Biofeedback controller segments.
The controller occupies two segments in the session table.
It is used to set up how the Proteus responds to Thought Stream data.
Note. If the Proteus is running a session and a new segment is read with no Thought Stream data coming in from the indicated sensor then the biofeedback control parameters will be ignored. If a sensor is plugged into the Proteus while a session is running the Proteus will refer to the current biofeedback control segments and alter the running characteristics of the segment. If the "No BioFd Ctrl" flag is set (see above) then the associated segment will ignore all Thought Stream data during that segment.
See the ProtEd 2.2 Session Programming document for more about the editing and use of the biofeedback control segments.
I. Biofeedback controller segment format
Byte 1:
Not used . set to 0
Bytes 2: LFO #1 (Start)
Bytes 3: LFO #1 (Finish)
Bytes 4: Channel #1 Brightness
Bytes 5: Channel #2 Brightness
Bytes 6: Pitch (Start and Finish)
Bytes 7: XtraBits
Programmed in the same manner as a regular session segment.
Bytes 8-9 Not currently used
Byte 10
Set flags so Proteus can process BF Segment #1
|
0
|
0
|
1
|
x
|
x
|
x
|
x
|
x
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Bytes 11: LFO #2 (Start)
Bytes 12: LFO #2 (Finish)
Programmed in the same manner as a regular session segment.
II. Segment format #2
Byte 1
Not used., set to 0
Bytes two through five are used to designate which control sensors effect which Proteus function.
Thought Stream sensors have the following values.
-
0) None
-
1) EDR Channel #1 . data from Thought Stream I is interpreted as EDR #1
The following sensors will be available with the ThoughtStream PC
-
2) EDR Channel #2
-
3) Temperature probe Channel #1
4) Temperature probe Channel #2
5) Heartbeat probe Channel #1
6) Heartbeat probe Channel #2
Byte 2
Encodes which Thought Stream sensor controls Pitch and LFO Channel #1
e.g. Pitch is not under biofeedback control (none=0) : LFO #1 is effected by the EDR #1 (=1) biofeedback sensor.
Byte encoding = (Pitch control sensor * 16) + LFO #1 control sensor
= (0 * 16) + 1 = 1
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
1
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Byte 3
Encodes which Thought Stream sensor controls Volume and Channel #1 brightness.
e.g., Volume is under the EDR #1 biofeedback control (=1) : Channel #1 brightness is under the Temp. #1 biofeedback control (=3).
Byte encoding = (Volume control sensor * 16) + Channel #1 brightness control sensor
= (1 * 16) + 3 = 19 = 000100112
|
0
|
0
|
0
|
1
|
0
|
0
|
1
|
1
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Byte 4
Future option . Encodes which Thought Stream sensor controls Proteus parameter #7 (future option) and LFO Channel #2
Byte encoding = (Proteus parameter #7 * 16) + LFO #2 control sensor
|
0
|
x
|
x
|
x
|
0
|
x
|
x
|
x
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Byte 5
Future option . Encodes which Thought Stream sensor controls Proteus parameter #8 (future option) and Channel #2 brightness
Byte encoding = (Proteus parameter #8 * 16) + Channel #2 brightness control sensor
|
0
|
x
|
x
|
x
|
0
|
x
|
x
|
x
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Bytes six through eight
Thought Stream sensor sensitivity settings.
There are 16 sensitivity levels per sensor.
EDR sensors have the following sensitivity ranges:
15 , 20, 26, 35, 46, 61, 80 , 106, 141, 186, 247, 326, 432, 571, 756 and 1000 (%)
These correspond to the to available sensitivity settings of 0 to 15.
Temperature sensors have a sensitivities ranges of:
0.33 , 0.42, 0.52, 0.66, 0.83, 1.0, 1.3 , 1.6, 2.0, 2.6, 3.2, 4.1, 5.1, 6.4, 7.8 and 10 (deg. F)
These correspond to the to available sensitivity settings of 0 to 15.
Byte 6
Encodes sensitivity setting for EDR #1 and EDR #2
e.g., EDR #1 sensitivity setting = 26% (2) : EDR #2 sensitivity setting = 106% (7)
Byte encoding = (EDR #2 setting * 16) + EDR #1 setting
= ( 7 * 16) + 2 = 114
|
0
|
1
|
1
|
1
|
0
|
0
|
1
|
0
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Byte 7
Encodes sensitivity setting for Temp #1 and Temp #2
Byte encoding = (Temp #2 setting * 16) + Temp #1 setting
|
x
|
x
|
x
|
x
|
x
|
x
|
x
|
x
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Byte 8
Byte encoding = (Heartbeat #2 setting * 16) + Heartbeat #1 setting
|
x
|
x
|
x
|
x
|
x
|
x
|
x
|
x
|
value
|
|
7
|
6
|
5
|
4
|
3
|
2
|
1
|
0
|
bit number
|
Byte 9
= value of Proteus parameter #8 (0- 255) (future option)
Byte 10
Set flags so Proteus can process BF Segment #2