A cool project for all those into the electro music. Here is something that even Jean Michel Jarre would want… an infrared Theremin-like musical instrument! Notes are vibrating from speakers just by moving your hands in thin air. One hand controls the note played and the other hand controls the octave. The difference is that the sensors are not antennas but two IR devices from Sharp, the GP2D120.
Notes are predefined, so unlike a Theremin, it’s pretty easy to play it. The instrument, named Squaremin, can only produce flat notes from the C major scale, so only C,D,E,F,G,A,B within 7 octaves. However you can change these notes to your desired scale, all you need to do is to define new notes by changing the period of the pulse in the source code. The microcontroller used is the ATmega168.
The operation of the instrument is given by the two IR sensors. These sensors can determine how close an object is to them by using triangulation. A pulse of IR light is emitted and if an object is in the way it reflects the light back to the sensor. A CCD array within the sensor receives the reflected light and determines the angle of this reflection. If the angle is wide it means the object is far and if the angle is narrow it means the object is close.
Therefore depending on the distance your hand is from the sensors, you change the notes and the octaves. The Squaremin has an internal audio amplifier with a small speaker but you can easily add a line out connector so you can hook the instrument to a mixer for example. Also it provides a little light show as it changes color with every note you play, again reminding of the awesome J.M. Jarre concerts.
All in all, although the spectral composition of each note is not that rich, this principle can be applied into a real instrument project that instead of microcontroller generated sounds plays real samples.