Introduction: Illumaphone: Light-based Musical Instrument With Arduino

About: Software engineer at Twitter, based in NYC. Member of NYC Resistor. I do stuff with Arduino, musical programming, and lasers. See more of my projects at http://blog.bonnieeisenman.com.

Ever wanted to build your own electronic musical instrument? In this Instructable, I walk through the build process for my Illumaphone, a light-based, spatial musical instrument that I built for Jeff Snyder's Computer Music class at Princeton. It consists of six coffee cups. Wave your hands over the air to trigger notes; light levels control volume and vibrato. Each cup represents a different note.

Prior knowledge:

This Instructable will assume that you are comfortable with the Arduino, and that you can handle installing and setting up a program called ChucK.

Materials:

  • 6 photoresistors
  • 1 Arduino Uno
  • The usual wiring bits: alligator clips / wire / breadboards. I didn't do any soldering because this was a temporary project.
  • Some kind of box-like object to hide the wiring. I used the cardboard lid to a box of printer paper.
  • 6 disposable coffee cups to act as light funnels
  • 1 laptop to process data and do sound generation

Everything starts with six trusty photoresistors, one in the bottom of each cup. The Arduino Uno reads in data from the light sensors, and sends it to the laptop, which then uses ChucK (a musical programming language developed at Princeton) to synthesize notes as appropriate. The physical build is key to providing a good experience. Hiding wires makes people focus on the sound, and the cups act as awesome light funnels, so their shape does kind of matter.

All right, let's get started.

Step 1: Light Sensing

Light sensors are the most basic, critical part of the Illumaphone! If you haven't used them before, I'll briefly outline how to do so. If you already know how to connect photoresistors to an Arduino, spoiler alert: all we're doing here is attaching one sensor to each analog pin on an Arduino Uno, so you can skip ahead.

What is a photoresistor / light sensor / light-dependent resistor, anyway?

A photoresistor is a special component whose resistance fluctuates based on visible light. Depending on your environment, a photoresistor may be able to sense fluctuations caused by movements as far as a few feet away.

Connecting one photoresistor to the Arduino Uno

I recommend the Arduino Playground tutorial for this sensor. Here are their instructions:

Connect the photoresistor one leg to pin 0, and pin to +5V
Connect a resistor (around 10k is a good value, higher values gives higher readings) from pin 0 to GND. (see appendix of arduino notebook page 37 for schematics).

From there, I highly recommend running their test code:

int lightPin = 0;  //define a pin for Photo resistor

void setup(){
    Serial.begin(9600);  //Begin serial communication
}
void loop()
{
    Serial.println(analogRead(lightPin));
    delay(200); //short delay for faster response to light.
}

Can you see values being printed? If so, great! You're ready to move on to the next step.

Step 2: Wiring Up the Light Sensors

Each light sensor needs to be connected to an analog-input pin on the Arduino. The circuit layout is identical to what we did in the last step, but multiplied by six.

As for the physical build, I found it useful to begin by inserting the light sensors into the cups first, and then attach the cups to the base second.

To insert the light sensors into the cups, I used a sewing needle to puncture two properly-spaced holes in the bottoms of each paper coffee cup. Thread the light sensor through so that it's facing in the proper direction. Depending on the size and shape of the cups, this may be difficult; you can use tweezers if you have difficulties.

To attach each cup to the base, I once again used a needle to poke holes through the cardboard, for the legs of the photoresistors to go through. Then I used liberal amounts of duct tape to keep everything together. You can improvise here quite effectively: try using hot glue instead, for instance. For me, the black duct tape ended up being part of the overall aesthetic.

You can see from the second photo that the circuit is formed with a mass of alligator clips. Like I said, this was designed to be a temporary build; if I were to do it again, I would be sure to actually solder things, route my wiring properly, etc. Even if you go the alligator clip route, be sure to use liberal amounts of tape to keep things relatively organized.

Step 3: Upload the Arduino Sketch

Now that your build is complete, flip the Illumaphone rightside up. Hey, it doesn't look completely messy from this side!

The next step is uploading the Arduino sketch. It is available here: https://github.com/bonniee/illumaphone/blob/master/readAllAnalog/readAllAnalog.ino

This sketch is quite simple; it just reads the data from the pins and then prints it out. Go ahead and inspect the Serial monitor to see what's happening.

Step 4: Run the ChucK Program

Sound generation is handled by a ChucK program.

If you don't have ChucK installed, you can find instructions for doing so here: http://chuck.cs.princeton.edu/release

You can download the ChucK program for the Illumaphone here: https://github.com/bonniee/illumaphone/blob/master/cuppy.ck

To run the program, open it in the ChucK IDE, also known as MiniAudicle. You will need to provide it with the correct number for your serial port. First, plug in the Illumaphone via USB. Then, attempt to run the ChucK program. It should give you a list of serial ports as options. Pick the number that represents the correct USB port, type it into the arguments field, and re-run the ChucK program.

(You can also run ChucK programs via the command line: chuck cuppy.ck:NUM_HERE )

Step 5: Calibrate and Play

The sketch is set up to calibrate when you start it, so be sure to run the ChucK program while you're not standing over the cups. After you run the program, you should not hear any noise; you should be able to wave a hand over the cups to play them.

Once you have everything properly calibrated -- enjoy! I would love to see some videos of your performance. Try experimenting with different motions and techniques; you can even use a flashlight to play the cups, since they're sensitive to both light and shadow.

Finally, I've attached a video of me performing alongside my friend Harvest. (He's wearing a meditation-based musical instrument that we built, too!)

Other Resources: