Multi-Axis T-Code: Advanced Haptic Script Control with 8 Axes
The 8 T-code axes, the T-code syntax HaptiQ reads and writes, and how HaptiQ builds multi-axis output: the stroke from video, derived axes and export (Pro).
A standard funscript controls one motion: the stroke. Multi-axis hardware can also twist, roll, pitch, surge, sway and vibrate, and T-code is a text format that carries all of those axes in one stream. This guide goes through the eight axes, the T-code syntax HaptiQ reads and writes, and exactly how HaptiQ produces multi-axis output, including the parts that are fixed formulas rather than measured motion.
The 8 axes HaptiQ works with
| Axis | Name | Motion |
|---|---|---|
| L0 | Stroke | Primary linear motion |
| L1 | Surge | Forward / back |
| L2 | Sway | Left / right |
| R0 | Twist | Rotation |
| R1 | Roll | Roll |
| R2 | Pitch | Pitch |
| V0 | Vibration | Vibration |
| A0 | Auxiliary | Auxiliary / valve |
L0 is the primary stroke axis, the one an ordinary single-axis funscript describes. HaptiQ's automatic generator makes this axis from your video. The other axes come from the derive step or from an imported T-code or CSV file.
T-code syntax
Each axis command is the axis name, a value from 0 to 999, then "I" and an interval in milliseconds (the time since the last command): L0500I100 is axis L0, value 500, interval 100 ms. Commands for several axes at the same moment share a line, separated by spaces:
L0500I100 R0300I100 V0800I100
HaptiQ maps funscript positions (0-100) onto the T-code range (0-999), writes every value with three digits, and its parser also accepts a command without the interval part.
Worked example
A stroke with position 0 at 0 ms, 100 at 100 ms and 0 at 200 ms exports as three lines:
L0000I0L0999I100L0000I100
The export writes one line per unique timestamp. Each line lists only the axes that have a keyframe at that moment; an axis without one keeps its last position and is left off the line.
How HaptiQ produces multi-axis output
Step 1: the stroke from your video
The generator measures the motion in your video with OpenCV optical flow, with camera compensation and scene-cut handling, and writes the primary stroke as a .funscript. It makes one axis. It does not measure twist, roll or pitch from the video.
Step 2: derived axes (Pro)
HaptiQ's multi-axis API has a derive endpoint that builds one secondary axis at a time from the stroke, with fixed parameters and no settings:
| Target axis | How /derive makes it from the stroke |
|---|---|
| R0 (twist) | Follows the speed of the stroke: half the position change per second, capped at 100 |
| V0 (vibration) | Follows the change in speed (acceleration magnitude), capped at 100 |
| L1 (surge) | A copy of the stroke shifted 200 ms later, at 60 hundredths of the amplitude around 50 |
| L2 (sway) | The same copy, shifted 400 ms later |
| R1, R2, A0 | Not derived (the request is refused) |
Because these are formulas applied to the stroke, a derived twist or vibration axis follows the stroke's speed or acceleration; it does not know what is happening in the scene. Use it as a starting point. If you change the stroke later, derive again so the secondary axes match.
Step 3: export (Pro)
Export includes only the axes you ask for, in one of three formats:
- Funscript JSON: one standard funscript per axis.
- T-code: one text line per timestamp, as in the example above.
- CSV: a
time_mscolumn plus one column per axis, one row per unique timestamp, with an empty cell where an axis has no keyframe.
Import (Pro)
The API also imports T-code text or CSV and turns it back into per-axis data, so a multi-axis script from elsewhere can come into HaptiQ.
What the derived values look like
The R0 formula takes the position change between two actions, divides by the time between them and halves the result, capped at 100, so a slow passage gives a low twist value and a fast one runs at the cap. V0 rises with every sudden change in speed, so steady strokes give little vibration and sharp reversals give a lot. L1 and L2 keep the stroke's shape, pulled in toward the middle (50) and delayed by 200 or 400 ms, so the extra motion trails the main stroke slightly.
Working with axes in the editor
In HaptiQ's editor, View → Multi-Axis Timeline shows one lane per active axis on a shared time axis, and View → Axis Configuration opens the axis selector: all 8 axes with enable/disable, a colour per axis, range sliders and invert toggles. The main timeline edits the stroke with the usual tools (pointer, draw, erase, region select), and the transform plugins clean it up before you derive. The editor's Download HaptiQ Script button saves the stroke as a .funscript; T-code and CSV export and import go through the multi-axis API.
Hardware
The open-hardware OSR2 and SR6 family has the most capable multi-axis motion of any consumer-accessible device. HaptiQ's device index lists the TempestVR OSR2, OSR2.1, OSR3, SR6 and SSR1 with a USB (Serial) connection and no Buttplug support, so HaptiQ does not drive them directly: you play exported scripts on them from a player that talks to them over that serial connection. Our OSR2 and SR6 setup guide covers that side, and the introduction to multi-axis funscripts covers the basics.
For The Handy and Bluetooth toys that HaptiQ connects to directly, HaptiQ plays the stroke script.
Tips for better multi-axis scripts
- Finish the stroke first. Smooth it, limit its speed and set its range before deriving, because the derived axes inherit its shape.
- Derive only what your hardware has. An export includes only the axes you list, so leave out axes your device does not have.
- Check derived vibration. V0 follows the change in speed, so a script full of sharp direction changes gives a busy vibration axis. Smoothing the stroke calms it.
- Use the timeline to compare. The Multi-Axis Timeline shows the lanes together, which makes a mistimed or inverted axis easy to spot; the invert toggle in Axis Configuration flips one.
Plans
Generating the stroke script works on the Free plan (2 full-quality scripts, then 1 free script a month). Multi-axis T-code export, import and derive are part of HaptiQ Pro. Create a free account to start with the stroke.
Frequently asked questions
What are the 8 T-code axes and what does each control?
L0 is the stroke (primary linear), L1 surge (forward/back), L2 sway (left/right), R0 twist (rotation), R1 roll, R2 pitch, V0 vibration and A0 auxiliary / valve. HaptiQ's generator makes L0; the others come from the derive step (R0, V0, L1, L2) or an imported T-code or CSV file.
How does T-code format differ from standard funscript JSON?
A funscript is JSON: a list of actions, each a time in ms and a position from 0 to 100, for one axis. T-code is text: each command is the axis, a value from 0 to 999 and an interval in ms, like L0500I100, with several axes on one line separated by spaces.
Which devices support multi-axis T-code?
The open-hardware OSR2 and SR6 family is the main multi-axis hardware. HaptiQ's device index lists the TempestVR OSR2, OSR2.1, OSR3, SR6 and SSR1 with a USB (Serial) connection, so you play exported scripts on them from a player that talks to them over serial.
How do I create a multi-axis script with HaptiQ?
Generate the stroke script from your video, clean it up in the editor, then with Pro derive the secondary axes you want (R0, V0, L1 or L2) from the stroke and export as funscript JSON, T-code or CSV. R1, R2 and A0 are not derived; import them as T-code or CSV if you have them.
Create a free HaptiQ account to generate a funscript from your own video.