Getting Jitter matrix info into JS

May 21, 2008 at 8:37pm

Getting Jitter matrix info into JS

I am trying to convert a way that I use jit.expr into javascript, but I am running into a problem getting javascript to call information about the incoming matrix, in this case its dimensions. I went through the tutorials but did not see anything about taking attributes from an input matrix.

The following patch shows the feature I want, the output matrix has the same dimensions as any input matrix.

– Pasted Max Patch, click to expand. –

To recreate this in javascript, I thought I could create a matrix and rescale it based on the incoming matrix something like this

var result_matrix = new JitterMatrix(1, “float32″, 120, 1);
function jit_matrix(matrix_in)
result_matrix.dim = matrix_in.dim;
myexpr = new JitterObject(“jit.expr”);
myexpr.expr = “in[0] + norm[0]“;
myexpr.matrixcalc(matrix_in, result_matrix)
outlet(0, “jit_matrix”,;

…but matrix_in.dim is undefined. What can I do?


You must be logged in to reply to this topic.