Something you might be interested in:
http://www.microchip.com/wwwproducts/Devices.aspx?product=MGC3130
Wahey! That is the kind of thing I was definitely looking for! I'll look into how I can obtain one of the dev boards. Quite amazing that it was fresh out last month.
What do you mean 'Roland controls all the rights'? You mean they have patents for music instruments?
Another very good option is to use ultrasound. That probably works even better than infrared especially for short distances. You'd need some processing power though for filtering but with the modern ARM controllers that is no problem at all.
They have patents directly for an infrared/visible light sensor that can be used to control musical parameters
http://www.google.co.uk/patents/US6501012I've had a quick look at ultrasonic and after some of my own experimentation and purchasing a cheapo ultrasonic sensor on ebay, I got turned off a bit at the thought of using ultrasound. The ebay sensor produces pretty erratic results dependent on my hand position, even if the distance is the same - merely slanting my hand produced weird results. It was only a cheapo SRF04 sensor though.
I had a go using an ultrasonic transducer and 40kHz source too. I attempted connecting the sensor to the 40kHz source through a small resistor (1k Ohm) and viewing the voltage across the transducer with my oscilloscope gave a really weird correlation between distance and voltage output.
It seemed that as I moved my hand towards the transducer, the voltage decreased from a maximum in a proportional manner, to a certain minimum at which it started increasing to a maximum larger than the first, to which it then started decreasing to a minimum, smaller than the first, continuing in this fashion until my hand was on the sensor. The frequency of maximum to minimum also increased as my hand got closer. Its quite hard to explain this behaviour in words and if I had access to my oscilloscope at the moment, I'd show you a picture! My only guess so far is that as my hand enters in and out of the nodes, the transducer is consuming more and less energy(?), altering the peak voltage drop across the transducer though other effects might come into play, any ideas there? I would prefer to be able to use a single transducer ultrasonic sensor.