Learning   Examples | Foundations | Hacking | Links

The Galileo-based Sample Sequencer

This is a tutorial on how to make a music sequencer with a Galileo board and a standard MP3 Shield for Arduino. Galileo is an Arduino based development board with Intel architecture. This project was developed as an interactive display for Maker Faire Rome where the Galileo was unveiled to the public. We wanted to make it fun, easy to use, and draw in kids and adults.

Being fully compatible with Arduino's hardware interface, IDE, and standard libraries, the Galileo board makes it easy for those familiar with Arduino to jump right in and start programming.

In a bigger scale, our sample sequencer consists of a control board and a pair of speakers/headphones. On the control board, there are four buttons, two dials, and 8 LEDs.

  • Button 1: Random - Creates a base sequence of random samples
  • Button 2: Try - Listen to the various samples before adding them to the sequence - used in conjunction with the Sample Select dial (Dial 1)
  • Button 3: Set - Sets the sample into the sequence
  • Button 4: Pause - Pauses the sequence

  • Dial 1: Sample select - Dials through the 50 sample sounds
  • Dial 2: Step count - Sets the step count from 1 to 8 steps

The Looks

The sound board was designed to be playful - we went for cute aliens and robots. The buttons, dials, and eyes became the eyes, tentacles, and signals. We used fluorescent and metallic stickers to add some color pop. The editable PDF template including the whole visual design can be found here: Soundboard.pdf Δ)

We made two large earphones using two 18 cm plastic food mixing bowls, a few lasercut parts, foam, fabric, and a pair of connected Mini X speakers. (You can download the design file here: BigEarphones.pdf)

Our Strategy

The software is based on an example sketch from the Sparkfun's MP3 Shield. It is however modified to accommodate the Galileo platform. Compared to e.g. Arduino Uno, Galileo can host much bigger programs as it has more memory and internal processing speed. Thanks to that the program switches between MP3 files faster. As Galileo has its own SD card reader, our code reads the MP3 files directly from there, the only part we are using of the MP3 Shield is the decoding chip on it.


The sequencer has 2 knobs, 4 buttons and 8 leds on its interface. When activated, it loops through and plays through 8 segments of sound samples repeatedly (or however many segments are chosen). The LEDs will light up according to which segment you’re listening to. You can use the buttons and knobs to customize the sequence.

If you press the big red “random” button, the whole sequence will be randomized. Press the “try” button to listen to the currently selected sample without making any changes to the sequence. You can select different samples by turning the “sample selection” knob. Insert a chosen sample in the sequence by pressing the “set” button. Press “pause” button to stop the playback as long as you’re holding it. Set the sound sequence's length (between 1 and 8 samples) by turning the knob marked “step count”.

Parts needed

  • Blue led 5mm x 8
  • 220 Ohm resistors x 8
  • 78HC595N shift register x 1
  • Push buttons x 4
  • 10k Ohm resistors x 4
  • Potentiometer x 2
  • Arduino Protoshield x 1
  • SparkFun Mp3 shield x 1

We used a 78HC595N shift register on a protoshield to control the LEDs, while the buttons and knobs are all directly connected to pins on the Galileo.

Putting things together

Here’s the schematics for the parts you need to mount on the protoshield:

The shift register

Layout of the resistors

The whole connection

The buttons

After the shield is done, the rest of the connections are made by simply stacking shields on top of the board.

The Code

First include the following libraries:

#include <SPI.h>
#include <SD.h>
Note the Galileo has a different mechanism for SD read/write, so the SD library here is a special Galileo version.

Then we define the basic configurations of the sequencer. Template of the file name, button/knob mapping, etc.

#define notes_len_max 8
#define num_sounds 49
char trackName[] = "track001.mp3";
int trackNumber = 1;

int pin_test=3;
int pin_save=9;
int pin_silent=10;
int pin_random=5;
int knob_choose_pin=A0;
int knob_nn_pin=A1;//number of notes knob

And some global variables

int sequence[notes_len_max];
int curr_sound_num;

int num_notes=notes_len_max;
float last_note_length=1;

The code is based on “ReadMP3fromSD” by Nathan Seidle. .

You can download the sketch from here: https://gist.github.com/X-Y/7900308

Here’s a simplified connection diagram:

On display at Maker Faire Rome, the Sample Sequencer with its vibrant colors, cool sounds, and big buttons drew in crowds of children and adults. With a short explanation, we had amatuer DJs in the making!




Tien Pham

David Cuartielles

Xun Yang