XML Feeds

.

[java-dev] Re: Eclipse Weirdness

Oliver Bown ollie at icarus.nu
Thu Sep 6 03:11:51 MDT 2007


(currentTime < timeOfFirstCoffee && haveFlu) but my guess is the "if 
(iReverseSound)" block should be outside the loop.

O

On 5 Sep 2007, at 14:34, Matthew Aidekman wrote:

>
> 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;  	
>
> 		}
> 	}
> }
>
>
>
>
> _______________________________________________
> java-dev mailing list
> java-dev at cycling74.com
> http://www.cycling74.com/mailman/listinfo/java-dev



More information about the java-dev mailing list