<commit_before>// assumes that uvacurve is already running
/* ALSO:
~finalaudiobus.scope;
~subbus.scope;
s.meter;
*/
(
var w, mainbox, obj, wrapperwidget, thiswidget, subwidget;
w = Window("gui_uvacurve_audio", Rect(800, 400, 700, 800));
mainbox = VLayout();

///////////////////////////////////////////////////
// GUI panel for global settings - main amp, speakers onoff+amp, subs onoff+amp, fakedoppler, fakereverb, fakependulums
// level meter would be nice too

wrapperwidget = HLayout();
wrapperwidget.add(StaticText().string_("Tempo"));
obj = Slider().orientation_(\horizontal).value_(1).action_({|slider|
	~settempo.value((1/~normalperiod) * slider.value);
});
//~scenesampsliders.add(obj);
wrapperwidget.add(obj);
mainbox.add(wrapperwidget);

wrapperwidget = HLayout();
//
thiswidget = VLayout();
thiswidget.add(StaticText().string_("MASTER"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(1).action_({|but|
	if(but.value==0){~outputter.run(false)}{~outputter.run(true)}
});
thiswidget.add(obj);
obj = Slider().value_(0.7).action_({|slider|
	~outputter.set(\amp, slider.value);
});
thiswidget.add(obj);
wrapperwidget.add(thiswidget);
//
thiswidget = VLayout();
thiswidget.add(StaticText().string_("Mids"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(1).action_({|but|
	~outputter.set(\midon, but.value);
});
thiswidget.add(obj);
obj = Slider().value_(0.7).action_({|slider|
	~outputter.set(\midamp, slider.value);
});
thiswidget.add(obj);
wrapperwidget.add(thiswidget);
//
thiswidget = VLayout();
thiswidget.add(StaticText().string_("Subs"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(0).action_({|but|
	~outputter.set(\subon, but.value);
});
thiswidget.add(obj);
obj = Slider().value_(0.7).action_({|slider|
	~outputter.set(\subamp, slider.value);
});
thiswidget.add(obj);
wrapperwidget.add(thiswidget);

mainbox.add(wrapperwidget);

////////

/*
thiswidget = HLayout();
thiswidget.add(StaticText().string_("Scene pos motion"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(1).action_({|but|
if(but.value==0){~scenepossynth.run(false)}{~scenepossynth.run(true)}
});
thiswidget.add(obj);
mainbox.add(thiswidget);
*/
thiswidget = HLayout();
thiswidget.add(StaticText().string_("Fake doppler & indirectness"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(0).action_({|but|
	~dopplerfaker.set(\active, but.value);
});
thiswidget.add(obj);
mainbox.add(thiswidget);

thiswidget = HLayout();
thiswidget.add(StaticText().string_("Fake reverb"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(0).action_({|but|
	~outputter.set(\reverbon, but.value);
});
thiswidget.add(obj);
mainbox.add(thiswidget);

thiswidget = HLayout();
thiswidget.add(StaticText().string_("Fake pendulum data"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(1).action_({|but|
	if(but.value==0){~fakependulums.run(false)}{~fakependulums.run(true)}
});
thiswidget.add(obj);
mainbox.add(thiswidget);

thiswidget = HLayout();
thiswidget.add(StaticText().string_("Auto-movement around the circle"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(1).action_({|but|
	~automoving.value(but.value==1);
});
thiswidget.add(obj);
mainbox.add(thiswidget);



///////////////////////////////////////////////////
// Foreach running scenemachine: an onoff button, scenetype, amp, width


~sceneshackboxes = [];
~scenesamps = {0.7}.dup(~nscenes);


~scenenames = ~scenetypes.keys.asArray.sort;
~scenesboxes = ~nscenes.collect{|whichscene|
	wrapperwidget = HLayout();
	thiswidget = VLayout();
	thiswidget.add(StaticText().string_("Scene %".format(whichscene)));
	obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(1).action_({|but|
		if(but.value==0){
			~sceneplayers[whichscene].pause;
			~sceneplayers_offstage[whichscene].pause;
		}{
			~sceneplayers[whichscene].resume;
			~sceneplayers_offstage[whichscene].resume;
		};
	});
	thiswidget.add(obj);
	obj = Slider().value_(0.7).action_({|slider|
		~scenesamps[whichscene] = slider.value;
		~sceneplayers[whichscene].set(\amp, slider.value);
		~sceneplayers_offstage[whichscene].set(\amp, slider.value);  // ekk - yuck to have to touch those while offstage
	});
	//~scenesampsliders.add(obj);
	thiswidget.add(obj);
	wrapperwidget.add(thiswidget);

	thiswidget = VLayout();
	obj = Slider().orientation_(\horizontal).value_(0).action_({|slider|
		~sceneplayers[whichscene].set(\width, slider.value);
		~sceneplayers_offstage[whichscene].set(\width, slider.value);
	});
	thiswidget.add(obj);

	/*  */
	subwidget = HLayout();
	obj = StaticText().string_("Rapidity:");
	subwidget.add(obj);
	obj = NumberBox().value_(5).action_({|widg|
		~scenepossynths[whichscene].set(\rapidity, widg.value)
	});
	subwidget.add(obj);
	obj = StaticText().string_("Circlesize:");
	subwidget.add(obj);
	obj = NumberBox().value_(1).action_({|widg|
		~scenepossynths[whichscene].set(\circlesize, widg.value);
		~sceneplayers[whichscene].set(\circlesize, widg.value)
		~sceneplayers_offstage[whichscene].set(\circlesize, widg.value)
	});
	subwidget.add(obj);
	thiswidget.add(subwidget);
	/*  */

	/*
	subwidget = HLayout();
	obj = StaticText().string_("Freq x");
	subwidget.add(obj);
	{
	var obj1, obj2;
	obj1 = NumberBox().value_(1);
	obj2 = Slider().orientation_(\horizontal).value_(0.5);
	obj1.action_({|widg|
	obj2.value_(widg.value.max(0.0001).explin(0.666666, 1.5, 0, 1));
	~sceneplayers[whichscene].set(\freqscale, widg.value)
	});
	obj2.action_({|widg|
	obj1.valueAction_(widg.value.linexp(0,1, 0.666666, 1.5));
	//~sceneplayers[whichscene].set(\freqscale, widg.value.linexp(0,1, 0.666666, 1.5))
	});

	subwidget.add(obj1);
	subwidget.add(StaticText().string_("     "));
	subwidget.add(obj2);<commit_msg>hide some unneeded gui buttons<commit_after>// assumes that uvacurve is already running
/* ALSO:
~finalaudiobus.scope;
~subbus.scope;
s.meter;
*/
(
var w, mainbox, obj, wrapperwidget, thiswidget, subwidget;
w = Window("gui_uvacurve_audio", Rect(800, 400, 700, 800));
mainbox = VLayout();

///////////////////////////////////////////////////
// GUI panel for global settings - main amp, speakers onoff+amp, subs onoff+amp, fakedoppler, fakereverb, fakependulums
// level meter would be nice too

wrapperwidget = HLayout();
wrapperwidget.add(StaticText().string_("Tempo"));
obj = Slider().orientation_(\horizontal).value_(1).action_({|slider|
	~settempo.value((1/~normalperiod) * slider.value);
});
//~scenesampsliders.add(obj);
wrapperwidget.add(obj);
mainbox.add(wrapperwidget);

wrapperwidget = HLayout();
//
thiswidget = VLayout();
thiswidget.add(StaticText().string_("MASTER"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(1).action_({|but|
	if(but.value==0){~outputter.run(false)}{~outputter.run(true)}
});
thiswidget.add(obj);
obj = Slider().value_(0.7).action_({|slider|
	~outputter.set(\amp, slider.value);
});
thiswidget.add(obj);
wrapperwidget.add(thiswidget);
//
thiswidget = VLayout();
thiswidget.add(StaticText().string_("Mids"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(1).action_({|but|
	~outputter.set(\midon, but.value);
});
thiswidget.add(obj);
obj = Slider().value_(0.7).action_({|slider|
	~outputter.set(\midamp, slider.value);
});
thiswidget.add(obj);
wrapperwidget.add(thiswidget);
//
thiswidget = VLayout();
thiswidget.add(StaticText().string_("Subs"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(0).action_({|but|
	~outputter.set(\subon, but.value);
});
thiswidget.add(obj);
obj = Slider().value_(0.7).action_({|slider|
	~outputter.set(\subamp, slider.value);
});
thiswidget.add(obj);
wrapperwidget.add(thiswidget);

mainbox.add(wrapperwidget);

////////

/*
thiswidget = HLayout();
thiswidget.add(StaticText().string_("Fake doppler & indirectness"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(0).action_({|but|
	~dopplerfaker.set(\active, but.value);
});
thiswidget.add(obj);
mainbox.add(thiswidget);

thiswidget = HLayout();
thiswidget.add(StaticText().string_("Fake reverb"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(0).action_({|but|
	~outputter.set(\reverbon, but.value);
});
thiswidget.add(obj);
mainbox.add(thiswidget);

thiswidget = HLayout();
thiswidget.add(StaticText().string_("Fake pendulum data"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(1).action_({|but|
	if(but.value==0){~fakependulums.run(false)}{~fakependulums.run(true)}
});
thiswidget.add(obj);
mainbox.add(thiswidget);

thiswidget = HLayout();
thiswidget.add(StaticText().string_("Auto-movement around the circle"));
obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(1).action_({|but|
	~automoving.value(but.value==1);
});
thiswidget.add(obj);
mainbox.add(thiswidget);
*/


///////////////////////////////////////////////////
// Foreach running scenemachine: an onoff button, scenetype, amp, width


~sceneshackboxes = [];
~scenesamps = {0.7}.dup(~nscenes);


~scenenames = ~scenetypes.keys.asArray.sort;
~scenesboxes = ~nscenes.collect{|whichscene|
	wrapperwidget = HLayout();
	thiswidget = VLayout();
	thiswidget.add(StaticText().string_("Scene %".format(whichscene)));
	obj = Button().states_([["off", Color.white, Color.black], ["ON", Color.red, Color.white]]).value_(1).action_({|but|
		if(but.value==0){
			~sceneplayers[whichscene].pause;
			~sceneplayers_offstage[whichscene].pause;
		}{
			~sceneplayers[whichscene].resume;
			~sceneplayers_offstage[whichscene].resume;
		};
	});
	thiswidget.add(obj);
	obj = Slider().value_(0.7).action_({|slider|
		~scenesamps[whichscene] = slider.value;
		~sceneplayers[whichscene].set(\amp, slider.value);
		~sceneplayers_offstage[whichscene].set(\amp, slider.value);  // ekk - yuck to have to touch those while offstage
	});
	//~scenesampsliders.add(obj);
	thiswidget.add(obj);
	wrapperwidget.add(thiswidget);

	thiswidget = VLayout();
	obj = Slider().orientation_(\horizontal).value_(0).action_({|slider|
		~sceneplayers[whichscene].set(\width, slider.value);
		~sceneplayers_offstage[whichscene].set(\width, slider.value);
	});
	thiswidget.add(obj);

	/*  */
	subwidget = HLayout();
	obj = StaticText().string_("Rapidity:");
	subwidget.add(obj);
	obj = NumberBox().value_(5).action_({|widg|
		~scenepossynths[whichscene].set(\rapidity, widg.value)
	});
	subwidget.add(obj);
	obj = StaticText().string_("Circlesize:");
	subwidget.add(obj);
	obj = NumberBox().value_(1).action_({|widg|
		~scenepossynths[whichscene].set(\circlesize, widg.value);
		~sceneplayers[whichscene].set(\circlesize, widg.value);
		~sceneplayers_offstage[whichscene].set(\circlesize, widg.value);
	});
	subwidget.add(obj);
	thiswidget.add(subwidget);
	/*  */

	/*
	subwidget = HLayout();
	obj = StaticText().string_("Freq x");
	subwidget.add(obj);
	{
	var obj1, obj2;
	obj1 = NumberBox().value_(1);
	obj2 = Slider().orientation_(\horizontal).value_(0.5);
	obj1.action_({|widg|
	obj2.value_(widg.value.max(0.0001).explin(0.666666, 1.5, 0, 1));
	~sceneplayers[whichscene].set(\freqscale, widg.value)
	});
	obj2.action_({|widg|
	obj1.valueAction_(widg.value.linexp(0,1, 0.666666, 1.5));
	//~sceneplayers[whichscene].set(\freqscale, widg.value.linexp(0,1, 0.666666, 1.5))
	});

	subwidget.add(obj1);
	subwidget.add(StaticText().string_("     "));
	subwidget.add(obj2);
{'fraction_non_alphanumeric': 0.22499789011730947, 'fraction_numerical': 0.015359945987003123, 'mean_word_length': 5.554203539823009, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6839140', 'n_tokens_mistral': 4433, 'n_tokens_neox': 4252, 'n_words': 608}