Published on June 16, 2016
Making noise with the tone() function is the "Hello World" of Arduino sound.
This project goes a little bit further and plays a song. The song is stored as a sequence of notes where a note is a pitch (frequency) and duration (time in milliseconds). The two include files that go along with the main sketch define symbolic note names (e.g., NOTE_C3 is middle C) and note durations (e.g., QUARTER is a quarter note). The song -- a sequence of notes -- is stored in a two dimensional array.
Synth people and other musicians call this kind of application a "sequencer" because it plays the sequence of notes as an endless loop. In fact, if you have the Synth Kit, you might want to send the audio signal to an envelope module, filter, etc. I'm expanding the basic sketch and using it for experiments in synthesis.
This is a good beginning project because the hardware is simple and the code is short. I'll cover the most basic information here, but please see http://sandsoftwaresound.net/littlebits-arduino-tone-sequencer/ for all the grungy details. Thanks.
Duration: A few hours