[java-dev] Re: Eclipse Weirdness
Matthew Aidekman
puuukeey at comcast.net
Wed Sep 5 07:34:00 MDT 2007
- Previous message: [java-dev] Re: Eclipse Weirdness
- Next message: [java-dev] Re: Eclipse Weirdness
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ok. I think I've got eclipse and quickie generating the same results. still whats so complicated about the following code?
I would expect the line
runningPosition+=currScrollSpeed; not to always evaluate to -1.
import com.cycling74.max.*;
import com.cycling74.msp.*;
public class plusequalstest extends MSPPerformer
{
boolean iReverseSound = true; //reverse scrollspeed
float iBaseScrollSpeed = 1.f ; //scrollspeed
float runningPosition = 0.f;
private static final String[] INLET_ASSIST = new String[]{
"input (sig)"
};
private static final String[] OUTLET_ASSIST = new String[]{
"output (sig)"
};
public plusequalstest(float gain)
{
declareInlets(new int[]{SIGNAL});
declareOutlets(new int[]{SIGNAL});
setInletAssist(INLET_ASSIST);
setOutletAssist(OUTLET_ASSIST);
}
public void dspsetup(MSPSignal[] ins, MSPSignal[] outs)
{
//If you forget the fields of MSPSignal you can select the classname above
//and choose Open Class Reference For Selected Class.. from the Java menu
}
public void perform(MSPSignal[] ins, MSPSignal[] outs)
{
int i;
float[] in = ins[0].vec;
float[] out = outs[0].vec;
float currScrollSpeed = iBaseScrollSpeed;
for(i = 0; i < in.length;i++)
{
if(iReverseSound)
currScrollSpeed= -1* currScrollSpeed;
runningPosition+=currScrollSpeed;
out[i] =runningPosition;
}
}
}
- Previous message: [java-dev] Re: Eclipse Weirdness
- Next message: [java-dev] Re: Eclipse Weirdness
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
