Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

Play some Super Arduino Bros. tunes with percussion

Play some Super Arduino Bros. tunes with percussion

Have you ever wished your Arduino project could play tunes, or even just note-based sound effects? Connor Nishijima has, and that’s why over the last three years he has been hard at work developing Miduino—a free web service that enables Makers to automatically convert their MIDI music into ready-made sketches.

Unlike any built-in Arduino noisemaking functions such as tone(), Miduino’s output is polyphonic–meaning you can play up to six notes at once. Most recently, he has added two major updates to the service: percussion tracking and switch to software-based timing.

Now the only thing setting your Arduino apart from an NES is a proper triangle wave! While it’s not fully featured yet for the whole MIDI percussion spectrum, your basic snares, kicks and hi-hats will be joining the music!

Originally I collaborated with Len Shustek to tie his Playtune library into the service, but his library requires a hardware timer for each active note–which has its ups and downs.

With a hardware timer you’ll get extremely crisp sound every time, but an Arduino Uno can only play up to three notes at once and the original code didn’t know what to do with MIDI percussion channels.

Instead, Nishijima is polling for new notes and their expirations at about 22,050Hz using Timer 1 and generating different types of percussion with some RNG tricks. Admittedly it hasn’t been perfected yet, as some songs need the polling frequency turned down to avoid crashes. (Cut the Arduino some slack, it’s not supposed to be good at this!)

To demonstrate his latest upgrades, Nishijima performs the Super Mario Bros. theme song with LEDs blinking to the iconic tunes. Although some would argue that this could be faked rather easily, the Maker has gone ahead and shared the code along with a couple other examples for any doubters–these include Van Halen’s “Eruption” and Mozart’s “Rondo Alla Turca.”

 

 

More Articles to Read

Replace a microwave’s beeping with the Windows XP startup sound
Replace a microwave’s beeping with the Windows XP startup sound
A DIY Laser Scanning Microscope
A DIY Laser Scanning Microscope
Teleknitting: TV-based string art
Teleknitting: TV-based string art
Start your day with Nerf target practice!
Start your day with Nerf target practice!
Converting a coffee maker into a 3D printer
Converting a coffee maker into a 3D printer
Sort your M&Ms or Skittles with this ingenious machine
Sort your M&Ms or Skittles with this ingenious machine
The Hunt is both a playful game and tasteful home decor
The Hunt is both a playful game and tasteful home decor
The Rick and Morty Alarm will make sure you’re always on time
The Rick and Morty Alarm will make sure you’re always on time
Build your own MIDI accordion with Arduino
Build your own MIDI accordion with Arduino
A tiny orchestra of Lego Robots driven by Arduino
A tiny orchestra of Lego Robots driven by Arduino
8-bit Frogger game on a digital microfluidics device
8-bit Frogger game on a digital microfluidics device
An experimental game with a conductive rubber band controller
An experimental game with a conductive rubber band controller

Top




Shares