Multitouch data "pixelate" into a matrix
Hi, sorry for the confusing title.
For example I have a 16x16 2D matrix. and I've pressed on a multitouch pad around (4,4) with a certain force, then the data in the (4,4) slot will be 1. And the slots around (4,4) - 8 of them - will have a number a bit lower (like 0.8). and the slots a step further away - 16 of them - will be lower again (e.g. 0.5).
And in this process, I can use my force to control how much the date would be in the slots.
Here in attachment I've made a simple drawing shows what I mean, there are 2 presses, the top-left is harder than the lower-right.
Thanks.
Edit: the top attachment is the right one, how do I delete posted attachments?
So uhm... what's the question? :)
you could do that with jit.matrix
- jit.expr a 7x7 single plane float matrix with something like
expr sin(norm[0]*PI)*sin(norm[1]*PI) or expr 1.-hypot(snorm[0]\,snorm[1])
- multiply this matrix (jit.op @op *) with a float that is the scaled velocity (f.e. scale 0 127 0. 1.)
- overwrite your main 16x16 matrix at the right offset with that matrix
- jit.spill
@tobiasros Thank you very much! I've nailed this down.
But my macbook pro gets so slow and lagging when I use this patch. Is this normal? I am totally beginner to jitter so I wonder if there's some setting or optimization I can do to the computer or the patch. Thanks.
Here is the patch:
here some quick improvements:
call this abstraction placethematrix:
this is main patcher:
next you could f.e. put the abstractions in a poly...
Thank you @tobiasros!
This is super awesome and fast.
Btw, I found that if I have too many UI objects on my retina macbook, it can get slow very quick. I found out I can lug the system pretty efficiently just by dragging the jit.pwindow bigger... seems like a bug between max and retina macbook.