Forums > Jitter

passing constants to jit.expr in javascript?

October 16, 2012 | 4:37 am

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.


Viewing 1 post (of 1 total)