"Buffer" of custom length in mxj~

Jan 8, 2012 at 2:59pm

"Buffer" of custom length in mxj~

Hello everybody!

I try to use a java class through mxj~ to output some sound. My problem is that I cannot “send as buffer” an array which is as “large” as I want, i.e. the length of the array is 64.

For example, the code below would print 64 on the Max window.

import com.cycling74.max.*;
import com.cycling74.msp.*;

public class MyTestClass extends MSPPerformer{
public MyTestClass(){
declareInlets(new int[]{DataTypes.ALL});
declareOutlets(new int[]{SIGNAL});
}

public void perform(MSPSignal[] in , MSPSignal[] out){
float[] myOut = out[0].vec;

post(“” + myOut.length);
}
}

THE QUESTION:
Is there a way to define the length of the out[0].vec?

I have searched a lot through the forums, but being realy new to java externals I might have stepped into the answer without realizing it!

#61096
Jan 8, 2012 at 5:01pm

If you don’t need audio into the mxj~ then try mxj. Have a look at the help file for ‘mxj buf.Op’ it has a ‘setLength’ message.

#220186

You must be logged in to reply to this topic.