xLights-tools: Project Intro

Last January I started work on a Rust library for parsing FSEQ files. FSEQ files are a format used for encoding the colour and timing data output from xLights for use by Falcon Player.

My primary motivation for that library was to use it in an embedded Rust project. That project has dropped in priority as I no longer have access to a 3D printer. One of the side-quests on that project was a web based viewer for the contents of the FSEQ file, this was very primitive but allowed me to get some hands-on experience with WebAssembly, Next.js and Google Firebase Hosting. The result of that experiment can be found at https://fseq-web.firebaseapp.com/

This Christmas, the lady of the house got an Oculus Quest 2 as a present, and I was wondering what I could make to experiment with writing code targeted at the VR experience. One idea that I have had is to take my previous FSEQ experiments a step further and attempt to render the lights in the same layout as originally shown in xLights.

This project provides lots of interesting challenges, on the back-end xLights stores layout in a custom XML format, but this layout is only providing the basic location and the type of thing it is, for example a pixel tree, a star, a line. The position of the lights is then calculated in the C++ code, if I want to re-create the full view of each model in another tool I’m going to need to port all of that layout logic.

On the front end I have very little previous experience of 3D programming. At university we touched on VRML (Virtual Reality Modeling Language), but other than my previous experiments with OpenSCAD I haven’t done anything in 3D.

After some quick googling it seems that there are two tools targeting VR development with web technology, A-Frame and babylon.js. I liked the declarative nature of A-Frame and the examples were very approachable, so I’m giving that a try first.

The plan for the first phase of the project is to take a simple layout defined in xLights, and output a format (probably json) consumable by an A-Frame application. For a next step I would then try and couple this up to my FSEQ parser in order to make the lights blink in patterns exported from xLights enabling a full VR xLights experience. The big picture though would be to wrap the layout code up as a WebAssembly module so that it could accept a URL to an xLights sequence export and an FSEQ file and it will play the sequence allowing you to explore the display in VR.

As an early proof of concept I’m just outputting A-Frame markup directly for pasting into a glitch project.