Saving OSC coordinates to achieve incremental movement

Hey everyone,

I could use some help with coordinates I am sending from a touchpad via OSC to Grasshopper.

Everytime I touch it sends out a fresh point and tracks my movement. I holds the point if I loose the touch, but when I retouch it jumps and directly relocates the last point to the new point.
What I like to achieve is incremental movement, means the last point of touch is safed and the new touch begins at the last position instead of the new absolut one.

I tried some phyton sc script to save the points, but it didn’t really work. Recording and evaluating the data was my second guess. Also tried to save the data in a csv file and read it back out, but got stuck in setting the startpoint for the fresh coordinates and making it live reading. If anybody has an idea I would really appreciate new input.

Here is how the remapping of the incoming data looks right now. MD Slider here as coordinates input reference.

2024_02_17_mapping for incremental point.gh (8.4 KB)

Data Recorder ? Avoid running data through text panels.

1 Like

Hi Joseph_Oster,

Edit: Thanks without the panel the evaluation works again. <3

yes I am trying, but the OSC is flooding me with the same coordinates. I couldn’t evaluate the changes because the branches are changing constantly. I try now to leave the branches out and see from there.

It looks like you have more text panels with data running through them (four) than before :exclamation:

Text panels are great for examining data and can be connected at many places but they can interfere and corrupt data when you use their output as downstream inputs. Converting data to text has many ways to foul things up including rounding of numbers, point coordinates being only one example. But it’s more than that. Use them freely to inspect data but don’t rely on their output.

1 Like

Its fine without the one connected to the data recording.

Still struggling to keep the last coordinate, because the OSC is flooding the evaluation.

Are you still running the point through the text panel? Why? Sure looks like that in the image but can’t be sure without examining the code, which you didn’t post.

I don’t understand the issue with “flooding the evaluation”? Is the same point being repeated? If so, you should be able to ignore it: if this point == lastPoint then ignore it ?

1 Like

Sorry it looks like its running through it, it didn’t.
The flooding issue is that the touch OSC is sending and sending even when nothing happens. Yes it repeats the point.

I just saw that, when more OSC data coming through the evaluation cannot work, because it cannot sort out which one to evaluate. I’ll go back trying it without the recording component.

Thanks for the help, time for me to get some sleep.

Here the file with one example coordinate
2024_02_18_mapping for incremental point.gh (5.7 KB)

I see that now in the code.

Not sure there is much to be done without the OSC device(?) or a simulation of it.

Have you considered using an Anemone loop to get each point?

1 Like

You are totally right.
Not yet, I’ll get to it. Thanks a lot!

I don’t know if this is correct or useful… The purple group on the left is a ‘send simulator’. It uses an Anemone loop to repeatedly “send” the value of the MD Slider (point) as fast as possible, simulating your OSC device?

The white group on the right is the “receiver” that keeps a list of unique points, ignoring the duplicates, and draws a polyline through them.



osc_2024Feb17a.gh (18.1 KB)

From time to time, both data recorders should be cleared using their respective ‘X’ buttons.

P.S. The Anemone loop and second Data Recorder in the white group (‘receiver’) were superfluous nonsense, The key component is the Set component. The remaining Data Recorder and Set component will likely break down at some point, overwhelmed by the flood of data from your device.


osc_2024Feb17b.gh (19.1 KB)

Hello again,
thank you, nice build!

also this is a nice touch draw tool now! and the set list would work to make the next step of combining the next point with the last point to make it incremental or relative in movement, BUT I have to see how I can delete the created points from the set component.

The simulation works also great, but it misses the point of my touchpad in the case, that the touch pad isn’t continously moving from the last point. it can jump because you wont touch at the exaxt point, when retouching, which creates the jump from coordinate to coordinate.
grafik

Difficult to work on a hardware interface issue without the hardware. Or a simulator that demonstrates the problem. Did you see this?

Yes absolutley, yes I saw it, it pointed me towards a solution for the OSCmessage when I am using a different touch software/hardware then TouchOSC.

“If there’s already an address pattern that it recognizes, then it will just update the existing value with the incoming one.”
This works fine with TouchOSC, which I currently use.

Essentialy I need the last touch point safed to use it for a new point and give the new point the startpoint of the last touch point.
This why I evaluate the incoming coordinates. True when it changes, false when it doesnt change.
I tried to write a script, which saves a coordinate when the state of true and false changes, but it didn’t save anything unfortunatley.

This helped with the duplicated numbers, but its the same problem with getting rid of the CSet points.


osc-distinct_numbers_2024Feb18s.gh (17.9 KB)

“saved”, not “safed”

I really can’t follow this OSC stuff, sorry. Good luck.

1 Like