Forums > Jitter

why do I need to reverse the [t I I] in this patch?


Per
August 18, 2011 | 1:10 pm

Hi!

Im using patch for framedifferencing and trying to understand whats going on in the patch.

I dont understand why i need to cross attache the [t I I] object to display the difference. If Im not Im not just getting a picture when something is changing:

so:
1) why do I need the [t l l] object

2) why do I need to cross connect the [t l l]

– Pasted Max Patch, click to expand. –

August 18, 2011 | 1:38 pm

By crossing the patch cords this happens:
1) You pass the current matrix, and then store it by passing it by the absdiff right inlet (this is how the function absdiff works: compares current matrix with a value or an stored matrix).
2)Then you pass a new current matrix, and as you have stored a matrix in the previous frame, then absdiff will have something to compare with (the previously stored frame).

The first time no comparison is made, as there is no matrix stored yet.



MIB
August 18, 2011 | 1:41 pm

think about what you need and then the order of operations:
you need: previous frame to be subtracted from the current frame. So somehow you have "store" it befor the next frame comes along.
now, order of operations: if you have a [t l l] the right "l" is sent out first, then the left. So if the right one goes into the left inlet of [jit.op] it triggers the computation, then it puts the current frame into "storage" for the next computation in the right inlet (ie. no output). next (new) frame comes along, first goes into the left inlet and triggers the computation with the previously "stored" frame, then puts the current frame into "storage",…

make sense??



Per
August 18, 2011 | 1:44 pm

thanks

but why do I need to reverse them? Im thinking that:

- max sends messages from right to left
- [jit.op @op absdiff] needs to get the signal to compare into the right inlet before the left
- then the right outlet should be connected to the right inlet of [jit.op @op absdiff] and not the left outlet.

why?


August 18, 2011 | 1:47 pm

I think that if you don’t reverse the patch cords, then you would always be comparing the matrix with itself all the time (you send the matrix to the right inlet, then to the left index, then comparison is made….they are the same matrices!)

You are right that jit.op@absdiff needs the right inlet input first in order to "compare" something, that is why (and this is my own guess)the first time you use jit.op absdiff, it considers that it has a null-matrix stored (a matrix in which all cells are 0). So the comparison is made with 0.



MIB
August 18, 2011 | 2:49 pm
– Pasted Max Patch, click to expand. –


Per
August 21, 2011 | 12:26 pm

ok thanks!

one more question though.

what exactly does this mean [jit.op @op > @val 0.1]


November 1, 2011 | 9:14 am

Hi,
I’m trying to use this operator in a complex JS code full of matrix.
Has someone any idea on how to do that framedifferencing in JS.
Here’s one attempt without success.
The question is how to manage the "inlets".
Is this at least possible in JS?
Thanks

autowatch = 1;
outlets = 2;

var mtrxone = new JitterMatrix(1, "float32", 2, 2);
var mtrxtwo = new JitterMatrix(1, "float32", 2, 2);
var mtrxthree = new JitterMatrix(1, "float32", 2, 2);

function jit_matrix(name)
{
mtrxone.name = name;
mtrxone.name = name;
outlet(1, "jit_matrix", mtrxone.name);
}

function bang()
{

jit_matrix();
mtrxthree.op("absdiff", mtrxtwo, mtrxone);
outlet(0, "jit_matrix", mtrxthree.name);
}


Viewing 8 posts - 1 through 8 (of 8 total)