sheadernanigans/src/2023-06-21.festl_is/processing_sketches/audio_processing_gui/gui.pde

143 lines
5.2 KiB
Plaintext

/* =========================================================
* ==== WARNING ===
* =========================================================
* The code in this tab has been generated from the GUI form
* designer and care should be taken when editing this file.
* Only add/edit code inside the event handlers i.e. only
* use lines between the matching comment tags. e.g.
void myBtnEvents(GButton button) { //_CODE_:button1:12356:
// It is safe to enter your event code here
} //_CODE_:button1:12356:
* Do not rename this tab!
* =========================================================
*/
public void gui_fftWindowing_click(GDropList source, GEvent event) { //_CODE_:gui_fftWindowing:384393:
//println("dropList1 - GDropList >> GEvent." + event + " @ " + millis());
String selected = source.getSelectedText();
switch(selected) {
case "bartlett":
myFFT.window(FFT.BARTLETT);
case "bartletthann":
myFFT.window(FFT.BARTLETTHANN);
case "blackmann":
myFFT.window(FFT.BLACKMAN);
case "cosine":
myFFT.window(FFT.COSINE);
case "gauss":
myFFT.window(FFT.GAUSS);
case "hammin":
myFFT.window(FFT.HAMMING);
case "hann":
myFFT.window(FFT.HANN);
case "lanczos":
myFFT.window(FFT.LANCZOS);
case "triangular":
myFFT.window(FFT.TRIANGULAR);
case "none":
default:
myFFT.window(FFT.NONE);
}
} //_CODE_:gui_fftWindowing:384393:
public void gui_fftAmpBeginFrac_change(GSlider source, GEvent event) { //_CODE_:gui_fftAmpBeginFrac:516902:
//println("slider1 - GSlider >> GEvent." + event + " @ " + millis());
} //_CODE_:gui_fftAmpBeginFrac:516902:
public void gui_baseAmp_change(GSlider source, GEvent event) { //_CODE_:gui_baseAmp:888464:
//println("slider2 - GSlider >> GEvent." + event + " @ " + millis());
} //_CODE_:gui_baseAmp:888464:
public void gui_ampStart_change(GSlider source, GEvent event) { //_CODE_:gui_ampStart:865325:
//println("slider1 - GSlider >> GEvent." + event + " @ " + millis());
} //_CODE_:gui_ampStart:865325:
public void gui_ampStep_change(GSlider source, GEvent event) { //_CODE_:gui_ampStep:498343:
//println("slider2 - GSlider >> GEvent." + event + " @ " + millis());
} //_CODE_:gui_ampStep:498343:
public void gui_beatDecay_change(GSlider source, GEvent event) { //_CODE_:gui_beatDecay:302227:
//println("gui_beatDecay - GSlider >> GEvent." + event + " @ " + millis());
myBeatMax = source.getValueI();
} //_CODE_:gui_beatDecay:302227:
// Create all the GUI controls.
// autogenerated do not edit
public void createGUI() {
G4P.messagesEnabled(false);
G4P.setGlobalColorScheme(GCScheme.CYAN_SCHEME);
G4P.setMouseOverEnabled(false);
GButton.useRoundCorners(false);
surface.setTitle("Sketch Window");
gui_fftWindowing = new GDropList(this, 100, 110, 100, 220, 10, 10);
gui_fftWindowing.setItems(loadStrings("list_384393"), 0);
gui_fftWindowing.addEventHandler(this, "gui_fftWindowing_click");
label1 = new GLabel(this, 20, 110, 80, 20);
label1.setText("windowing:");
label1.setOpaque(true);
label2 = new GLabel(this, 20, 130, 180, 20);
label2.setText("amp begin at bin fraction");
label2.setOpaque(true);
label3 = new GLabel(this, 20, 190, 180, 20);
label3.setText("base amp");
label3.setOpaque(true);
label4 = new GLabel(this, 20, 250, 180, 20);
label4.setText("amp start");
label4.setOpaque(true);
gui_fftAmpBeginFrac = new GSlider(this, 20, 150, 180, 40, 10.0);
gui_fftAmpBeginFrac.setShowValue(true);
gui_fftAmpBeginFrac.setLimits(0.3, 0.0, 1.0);
gui_fftAmpBeginFrac.setNumberFormat(G4P.DECIMAL, 2);
gui_fftAmpBeginFrac.setOpaque(true);
gui_fftAmpBeginFrac.addEventHandler(this, "gui_fftAmpBeginFrac_change");
gui_baseAmp = new GSlider(this, 20, 210, 180, 40, 10.0);
gui_baseAmp.setShowValue(true);
gui_baseAmp.setLimits(30.0, 1.0, 100.0);
gui_baseAmp.setNumberFormat(G4P.DECIMAL, 2);
gui_baseAmp.setOpaque(true);
gui_baseAmp.addEventHandler(this, "gui_baseAmp_change");
label5 = new GLabel(this, 20, 310, 180, 20);
label5.setText("amp step");
label5.setOpaque(true);
gui_ampStart = new GSlider(this, 20, 270, 180, 40, 10.0);
gui_ampStart.setShowValue(true);
gui_ampStart.setLimits(0.05, 0.005, 0.2);
gui_ampStart.setNumberFormat(G4P.DECIMAL, 3);
gui_ampStart.setOpaque(true);
gui_ampStart.addEventHandler(this, "gui_ampStart_change");
gui_ampStep = new GSlider(this, 20, 330, 180, 40, 10.0);
gui_ampStep.setShowValue(true);
gui_ampStep.setLimits(0.02, 0.005, 0.2);
gui_ampStep.setNumberFormat(G4P.DECIMAL, 3);
gui_ampStep.setOpaque(true);
gui_ampStep.addEventHandler(this, "gui_ampStep_change");
label6 = new GLabel(this, 20, 20, 180, 20);
label6.setText("simple beat decay");
label6.setOpaque(true);
gui_beatDecay = new GSlider(this, 20, 40, 140, 40, 10.0);
gui_beatDecay.setShowValue(true);
gui_beatDecay.setLimits(30.0, 1.0, 60.0);
gui_beatDecay.setNumberFormat(G4P.DECIMAL, 2);
gui_beatDecay.setOpaque(true);
gui_beatDecay.addEventHandler(this, "gui_beatDecay_change");
}
// Variable declarations
// autogenerated do not edit
GDropList gui_fftWindowing;
GLabel label1;
GLabel label2;
GLabel label3;
GLabel label4;
GSlider gui_fftAmpBeginFrac;
GSlider gui_baseAmp;
GLabel label5;
GSlider gui_ampStart;
GSlider gui_ampStep;
GLabel label6;
GSlider gui_beatDecay;