Posts | Comments

Planet Arduino

Archive for the ‘chiptune’ Category

[Robson Couto] started to get interested in musical projects and as a side effect created downloadable code with simple notation for a good variety of themes, songs, and melodies. They are all for the Arduino and use only the built-in tone() function, but don’t let that distract you. If you look past that, you’ll see that each sketch is a melody that consists of single notes and durations; easily adapted to other purposes or simply used as-is. After all, [Robson] wanted the source of each tune to be easily understood, easily modified, and to have no external dependencies.

All that may sound a bit like MIDI, but MIDI has much more in common with hardware events than music notation because it includes (among other things) note starts and note ends as separate elements. Converting MIDI into a more usable format was a big part of a project that fed Bach music to a neural network and got surprisingly good results.

When doing music projects, sometimes having a recognizable melody represented very simply as notes and durations with only one note at a time can be an awfully handy resource, and you can find them on GitHub. There’s a brief video of the Tetris theme (actual name: Korobeiniki) being played after the break.

[Robson Couto] started to get interested in musical projects and as a side effect created downloadable code with simple notation for a good variety of themes, songs, and melodies. They are all for the Arduino and use only the built-in tone() function, but don’t let that distract you. If you look past that, you’ll see that each sketch is a melody that consists of single notes and durations; easily adapted to other purposes or simply used as-is. After all, [Robson] wanted the source of each tune to be easily understood, easily modified, and to have no external dependencies.

All that may sound a bit like MIDI, but MIDI has much more in common with hardware events than music notation because it includes (among other things) note starts and note ends as separate elements. Converting MIDI into a more usable format was a big part of a project that fed Bach music to a neural network and got surprisingly good results.

When doing music projects, sometimes having a recognizable melody represented very simply as notes and durations with only one note at a time can be an awfully handy resource, and you can find them on GitHub. There’s a brief video of the Tetris theme (actual name: Korobeiniki) being played after the break.

[Captain Credible] is a chiptune music artist. He wanted to release an EP, but a regular old em-pee-three was too lame for him, so he made a tiny board with a coin cell, an ATtiny85, and a 3.5mm socket on it.

Rather than just writing some code to generate the tones for a pre-composed song, his “Dead Cats” EP generates the music itself. Using the arduino-tiny library, which adds the tone() function to the ATtiny, he has the chip pick its own time signature, key, subdivisions, and tempo. The melody and drum beat is randomly generated into an array. In addition to that, there are some code “one-liners” which insert unique sounds. After that the code just loops through the music.

If you don’t like the song, simply unplug the audio cable and plug it back in. The 3.5mm jack he chose has a built-in micro-switch, so the board is only powered up if someone is listening. If you’d like to see the circuit diagram, purchase the EP, or take a look at the code, all of that is available on his site.


Filed under: Arduino Hacks, musical hacks


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook