stepmania/stepmania — pull request #343 by psmay (2014-10-19 21:28:04+00:00)
Title: SextetStream lights and input

More of a request for comment than a pull request. This branch contains cross-platform drivers for input handler and lights data over named pipes (more generally, over any file, but named pipes are the only possibility that makes sense). The nominal use case for this is to be able to use an external program (say, a program written in Perl, Python, Java, or another platform with well known and tested cross-platform serial libs) to process I/O for a piece of hardware (say, an outboard PIC- or Arduino-based I/O device) rather than having to attempt writing a (probably less flexible) driver directly into StepMania. Secondarily, it may help quickly prototype drivers to be baked directly into StepMania at a later time, or provide a means of late binding for drivers distributed separately from StepMania.

Data is encoded in sextets (that is, six bits at a time); the top two bits of each byte are calculated to turn each sextet into a printable, non-whitespace ASCII character so that the data may be processed/monitored/debugged using plain text streams, be treated as a normal C string even if it contains zeros, be read on a terminal without screwing it up, and so forth. This also allows a newline to terminate each individual message.

Both ends have software-based test devices for those without the hardware, plus fairly complete instructions on how to use them (refer to the new `.md` files in this branch for information).

Work on firmware and software for hardware interfaces is ongoing. The lights driver [is seen working with an Arduino via `socat` in a video I posted](https://www.youtube.com/watch?v=Aq0FYWxT2Tk). The hardware for the input side is still very much under construction. A full-duplex driver for input and lights over the same connection is also in the works.

Testing is needed on non-Linux platforms. (See the TODOs an FIXMEs in the `.md` files.)

What do you think? Please comment.