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.

[youtube=http://www.youtube.com/watch?v=tEI5F_lRd6Q&w=470]

26 thoughts on “Layering Pinball Audio Using Parallel WAV Shields

  1. 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.

  2. 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…

  3. 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!

  4. 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..!!!

  5. @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

  6. @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.

  7. @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

  8. 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

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.