src/codeandchords/ModuleMenu.java
public void addGuideTonePopout(int xVal, int guideToneY)
	{

		Color	transparentBlack	= new Color(0, 0, 0, 240);
		int		transBlackInt		= transparentBlack.getRGB();

		int		boxWidth		= 220;
		int		boxHeight		= 130;

		int		labelWidth		= 30;
		int		listWidth		= 155;
		int		sliderWidth		= 120;
		int		textfieldWidth	= 30;
		int		popoutSpacer	= 12;

		int		height			= 18;

		int		listSliderX		= /*xVal + */(popoutSpacer * 2) + labelWidth;

		int		rangeY			= popoutSpacer;
		int		adsrY			= (popoutSpacer * 2) + height;
		int		bpmY			= (popoutSpacer * 3) + (height * 2);
		int		volumeY			= (popoutSpacer * 4) + (height * 3);

		this.controlP5.addGroup("guideToneBackground")
		.setPosition(xVal + this.leftAlign, guideToneY + 20)
		.setSize(boxWidth, boxHeight)
		.setBackgroundColor(transBlackInt)
		.setVisible(false)
		.moveTo("sensitivity")	// Add the Group to this Tab and all the Controllers will come, too.
		.hideBar();

		String[]	labels		= new String[]	{ "bpmLabel", 	"volumeLabel" };
		int[]		yVals		= new int[]		{ bpmY, 		volumeY	};
		String[]	labelVals	= new String[]	{ "BPM",	"Volume"	};
		float[][]	ranges		= new float[][]	{
			// bpm range:
			new float[] { 40, 	240 },
			// volume range:
			new float[] { 0.01f,	5	}
		};
		float[]		startingVals	= new float[]	{ 120, 1	};

		this.bpmSliderId	= this.nextSliderId;
		this.volumeSliderId	= this.nextSliderId + 1;

		for(int i = 0; i < labels.length; i++)
		{
			this.addSliderGroup(/*xVal*/0, yVals[i], labelVals[i], listSliderX, sliderWidth, ranges[i][0], ranges[i][1], startingVals[i], textfieldWidth, "sensitivity");
			// Since addSliderGroup no longer allows one to specify the group of the Controllers,
			// do that manually, below:
			this.controlP5.getController("label" + (this.nextSliderId - 1)).setGroup("guideToneBackground");
			this.controlP5.getController("slider" + (this.nextSliderId - 1)).setGroup("guideToneBackground");
			this.controlP5.getController("textfield" + (this.nextSTextfieldId - 1)).setGroup("guideToneBackground");
		} // for

		// "ADSR Presets" Textlabel
		this.controlP5.addTextlabel("adsrPresets")
		.setPosition(/*xVal + */popoutSpacer, adsrY)
		.setGroup("guideToneBackground")
		.setValue("ADSR \nPresets");

		// ArrayList of ADSR options:
		String[]	adsrItems	= new String[] {
				"Even",
				"Long Attack",
				"Long Decay",
				"High Sustain",
				"Low Sustain",
				"Long Release"
		};

		this.controlP5.addScrollableList("adsrPresetsDropdown")
		.setPosition(listSliderX, adsrY)
		.setWidth(listWidth)
		.setBarHeight(18)
		.setItemHeight(18)
		.setItems(adsrItems)
		.setValue(0f)		// sets it to the first item
		.setOpen(false)
		.setGroup("guideToneBackground")
		.bringToFront()
		.getCaptionLabel().toUpperCase(false);

		// "Range" Textlabel
		this.controlP5.addTextlabel("range")
		.setPosition(/*xVal + */popoutSpacer, rangeY + 4)
		.setGroup("guideToneBackground")
		.setValue("Range");

		// Update Melody's scale:
		String[] scales	= new String[] { "major", "minor", "chromatic" };
		this.melody.setScale(scales[this.majMinChrom]);
		this.melody.setRangeList();

		this.controlP5.addScrollableList("rangeDropdown")
		.setPosition(listSliderX, rangeY)
		.setWidth(listWidth)
		.setBarHeight(18)
		.setItemHeight(18)
		.setItems(this.melody.getRangeList())
		.setValue(0f)
		.setOpen(false)
		.setGroup("guideToneBackground")
		.bringToFront()
		.getCaptionLabel().toUpperCase(false);

	}
/**
	 * Adds the guide tone pop-out with range and envelope preset select dropdowns, bpm and volume sliders.
	 * 
	 * @param guideToneY	y value for the top of the pop-out; 
	 * 						for ModuleTemplate_01, this is same as the value for addKeySelector
	 */
