April 18, 2023

rack -> unreal

My custom module is now sitting in the virtual rack with the other modules, and—after a thousand debug statements and recompiles to figure out how and where to find the data—it is introspecting the state of the running Rack instance. It is gathering data about the other modules– their size and location, and the location and size of each of their params, ports, and displays, and gathering data for the cables, which is simply their origin and destination ports.

I have decided, initially at least, to use Open Sound Control (OSC) for communication between Rack and Unreal. OSC is a “data transport specification…for realtime message communication among applications and hardware.” There are a few reasons for this choice: OSC was designed for real-time communication and is very flexible about how messages are structured. Unreal has a built-in library for handling OSC communication and there is a straightforward library for C++ too. And lastly, I have seen other VCV Rack modules using it so I know it’s feasible to work it into the system.

One other fun thing about OSC is that it uses UDP and not TCP like I’m familiar with from my web work. That means it is “fire-and-forget” and doesn’t use handshakes or responses to ensure data was properly transmitted. Which means I get to learn how to work with those limitations. I’m always up for a new challenge.

a screenshot of a computer screen showing a software modular synthesizer app on one side, and a crude recreation of that interface in a game engine on the other side.

One should always take the opportunity to find a nice color scheme.

And so, I finally have something up on the screen besides debug messages in the logs. I’m taking the data transmitted from Rack and drawing representations of each of the modules and cables in Unreal with debug lines instead.

Friends, we have computer graphics.