Ir Distance Phidget query in Max MSP

rudetc's icon

Hey there!

I'm a student in a digital design school in Stockholm called Hyper Island (hyperisland.se) and we're currently working on a module where we get given a piece of tech and have two weeks to make a prototype of some sort. Rather intensly, my group got given 4 IR distance sensor phidgets (http://www.phidgets.com/products.php?product_id=2008)

So we decided that we would like to use them to allow users to manipulate auditory properties, pitch, tempo, tremolo etc. of musical tracks with their hands, which has required that we start using Max MSP, something I've never had any experience with. So basically, help me MAX Msp forum, you're my only hope!

So basically the problem is this: We need the system to detect the difference between when there's a hand there and when there isn't, but as we get a continous stream of output value from the phidgets the system is ALWAYS getting data, causing it to always reset back to the maximum set value whenever you remove your hand. So, if we take our hand away, the sensor thinks that its still there, just really far away, so it instantly pushes the value back up to maximum and this means the user can't really interface with the musical track.

So firstly: what we need is a way of having the sensor "Remember" the value it's set at by the hand and, output it for further manipulation and stop taking in data until the hand comes back.

We thought that the best way would be if we could have it set so that that if you hold your hand in place for two seconds, it stops taking input from the phidget and stay at that level, but that means you'd have to make it not too oversensitive so that you can easily do that. We've figured out how to use scale objects to give us a value range of 0-19, but as the sensor is extremely sensitive and would be stimulated by a hand being removes, we would need the system to start counting down when the hand stays within say, three sections.

So secondly, how do we make the system not get overstimulated when we remove our hand?

I'll be checking this forum loads for responses, so feel free to ask questions if you need any clarification. I've attached the file we're using for your perusal.