src/codeandchords/ModuleMenu.java
public void smoothAmpScale(/*int curAmp,*/int inputNum)
	{
		this.inputNumErrorCheck(inputNum);

		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.goalAmpScale[inputNum]	= 0;
		} else {
			this.goalAmpScale[inputNum]	= curAmp / this.forteThreshold[inputNum];
		} // else

		if(this.ampCheckpoint[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.curHue[inputNum][i] < this.goalHue[inputNum][i] - (this.colorAdd[inputNum][i] / 2))
				{
					this.curHue[inputNum][i]	=	this.curHue[inputNum][i] + this.colorAdd[inputNum][i];
				} else 
					// otherwise, if it's more than the goal Hue, even after adding half of colorAdd, then subtract:
					if(this.curHue[inputNum][i] > this.goalHue[inputNum][i] + (this.colorAdd[inputNum][i] / 2))
					{
						this.curHue[inputNum][i]	=	this.curHue[inputNum][i] - this.colorAdd[inputNum][i];
					}
			} // for - i

			this.ampCheckpoint[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.goalHue[inputNum][i] - 5;
			highBound	= this.goalHue[inputNum][i] + 5;

			// Now check colors for whether they have moved into the boundaries:
			if(this.curHue[inputNum][i] < highBound && this.curHue[inputNum][i] > lowBound) {
				// if here, color has been reached.
				this.colorReachedArray[inputNum][i]	= true;
			} else {
				this.colorReachedArray[inputNum][i]	= 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] && !colorReached[inputNum]) 
		{	
			this.attRelTranPos[inputNum]	= 0;
			//			System.out.println("	attack!!!!");
		} else if(!this.nowBelow[inputNum] && colorReached[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.curHue[inputNum].length; i++)
		{
			this.colorRange[inputNum][i]	= Math.abs(this.goalHue[inputNum][i] - this.curHue[inputNum][i]);

			// 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.colorRange[inputNum][i] / (this.attRelTranVals[inputNum][this.attRelTranPos[inputNum]] / 50));

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

	}
/**
	 * In progress; will eventually allow shape size to change smoothly over time,
	 * like fade() does to color, rather than jumping as it currently does. (Mar. 2018)
	 * 
	 * @param inputNum
	 */
In progress; will eventually allow shape size to change smoothly over time,
like fade() does to color, rather than jumping as it currently does. (Mar. 2018)

@param inputNum
In progress ; will eventually allow shape size to change smoothly over time like fade () does to color rather than jumping as it currently does . ( Mar . 2018 ) @param inputNum
public void smoothAmpScale(/*int curAmp,*/int inputNum)
	{
		this.inputNumErrorCheck(inputNum);
		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.goalAmpScale[inputNum]	= 0;
		} else {
			this.goalAmpScale[inputNum]	= curAmp / this.forteThreshold[inputNum];
		} 
		if(this.ampCheckpoint[inputNum] < this.parent.millis())
		{
			for(int i = 0; i < 3; i++)
			{				
				if(this.curHue[inputNum][i] < this.goalHue[inputNum][i] - (this.colorAdd[inputNum][i] / 2))
				{
					this.curHue[inputNum][i]	=	this.curHue[inputNum][i] + this.colorAdd[inputNum][i];
				} else 
					if(this.curHue[inputNum][i] > this.goalHue[inputNum][i] + (this.colorAdd[inputNum][i] / 2))
					{
						this.curHue[inputNum][i]	=	this.curHue[inputNum][i] - this.colorAdd[inputNum][i];
					}
			} 
			this.ampCheckpoint[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.goalHue[inputNum][i] - 5;
			highBound	= this.goalHue[inputNum][i] + 5;
			if(this.curHue[inputNum][i] < highBound && this.curHue[inputNum][i] > lowBound) {
				this.colorReachedArray[inputNum][i]	= true;
			} else {
				this.colorReachedArray[inputNum][i]	= false;
			}
		} 
		this.colorReached[inputNum]	= this.colorReachedArray[inputNum][0] && this.colorReachedArray[inputNum][1] && this.colorReachedArray[inputNum][2];
		if(!this.nowBelow[inputNum] && !colorReached[inputNum]) 
		{	
			this.attRelTranPos[inputNum]	= 0;
		} else if(!this.nowBelow[inputNum] && colorReached[inputNum]) {
			this.attRelTranPos[inputNum]	= 2;
		} else if(this.nowBelow[inputNum]) {
			this.attRelTranPos[inputNum]	= 1;
		}
		for(int i = 0; i < this.curHue[inputNum].length; i++)
		{
			this.colorRange[inputNum][i]	= Math.abs(this.goalHue[inputNum][i] - this.curHue[inputNum][i]);
			float addThis = (int)(this.colorRange[inputNum][i] / (this.attRelTranVals[inputNum][this.attRelTranPos[inputNum]] / 50));
			this.colorAdd[inputNum][i]	= (int)addThis;	
		} 
	}
public void smoothAmpScale ( /*int curAmp,*/ int inputNum ) { this . inputNumErrorCheck ( inputNum ) ; 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 . goalAmpScale [ inputNum ] = 0 ; } else { this . goalAmpScale [ inputNum ] = curAmp / this . forteThreshold [ inputNum ] ; } if ( this . ampCheckpoint [ inputNum ] < this . parent . millis ( ) ) { for ( int i = 0 ; i < 3 ; i ++ ) { if ( this . curHue [ inputNum ] [ i ] < this . goalHue [ inputNum ] [ i ] - ( this . colorAdd [ inputNum ] [ i ] / 2 ) ) { this . curHue [ inputNum ] [ i ] = this . curHue [ inputNum ] [ i ] + this . colorAdd [ inputNum ] [ i ] ; } else if ( this . curHue [ inputNum ] [ i ] > this . goalHue [ inputNum ] [ i ] + ( this . colorAdd [ inputNum ] [ i ] / 2 ) ) { this . curHue [ inputNum ] [ i ] = this . curHue [ inputNum ] [ i ] - this . colorAdd [ inputNum ] [ i ] ; } } this . ampCheckpoint [ 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 . goalHue [ inputNum ] [ i ] - 5 ; highBound = this . goalHue [ inputNum ] [ i ] + 5 ; if ( this . curHue [ inputNum ] [ i ] < highBound && this . curHue [ inputNum ] [ i ] > lowBound ) { this . colorReachedArray [ inputNum ] [ i ] = true ; } else { this . colorReachedArray [ inputNum ] [ i ] = false ; } } this . colorReached [ inputNum ] = this . colorReachedArray [ inputNum ] [ 0 ] && this . colorReachedArray [ inputNum ] [ 1 ] && this . colorReachedArray [ inputNum ] [ 2 ] ; if ( ! this . nowBelow [ inputNum ] && ! colorReached [ inputNum ] ) { this . attRelTranPos [ inputNum ] = 0 ; } else if ( ! this . nowBelow [ inputNum ] && colorReached [ inputNum ] ) { this . attRelTranPos [ inputNum ] = 2 ; } else if ( this . nowBelow [ inputNum ] ) { this . attRelTranPos [ inputNum ] = 1 ; } for ( int i = 0 ; i < this . curHue [ inputNum ] . length ; i ++ ) { this . colorRange [ inputNum ] [ i ] = Math . abs ( this . goalHue [ inputNum ] [ i ] - this . curHue [ inputNum ] [ i ] ) ; float addThis = ( int ) ( this . colorRange [ inputNum ] [ i ] / ( this . attRelTranVals [ inputNum ] [ this . attRelTranPos [ inputNum ] ] / 50 ) ) ; this . colorAdd [ inputNum ] [ i ] = ( int ) addThis ; } }
In progress; will eventually allow shape size to change smoothly over time,
 like fade() does to color, rather than jumping as it currently does.
In progress ; will eventually allow shape size to change smoothly over time like fade () does to color rather than jumping as it currently does .
// 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: // 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: // divide the attack/release/transition value by 50 // and divide colorRange by that value to find the amount to add each 50 millis. // for