matrixcalc with obj with more than 1 input in Java

Apr 3, 2006 at 6:11am

matrixcalc with obj with more than 1 input in Java

(Sorry ..new in Java)

I got the point in JS passing an Array of matrix trough the “matrixcalc” method for Jitter objects with more than 1 input (or output..).
But in Java what will be the syntax ?..
I’ve tried something like :
(where m m1 m2 are JitterMatrix and myobj a JitterObject)
myobj.matrixcalc(new JitterMatrix[]{m1,m2},m);
and the compiler returns :
incompatible types
found :com.cycling74.jitter.JitterObject
required :com.cycling74.jitter.JitterMatrix

I guess i’m missing the point creating an Array of JitterMatrix…
(Sorry ..new in Java)

Help !

#25199
Apr 3, 2006 at 11:40pm

Hi Pascal,

I just made the following class and everything seems to be working
okay. Let me know if this code doesn’t help you.

Ben

import com.cycling74.max.*;
import com.cycling74.jitter.*;

public class matrixcalctest extends MaxObject {

JitterObject jo = new JitterObject(“jit.op”);

public void jit_matrix(String mname)
{
JitterMatrix out = new JitterMatrix();
JitterMatrix arr[] = new JitterMatrix[] {new JitterMatrix(), new
JitterMatrix()};
arr[0].frommatrix(mname);
arr[1].frommatrix(mname);
out.frommatrix(mname);

jo.send(“op”, “+”);
jo.matrixcalc(arr, out);

outlet(0, “jit_matrix”, out.getName());
}
}

Ben

#73900
Apr 3, 2006 at 11:43pm

Without seeing more code, this doesn’t look like an error resulting
from myobj.matrixcalc(new JitterMatrix[]{m1,m2},m); since matrixcalc
(Object,Object) should accept the following input. It wouldd appear
that elsewhere you are using myobj (or some other instance of
JitterObject in place of a required JitterMatrix type). Could m1 or
m2 be JitterObject instead of JitterMatrix? Might want to post a
minimal, but similarly offending .java file for more feedback.

-Joshua

#73901
Apr 4, 2006 at 9:54am

Thanks a lot ..for the precision ..and sorry for the noise.
My “JitterMatrix”..were created as behind “JitterObject”..so changing the declaration ..solve my problems..
Need to read more deeply the Jitter Java Docs..

Pascal

#73902

You must be logged in to reply to this topic.