[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”
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…
That is a crazy waste of materials, but whatever works I suppose…
There are 1000 better ways to do this.
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.
Anyone who is interested in making a pinball machine may be interested in FreeWPC ( http://www.oddchange.com/freewpc/ ) which is a library for actual pinball hardware (WPC System). It’s still fairly new I believe but there are working games built with it currently.
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.
Wouldn’t you only need one oscillator for the arduinos?
Is this the best/easiest/cheapest/most efficient way to do this? Maybe not. Is this a hack? Most definitely! Kudos.
I think you could do this with only one sd card with the propeller
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.
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…
I suppose multichannel audio could be exploited here. Effects in weapons, music in real speaker systems.
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.
Cool project – thanks for sharing.
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!
>but I bet Ed had fun and learned something along
dude, he used THREE shields to play 3 sounds, He learned nothing, as per Arduino design
Why is this on HaD? This is about as bad as that prank post about powering your house with gasoline generators.
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..!!!
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
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.
Cool project, Way to go. Someday I hope to build something as cool as that… Still using discretes.
@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.
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
I would laugh soooooo hard if this makes it on thereifixedit.com
Three Arduinos to power three wav shields? Wow. You could do it with a single microcontroller and three of these $10 TTL serial controlled mp3 playback modules, and get higher quality audio to boot (up to 48khz, 320kbps stereo mp3s, up to 3000 tracks, with up to 8gb SDHC cards) http://www.mdfly.com/index.php?main_page=product_info&cPath=9_53&products_id=284
Search for ‘TDB380 pdf’ for the proper manual.
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.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)