Here’s a little software project I’ve been working on, alongside of my more “hard” modeling work. I made a video demo, as it can be hard to express how this is all supposed to work in words.
This is the result of a confluence of several factors.
I have long wanted to have sound on my layout, but I was balking at the expense and the lack of sound quality from N scale sound decoders (this has more to do with physics and tiny speakers than the quality of the available products). SoundTraxx had been pre-announcing their SurroundTraxx product for a while, and a couple of online friends of mine have been toying with under-the-table sound systems being driven by hardware sound decoders and larger speakers. And I had been playing with the JMRI Java Model Railroad Interface project.
It occurred to me that I could write a software program that would emulate (or simulate, if you prefer) the function of a hardware sound decoder, listening to the layout interface for throttle commands and responding to them just as a hardware decoder installed in a locomotive would. And most PCs these days come with surround sound audio systems! JMRI already provided much of the foundation for this, including the layout interface, a nice abstraction of the throttle, and integration with the OpenAL 3D audio system, so it seemed a good match.
I’ve been working on this for a few months. The basic idea follows very roughly the scheme of an add-on sound decoder. For each engine you want to have sound, you launch a “Virtual Sound Decoder” (or “VSDecoder”) on the PC, select a “sound profile” from a “VSD File” and assign it a DCC address. The virtual decoder then sits in the background and generates sounds in response to the throttle inputs. Thanks to the way JMRI handles throttles, it will respond to any throttle on the system, whether a hardware or software throttle, or a wireless-attached throttle on a PDA or smart phone. Buttons on the VSDecoder allow the user to directly trigger sounds, bypassing the throttle if desired.
The “VSD File is somewhat like a Digitrax SPJ file, though the two are completely incompatible. The VSD file is a Zip archive containing all of the source audio files, plus a configuration file (written in XML) that tells the Virtual Sound Decoder when and how to use the sound files. Each VSD File can contain one or more “Profiles”, each of which describes a specific configuration of a locomotive. This could be multiple variants of a particular type of locomotive, or several completely different types of locomotives. For example, a VSD FIle might contain profiles for several different EMD engines based on the 567 Diesel prime mover, or an eclectic collection of engines belonging to the Pennsylvania Railroad. VSD Files can be easily constructed by and shared among folks who are interested in doing so.
Work progresses steadily, and I hope to have a version of this included in the 2.13 development release of JMRI at some point. In the meantime, if you are interested in developing or providing sound files, let me know!