Adds the guide tone pop-out with range and envelope preset select dropdowns, bpm and volume sliders.

@param guideToneY    y value for the top of the pop-out;
for ModuleTemplate_01, this is same as the value for addKeySelector
Adds the guide tone pop - out with range and envelope preset select dropdowns bpm and volume sliders . @param guideToneY y value for the top of the pop - out ; for ModuleTemplate_01 this is same as the value for addKeySelector
public void addGuideTonePopout(int xVal, int guideToneY)
	{
		Color	transparentBlack	= new Color(0, 0, 0, 240);
		int		transBlackInt		= transparentBlack.getRGB();
		int		boxWidth		= 220;
		int		boxHeight		= 130;
		int		labelWidth		= 30;
		int		listWidth		= 155;
		int		sliderWidth		= 120;
		int		textfieldWidth	= 30;
		int		popoutSpacer	= 12;
		int		height			= 18;
		int		listSliderX		= /*xVal + */(popoutSpacer * 2) + labelWidth;
		int		rangeY			= popoutSpacer;
		int		adsrY			= (popoutSpacer * 2) + height;
		int		bpmY			= (popoutSpacer * 3) + (height * 2);
		int		volumeY			= (popoutSpacer * 4) + (height * 3);
		this.controlP5.addGroup("guideToneBackground")
		.setPosition(xVal + this.leftAlign, guideToneY + 20)
		.setSize(boxWidth, boxHeight)
		.setBackgroundColor(transBlackInt)
		.setVisible(false)
		.moveTo("sensitivity")	
		.hideBar();
		String[]	labels		= new String[]	{ "bpmLabel", 	"volumeLabel" };
		int[]		yVals		= new int[]		{ bpmY, 		volumeY	};
		String[]	labelVals	= new String[]	{ "BPM",	"Volume"	};
		float[][]	ranges		= new float[][]	{
			new float[] { 40, 	240 },
			new float[] { 0.01f,	5	}
		};
		float[]		startingVals	= new float[]	{ 120, 1	};
		this.bpmSliderId	= this.nextSliderId;
		this.volumeSliderId	= this.nextSliderId + 1;
		for(int i = 0; i < labels.length; i++)
		{
			this.addSliderGroup(/*xVal*/0, yVals[i], labelVals[i], listSliderX, sliderWidth, ranges[i][0], ranges[i][1], startingVals[i], textfieldWidth, "sensitivity");
			this.controlP5.getController("label" + (this.nextSliderId - 1)).setGroup("guideToneBackground");
			this.controlP5.getController("slider" + (this.nextSliderId - 1)).setGroup("guideToneBackground");
			this.controlP5.getController("textfield" + (this.nextSTextfieldId - 1)).setGroup("guideToneBackground");
		} 
		this.controlP5.addTextlabel("adsrPresets")
		.setPosition(/*xVal + */popoutSpacer, adsrY)
		.setGroup("guideToneBackground")
		.setValue("ADSR \nPresets");
		String[]	adsrItems	= new String[] {
				"Even",
				"Long Attack",
				"Long Decay",
				"High Sustain",
				"Low Sustain",
				"Long Release"
		};
		this.controlP5.addScrollableList("adsrPresetsDropdown")
		.setPosition(listSliderX, adsrY)
		.setWidth(listWidth)
		.setBarHeight(18)
		.setItemHeight(18)
		.setItems(adsrItems)
		.setValue(0f)		
		.setOpen(false)
		.setGroup("guideToneBackground")
		.bringToFront()
		.getCaptionLabel().toUpperCase(false);
		this.controlP5.addTextlabel("range")
		.setPosition(/*xVal + */popoutSpacer, rangeY + 4)
		.setGroup("guideToneBackground")
		.setValue("Range");
		String[] scales	= new String[] { "major", "minor", "chromatic" };
		this.melody.setScale(scales[this.majMinChrom]);
		this.melody.setRangeList();
		this.controlP5.addScrollableList("rangeDropdown")
		.setPosition(listSliderX, rangeY)
		.setWidth(listWidth)
		.setBarHeight(18)
		.setItemHeight(18)
		.setItems(this.melody.getRangeList())
		.setValue(0f)
		.setOpen(false)
		.setGroup("guideToneBackground")
		.bringToFront()
		.getCaptionLabel().toUpperCase(false);
	}
