a jit.gen patcher of my own that doesn't work

vichug's icon

Hey,

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

So i'm trying to make somethign that would seem logically simple, with jitter matrices, but i couldn't really figure out how to do this simply, so i thought "hey, that's an occasion to learn some jit.gen !"
And here i am, with i think basic noobish errors inside my gen abstraction. I tried a little to find appropriate tutorials, but there aren't that many, and i thought it would be maybe faster to ask some help from You, Ô gentle crowd !
So the patch is here :

and the logic is as follow :
each input is a matrix.
The third is an incoming matrix.
The second is a matrix that has been previously processed by an effect, that comes after the jit.gen. That effect affects only some of the cells.
The first input is... the previous incoming matrix.
What i'm trying to do here is :
-compare each cell of the previously incoming matrix and the resulting processed matrix that had come out from that input
-if a cell is the same in each of the compared matrix, it is replaced by the corresponding cell from the currently incoming matrix, ie the third inlet
-if a cell differs in the previously input matrix and the resulting processed matrix from that previous input, then the corresponding cell is taken from the "resulting processed matrix from that previous input"
-the output should be a mix of the two operations.

-from my point of view, it should work... but i'm biased.

So, yeah...... i hope it's.... clear.

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

(for the record : solved using codebox

)

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

?

Wesley Smith's icon

Hi vichug
[sample] is not a reliable operator for exact comparisons because it uses linear interpolation. You could use [nearest], but since you're not warping the sampling coordinates, you don't even need that. As gregory showed, you can just make use of the inputs directly.

vichug's icon

Hey,

Somehow I did not notice the answers to this, thanks. Jit.gen is a little clearer now :)