# Python Math acting funny

I’m trying to use an evaluate DAT to organize a column in a table to reflect relative frames. Meaning, I have a program built to capture the absolute frame when a controller input is detected and want to make the frames relative (i.e., instead of 34000 to 38000, it would be 1 to 4000).

I put an expression in a table and plugged it and my original table into the evaluate, but when I try to subtract the cell from itself - 1, I get every cell changing to 1. If I invert the - to a + operand, it works like I thought it would. Am I missing something significant here?

Once I get these new values, I want to replace the column in the table with these new values. I’ve been told a for loop can also work for this math, but I feel like an eval would be easier. Would for loops make more sense when capturing this kind of data since a CHOP execute only runs once (which I already have capturing the data in the first place) while an eval is constantly cooking?

Thanks all.

Attached the .toe file for reference in case anyone wants to poke around.

controller_data.toe (10.8 KB)

That is indeed all checking out and the intendet behavior. x - (x-1) will always be one.
Please, can you again state what you are aiming for?

At second glance, I suppose that does make sense. I guess it’s MY math that is acting funny.

I’m trying to create a function for an eval DAT that will change the values in a table column to a different start point, but the same intervals between values. Essentially, I want to take the minimum value in that column and subtract it from every value in that same column, but have it start at 1.

So in my above example, I want it to go from 50, 150, 300 etc to 1, 101, 251, etc.

Is it possible to run a math function in the eval that will run once? Something like math.min() at a certain index? I know the eval cooks constantly, so maybe that isn’t the best solution for this since I have a trigger that stores the data after it’s recorded live.