gtr/GUI.scd

222 lines
6.6 KiB
Plaintext

(
Window.closeAll;
w = Window.new().front.background_(Color.black);
~inputGui = CompositeView(w, Rect(10,80,250,450))
.background_(Color.rand)
.alwaysOnTop_(true);
//~inputGui.decorator = FlowLayout(~inputGui.bounds);
StaticText(w, Rect(10,10,140,50))
.string_("GTR+")
.stringColor_(Color.black)
.background_(Color.rand)
.font_(Font.default.size_(34));
c = QNumberBox(~inputGui, Rect(55, 250, 40, 40))
.font_(Font.default.size_(25))
.background_(Color.white);
a = QSlider(~inputGui, Rect(55, 60, 40, 240))
.action_({
c.value_(a.value)
});
StaticText(~inputGui, Rect(0,0,230,40))
.string_("INPUT //").background_(Color.rand)
.stringColor_(Color.black)
.font_(Font.default.size_(30));
~fxModeGui = QPopUpMenu(~inputGui, Rect(10, 400, 300, 40))
.items_(["dry", "ringmod", "reverb","ringmod and reverb"])
.font_(Font.default.size_(35)).background_(Color.yellow);
~recTrigButton = Button(~inputGui, Rect(100, 50, 140, 45))
.states_([
["TRIGGER", Color.black, Color.green],
["=======", Color.black, Color.red],
])
.font_(Font.default.size_(20))
.value_(0)
.action_({ arg butt;
butt.value.postln;
});
~recModeGui = Button(~inputGui, Rect(100, 110, 140, 90))
.states_([
["TRIGGER \n ACTIVE", Color.black, Color.green],
["LOOPING \n RECORD", Color.black, Color.red],
["ONSET \n DETECTION", Color.black, Color.cyan],
["DISABLE \n RECORDING", Color.black, Color.gray]
])
.font_(Font.default.size_(20))
.value_(2)
.action_({ arg butt;
butt.value.postln;
});
StaticText(~inputGui, Rect(100,200,130,30))
.string_("OVERDUB LEVEL").background_(Color.clear)
.stringColor_(Color.white)
.font_(Font.default.size_(15));
~overdubModeGui = Button(~inputGui, Rect(100, 220, 140, 90))
.states_([
["0%", Color.white, Color.gray],
["30%", Color.white, Color.red],
["50%", Color.white, Color.red],
["75%", Color.white, Color.red],
["90%", Color.white, Color.red],
["100%", Color.white, Color.red],
])
.font_(Font.default.size_(60))
.action_({ arg butt;
butt.value.postln;
});
~instrPanModeGui = QPopUpMenu(~inputGui, Rect(10, 320, 220, 30))
.items_(["OFF","STEREO FRONT","STEREO BACK", "STEREO PAN", "STEREO RND", "QUAD", "QUAD ROTATE", "QUAD RANDOM" ]).font_(Font.default.size_(24));
~c1 = QNumberBox(~inputGui, Rect(200, 360, 70, 40))
.font_(Font.default.size_(25))
.background_(Color.clear);
~a1 = QSlider(~inputGui, Rect(10, 360, 150, 30))
.action_({
~c1.value_(~a1.value)
});
l = LevelIndicator(~inputGui, bounds:Rect(10, 50, 40, 240)).front().value_(1).style_(\led);
l.meterColor = Color.green(0.9);
l.warningColor = Color.yellow(0.7);
l.criticalColor = Color.red(0.5);
///////////// END OF INPUT GUI BOX
//b
~bufferGui = CompositeView.new(w, bounds:Rect(40,750,750,200))
.background_(Color.white)
.alwaysOnTop_(true);
//~bufferPlotter = Plotter("plot", parent: ~bufferGui).value_([0, 1, 2, 3, 4].scramble * 100);
// todo howto do this ? see end of chapter one of marinos's book on archive.org
//. or page 215 - of this https://escholarship.org/content/qt2d33344j/qt2d33344j.pdf
//~bufferPlotter = Plotter("plot", parent: ~bufferGui).value_(b);
//~bufferPlotter.val
// ------------- GRAIN GUI
~grainGui = CompositeView.new(w, bounds:Rect(540,80,250,760))
.background_(Color.rand)
.alwaysOnTop_(true);
~grainGui.decorator = FlowLayout(~grainGui.bounds);
VLayout(
StaticText(~grainGui, Rect(50,50,200,30)).string_("gSYNTH////").background_(Color.rand).stringColor_(Color.black).font_(Font.default.size_(30));
StaticText(~grainGui, Rect(50,50,300,40)).string_("PLAYHEAD MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
~posModeGui = QPopUpMenu(~grainGui, Rect(10, 50, 300, 40))
.items_(["0.125", "0.25", "0.5", "1","2", "3", "4", "sensor"])
.font_(Font.default.size_(35)).background_(Color.yellow);
StaticText(~grainGui, Rect(50,50,300,40)).string_("PITCH MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
~pitchModeGui = QPopUpMenu.new(~grainGui, Rect(10,100,300,40))
.items_([
"0: NO TRANSPOSITION",
"1: + OCTAVE",
"2: - OCTAVE",
"3: 1 : 1.1 RANDOM SEMI/MIKTRO/TONES",
"4: .25 : 5 LOW 5 OCTAVES",
"5: 0.1 : 100 ",
"6: 10 : 1000",
"7: SENSOR --> RANDRATE",
])
.font_(Font.default.size_(20))
.stringColor_(Color.black).background_(Color.yellow);
StaticText(~grainGui, Rect(50,50,300,40)).string_("DURATION MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
~durModeGui = QPopUpMenu.new(~grainGui, Rect(10,150,300,40))
.items_([
"0: baseDur 1 durRand 1",
"1: baseDur 1/2 durRand 1",
"2: baseDur 1/4 durRand 1",
"3: baseDur 1/8 durRand 1",
"4: baseDur 1/16 durRand 1",
"5: baseDur 1 durRand 100",
"5: baseDur 1 durRand 1000",
"7: SENSOR --> RANDRATE",
])
.font_(Font.default.size_(20))
.value_(0)
.stringColor_(Color.black).background_(Color.yellow);
StaticText(~grainGui, Rect(50,150,150,40)).string_("DENSITY").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
~densModeGui = QPopUpMenu.new(~grainGui, Rect(50,60,100,40))
.items_(["1","2","3","5","8","13","21", "34", "55","89","144","233", "377"]) .font_(Font.default.size_(30)).background_(Color.yellow);
StaticText(~grainGui, Rect(50,50,150,40)).string_("IMPULSE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
~impulseModeGui = CheckBox.new(~grainGui, Rect(30,350,80,60)).value_(1).string_("sync/async");
/* StaticText(~grainGui, Rect(50,50,150,40)).string_("Pointer Rate Freeze").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(20));
~ptrRateGui = NumberBox.new(~grainGui, Rect(30,450,80,40)).value_(1).increment(factor: 0.1).font_(Font.default.size_(30));*/
~gPanModeGui = QPopUpMenu(~grainGui, Rect(10, 300, 220, 30))
.items_(["OFF","STEREO FRONT","STEREO BACK", "STEREO PAN", "STEREO RND", "QUAD", "QUAD ROTATE", "QUAD RANDOM" ]).font_(Font.default.size_(24));
~outAmpModeGui = QSlider(~grainGui, Rect(55, 60, 240, 40)).value_(0.5)
.action_({
~g1.set(\amp, ~outAmpModeGui.value);
});
);
// ------------- GRAIN GUI END
~iSpatGui = CompositeView.new(w, bounds:Rect(500,80,250,400))
.background_(Color.rand)
.alwaysOnTop_(true);
~inputGui.bounds_(Rect(10, 60, 250, 450)); // contents adjust since coords are relative
~grainGui.bounds_(Rect(280, 60, 450, 650)); // contents adjust since coords are relative
~iSpatGui.bounds_(Rect(10, 570, 250, 500)); // contents adjust since coords are relative
)
//~inputGui.resize_(6); // contents adjust since coords are relative
//w.layout = HLayout(~inputGui, ~grainGui);
/*(
Window.closeAll;
w = Window.new("GUI GTR", Rect(100,100,300,300)).layout(
VLayout(
HLayout([~inputGui]);
)
).front
)
w.front;*/