src/codeandchords/ModuleMenu.java
public void sliderEvent(int id, float val)
	{
		//		System.out.println("ModuleMenu: got sliderEvent with id " + id + " and val " + val);

		// Piano Threshold:
		if(id == this.pianoThresholdSliderId)
		{
			for(int i = 0; i < this.module.getTotalNumInputs(); i++)
			{
				this.pianoThreshold[i]	= (int)val;
				this.resetThresholds(i);
			}
		} // piano threshold Slider

		// Forte Threshold:
		if(id == this.forteThresholdSliderId)
		{
			for(int i = 0; i < this.module.getTotalNumInputs(); i++)
			{
				this.forteThreshold[i]	= (int)val;
				this.resetThresholds(i);
			}
		} // forte threshold Slider

		// Attack, Release, and Transition:
		if((id >= this.getFirstARTSliderId() && id < (this.getFirstARTSliderId() + 3)) && this.getFirstARTSliderId() != -1)
		{
			//			int	pos	= (id / 2) - 1;
			int	pos	= id - this.getFirstARTSliderId();
			//			this.attackReleaseTransition[pos]	= val;

			if(global)
			{
				for(int i = 0; i < this.module.getTotalNumInputs(); i++)
				{
					this.setAttRelTranVal(pos, i, val);
				} // for
			} else {
				this.setAttRelTranVal(pos, this.currentInput, val);
			} // else - not global
		} // attack/release/transition

		// Hue/Saturation/Brightness modulate
		if((id >= this.firstHSBSliderId && id < (this.firstHSBSliderId + 3)) && this.firstHSBSliderId != -1)
		{
			//			int pos = (id/2)-7;
			int pos = id - this.firstHSBSliderId;

			this.setHueSatBrightnessMod(pos, val);

			//					this.applyHSBModulate(this.hsbColors);
			this.applyHSBModulate();
		}//hsb mod

		// Red Modulate/Green Modulate/Blue Modulate:
		if((id >= this.firstRGBSliderId && id < (this.firstRGBSliderId + 3)) && this.firstRGBSliderId != -1)
		{
			//			int	pos	= (id / 2) - 4;		
			int	pos	= id - this.firstRGBSliderId;	// red = 0, green = 1, blue = 2

			this.redGreenBlueMod[pos]	= val;
			this.applyRGBModulate();
		} // red/green/blue mod

		if( id == this.bpmSliderId)
		{
			this.bpm	= Math.max(Math.min((int)val, 240), 0);
		}

		if(id == this.volumeSliderId)
		{
			this.instrument.setVolume(Math.max(Math.min(val, 5), 0));
		}

		if(id == this.shapeSizeSliderId)
		{
			for(int i = 0; i < this.shapeSize.length; i++)
			{
				this.shapeSize[i]	= val;
			}
		}

		// Saturation and Brightness Threshold and Percent Sliders:
		if( ( id >= this.firstSatBrightThreshSliderId ) && ( id < this.firstSatBrightThreshSliderId + 4 ) 
				&& this.firstSatBrightThreshSliderId != -1)
		{

			int		arrayPos	= (id - this.firstSatBrightThreshSliderId /*- 1*/) / 2;
			float	forteThreshPercent;

			for(int i = this.startHere; i < this.endBeforeThis; i++)
			{
				// Percent Sliders
				if((id - this.firstSatBrightThreshSliderId) % 2 == 0)
				{
					this.satBrightPercentVals[i][arrayPos]		= val;

					// The percent of forte slider that the threshold should be:
					forteThreshPercent	= this.controlP5.getValue("slider" + (id + 1));
					//				percentVal		= controlEvent.getValue();
				} else {
					// Threshold Sliders:

					forteThreshPercent	= val;
					this.satBrightPercentVals[i][arrayPos]		= this.controlP5.getValue("slider" + (id - 1));
				}

				this.satBrightThresholdVals[i][arrayPos]	= this.pianoThreshold[i] + (this.forteThreshold[i] * forteThreshPercent);

			} // for
		} // Saturation and Brightness Threshold and Percent Sliders

		// Alpha Slider:
		if(id > 0 && id == this.alphaSliderId)
		{
			this.alphaVal	= (int)val;
		} // alpha Slider
	}
