Hope everyone had a great Christmas and New Years. I was reading the latest update documentation (man, I love how the latest version is looking) and then got very interested in force/pressure.
Can someone explain to me how this works? I mean, if using an iPad and an Apple Pencil, the pressure is measured through the Pencil. So, to use Pressure, is this only applicable for screens that support force? I'm just curious about how this works with OSC.
I'm incredibly interested in this because imagine having a pressure sensitive keyboard so you can suddenly implement Aftertouch. Or 5D Touch meaning we can suddenly have "lift" as a way of inputting data to create performance based instruments.
Very excited. I apologise for ignorance on such matters. Never in my life did I think this could even be a possibility!
Pressure will indeed work only on devices/screens that supports it (I guess most smartphones and tablets do, not sure about desktop touchscreens). The pressure information can only be used with a canvas widget, there's no predefined usage for it in o-s-c, it's up to you to be creative with it :).
Here is a simple example to test it: create a canvas widget with the following touch script and draw script:
Wow, this is amazing !
(I've been waiting and requesting for such a thing in Lemur / touchOSC / Max Mira, ...)
Finally I can use the Apple Pencil pressure to send OSC
Once again, thank you very much Jean-Emmanuel !!
PointerEvent.pointerType may be useful as well... to know if the pointer us a touch, a stylus, etc... ?
So many exiting things to explore with this new input
On iPad, look like when Apple Pencil is used, the touch events are ignored...
is it a setting we could change ? or an iOS limitation ?
I'm pretty sure that there are apps that can use simultaneously pencil + touch...
One more thing :
on iOS devices, touch radius ( radiusX ?) should also be accessible.
I remmener a couple of years ago, developers had to use a forbidden private api to access these data (some apps had some hidden parameters to enable it..) ; then it became officially supported, but with a very low resolution. (Orphion app uses this feature)
Anyway, I guess it would worth giving it a try
I'm adding these properties in next version, except those tied to the PointerEvent API that would require a partial rewrite of o-s-c touch event implementation.
touch script seem to be triggered only when cursors is added/removed or moves (X/Y)
So force/pressure is only sent / drawn when x or y value change.
(if the stylus stays at same position, pressure is not updated.)
Can't find a way to trigger a script when any value changes (force, azimuthAngle, altitudeAngle, ...)
I'm only starting to use iPad stylus in a 'real' project right now ..
It's really really fun, adds another level of expressiveness. I love it.
But for now, as soon as I map pressure or tilt to some real-time synth parameters (gain, pitch, ..), this limitation is a showstopper :-s
Sorry for late reply !
just seen the changeling for v1.18.0
canvas: iOS: trigger onTouch when event.force, event.altitudeAngle or event.azimuthAngle updates
great news !
but it doesn't seem to work here..
is there something I missed in order to enable this ?
I added updateCanvas() in my onTouch script, but it doesn't work.
Only x | y update the script.
I have this error message in O-S-C console when opening canvas_x_y_force.json
(ERROR, CLIENT) TypeError: undefined is not an object (evaluating 'this.iosTouchCache[e.pointerId][t]')
at setInterval( (src/client/widgets/pads/canvas.js:136:73)
Thanks for trying !
in case it can help, I also get this one :
(ERROR, CLIENT) TypeError: undefined is not an object (evaluating 'this.iosTouchCache[e.pointerId]')
at setInterval( (src/client/widgets/pads/canvas.js:136:60)
As these error messages are returned on each frame.. my sessions that contains this kind of script run veeeeery sloowwwly with 1.18.0
(I noticed that I have to close / reopen | refresh the page on iOS / safari when I change O-S-C server version ; I guess the client needs to reload the new version)