Save and recall the state of a matrix +index

Andro's icon

Hi everyone,

I'd like to be able to output a matrix with jit.bfg (greyscale data, 8 planes) into another jit.matrix and then save the state of that jit.matrix as a preset.
Have multiple presets and be able to save and export this data. I saw that I can read and write a matrix file individually but I'd rather just do this with an index system so that everything is loaded at once.
I checked the forums but just can't seem to find a solution.
And and all help would be greatly appreciated.

(karrrlo)'s icon

[jit.submatrix] might be your friend.
or fill a multislider with your matrix data and save the multislider state in your preset system... there is a good example Andrew benson's receipes

Andro's icon

jit.submatrix only allows you to sample a portion of a matrix not save it in any form.
I think using 8 multisliders for 8 planes of data would use way too much cpu than I'd need.
Any other solutions anyone ?

(karrrlo)'s icon

apologies i ment [jit.marixset] and not [jit.submatrix], my bad

i don't know you can record 8 planes with [jit.qt.record] but with some workaround you could then read your matrices back as frames with a [jit.qt.movie] also...
you don't specify the dimensions of your matrices ?

Andro's icon

Sorry for the late reply.
I need to keep all 8 planes of data because I'm using them to distort and manipulate open GL models. so plane 1 is the x co-ordinate of a vertex, plane 2 the y co-ordinate (well thats the idea of it) This is why jit.qmovie won't work as I'll lose all the planes.

For now I've just used a sel object to bang a read message which loads the matrix state. This works, but I'd rather know if theres an index system or something else that I can use.
I tried jit.matrixset but this won't work because I ned to load all the different matrices at start up.
The dimensions of the matrices don't matter and vary according to each model that I load.

Christopher Dobrian's icon

You wrote: "I tried jit.matrixset but this won’t work because I need to load all the different matrices at start up."

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

jit.matrixset has 'write' and 'read' messages that allow you to store and recall its contents in a file, just as you would do with most presets.

Andro's icon

Christopher, that is such an amazing simple patch ! Thank you so much !
Problem solved :)

nleonard's icon

Christopher, firstly I have admired your work for years. Your examples and insights have been a huge help.

Is it faster to access data in 16 discreet matrices in realtime, as opposed to accessing data in 16 matrices combined in one matrixset? I've written a patch that accesses matrix data around 15 times per second. The matrices are [1 char 1024 1024].

Thank you!