Here’s the code for the arduino and processing sketches. The arduino sketch is used by the microcontroller sewn in to´ the mask and the processing sketch is run on the computer controlling the input via the video camera. The arduino code relies on two libraries: the first is the publicly available TimerOne library; the second is a new library written during Science Hack Day SF 2011 called SoftwareTone which allows creation of square wave tones to any (and all) arduino digital pin in software. The SoftwareTone library will be uploaded to github shortly.