Go Down

Topic: Easy chiptune/multiple tone library that leaves loop() clean (Read 1 time) previous topic - next topic


I'm intending to build a device that can do several things, including the ability to play chiptunes (probably from a memory card so it can hold a selection).
As playing tunes isn't the only thing it'll be doing I'd love to be able to keep void loop() fairly clean and to be able to do other things while a tune is playing (although I can work around that if it's not feasible).

The other thing is - I really would like to keep the component count low, ideally just a speaker. I know there are lots of MIDI and synthesizer projects out there - for me the one with the most mileage looks to be atmegaSID (but you've got to read and send it serial commands for each note..)  - but these are synthesizers for music creation and I think they're probably overkill and intensive in terms of program time and programming time. All I want is a routine that can play some 4-channel (ish) tunes.

Is this possible? Feasible? I'm not an expert programmer by any means and writing the chiptune bit from scratch is beyond my skills and would make the the project infeasible. Any suggestions?


Sure, go on then.

I am not aware of anything that exactly fits your need, but I can think of two cut and paste projects that cover the sound part without much happening in loop -

option 1 - http://rcarduino.blogspot.com/2012/08/the-must-build-arduino-project-illutron.html

option 2 - http://rcarduino.blogspot.com/2012/09/algorithmic-music-on-arduino.html

Another option is to play back prerecorded audio from an SD Card, there are lots of examples for doing this.

There is also the mozzi library, I have not used it but people are excited by its potential

For connecting a speaker this is a minimal and highly effective option -

Duane B

Read this
then watch this



This MP3 shield from Sparkfun looks like the sort of thing you're after.

Although it needs a sketch to pull the stream from an SD card and push it out over the SPI bus, you could do that in a non-blocking way that left loop() running and able to deal with other things concurrently.


Awesome, thanks. I was hoping for something more "drop-in" but I guess that's not really the point of an arduino anyway! I was hoping there would be a project that would play the music - from instructions rather than a sound file to maintain some integrity - so that I wouldn't have to get too involved in the actual sound creation stuff. Dealing with frequencies and manipulating bits to make sounds is not something that I'm going to find easy.

With your links, and these two projects I should, eventually, be able to string something together...I hope.

I might make an Illutron B anyway - it looks awesome.


For anyone else who finds this after me -

Also look at http://code.google.com/p/miditones/ which works with http://code.google.com/p/arduino-playtune/

Go Up