JitterObject Java - using multiple inlets/matrix with matrixcalc
Hi all,
I've been wondering about how to use objects like "jit.expr", "jit.convolve", etc... for a while now.
As you should all know, a simple 1-in 1-out matrix calculation can be performed like this:
JitterObject myExpr = new JitterObject("jit.expr");
myExpr.setAttr("expr", "in[0]+1");
myExpr.matrixcalc(inputmatrix, outputmatrix);
However, if you want to use several inputs/inlets you need to set up a JITTER MATRIX ARRAY and feed it to the JitterObject like this;
JitterMatrix[] inputs = new JitterMatrix[] { new JitterMatrix(args...), new JitterMatrix(args...) };
JitterObject myExpr = new JitterObject("jit.expr");
myExpr.setAttr("expr", "in[0]+in[1]");
myExpr.matrixcalc(inputs, outputmatrix);
I haven't tested, but I'm assuming that the same can be said for output matrix arrays.
Enjoy,
Darius