Use only part of a matrix

evillordzenu's icon

Hi Guys,

I'm working on a patch using a jitter matrix. I need to isolate a certain part of the image and turn the rest of the values in the matrix to 0 (in real time). I tried to use an MXJ object but have ran into issues with loss of frames, and the code was also not very good at accomplishing the task, even though logically it should have worked. Is there any object within the max library that could isolate a box in the image from four cordinates, i.e. the top left right and bottom left right. Any help would be greatly appreciated.

Thanks,
Alan

seejayjames's icon

jit.submatrix? jit.scissors? you can use these smaller pieces and put into another matrix that's otherwise all 0 values.

probably there is a clever way to use jit.op as well.

cap10subtext's icon

Here's a tutorial patch I've used in my class which my old instructor gave to me. Jit.submatrix basically does the same thing, but this is a way to do it without any extra objects.

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

Explains the usedstdim and usesrcdim attibutes and how to control them with srcdimstart, srcdimend, dstdimstart, and dstdimend.

evillordzenu's icon

Thanks for the help guys, I'll try both of these methods and see if I achieve my original goal.

evillordzenu's icon

Thanks cap10subtext, works a treat.