Reputation: 186
Can I detect the force or pressure exerted by a user (musician's) finger?
Upvotes: 4
Views: 2488
Reputation: 1437
Yes you can detect finger area, which is similar. Really! You just don't get point-pressure which requires a different sensor technology.
You can get a number that's the major radius of your finger in millimeters from every finger individually. It's essentially a processed number related to the number of pixels you are covering with the finger. Unfortunately, I haven't been able to get a straight answer on whether this is a problem to ship this way, so I have to ship with it disabled. But it works. It returns a value from 7.0 to about 11.0, it varies wildly, and you might want to low-pass filter changes to this value.
float vf = 10.0;
id valFloat = [thisTouch valueForKey:"pathMajorRadius"];
if(valFloat != nil)
{
vf = [valFloat floatValue];
}
As an iPad developer, it drives me COMPLETELY insane that this has worked since the iPad shipped, works now in iOS4.2, and still doesn't appear to be sanctioned. This feature is a basic requirement for many classes of application if you want something that's more than a $2 toy.
Upvotes: 2
Reputation: 22711
Done. See my answer in Tap pressure strength detection using accelerometer
Upvotes: 0
Reputation: 8919
You cannot detect pressure but you can detect velocity of movement (distance/time) and you could establish a linear relationship between velocity and force -> volume. You could make a bell ring louder, for example, by swiping your finger vigorously, rapidly across the bell, and quietly by a gentle, short, slow stroke. Probably would work OK with harp strings.
Upvotes: 1
Reputation: 26873
Not yet.
There's a technical demo showing how to do it. See http://tenonedesign.com/blog/pressure-sensitive-drawing-on-ipad/ . Hopefully something comes out of that. :)
Upvotes: 3