public void addGuideTonePopout ( int xVal , int guideToneY ) { Color transparentBlack = new Color ( 0 , 0 , 0 , 240 ) ; int transBlackInt = transparentBlack . getRGB ( ) ; int boxWidth = 220 ; int boxHeight = 130 ; int labelWidth = 30 ; int listWidth = 155 ; int sliderWidth = 120 ; int textfieldWidth = 30 ; int popoutSpacer = 12 ; int height = 18 ; int listSliderX = /*xVal + */ ( popoutSpacer * 2 ) + labelWidth ; int rangeY = popoutSpacer ; int adsrY = ( popoutSpacer * 2 ) + height ; int bpmY = ( popoutSpacer * 3 ) + ( height * 2 ) ; int volumeY = ( popoutSpacer * 4 ) + ( height * 3 ) ; this . controlP5 . addGroup ( "guideToneBackground" ) . setPosition ( xVal + this . leftAlign , guideToneY + 20 ) . setSize ( boxWidth , boxHeight ) . setBackgroundColor ( transBlackInt ) . setVisible ( false ) . moveTo ( "sensitivity" ) . hideBar ( ) ; String [ ] labels = new String [ ] { "bpmLabel" , "volumeLabel" } ; int [ ] yVals = new int [ ] { bpmY , volumeY } ; String [ ] labelVals = new String [ ] { "BPM" , "Volume" } ; float [ ] [ ] ranges = new float [ ] [ ] { new float [ ] { 40 , 240 } , new float [ ] { 0.01f , 5 } } ; float [ ] startingVals = new float [ ] { 120 , 1 } ; this . bpmSliderId = this . nextSliderId ; this . volumeSliderId = this . nextSliderId + 1 ; for ( int i = 0 ; i < labels . length ; i ++ ) { this . addSliderGroup ( /*xVal*/ 0 , yVals [ i ] , labelVals [ i ] , listSliderX , sliderWidth , ranges [ i ] [ 0 ] , ranges [ i ] [ 1 ] , startingVals [ i ] , textfieldWidth , "sensitivity" ) ; this . controlP5 . getController ( "label" + ( this . nextSliderId - 1 ) ) . setGroup ( "guideToneBackground" ) ; this . controlP5 . getController ( "slider" + ( this . nextSliderId - 1 ) ) . setGroup ( "guideToneBackground" ) ; this . controlP5 . getController ( "textfield" + ( this . nextSTextfieldId - 1 ) ) . setGroup ( "guideToneBackground" ) ; } this . controlP5 . addTextlabel ( "adsrPresets" ) . setPosition ( /*xVal + */ popoutSpacer , adsrY ) . setGroup ( "guideToneBackground" ) . setValue ( "ADSR \nPresets" ) ; String [ ] adsrItems = new String [ ] { "Even" , "Long Attack" , "Long Decay" , "High Sustain" , "Low Sustain" , "Long Release" } ; this . controlP5 . addScrollableList ( "adsrPresetsDropdown" ) . setPosition ( listSliderX , adsrY ) . setWidth ( listWidth ) . setBarHeight ( 18 ) . setItemHeight ( 18 ) . setItems ( adsrItems ) . setValue ( 0f ) . setOpen ( false ) . setGroup ( "guideToneBackground" ) . bringToFront ( ) . getCaptionLabel ( ) . toUpperCase ( false ) ; this . controlP5 . addTextlabel ( "range" ) . setPosition ( /*xVal + */ popoutSpacer , rangeY + 4 ) . setGroup ( "guideToneBackground" ) . setValue ( "Range" ) ; String [ ] scales = new String [ ] { "major" , "minor" , "chromatic" } ; this . melody . setScale ( scales [ this . majMinChrom ] ) ; this . melody . setRangeList ( ) ; this . controlP5 . addScrollableList ( "rangeDropdown" ) . setPosition ( listSliderX , rangeY ) . setWidth ( listWidth ) . setBarHeight ( 18 ) . setItemHeight ( 18 ) . setItems ( this . melody . getRangeList ( ) ) . setValue ( 0f ) . setOpen ( false ) . setGroup ( "guideToneBackground" ) . bringToFront ( ) . getCaptionLabel ( ) . toUpperCase ( false ) ; }
Adds the guide tone pop-out with range and envelope preset select dropdowns, bpm and volume sliders.
Adds the guide tone pop - out with range and envelope preset select dropdowns bpm and volume sliders .
// Add the Group to this Tab and all the Controllers will come, too. // bpm range: // volume range: // Since addSliderGroup no longer allows one to specify the group of the Controllers, // do that manually, below: // for // "ADSR Presets" Textlabel // ArrayList of ADSR options: // sets it to the first item // "Range" Textlabel // Update Melody's scale: