This was a neat project which only took one day to fabricate, once we finally got started. And part of the afternoon was spent milling rectangular holes in the chassis.
The original conversation with the client went something like this:
“We need DMX triggered audio playback.”
As a bit of background, this assembly was to be installed in a haunted house. Various pressure switches, light curtains and proximity sensors would trigger pneumatics, hydraulics and lights in different areas of the installation.
Further discussion revealed that their situation required some specific design constraints which, after deeper contemplation, make for a tricky final build. To wit:
- Setting a DMX channel to full intensity triggers audio playback of a specific track. (This is easy, and we’ve done it for years and years.)
- We need eight DMX channels to trigger eight different tracks. (… still easy. Been there, done that.)
- These eight triggers may happen at any time, in an asynchronous manner. Multiple audio playback instances may / will overlap. (… not as easy, even a little bit. On a PC, this is no big deal. A multi-track recording studio can play 192 channels from a hard drive without even working hard. But in the embedded world where we play, dealing with eight open files on a memory card, or even caching and then reading eight files from RAM while keeping proper playback timing, is nontrivial.
- Each triggered sound effect needs a separate audio output. We’re using local loudspeakers in different areas of the haunt, so mixing down to stereo bus is completely, totally out. (ouch.)
- And no, it won’t work to have a large DMX bus and single-channel audio engines at each station. (Ouch.)
- Standalone operation is very strongly preferred over using a PC. Because they lock up and crash. (sigh)
- Reasonably low cost.
Some fairly obvious solutions immediately come to mind:
If we ignore constraint #1, a PC ($800?) running MAX/MSP ($300) with a decent 8-way audio interface ($300-$3K) and an Enttec DMX Bridge ($150) would do the job nicely. Probably spend an afternoon building the Max patch and you’re home free. This is easier if you already own any or all of the required parts. But the client didn’t.
In a similar vein, a Raspberry Pi ($40) plus Processing ($0) and audio interfaces might work. But a fairly detailed Internet search shows that while a few people have considered 8-way audio on the Pi, just about nobody has made it work in a stable way. And this comes from guys who are comfortable poking around in Linux’s hairy undercarriage.
The pyGame library looked neat as well, but it assumes stable decent audio output, and didn’t appear (?) to support complicated audio routing. Further, the Pi’s ‘stock’ audio output is PWM’d garbage. So a USB interface of some sort is required. And, can the Pi’s processor even handle pushing 8 x HiFi streams over its USB bus? Finally, we discovered that there are HDMI bridges which can extract 7.1 channel audio from an HDMI cable, but that seems like a lot of work on the front end…
After some further brainstorming, we discovered a batch of 100-300 second press-to-trigger audio playback modules. Connect them to your PC, use the dreadful Asian software to load your WAV files in permanent memory via USB, then play each file by closing a pair of contacts.
Granted, the audio resolution isn’t the best. 10 KHz. We discussed this. I suggested the client order one for testing. Since the ambient environment would be loud and confusing anyway, this might be a decent tradeoff. The price is certainly right.
So a few days later, the client reported that these would work ‘just fine’ for the installation. So we installed eight of them in a chassis, added one of our own DMX–>Relay Cards (it’s got 8 outputs of SSR, rated at 60V / 3A per output), and were off and running.
It’s embedded. It boots and is ready to run about half a second after power is added. Each output is on a sturdy 1/4″ jack, which can be routed, patched, mixed and amplified in exactly the required way. Yes, the picture above shows eight separate panel-mount USB ports. This is because putting more than one of these cards on a USB bus causes contention and ugly infighting.
Fun project. Works perfectly.
Contact us if you need something similar.