4

Can I detect the force or pressure exerted by a user (musician's) finger?

Bill Drissel
  • 186
  • 1
  • 6
  • 1
    Look at this: http://www.templeofipad.com/pressure-sensitive-drawing-on-the-ipad/ It could be of use to you. – johnny Dec 17 '10 at 21:16

4 Answers4

3

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. :)

Juho Vepsäläinen
  • 26,573
  • 12
  • 79
  • 105
  • A.W.E.S.O.M.E. :| +1 - I didn't believe something like that was possible – usr-local-ΕΨΗΕΛΩΝ Dec 17 '10 at 21:18
  • isn't the new iPad2 with the Gyro able to sense the pressure now thanks to gyro? I thought I understood that. – Jakub Mar 22 '11 at 17:53
  • Accelerometers or gyros can simulate pressure detection due to the slight push on the device that happens when you press the screen. GarageBand does just that. – Jano May 04 '11 at 11:52
2

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.

bobobobo
  • 64,917
  • 62
  • 258
  • 363
Rob
  • 1,387
  • 1
  • 13
  • 18
  • 1
    Update 2 years later: it appears that pathMajorRadius can in fact be used. Orphion uses it very publicly, Cantor uses it publicly and mentions it as the first thing in its description. The call to get the property is clearly a public API, and we gracefully recover if the dynamic value is not found. Many developers have asked Apple for over 2 years about it and nobody seems to have gotten an answer. But I also don't know of anybody that had just shipped it like that and got rejected either. Orphion has the honor of just doing it and getting approved first. – Rob Jun 01 '12 at 15:22
  • Update even later... Apple called me at my house over this issue, and called the Orphion developer the next day. I clearly described what I was doing, as did the Orphion developer. Apple initially passed these apps, then changed their minds over a year later. They are asking us to remove this functionality or have our apps removed from the store. It's a wonderful feature and works so well that it's the whole premise of the app. iOS apps published as open source can be compiled by individual users (as a developer-only way to distribute such apps). – Rob Jun 27 '13 at 15:16
  • This is so frustrating to hear. Any explanation of the reason, or suggested alternative approaches? – Russell Borogove Jun 28 '13 at 05:51
  • No alternative. Capacitance-only touch screens are capable of multi-touch, with finger-area being the natural way to have a per finger-tip sensing. It's extremely accurate. Some apps use the accelerometer, which though better than nothing is just not even close (not per-finger, having to string together two signals that come in at different rates which can be cpu intensive). Other apps use the microphone which can be very accurate alt to an accelerometer, which needs quiet to work (for a sound generating app). Orphion must update to remove it, but no user willingly installs the new build. – Rob Jul 03 '13 at 14:57
  • I'm thinking of developing a performance synth app, holding the tablet two-handed with no fixed support, for use on stage, so both accelerometer and mic are non-starters. :( – Russell Borogove Jul 03 '13 at 23:05
1

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.

Tim
  • 8,669
  • 31
  • 105
  • 183
0

Done. See my answer in Tap pressure strength detection using accelerometer

Community
  • 1
  • 1
picciano
  • 22,341
  • 9
  • 69
  • 82