Art of the (Computer) Machine!

Project 4 - What if you can make music with just your hands?


Source Code

The Device

I created this device in a few hours using the base of an old keyboard I took apart a long time ago, and a lot of Sticky Putty.

Here is the device I made for the project.
Full Device.
Here is the device connected to my computer.

Project Information

This was the final project in my MART380 class.


I have recently been researching more about Computer Music, and decided that this would be a cool concept to peruse for my final project in this class. I had some experience in working with the Distance Sensor for an Arduino, so I decided to go with that.


I decided to go with using a Pentatonic Scale, as well as 7th chords with added 2nds to make my music. There are a few distinct parts of the music generation process: The Arpeggio, Chords, Melody, and Bass. The Melody is randomly generated by picking one of the 5 notes to play. Chords change on the user putting their hands close to the device, which causes a new Chord to be randomly selected.

System Requirements

Currently I only support linux, but in theory this project can be modified to work on other platforms, such as Windows or MacOS.

Software Required:

Tools Needed

In order to setup this system, you will need:

Setup Procedure

This is a brief guide to setting up the Arduino software and hardware, as well as Pure Data.


  1. Connect the Arduino to the Distance Sensor.

NOTE: Be sure that the ultrasonic sensors point opposite of each other, otherwise interference may occur.

  1. Connect Arduinos to PC

  2. Write Program to both Arduinos


  1. Start Jack

    a. Note that QJackCtl has a nice GUI to help with setup if you are into that type of thing

  2. Start Pure Data

    • Turn on the DSP

    • Open up mart380_final.pd

  3. Start ZynAddSubFX

    • Load inst.xmz
  4. Make connections

  5. In the Opened Pure Data Project, click on the large Bang Object (looks like a button) at the top-left corner of the window, where there is a comment saying "Start".


By default, the system should be quiet, as the reverb is on full-blast, and the notes are very short. Place hands in front of the sensors, about 20 inches away, and move around, probably closer to the sensor, until the L LED on the Arduino illuminates. When this light is lit, you will know that your hand is within the range of the sensor, and a non-zero or 127 value will be sent to the computer.

First, try moving your hands closer to the sensors and listen for the music to get louder. To change Chords, move your hands closely in front of the sensors, until the lights go out (from your hands being too close). After a few ticks, the chord should randomly change.


This program can be modified to accomodate different instruments, sensors, or chords.