/**
	 * Called from MenuTemplate for Sliders that were added by the addSliderGroup() method
	 * and are connected to a Textfield (MenuTemplate has already updated the Textfield value).
	 */
Called from MenuTemplate for Sliders that were added by the addSliderGroup() method
and are connected to a Textfield (MenuTemplate has already updated the Textfield value).
Called from MenuTemplate for Sliders that were added by the addSliderGroup () method and are connected to a Textfield ( MenuTemplate has already updated the Textfield value ) .
public void sliderEvent(int id, float val)
	{
		if(id == this.pianoThresholdSliderId)
		{
			for(int i = 0; i < this.module.getTotalNumInputs(); i++)
			{
				this.pianoThreshold[i]	= (int)val;
				this.resetThresholds(i);
			}
		} 
		if(id == this.forteThresholdSliderId)
		{
			for(int i = 0; i < this.module.getTotalNumInputs(); i++)
			{
				this.forteThreshold[i]	= (int)val;
				this.resetThresholds(i);
			}
		} 
		if((id >= this.getFirstARTSliderId() && id < (this.getFirstARTSliderId() + 3)) && this.getFirstARTSliderId() != -1)
		{
			int	pos	= id - this.getFirstARTSliderId();
			if(global)
			{
				for(int i = 0; i < this.module.getTotalNumInputs(); i++)
				{
					this.setAttRelTranVal(pos, i, val);
				} 
			} else {
				this.setAttRelTranVal(pos, this.currentInput, val);
			} 
		} 
		if((id >= this.firstHSBSliderId && id < (this.firstHSBSliderId + 3)) && this.firstHSBSliderId != -1)
		{
			int pos = id - this.firstHSBSliderId;
			this.setHueSatBrightnessMod(pos, val);
			this.applyHSBModulate();
		}
		if((id >= this.firstRGBSliderId && id < (this.firstRGBSliderId + 3)) && this.firstRGBSliderId != -1)
		{
			int	pos	= id - this.firstRGBSliderId;	
			this.redGreenBlueMod[pos]	= val;
			this.applyRGBModulate();
		} 
		if( id == this.bpmSliderId)
		{
			this.bpm	= Math.max(Math.min((int)val, 240), 0);
		}
		if(id == this.volumeSliderId)
		{
			this.instrument.setVolume(Math.max(Math.min(val, 5), 0));
		}
		if(id == this.shapeSizeSliderId)
		{
			for(int i = 0; i < this.shapeSize.length; i++)
			{
				this.shapeSize[i]	= val;
			}
		}
		if( ( id >= this.firstSatBrightThreshSliderId ) && ( id < this.firstSatBrightThreshSliderId + 4 ) 
				&& this.firstSatBrightThreshSliderId != -1)
		{
			int		arrayPos	= (id - this.firstSatBrightThreshSliderId /*- 1*/) / 2;
			float	forteThreshPercent;
			for(int i = this.startHere; i < this.endBeforeThis; i++)
			{
				if((id - this.firstSatBrightThreshSliderId) % 2 == 0)
				{
					this.satBrightPercentVals[i][arrayPos]		= val;
					forteThreshPercent	= this.controlP5.getValue("slider" + (id + 1));
				} else {
					forteThreshPercent	= val;
					this.satBrightPercentVals[i][arrayPos]		= this.controlP5.getValue("slider" + (id - 1));
				}
				this.satBrightThresholdVals[i][arrayPos]	= this.pianoThreshold[i] + (this.forteThreshold[i] * forteThreshPercent);
			} 
		} 
		if(id > 0 && id == this.alphaSliderId)
		{
			this.alphaVal	= (int)val;
		} 
	}
