Problem with jit.iter

Oct 11, 2011 at 9:21pm

Problem with jit.iter

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.

Thanks
D

– Pasted Max Patch, click to expand. –
#59259
Oct 11, 2011 at 9:56pm

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.

#212978
Oct 12, 2011 at 2:18pm

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?

#212979
Oct 12, 2011 at 4:17pm

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.

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.

– Pasted Max Patch, click to expand. –
#212980
Oct 12, 2011 at 6:39pm

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.

#212981
Oct 13, 2011 at 6:26pm

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?

#212982
Oct 14, 2011 at 1:40pm

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:

– Pasted Max Patch, click to expand. –
#212983

You must be logged in to reply to this topic.