Problem with jit.iter

tenman's icon

I've got a patch designed to function as a pattern recorder for a monome or similar. It is all making sense apart from the jit.iter function that I am expecting to relay the co-ordinates of the altered cell in the matrix being passed into it, however it instead always the maximum co-ordinate of the matrix (bottom right corner).

I think I'm mis-understanding the function of jit.iter.

Any help gratefully recieved.

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

Thanks
D

Luke Woodbury's icon

If you hook a print up you'll see it is printing all the cells in the matrix, you are just seeing the last message to arrive in your message box (never trust message boxes for debugging!). Are you expecting jit.change to only output a changed cell? It actually outputs a whole frame and then jit.iter spits them out one at a time.

tenman's icon

I see! Thank you that is very helpful indeed, i'll just need to put some route's on the output in order to purely differentiate the changed cells. Is there a particularly smarter way of doing that then just using route?

cap10subtext's icon

I'm not saying this is a smart way, a good way or the right way, but this just happened to be something I had to try to do a long while ago. In some ways it feels like chasing your tail because the numbers you use to test it are the same numbers you end up with, but I can understand some instances where it's necessary. However this ensures you only get a bang once on change for each coordinate from 0 - 1 and from 1 - 0.

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

The right outlet outputs the numbers that have changed from 0 - 1 by outputting the coordinates and 255.
The left outlet outputs the numbers that have changed from 1 - 0 by outputting the coordinates and a 1.

Luke Woodbury's icon

I did wonder if there was a particular reason you were using matrices? I normally do things like recording patterns with a coll or just sticking the preset object on a matrixctrl.

tenman's icon

That's really helpful cap10! Thanks a lot.

To be honest matrices were the first solution i stumbled upon, and the analogy of the recording with frames of film kind of appealed to me. Do you think it's a very inefficient way to go about things?

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

Well, it depends what you want to do I guess. Maybe not too inefficient, but it seems a bit convoluted compared to something like this: