src/codeandchords/ModuleMenu.java
public void fadeShapeSize(int position, int inputNum)
	{
		this.inputNumErrorCheck(inputNum);

		if(position > this.colorSelect.length || position < -1) {
			throw new IllegalArgumentException("ModuleTemplate.fadeColor: position " + position + 
					" is out of bounds; must be between -1 (signifying canvas color) or " + (this.colorSelect.length - 1));
		} // error checking

		float	curAmp;
		curAmp = this.input.getAmplitude(inputNum);
		/*
		if(!this.recInputPlaying)
		{
			curAmp = this.input.getAmplitude(inputNum);
		} else {
			curAmp	= this.recInput.getAmplitude(inputNum);
		}
		*/

		if(curAmp < this.pianoThreshold[inputNum])	
		{
			this.nowBelow[inputNum]	= true;

			/*
			for(int i = 0; i < this.goalHue[inputNum].length; i++)
			{
				this.goalHue[inputNum][i]	= this.canvasColor[i];
			} // for - canvas
*/
		} else {
			this.nowBelow[inputNum]	= false;
/*
			this.goalHue[inputNum]	= this.applyThresholdSBModulate(curAmp, inputNum, position);
			*/
		} // else

		if(this.shapeSizeCheckpoint[inputNum] < this.parent.millis())
		{
			for(int i = 0; i < 3; i++)
			{				
				// if the current hue is less than the goalHue - the colorAdd, then add colorAdd:
				if(this.curShapeSize[inputNum] < this.goalShapeSize[inputNum] - (this.shapeSizeAdd[inputNum] / 2))
				{
					this.curShapeSize[inputNum]	=	this.curShapeSize[inputNum] + this.shapeSizeAdd[inputNum];
				} else 
					// otherwise, if it's more than the goal Hue, even after adding half of colorAdd, then subtract:
					if(this.curShapeSize[inputNum] > this.goalShapeSize[inputNum] + (this.shapeSizeAdd[inputNum] / 2))
					{
						this.curShapeSize[inputNum]	=	this.curShapeSize[inputNum] - this.shapeSizeAdd[inputNum];
					}
			} // for - i

			this.shapeSizeCheckpoint[inputNum] = (this.parent.millis() + 50);
		} // if - adding every 50 millis

		/*
		System.out.println("curHue: " + this.curHue[0][0] + ", "
				+ this.curHue[0][1] + ", "
				+ this.curHue[0][2]);
		System.out.println("goalHue: " + this.goalHue[0][0] + ", "
						+ this.goalHue[0][1] + ", "
						+ this.goalHue[0][2]);

		System.out.println("input.getAmplitude() = " + input.getAmplitude());

		System.out.println("colorAdd: " + this.colorAdd[0][0] + ", "
				+ this.colorAdd[0][1] + ", "
				+ this.colorAdd[0][2]);
		 */

		float	lowBound;
		float	highBound;

		for (int i = 0; i < 3; i++)
		{
			lowBound	= this.goalShapeSize[inputNum] - 5;
			highBound	= this.goalShapeSize[inputNum] + 5;

			// Now check colors for whether they have moved into the boundaries:
			if(this.curShapeSize[inputNum] < highBound && this.curShapeSize[inputNum] > lowBound) {
				// if here, color has been reached.
				this.shapeSizeReached[inputNum]	= true;
			} else {
				this.shapeSizeReached[inputNum]	= false;
			}
		} // for

		// If all elements of the color are in range, then the color has been reached:
//		this.colorReached[inputNum]	= this.colorReachedArray[inputNum][0] && this.colorReachedArray[inputNum][1] && this.colorReachedArray[inputNum][2];

		// If coming from a low amplitude note and not yet reaching a color,
		// use the attack value to control the color change:
		if(!this.nowBelow[inputNum] && !shapeSizeReached[inputNum]) 
		{	
			this.attRelTranPos[inputNum]	= 0;
			//			System.out.println("	attack!!!!");
		} else if(!this.nowBelow[inputNum] && shapeSizeReached[inputNum]) {
			// Or, if coming from one super-threshold note to another, use the transition value:
			this.attRelTranPos[inputNum]	= 2;
			//			System.out.println("	transition.... transition [doooooo do dooo do do ] - transition!");
		} else if(this.nowBelow[inputNum]) {
			// Or, if volume fell below the threshold, switch to release value:
			this.attRelTranPos[inputNum]	= 1;
			//			System.out.println("	re....lent! re...coil! re...verse!");
		}

		// Calculate color ranges:
//		for(int i = 0; i < this.curShapeSize[inputNum].length; i++)
//		{
			this.shapeSizeRange[inputNum]	= Math.abs(this.goalShapeSize[inputNum] - this.curShapeSize[inputNum]);

			// divide the attack/release/transition value by 50
			// and divide colorRange by that value to find the amount to add each 50 millis.
			float addThis = (int)(this.shapeSizeRange[inputNum] / (this.attRelTranVals[inputNum][this.attRelTranPos[inputNum]] / 50));

			this.shapeSizeAdd[inputNum]	= (int)addThis;	
//		} // for

	}
/**
	 * Takes the values of curHue from its current values to the values in goalHue
	 * over the time that is designated by the attack, release, and transition sliders
	 * 
	 * @param position	position in colors to which curHue should fade
	 */
Takes the values of curHue from its current values to the values in goalHue
over the time that is designated by the attack, release, and transition sliders

@param position      position in colors to which curHue should fade
Takes the values of curHue from its current values to the values in goalHue over the time that is designated by the attack release and transition sliders @param position position in colors to which curHue should fade
public void fadeShapeSize(int position, int inputNum)
	{
		this.inputNumErrorCheck(inputNum);
		if(position > this.colorSelect.length || position < -1) {
			throw new IllegalArgumentException("ModuleTemplate.fadeColor: position " + position + 
					" is out of bounds; must be between -1 (signifying canvas color) or " + (this.colorSelect.length - 1));
		} 
		float	curAmp;
		curAmp = this.input.getAmplitude(inputNum);
		/*
		if(!this.recInputPlaying)
		{
			curAmp = this.input.getAmplitude(inputNum);
		} else {
			curAmp	= this.recInput.getAmplitude(inputNum);
		}
		*/
		if(curAmp < this.pianoThreshold[inputNum])	
		{
			this.nowBelow[inputNum]	= true;
			/*
			for(int i = 0; i < this.goalHue[inputNum].length; i++)
			{
				this.goalHue[inputNum][i]	= this.canvasColor[i];
			}  - canvas
*/
		} else {
			this.nowBelow[inputNum]	= false;
/*
			this.goalHue[inputNum]	= this.applyThresholdSBModulate(curAmp, inputNum, position);
			*/
		} 
		if(this.shapeSizeCheckpoint[inputNum] < this.parent.millis())
		{
			for(int i = 0; i < 3; i++)
			{				
				if(this.curShapeSize[inputNum] < this.goalShapeSize[inputNum] - (this.shapeSizeAdd[inputNum] / 2))
				{
					this.curShapeSize[inputNum]	=	this.curShapeSize[inputNum] + this.shapeSizeAdd[inputNum];
				} else 
					if(this.curShapeSize[inputNum] > this.goalShapeSize[inputNum] + (this.shapeSizeAdd[inputNum] / 2))
					{
						this.curShapeSize[inputNum]	=	this.curShapeSize[inputNum] - this.shapeSizeAdd[inputNum];
					}
			} 
			this.shapeSizeCheckpoint[inputNum] = (this.parent.millis() + 50);
		} 
		/*
		System.out.println("curHue: " + this.curHue[0][0] + ", "
				+ this.curHue[0][1] + ", "
				+ this.curHue[0][2]);
		System.out.println("goalHue: " + this.goalHue[0][0] + ", "
						+ this.goalHue[0][1] + ", "
						+ this.goalHue[0][2]);
		System.out.println("input.getAmplitude() = " + input.getAmplitude());
		System.out.println("colorAdd: " + this.colorAdd[0][0] + ", "
				+ this.colorAdd[0][1] + ", "
				+ this.colorAdd[0][2]);
		 */
		float	lowBound;
		float	highBound;
		for (int i = 0; i < 3; i++)
		{
			lowBound	= this.goalShapeSize[inputNum] - 5;
			highBound	= this.goalShapeSize[inputNum] + 5;
			if(this.curShapeSize[inputNum] < highBound && this.curShapeSize[inputNum] > lowBound) {
				this.shapeSizeReached[inputNum]	= true;
			} else {
				this.shapeSizeReached[inputNum]	= false;
			}
		} 
		if(!this.nowBelow[inputNum] && !shapeSizeReached[inputNum]) 
		{	
			this.attRelTranPos[inputNum]	= 0;
		} else if(!this.nowBelow[inputNum] && shapeSizeReached[inputNum]) {
			this.attRelTranPos[inputNum]	= 2;
		} else if(this.nowBelow[inputNum]) {
			this.attRelTranPos[inputNum]	= 1;
		}
			this.shapeSizeRange[inputNum]	= Math.abs(this.goalShapeSize[inputNum] - this.curShapeSize[inputNum]);
			float addThis = (int)(this.shapeSizeRange[inputNum] / (this.attRelTranVals[inputNum][this.attRelTranPos[inputNum]] / 50));
			this.shapeSizeAdd[inputNum]	= (int)addThis;	
//		} 
	}
public void fadeShapeSize ( int position , int inputNum ) { this . inputNumErrorCheck ( inputNum ) ; if ( position > this . colorSelect . length || position < - 1 ) { throw new IllegalArgumentException ( "ModuleTemplate.fadeColor: position " + position + " is out of bounds; must be between -1 (signifying canvas color) or " + ( this . colorSelect . length - 1 ) ) ; } float curAmp ; curAmp = this . input . getAmplitude ( inputNum ) ; /*
		if(!this.recInputPlaying)
		{
			curAmp = this.input.getAmplitude(inputNum);
		} else {
			curAmp	= this.recInput.getAmplitude(inputNum);
		}
		*/ if ( curAmp < this . pianoThreshold [ inputNum ] ) { this . nowBelow [ inputNum ] = true ; /*
			for(int i = 0; i < this.goalHue[inputNum].length; i++)
			{
				this.goalHue[inputNum][i]	= this.canvasColor[i];
			} // for - canvas
*/ } else { this . nowBelow [ inputNum ] = false ; /*
			this.goalHue[inputNum]	= this.applyThresholdSBModulate(curAmp, inputNum, position);
			*/ } if ( this . shapeSizeCheckpoint [ inputNum ] < this . parent . millis ( ) ) { for ( int i = 0 ; i < 3 ; i ++ ) { if ( this . curShapeSize [ inputNum ] < this . goalShapeSize [ inputNum ] - ( this . shapeSizeAdd [ inputNum ] / 2 ) ) { this . curShapeSize [ inputNum ] = this . curShapeSize [ inputNum ] + this . shapeSizeAdd [ inputNum ] ; } else if ( this . curShapeSize [ inputNum ] > this . goalShapeSize [ inputNum ] + ( this . shapeSizeAdd [ inputNum ] / 2 ) ) { this . curShapeSize [ inputNum ] = this . curShapeSize [ inputNum ] - this . shapeSizeAdd [ inputNum ] ; } } this . shapeSizeCheckpoint [ inputNum ] = ( this . parent . millis ( ) + 50 ) ; } /*
		System.out.println("curHue: " + this.curHue[0][0] + ", "
				+ this.curHue[0][1] + ", "
				+ this.curHue[0][2]);
		System.out.println("goalHue: " + this.goalHue[0][0] + ", "
						+ this.goalHue[0][1] + ", "
						+ this.goalHue[0][2]);

		System.out.println("input.getAmplitude() = " + input.getAmplitude());

		System.out.println("colorAdd: " + this.colorAdd[0][0] + ", "
				+ this.colorAdd[0][1] + ", "
				+ this.colorAdd[0][2]);
		 */ float lowBound ; float highBound ; for ( int i = 0 ; i < 3 ; i ++ ) { lowBound = this . goalShapeSize [ inputNum ] - 5 ; highBound = this . goalShapeSize [ inputNum ] + 5 ; if ( this . curShapeSize [ inputNum ] < highBound && this . curShapeSize [ inputNum ] > lowBound ) { this . shapeSizeReached [ inputNum ] = true ; } else { this . shapeSizeReached [ inputNum ] = false ; } } if ( ! this . nowBelow [ inputNum ] && ! shapeSizeReached [ inputNum ] ) { this . attRelTranPos [ inputNum ] = 0 ; } else if ( ! this . nowBelow [ inputNum ] && shapeSizeReached [ inputNum ] ) { this . attRelTranPos [ inputNum ] = 2 ; } else if ( this . nowBelow [ inputNum ] ) { this . attRelTranPos [ inputNum ] = 1 ; } this . shapeSizeRange [ inputNum ] = Math . abs ( this . goalShapeSize [ inputNum ] - this . curShapeSize [ inputNum ] ) ; float addThis = ( int ) ( this . shapeSizeRange [ inputNum ] / ( this . attRelTranVals [ inputNum ] [ this . attRelTranPos [ inputNum ] ] / 50 ) ) ; this . shapeSizeAdd [ inputNum ] = ( int ) addThis ; }
Takes the values of curHue from its current values to the values in goalHue
 over the time that is designated by the attack, release, and transition sliders
Takes the values of curHue from its current values to the values in goalHue over the time that is designated by the attack release and transition sliders
// error checking // else // if the current hue is less than the goalHue - the colorAdd, then add colorAdd: // otherwise, if it's more than the goal Hue, even after adding half of colorAdd, then subtract: // for - i // if - adding every 50 millis // Now check colors for whether they have moved into the boundaries: // if here, color has been reached. // for // If all elements of the color are in range, then the color has been reached: //		this.colorReached[inputNum]	= this.colorReachedArray[inputNum][0] && this.colorReachedArray[inputNum][1] && this.colorReachedArray[inputNum][2]; // If coming from a low amplitude note and not yet reaching a color, // use the attack value to control the color change: //			System.out.println("	attack!!!!"); // Or, if coming from one super-threshold note to another, use the transition value: //			System.out.println("	transition.... transition [doooooo do dooo do do ] - transition!"); // Or, if volume fell below the threshold, switch to release value: //			System.out.println("	re....lent! re...coil! re...verse!"); // Calculate color ranges: //		for(int i = 0; i < this.curShapeSize[inputNum].length; i++) //		{ // divide the attack/release/transition value by 50 // and divide colorRange by that value to find the amount to add each 50 millis. //		} // for