Layering pinball audio using parallel WAV shields

[Ed Zarick] is preparing his pinball project and wants to have authentic sound to go with the game play. The game is modeled after NBA Hangtime and in addition to music he also needs a wide range of sound effects to beef up the experience. To make this all happen at once he developed a set of Arduino WAV shields controlled by an Arduino Mega.

As you can see above, there are three ATmega328 chips which run the Arduino boot loader and each interface with one of the three green WAV shields. That set of chips listens for commands over and i2c protocol, and once they receive instructions they play can play the chosen file without affecting the other shields.

But to have the authentic sounds you first need to acquire the audio samples. [Ed] grabbed a ROM of the original video game and dumped all of the audio samples. From there it was a chore to listen to and catalog the sounds for SD card playback with the pinball version of the game. But it’s well worth the effort as the sound will end up tying the whole experience together.

26 thoughts on “Layering pinball audio using parallel WAV shields

  1. OMG! Couldn’t he have just taken some ARM that could handle all the layering? Or even some avr, but a dedicated IC? That would lower the cost and the effort to make this stuff…

  2. I imagine it could have been done cheaper with an old android phone and the arduino android library. $22 per wav shield + storage space, versus a $50 ebay repurposed phone.

  3. If this was built on a Propeller it would have needed much less supporting hardware. Just add a couple SD card slots and everything else gets done in software.

  4. WOW. Really? You’ve never heard of polyphony, guy? Never heard of interrupts?

    Talk about taking a simple problem with a simple solution, and then creating a solution that is as complicated, redundant and unneccesary as possible. This is why the “arduino” movement is bad. No one thinks out of the box anymore.

    “Oh, I need to play 3 sounds at the same time. Hmmm, let me see what shields are available… Hmmm, well I will need 3 shields to play 3 sounds! To hell with actually *thinking* about this problem and coming up with an appropriate solution!”

    Wow. Just wow. You don’t need a multicore processor. You don’t need any “shields”. Grrr.

  5. all of the comments sum up what i was going to post. a single arduino mega has dozens of IO pins to do whatever triggers he needs for sounds, and he can take a few SPI pins to talk to an SD card for sounds/storage. he could even do this with any of the lower-end arduino models and multiplex the few IO pins so he could do this even cheaper.

    i dont even work with arduinos and even i know this is overkill… the things i could do with just 1 arduino, let alone 3 is mindboggling…

  6. What a waste. If he wasn’t using the wave shield he could have done the channel mixing in software and used a single Atmega328 with an external DAC.

  7. This is not the most efficient way to solve the problem, but I bet Ed had fun and learned something along the way. And that is at the heart of hacking.

    Besides, the dude is building his own freaking pinball machine! Way to go!

  8. >but I bet Ed had fun and learned something along
    >the way

    dude, he used THREE shields to play 3 sounds, He learned nothing, as per Arduino design

  9. To all that claim to be so smart and just rain on this guys parade – please post your version of these easier ways of doing that same with less.. and I expect it by the end of the week.. cause it’s that simple… right??

    Really – I get sick of the negative comments on here sometimes..!!!

  10. @Hoopstar

    challenge accepted

    wave file data is just bytes that represent amplitude, averaging the data from three files would give right sound mix

    now one issue would be accessing three files at the same time from one SD card, because there might be issues with timing when accessing different sectors on the card. But most SD card and FAT file system libraries pre-caches data blocks from the SD card. To solve file access time issues, just preallocate three caches instead of just one.

    If you run out of memory doing this, then you are probably using the wrong microcontroller for the application, you should use a bigger microcontroller or external memory. both of these alternatives are better than using three separate microcontrollers

  11. @Hoopstar

    And if you argue that my method is harder, then consider that two extra wave shields + two extra SD cards + two extra ATmega328P probably costs about $64 + shipping. That’s a lot of lunches or a lot of hours worth of paid work. The extra work vs money saved would be worth it.

  12. @frank – ok.. so now go build it..

    Cause the difference between this guy and all those that have knocked him for his efforts, is he has built it and it works.

  13. @Hoopstar

    When there are so many things he could improve on, do you expect people to simply pat him on the back and not say anything? Real engineers and programmers hate inefficiency, it’s in their blood, I’m not surprised that everybody is so vocal about it.

    Do you ever go on The Daily WTF? Are you familiar with their column called CodeSOD? This is like CodeSOD but with hardware.

    I bet a lot of readers here have seen and even submitted MUCH better projects but Hack a Day probably ignored them, thus leaving them slightly pissed that this project got on the front page.

    I too applaud him on his spirit. No offense to him, but this project makes him seem more like a manager than an engineer.

    The “so now go build it” is quite tempting, but I don’t get anything out of it other than to rub it in your face when I’m done :-P

  14. Nice to see someone mention the FreeWPC project, which I’ve been working with Brian for about a year now. We have builds working for Twilight Zone, World Cup Soccer and Corvette pinball tables, but as the system is fairly modular and C-based it means it can be ported fairly easily to different hardware platforms.

    One thing FreeWPC doesn’t do is sound at the moment, this is due to the sound hardware running it’s on separate OS. We currently have a kernel running on that hardware but not much else.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s