passing constants to jit.expr in javascript?

Oct 16, 2012 at 4:37am

passing constants to jit.expr in javascript?

Hello. Is it possible to pass a number (not a matrix) as an input to a jit.expr object inside a javascript patch? For example the following bit of code returns an error.

var myConst = 42;
var myInMatrix = new JitterMatrix(1, “float32″, 3 ,3);
var myOutMatrix = new JitterMatrix(1, “float32″, 3 ,3);
var myExpr = new JitterObject(“jit.expr”);
myExpr.expr = “cell[0]*in[1]“;
myExpr.matrixcalc([myInMatrix, myConst], myOutMatrix);

The error reads “Matrix array argument not valid matrix or matrixname”. I believe the error is because matrixcalc expects matrix inputs. However it is possible to pass int’s and floats to jit.expr in Max. It seems like this should be possible.

Help please.

#64796

You must be logged in to reply to this topic.