by Chris Imbriano and Sana Malik

Human-Computer Interaction Lab, University of Maryland, College Park

Github

parts.jpg
kinect.png


Description

(motor)chestra lets you conduct two motors to create music. Your left hand controls motor 1 (bottom) and your right hand controls motor 2 (top). As you move your hands up and down, the motors go faster or slower respectively.

Motor 1 is mapped to notes (table below) while motor 2 is mapped to RPM 1 - 9 to emulate a drum. Notes are created by changing the speeds (in RPM) at which the motors spin. Low speeds (10 RPM or less) create rhythmic drumbeats while higher speeds (200 - 1200 RPM) create continuous tones.

Notes for motor 1:
Position
Note
RPM
1
C#
92
2
D#
118
3
F
163
4
F#
197
5
G
225
6
G#
273
7
A#
685
8
B
1055
9
C
3010
We use the FingerTracker library in Processing to track the position of your fingers with the Kinect. The tone is chosen by the top-most finger (indicated with a red dot). The selected tone is shown by greying the corresponding box.

sana.gif

Materials

2 Arduinos (1 Leo, 1 Uno)
2 Adafruit MotorShields v2
2 12V 200-step motors (adafruit, CanaKit via Amazon)
1 Kinect (Model 1414)
a bookshelf

Challenges

Stepping two motors at different speeds simultaneously

Because the motor's step command is blocking, it is impossible to run both motors simultaneously with one Arduino. First we tried interleaving the two motors' step commands by switching between each motor for a short amount of time. This worked well for running the motors at the same speed, but when the speeds were different, the faster motor had to wait on the slower motor, so the speeds of both motors were reduced to the lowest speed. We ended up using two separate Arduinos and shields to control the motors independently of each other.

Connecting a Kinect with Mac

We used the OpenKinect library for Processing, which works with the Kinect Model 1414. Once we knew the correct steps, setup was very easy. Processing has a repository of available libraries accessible through the "Skech -> Import Library -> Add Library". Installing OpenKinect for Processing and SimpleOpenNI allow you to use the Kinect with Processing.

A mistake we made originally was trying to use the model 1517 Kinect. This model does not work with the available Processing libraries which were developed for the model 1414.

Tuning the shelves


The pitches of the motors varied by rotating speed of the motor and the resonating material (shelving). We experimented with plastic, wood, and metal and found that the thin layer of metal in the shelving worked best..

Debugging the serial port output

The Kinect communicates with the Arduinos over the serial port. However, because the Arduino is reading from the serial, it cannot write back otherwise it will try to read what it wrote. This made it really challenging to debug the Arduino and whether we were sending the correct values. We ended up using a single LED to map values that we were sending to some range and used the brightness to determine whether the values were "about right" and to determine which points in the code the Arduino was reaching by turning it on or off.

Credits