Data storage advice/tips

Max Björverud's icon

Hi!

I'm a big big patch and right now im trying to find a solution to one of its function. In this patch I'm steering a dot in a X,Y coordinate system rangeing from -0.5 to 0.5. The range is the scaled to a grid rangeing from 0 to 10 in a sub patcher. The goal is then to keep track of how long this dot, that im steering, has been in each grid, totally. Get it?

Max Patch
Copy patch and select New From Clipboard in Max.

I've made an patch that wont do the trick but it might be of help understanding.

MIB's icon
Max Patch
Copy patch and select New From Clipboard in Max.

haven't really tested it, but maybe something like this??

Max Björverud's icon

Yes that works in one way. But I don't get the time, I get how much I've moved within this 10x10 square. I need it to count seconds :/ Another part of the patch actually does this with "Anal".

Uploaded a text file you can load into coll.

/Max

4888.Coll10x10.txt
txt
Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

this isn't perfect but you get the idea-- use a matrix to store and modify your data

Max Björverud's icon

Yes that did it! Many thanks! And that solution gave me another idéa to work on :) Change the color of every pixel in the jit.pwindow depending on time. LoveMax

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I made some slight changes (objects coloured) so it's a bit more reliable. (Needed pack instead of pak, a speedlim added and args to scale tweaked).
-T

Max Björverud's icon

This works really good!