If there a way to know the velocity when the user touch the screen of an Android phone...

If there a way to know the velocity when the user touch the screen of an Android phone? I need to know that for a drumming app project

Attached: fix-touchscreen-android.jpg (580x357, 135K)

Other urls found in this thread:

developer.android.com/reference/android/view/MotionEvent.html#getPressure(int)
twitter.com/SFWRedditGifs

Is there*

yes

some phones can detect pressure I think

Any example of such thing?

Like when you're scrolling a long page in the browser, you swipe up very fast and it continue to scroll.

he press pressure not speed

Yeah but that's not what I mean. What I would like to have is like when I touch a drum on the screen with my finger, the program knows how strong my touch was, you see?

developer.android.com/reference/android/view/MotionEvent.html#getPressure(int)

that pretty much has to be a pressure sensitive screen
you might be able to fake it by using the phone mic to listen to hear how hard the physical tap was, I doubt it would get any good results

or just have different volumes for different digital drums

>0.5sec lag
>drums
wut

Distance/Time

It should be noted that any electronic technology where you need to hit it harder to perform a function may not last very long.

Attached: Riding Boots. Crushing mobile phone.webm (480x270, 2.91M)

What about just detecting the area or more fingers. So more = louder

You could also think about taking small Jitters from the gyroscope into account. So tapping harder shakes the phone a bit and makes it louder

Thanks. Maybe I will have to drop the idea of capturing the pressure to determine velocity then, since it would make my program not available on some devices

Other than that I have an alternative idea thanks to . Instead of recording drum hits from single touch, I change the design of the app and instead, let's say the drums are at the bottom of the screen, the user scroll down his finger until he touch the drums, and the velocity is determined from the speed he took until the finger arrived at the position of the drum

Nice idea, I will think about this. Thanks

I will try this too. Thank you user!

Ok, so I have no idea of touchscreens but here's something:

When you touch your screen the surface of the screen that is covered by your finger changes/increases depending on how hard you press it. If a screen would be sensitive enough to time this gradient, you could find the speed of impact.

How good will yiffy rips look with AV1?

If you're making your app for both iOS and Android then you'll need to account for latency issues on Android.

is that you alex?

God I wish that were me.

>Thanks. Maybe I will have to drop the idea of capturing the pressure to determine velocity then, since it would make my program not available on some devices
maybe try using touch duration?

Maybe use the speed of the expanse of the touch gradiant to trigger it? Might not be what you're looking for though.

if you open the developer settings on your phone, you can see all the data it collects for touch. it includes pressure (for my phone). pic related.

Attached: Screenshot_2019-04-08_173822.jpg (1440x2560, 326K)

can you obtain touch pressure ?

That's a VERY clever idea with the microphone

You may be able to detect surface area of the touch. A light touch would have a farily constant surface area while a harder touch would have an area that increases from when the touch os forst recognized to when it is stable.

Possibly looking at rate of change in surface area. It may be hard to normalize across different people though.

Android dev here. No. The phone would need a pressure sensitive display and even then it would report pressure not velocity. I don't know of any such android devices.

You're better off engineering some 3rd party drumming kit that communicates with the device through bluetooth.

Early HTC Desires had pressure sensitive displays.

I think some devices have kernel level implementation of calculated pressure based on tap area. But it's still not true pressure sensitivity.

I have no idea but if I were to tackle this problem I would probably do it off of the time it takes for the surface area being covered by the finger to increase because you know fingers are soft, glass is hard, ones going to spread out across the other and the rate of spreading is dependent on the velocity of the finger

Theres no way to do that. You can measure pressure on some special screen but not velocity. You might also be able to measure pressure in the way this guy explained: You could come up with some formula based on pressure, but ultimately, pressure is pressure, and the velocity you derive from it won't be accurate. Your best bet would be to use the camera to detect how fast fingers in its FOV move.

You might be able to jerry rig it by how quickly the pressure increases.

to modern touchscreens actually give an array of touched pixels, or just a couple points where it thinks the fingers are?

>velocity

incorporate the front facing camera to detect speed of incoming strikes

easiersaidthandone.jpg

ehh let's discuss that wallpaper.

he's talking about velocity i.e. MIDI

It might make more sense to measure the time the user hits the screen and play a sound of a certain degree to match it. For example, if the user only touches the screen for 1/20th of a second, then you could play the light variant, whereas if the user touches the screen for 1/10, you could play the heavy variant. The only downside to this is that there will be slight lag, but if you keep it under 1/7th of a second (average human reaction time), then it shouldn't be too noticeable.

>audio app
>android
lol'd fucking hard.

Apparently GarageBand does it using the accelerometer.

Where did you read that and how do they do(is there any formula)? made a similar proposal with the gyroscope instead

Easier hack: just measure duration

Sounds like some cross between duration of the tap/touch, and if determinable, the radius or area of contact ... if you’re touched your thumb flat on the screen, does the entire area of contact detectable? Or does it only report some calculated center?