-
Notifications
You must be signed in to change notification settings - Fork 1
/
quneo-5.scd
169 lines (144 loc) · 6.26 KB
/
quneo-5.scd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// fix width -- done!
// fix buttons -- done!!
// measure up QuNeo
// refer to SCLOrkSynths
// match up Composite View dimensions with window dimensions -- done !!
// build smaller Composite Buttons
// don't hardcode dimensions, use variables!
(
// must happen first
var window, composite, left, right, vader, footer; // main components of box model
var top, bottom1, bottom2; // components of left: 4 buttons on top
var k1, k2, nose, s1, s2, s3, s4; // components of vader: 2 knobs, a nose, 4 sliders
var text, text2, slider, b1, b2, b3, b4; // components of footer: 2 texts, 1 slider, and 4 buttons
Window.closeAll;
window = Window.new(name: "QuNeo", bounds: Rect(275, 163, 900, 600), resizable: false).front;
composite = CompositeView(parent: window, bounds: Rect(0, 0, 900, 600));
// composite = CompositeView(parent: window, bounds: Rect(25, 25, 850, 550));
composite.background = Color.black;
// ************************************ LEFT ***************************************
// want it above
// left side
// using compositeviews instead of flowlayouts
left = CompositeView(parent: composite, bounds: Rect(35, 35, 250, 270));
// left.background = Color.new255(127, 255, 212); // aquamarine
// left.background = Color.black;
// top buttons
top = CompositeView(parent: left, bounds:Rect(0, 30, 250, 60));
// top.background = Color.new255(255, 250, 205); // lime
top.decorator = FlowLayout(bounds: top.bounds, margin:15@3, gap: 25@25);
4.do({
var tb; // buttons on top
tb = Button(parent: top, bounds: 35@35);
tb.states = [["", Color.black, Color.white], ["", Color.white, Color.black]];
});
// bottom combinations
// bottom left
/*bottom = CompositeView(parent: left, bounds: Rect(0, 40, 250, 230));*/
bottom1 = CompositeView(parent: left, bounds: Rect(0, 75, 83, 170));
// bottom1.background = Color.new255(224, 102, 255); // bright purple
bottom1.decorator = FlowLayout(bounds: bottom1.bounds, margin: 15@15, gap: 5@15);
8.do({
var lb; // lower buttons
lb = Button(parent:bottom1, bounds: 20@20);
lb.states = [["", Color.black, Color.white], ["", Color.white, Color.black]];
});
// bottom right
bottom2 = CompositeView(parent: left, bounds: Rect(83, 65, 166, 180));
//bottom2.background = Color.new255(0, 0, 128); // dark navy
bottom2.decorator = FlowLayout(bounds: bottom2.bounds, margin: 15@15, gap: 10@10);
4.do({
var ls; //lower sliders
ls = Slider(parent: bottom2, bounds: 140@25);
// ls.background = Color.new255(219, 112, 147);
ls.background = Color.white;
});
// ************************************ RIGHT ***************************************
// 16 buttons
right = CompositeView(parent: composite, bounds: Rect(285, 35, 580, 470));
// right.background = Color.new255(255, 215, 0); // gold
// right.background = Color.black;
right.decorator = FlowLayout(bounds: right.bounds, margin: 75@25, gap: 15@15);
4.do({
var button;
button = Button.new(parent: right, bounds: 95@95);
button.states = [["", Color.black, Color.white], ["", Color.white, Color.black]];
});
right.decorator.nextLine;
4.do({
var button;
button = Button.new(parent: right, bounds: 95@95);
button.states = [["", Color.black, Color.white], ["", Color.white, Color.black]];
});
right.decorator.nextLine;
4.do({
var button;
button = Button.new(parent: right, bounds: 95@95);
button.states = [["", Color.black, Color.white], ["", Color.white, Color.black]];
});
right.decorator.nextLine;
4.do({
var button;
button = Button.new(parent: right, bounds: 95@95);
button.states = [["", Color.black, Color.white], ["", Color.white, Color.black]];
});
// ********************************* DARTH VADER *************************************
// darth vader
vader = CompositeView(parent: composite, bounds: Rect(35, 305, 250, 260));
// vader.background = Color.new255(255, 240, 245); // Lavender
// vader.background = Color.black;
// knobs
k1 = Knob(parent: vader, bounds: Rect(10, 0, 95, 95));
k2 = Knob(parent: vader, bounds: Rect(135, 0, 95, 95));
// nose
nose = Button(parent: vader, bounds: Rect(112.5, 75, 15, 15));
nose.states = [["", Color.black, Color.white], ["", Color.white, Color.black]];
// sliders
s1 = Slider.new(parent: vader, bounds: Rect(35, 105, 30, 150));
// s1.background_(Color.new255(219, 112, 147)); // pale violet red
s1.background_(Color.white);
s2 = Slider.new(parent: vader, bounds: Rect(85, 105, 30, 150));
// s2.background_(Color.new255(219, 112, 147)); // pale violet red
s2.background_(Color.white);
s3 = Slider.new(parent: vader, bounds: Rect(135, 105, 30, 150));
// s3.background_(Color.new255(219, 112, 147)); // pale violet red
s3.background_(Color.white);
s4 = Slider.new(parent: vader, bounds: Rect(185, 105, 30, 150));
// s3.background_(Color.new255(219, 112, 147)); // pale violet red
s4.background_(Color.white);
// ************************************ FOOTER ***************************************
// footer
footer = CompositeView(parent: composite, bounds: Rect(285, 505, 580, 60));
// footer.background = Color.new255(176, 226, 255); // Sky Blue
// footer.background = Color.black;
// upper left button
b1 = Button(parent: footer, bounds: Rect(35, 0, 25, 25));
b1.states = [["", Color.black, Color.white], ["", Color.white, Color.black]];
// lower left button
b2 = Button(parent: footer, bounds: Rect(35, 30, 25, 25));
b2.states = [["", Color.black, Color.white], ["", Color.white, Color.black]];
// text
// text = StaticText(parent: footer, bounds: Rect(80, 10, 80, 30));
text = StaticText(parent: footer, bounds: Rect(100, 0, 70, 30));
text.string = "SCLOrk";
// text.background = Color.white;
text.align = \left;
text.font = Font(name: "Times", size: 20, italic: true); //size
text.stringColor = Color.white;
text2 = StaticText(parent: footer, bounds: Rect(415, 0, 60, 30));
text2.string = "QuNeo";
// text2.background = Color.white;
text2.align = \left;
text2.font = Font(name: "Monaco", size: 20, bold: true);
text2.stringColor = Color.white;
// slider
slider = Slider.new(parent: footer, bounds: Rect(97, 25, 380, 30));
// slider.background_(Color.new255(219, 112, 147)); // pale violet red
slider.background_(Color.white);
// upper right button
b3 = Button(parent: footer, bounds: Rect(515, 0, 25, 25));
b3.states = [["", Color.black, Color.white], ["", Color.white, Color.black]];
// lower right button
b4 = Button(parent: footer, bounds: Rect(515, 30, 25, 25));
b4.states = [["", Color.black, Color.white], ["", Color.white, Color.black]];
)