public void sliderEvent ( int id , float val ) { if ( id == this . pianoThresholdSliderId ) { for ( int i = 0 ; i < this . module . getTotalNumInputs ( ) ; i ++ ) { this . pianoThreshold [ i ] = ( int ) val ; this . resetThresholds ( i ) ; } } if ( id == this . forteThresholdSliderId ) { for ( int i = 0 ; i < this . module . getTotalNumInputs ( ) ; i ++ ) { this . forteThreshold [ i ] = ( int ) val ; this . resetThresholds ( i ) ; } } if ( ( id >= this . getFirstARTSliderId ( ) && id < ( this . getFirstARTSliderId ( ) + 3 ) ) && this . getFirstARTSliderId ( ) != - 1 ) { int pos = id - this . getFirstARTSliderId ( ) ; if ( global ) { for ( int i = 0 ; i < this . module . getTotalNumInputs ( ) ; i ++ ) { this . setAttRelTranVal ( pos , i , val ) ; } } else { this . setAttRelTranVal ( pos , this . currentInput , val ) ; } } if ( ( id >= this . firstHSBSliderId && id < ( this . firstHSBSliderId + 3 ) ) && this . firstHSBSliderId != - 1 ) { int pos = id - this . firstHSBSliderId ; this . setHueSatBrightnessMod ( pos , val ) ; this . applyHSBModulate ( ) ; } if ( ( id >= this . firstRGBSliderId && id < ( this . firstRGBSliderId + 3 ) ) && this . firstRGBSliderId != - 1 ) { int pos = id - this . firstRGBSliderId ; this . redGreenBlueMod [ pos ] = val ; this . applyRGBModulate ( ) ; } if ( id == this . bpmSliderId ) { this . bpm = Math . max ( Math . min ( ( int ) val , 240 ) , 0 ) ; } if ( id == this . volumeSliderId ) { this . instrument . setVolume ( Math . max ( Math . min ( val , 5 ) , 0 ) ) ; } if ( id == this . shapeSizeSliderId ) { for ( int i = 0 ; i < this . shapeSize . length ; i ++ ) { this . shapeSize [ i ] = val ; } } if ( ( id >= this . firstSatBrightThreshSliderId ) && ( id < this . firstSatBrightThreshSliderId + 4 ) && this . firstSatBrightThreshSliderId != - 1 ) { int arrayPos = ( id - this . firstSatBrightThreshSliderId /*- 1*/ ) / 2 ; float forteThreshPercent ; for ( int i = this . startHere ; i < this . endBeforeThis ; i ++ ) { if ( ( id - this . firstSatBrightThreshSliderId ) % 2 == 0 ) { this . satBrightPercentVals [ i ] [ arrayPos ] = val ; forteThreshPercent = this . controlP5 . getValue ( "slider" + ( id + 1 ) ) ; } else { forteThreshPercent = val ; this . satBrightPercentVals [ i ] [ arrayPos ] = this . controlP5 . getValue ( "slider" + ( id - 1 ) ) ; } this . satBrightThresholdVals [ i ] [ arrayPos ] = this . pianoThreshold [ i ] + ( this . forteThreshold [ i ] * forteThreshPercent ) ; } } if ( id > 0 && id == this . alphaSliderId ) { this . alphaVal = ( int ) val ; } }
Called from MenuTemplate for Sliders that were added by the addSliderGroup() method
 and are connected to a Textfield (MenuTemplate has already updated the Textfield value).
Called from MenuTemplate for Sliders that were added by the addSliderGroup () method and are connected to a Textfield ( MenuTemplate has already updated the Textfield value ) .
//		System.out.println("ModuleMenu: got sliderEvent with id " + id + " and val " + val); // Piano Threshold: // piano threshold Slider // Forte Threshold: // forte threshold Slider // Attack, Release, and Transition: //			int	pos	= (id / 2) - 1; //			this.attackReleaseTransition[pos]	= val; // for // else - not global // attack/release/transition // Hue/Saturation/Brightness modulate //			int pos = (id/2)-7; //					this.applyHSBModulate(this.hsbColors); //hsb mod // Red Modulate/Green Modulate/Blue Modulate: //			int	pos	= (id / 2) - 4;		 // red = 0, green = 1, blue = 2 // red/green/blue mod // Saturation and Brightness Threshold and Percent Sliders: // Percent Sliders // The percent of forte slider that the threshold should be: //				percentVal		= controlEvent.getValue(); // Threshold Sliders: // for // Saturation and Brightness Threshold and Percent Sliders // Alpha Slider: // alpha Slider