OSDN Git Service

01813708d0588dfdacffd185049621224fc48239
[timewavesynth/Timewave_Synthesizer.git] / timewavesynth8osx.scd
1 (
2 //To run the synth, click anywhere within the parenthesis above and press "ctrl - enter" or "cmd - return".
3 //A guide to using the instrument is available by clicking on the "i" button in the bottom right corner of the GUI.
4 //Several lines down, where it says "//VARIABLES YOU MAY WISH TO CHANGE", are variables that you can change for various things,
5 //including key codes for keyboard functions.
6
7 //It is recommended to reboot the interpreter in the "Language" toolbar, or by hightlighting - (thisProcess.platform.recompile);
8 //and pressing "ctrl - enter" or "cmd - return", before each server boot. Rebooting the interpreter is not needed to
9 //evaluate the code below if the server is booted.
10
11 //You can program/make a song by using the "timewavesynth8script.scd" file
12
13 //This synth is compatible with the Korg NanoKontrol 2
14
15 s.options.memSize = 2097152/4;
16 MIDIIn.connectAll;
17
18 (
19 s.boot;
20 s.waitForBoot({
21         var point, w, view, view2,
22         vol = 0.02,mute1,mute2,mute3,mute4,mute5,mute6,mute7,mute8,muteall,unmuteall,
23         g1,g2,g6,g8,g33,g48,g64,g72,g88,gm,ngm1,ngm2,ngm6,set1,set2,menu1,menu2,
24         ts,sts,str,spaceb,b1,b2,b3,b4,button,button1,info,
25         n1,n2,n3,n4,n5,n6,n7,n8,keycodeb,
26         f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12;
27
28
29         //VARIABLES YOU MAY WISH TO CHANGE
30
31
32         //note A tuning frequency in hz
33
34         ~tuning_frequency = 432; //default 432 hz
35
36         ~freqmap = (i = ~tuning_frequency / (2 ** (69 / 12)); a = (-1); b = (-1); Array.fill(128, {i * (2 ** (((a=a+1) / 12).trunc)) * ( (2 ** (12.reciprocal)) ** ((b=b+1)  % 12));}));/*~freqmap = (i = 8.0271480262684/*-0.0000000000024*/; ~stepratio = 1.0594630943593; Array.fill(128, { i = i*~stepratio;}));*/
37
38
39         //number of KW(King Wen) sequences in a timewave half-cycle (or amplitude x2)
40
41         ~synthdefnum = 12; //default 12
42
43
44         //timewave starting base (lowest) frequency
45
46         x = 432; y = 432; ~basefreqmap = Array.fill(32, {x=x/1.0835058821738}).reverse++[432]++Array.fill(25, {y=y*1.0835058821738}); //create basefreqmap array
47
48         ~base_frequency = ~basefreqmap.at(8); //default 8 (63.027950580203). replace "~basefreqmap.at(#)" for custom value.
49
50
51         //starting synthdef setting
52
53         if((~kws_setting == nil) or: (~ratio_setting == nil), {
54
55                 ~kws_setting = 1; //default type of King Wen sequence interpretation
56
57                 ~ratio_setting = "psine1"; //default ratio setting for synthdef
58         });
59
60
61         //low-pass filter settings
62
63         if(~low_pass_filter_on == nil, {~low_pass_filter_on = 1}); //set starting low-pass filter on/off. 1 means on - switch to 0 for off.
64
65         if(~low_pass_filter_set_value == nil, {~low_pass_filter_freq_limit = 1728; //frequency limit for low-pass filter in synthdefs. default is 1728.
66         });
67
68
69         //default sendreply toggle
70
71         if(~sendreplysynthdef_on == nil, {~sendreplysynthdef_on = 0; //switch for mid-timewave sequence events. 0 is off, 1 is on. default is 0
72         });
73         if(~sendreplyfuncswitch == nil, {~sendreplyfuncswitch = 1; //1 is random western scale note change per timewave half-cycle, 2 is eastern scale. default is 1
74         });
75
76
77         //volume
78
79         ~vol = 0.005; //default 0.005
80         12.do(x = 0; {("vol"++(x=x+1)).asSymbol.envirPut(~vol)});
81
82
83         //Key codes for keyboard functions - either unicode or keycode. To find key codes, see below:
84
85         ~rightarrow_keycode = 65363; //next note change increase
86         ~leftarrow_keycode = 65361; //next note change decrease
87         ~uparrow_keycode = 65362; //change synth up
88         ~downarrow_keycode = 65364; //change synth down
89
90         ~rightarrow_keycode1 = 124; //next note change increase (old version - may not work)
91         ~leftarrow_keycode1 = 123; //next note change decrease (old version - may not work)
92         ~uparrow_keycode1 = 126; //change synth up (old version - may not work)
93         ~downarrow_keycode1 = 125; //change synth down (old version - may not work)
94
95         ~enter_unicode = 13; //
96         ~s_unicode = 115; //start synth
97         ~m_unicode = 109; //mute/unmute all synths
98         ~r_unicode = 114; //routine/loop function
99         ~u_unicode = 117; //
100         ~t_unicode = 116; //timer function
101         ~c_unicode = 99; //copy function
102         ~i_unicode = 105; //change synth up
103         ~k_unicode = 107; //change synth down
104         ~j_unicode = 106; //next note change decrease
105         ~l_unicode = 108; //next note change increase
106         ~spacebar_unicode = 32; //pause all synths
107         ~one_unicode = 49; //choose synth 1
108         ~two_unicode = 50; //choose synth 2
109         ~three_unicode = 51; //choose synth 3
110         ~four_unicode = 52; //choose synth 4
111         ~five_unicode = 53; //choose synth 5
112         ~six_unicode = 54; //choose synth 6
113         ~seven_unicode = 55; //choose synth 7
114         ~eight_unicode = 56; //choose synth 8
115         ~nine_unicode = 57; //choose synth 9
116         ~ten_unicode = 48; //choose synth 10
117         ~eleven_unicode = 45; //choose synth 11
118         ~twelve_unicode = 61; //choose synth 12
119         ~escape_unicode = 27; //escape function
120
121
122         //To find key codes in post window... Hightlight the function and its parenthesis in red below,
123         //and press "ctrl - enter" or "cmd - return" - then a small window called "test" will pop up...
124         //Press the "type" button inside of the window, then press anywhere on the keyboard to find
125         //the key codes in the right-hand side post window. Layout: [unicode, keycode, modifiers]. It is either a unicode
126         //or a keycode. Do not delete the /* and */ characters, or else the
127         //program will not run.
128
129         /*
130
131         (
132         var win = Window(\test, Rect(10, 100, 100, 50)),
133         btn = Button(win, Rect(5, 5, 90, 40)).states_([["type"]]);
134         btn.keyDownAction =
135         { arg view, char, modifiers, unicode, keycode;
136         ["unicode:"+unicode, "keycode:"+keycode, "modifiers:"+modifiers].postln;
137         };
138         win.front;
139         )
140
141         */
142
143
144         //gui set frequency ranges - currently set at the lowest and highest notes on a 128 key range using 432 hz A tuning
145         //you can change the tuning near top
146         //to insert custom ranges, replace "~freqmap.at()" with a hz frequency
147
148         ~outmin1 = ~freqmap.at(0);       // 8.0271480262684 hz                       //base frequency of upper set
149         ~outmax1 = ~freqmap.at(127);     // 12315.783879572 hz                       //high frequency of upper set
150         ~outmin2 = ~freqmap.at(0)*8;     // (8.0271480262684)*8 hz                   //base frequency of lower set
151         ~outmax2 = ~freqmap.at(127)/8;   // (12315.783879572)/8 hz;                  //high frequency of lower set
152
153         ~outmina = ~outmin2;
154         ~outmaxa = ~outmax2;
155         ~outminb = ~outmin1;
156         ~outmaxb = ~outmax1;
157
158
159         //increase or decrease magnitude of second and third harmonics for synthdefs and synth functions (not recommend changing if uncertain of effects)
160
161         //synthdefs
162
163         ~first_harmonic = 1;  //1
164         ~second_harmonic = 2; //2
165         ~third_harmonic = 6;  //6
166
167         //synth functions
168
169         ~icd3 = 3; //3
170         ~icd6 = 6; //6
171
172
173         //ratio values
174
175         ~fth = 1.4142135623729; //default kws binary interval
176         ~bi = ~fth; //~bi = "binary interval" - intverval of key change to a hexagram line's opposite in King Wen sequence
177         ~stepratio = 1.0594630943593;
178         ~nval = 1.0355417528;
179         ~n9s = 1.86;
180         ~n9 = 1.080059789899;
181         ~n18 = 1.0392592260319;
182         ~n27 = 1.0260044847071;
183         ~n36 = 1.0194406437022;
184         ~n45 = 1.0155225125043;
185         ~n54 = 1.012918794725;
186         ~n63 = 1.0110630844869;
187         ~n72 = 1.0096735332285;
188         ~gm = 1.6180339887499; //phi (golden mean), scaled on 1 key change per King Wen sequence
189         ~gm2 = 1.2720196495141;
190         ~gm6 = 1.0835058821738;
191         ~ngm1 = 1.0549232131786; //phi (golden mean), scaled on 9 key changes per King Wen sequence
192         ~ngm2 = 1.0270945492887;
193         ~ngm6 = 1.0089511542031;
194         ~nngm1 = 1.0075472729363; //phi (golden mean), scaled on 64 key changes per King Wen sequence
195         ~nngm2 = 1.0037665430449;
196         ~nngm6 = 1.0012539413222;
197         ~h1 = 11.10101010101; //based on 19.47:360, scaled on 1 key change per King Wen sequence
198         ~h2 = 4.2999982083345;
199         ~h6 = 1.6261331058274;
200         ~nh1 = 1.3828361607663; //based on 19.47:360, scaled on 9 key changes per King Wen sequence
201         ~nh2 = 1.1759405430404;
202         ~nh6 = 1.0555086286213;
203         ~nnh1 = 1.0466365180627; //based on 19.47:360, scaled on 64 key changes per King Wen sequence
204         ~nnh2 = 1.0230525490231;
205         ~nnh6 = 1.0076258811195;
206
207
208         //edit SAVED s1-s8 frequencies/chords. Replace any "[ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]" with desired frequencies.
209         //Example: [~f1=31.385685128991,~f2=86.222407114322,~f3=229.95963599755,~f4=841.97361403235,~f5=894.01606840275,~f6=38.068730542463,~f7=80.91428965114,~f8=554.92014995488]
210         //You can find frequencies in the "copy" section of GUI under "saved open/flow 1-8 frequencies:" or "saved slide 1-8 frequencies:".
211         //Remove both the "/*" and "*/" around the code to make evaluable. Put them back to make it unevaluable.
212
213         /*
214
215         8.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ].at(x-1))});
216         8.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ].at(x-1))});
217         8.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ].at(x-1))});
218         8.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ].at(x-1))});
219         8.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ].at(x-1))});
220         8.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ].at(x-1))});
221         8.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ].at(x-1))});
222         8.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ].at(x-1))});
223
224         */
225
226
227         //edit STARTING frequencies/chord (not saved s1-s8 frequencies/chords). Replace "[ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]" with starting frequencies.
228         //Example: [~f1=31.385685128991,~f2=86.222407114322,~f3=229.95963599755,~f4=841.97361403235,~f5=894.01606840275,~f6=38.068730542463,~f7=80.91428965114,~f8=554.92014995488]
229         //You can find frequencies in the "copy" section of GUI under "current chord/frequencies".
230         //Remove both the "/*" and "*/" around the code to make evaluable. Put them back to make it unevaluable again.
231
232         /*
233
234         8.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut(
235
236         [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]
237
238         .at(x-1))});
239
240         */
241
242         //^Imoprtant note: "edit STARTING frequencies/chord" must be placed after "edit SAVED frequencies/chords" in code in order for it to work correctly
243
244
245         ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
246
247
248         //default starting notes
249
250         if(([f1,f2,f3,f4,f5,f6,f7,f8] == [nil,nil,nil,nil,nil,nil,nil,nil]), {
251                 #f1,f2,f3,f4,f5,f6,f7,f8 = [
252                         (~freqmap.at(127)/8).rand,
253                         (~freqmap.at(127)/8).rand,
254                         (~freqmap.at(127)/8).rand,
255                         (~freqmap.at(127)/8).rand,
256                         (~freqmap.at(127)/8).rand,
257                         (~freqmap.at(127)/8).rand,
258                         (~freqmap.at(127)/8).rand,
259                         (~freqmap.at(127)/8).rand
260                 ];
261         });
262
263         if(([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil]), {8.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut([f1,f2,f3,f4,f5,f6,f7,f8].at(x-1))});});
264
265         if([~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8,~fp9,~fp10,~fp11,~fp12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))});});
266         if([~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b,~fp9b,~fp10b,~fp11b,~fp12b] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))});});
267         if([~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c,~fp9c,~fp10c,~fp11c,~fp12c] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))});});
268         if([~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d,~fp9d,~fp10d,~fp11d,~fp12d] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))});});
269         if([~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e,~fp9e,~fp10e,~fp11e,~fp12e] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))});});
270         if([~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f,~fp9f,~fp10f,~fp11f,~fp12f] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))});});
271         if([~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g,~fp9g,~fp10g,~fp11g,~fp12g] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))});});
272         if([~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h,~fp9h,~fp10h,~fp11h,~fp12h] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {12.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))});});
273
274         12.do(x = 0; {("u"++(x=x+1)).asSymbol.envirPut([~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8,~fp9,~fp10,~fp11,~fp12].at(x-1))});
275         12.do(x = 0; {("u"++(x=x+1)++"b").asSymbol.envirPut([~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b,~fp9b,~fp10b,~fp11b,~fp12b].at(x-1))});
276         12.do(x = 0; {("u"++(x=x+1)++"c").asSymbol.envirPut([~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c,~fp9c,~fp10c,~fp11c,~fp12c].at(x-1))});
277         12.do(x = 0; {("u"++(x=x+1)++"d").asSymbol.envirPut([~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d,~fp9d,~fp10d,~fp11d,~fp12d].at(x-1))});
278         12.do(x = 0; {("u"++(x=x+1)++"e").asSymbol.envirPut([~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e,~fp9e,~fp10e,~fp11e,~fp12e].at(x-1))});
279         12.do(x = 0; {("u"++(x=x+1)++"f").asSymbol.envirPut([~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f,~fp9f,~fp10f,~fp11f,~fp12f].at(x-1))});
280         12.do(x = 0; {("u"++(x=x+1)++"g").asSymbol.envirPut([~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g,~fp9g,~fp10g,~fp11g,~fp12g].at(x-1))});
281         12.do(x = 0; {("u"++(x=x+1)++"h").asSymbol.envirPut([~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h,~fp9h,~fp10h,~fp11h,~fp12h].at(x-1))});
282
283         if([~sg1a1,~sg1a2,~sg1a3,~sg1a4,~sg1a5,~sg1a6,~sg1a7,~sg1a8,~sg1a9,~sg1a10,~sg1a11,~sg1a12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg1a1=~f1,~sg1a2=~f2,~sg1a3=~f3,~sg1a4=~f4,~sg1a5=~f5,~sg1a6=~f6,~sg1a7=~f7,~sg1a8=~f8];});
284         if([~sg1b1,~sg1b2,~sg1b3,~sg1b4,~sg1b5,~sg1b6,~sg1b7,~sg1b8,~sg1b9,~sg1b10,~sg1b11,~sg1b12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg1b1=~f1,~sg1b2=~f2,~sg1b3=~f3,~sg1b4=~f4,~sg1b5=~f5,~sg1b6=~f6,~sg1b7=~f7,~sg1b8=~f8];});
285         if([~sg1c1,~sg1c2,~sg1c3,~sg1c4,~sg1c5,~sg1c6,~sg1c7,~sg1c8,~sg1c9,~sg1c10,~sg1c11,~sg1c12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg1c1=~f1,~sg1c2=~f2,~sg1c3=~f3,~sg1c4=~f4,~sg1c5=~f5,~sg1c6=~f6,~sg1c7=~f7,~sg1c8=~f8];});
286         if([~sg1d1,~sg1d2,~sg1d3,~sg1d4,~sg1d5,~sg1d6,~sg1d7,~sg1d8,~sg1d9,~sg1d10,~sg1d11,~sg1d12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg1d1=~f1,~sg1d2=~f2,~sg1d3=~f3,~sg1d4=~f4,~sg1d5=~f5,~sg1d6=~f6,~sg1d7=~f7,~sg1d8=~f8];});
287         if([~sg1e1,~sg1e2,~sg1e3,~sg1e4,~sg1e5,~sg1e6,~sg1e7,~sg1e8,~sg1e9,~sg1e10,~sg1e11,~sg1e12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg1e1=~f1,~sg1e2=~f2,~sg1e3=~f3,~sg1e4=~f4,~sg1e5=~f5,~sg1e6=~f6,~sg1e7=~f7,~sg1e8=~f8];});
288         if([~sg1f1,~sg1f2,~sg1f3,~sg1f4,~sg1f5,~sg1f6,~sg1f7,~sg1f8,~sg1f9,~sg1f10,~sg1f11,~sg1f12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg1f1=~f1,~sg1f2=~f2,~sg1f3=~f3,~sg1f4=~f4,~sg1f5=~f5,~sg1f6=~f6,~sg1f7=~f7,~sg1f8=~f8];});
289         if([~sg1g1,~sg1g2,~sg1g3,~sg1g4,~sg1g5,~sg1g6,~sg1g7,~sg1g8,~sg1g9,~sg1g10,~sg1g11,~sg1g12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg1g1=~f1,~sg1g2=~f2,~sg1g3=~f3,~sg1g4=~f4,~sg1g5=~f5,~sg1g6=~f6,~sg1g7=~f7,~sg1g8=~f8];});
290         if([~sg1h1,~sg1h2,~sg1h3,~sg1h4,~sg1h5,~sg1h6,~sg1h7,~sg1h8,~sg1h9,~sg1h10,~sg1h11,~sg1h12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg1h1=~f1,~sg1h2=~f2,~sg1h3=~f3,~sg1h4=~f4,~sg1h5=~f5,~sg1h6=~f6,~sg1h7=~f7,~sg1h8=~f8];});
291         if([~sg2a1,~sg2a2,~sg2a3,~sg2a4,~sg2a5,~sg2a6,~sg2a7,~sg2a8,~sg2a9,~sg2a10,~sg2a11,~sg2a12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg2a1=~f1,~sg2a2=~f2,~sg2a3=~f3,~sg2a4=~f4,~sg2a5=~f5,~sg2a6=~f6,~sg2a7=~f7,~sg2a8=~f8];});
292         if([~sg2b1,~sg2b2,~sg2b3,~sg2b4,~sg2b5,~sg2b6,~sg2b7,~sg2b8,~sg2b9,~sg2b10,~sg2b11,~sg2b12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg2b1=~f1,~sg2b2=~f2,~sg2b3=~f3,~sg2b4=~f4,~sg2b5=~f5,~sg2b6=~f6,~sg2b7=~f7,~sg2b8=~f8];});
293         if([~sg2c1,~sg2c2,~sg2c3,~sg2c4,~sg2c5,~sg2c6,~sg2c7,~sg2c8,~sg2c9,~sg2c10,~sg2c11,~sg2c12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg2c1=~f1,~sg2c2=~f2,~sg2c3=~f3,~sg2c4=~f4,~sg2c5=~f5,~sg2c6=~f6,~sg2c7=~f7,~sg2c8=~f8];});
294         if([~sg2d1,~sg2d2,~sg2d3,~sg2d4,~sg2d5,~sg2d6,~sg2d7,~sg2d8,~sg2d9,~sg2d10,~sg2d11,~sg2d12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg2d1=~f1,~sg2d2=~f2,~sg2d3=~f3,~sg2d4=~f4,~sg2d5=~f5,~sg2d6=~f6,~sg2d7=~f7,~sg2d8=~f8];});
295         if([~sg2e1,~sg2e2,~sg2e3,~sg2e4,~sg2e5,~sg2e6,~sg2e7,~sg2e8,~sg2e9,~sg2e10,~sg2e11,~sg2e12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg2e1=~f1,~sg2e2=~f2,~sg2e3=~f3,~sg2e4=~f4,~sg2e5=~f5,~sg2e6=~f6,~sg2e7=~f7,~sg2e8=~f8];});
296         if([~sg2f1,~sg2f2,~sg2f3,~sg2f4,~sg2f5,~sg2f6,~sg2f7,~sg2f8,~sg2f9,~sg2f10,~sg2f11,~sg2f12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg2f1=~f1,~sg2f2=~f2,~sg2f3=~f3,~sg2f4=~f4,~sg2f5=~f5,~sg2f6=~f6,~sg2f7=~f7,~sg2f8=~f8];});
297         if([~sg2g1,~sg2g2,~sg2g3,~sg2g4,~sg2g5,~sg2g6,~sg2g7,~sg2g8,~sg2g9,~sg2g10,~sg2g11,~sg2g12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg2g1=~f1,~sg2g2=~f2,~sg2g3=~f3,~sg2g4=~f4,~sg2g5=~f5,~sg2g6=~f6,~sg2g7=~f7,~sg2g8=~f8];});
298         if([~sg2h1,~sg2h2,~sg2h3,~sg2h4,~sg2h5,~sg2h6,~sg2h7,~sg2h8,~sg2h9,~sg2h10,~sg2h11,~sg2h12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg2h1=~f1,~sg2h2=~f2,~sg2h3=~f3,~sg2h4=~f4,~sg2h5=~f5,~sg2h6=~f6,~sg2h7=~f7,~sg2h8=~f8];});
299         if([~sg3a1,~sg3a2,~sg3a3,~sg3a4,~sg3a5,~sg3a6,~sg3a7,~sg3a8,~sg3a9,~sg3a10,~sg3a11,~sg3a12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg3a1=~f1,~sg3a2=~f2,~sg3a3=~f3,~sg3a4=~f4,~sg3a5=~f5,~sg3a6=~f6,~sg3a7=~f7,~sg3a8=~f8];});
300         if([~sg3b1,~sg3b2,~sg3b3,~sg3b4,~sg3b5,~sg3b6,~sg3b7,~sg3b8,~sg3b9,~sg3b10,~sg3b11,~sg3b12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg3b1=~f1,~sg3b2=~f2,~sg3b3=~f3,~sg3b4=~f4,~sg3b5=~f5,~sg3b6=~f6,~sg3b7=~f7,~sg3b8=~f8];});
301         if([~sg3c1,~sg3c2,~sg3c3,~sg3c4,~sg3c5,~sg3c6,~sg3c7,~sg3c8,~sg3c9,~sg3c10,~sg3c11,~sg3c12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg3c1=~f1,~sg3c2=~f2,~sg3c3=~f3,~sg3c4=~f4,~sg3c5=~f5,~sg3c6=~f6,~sg3c7=~f7,~sg3c8=~f8];});
302         if([~sg3d1,~sg3d2,~sg3d3,~sg3d4,~sg3d5,~sg3d6,~sg3d7,~sg3d8,~sg3d9,~sg3d10,~sg3d11,~sg3d12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg3d1=~f1,~sg3d2=~f2,~sg3d3=~f3,~sg3d4=~f4,~sg3d5=~f5,~sg3d6=~f6,~sg3d7=~f7,~sg3d8=~f8];});
303         if([~sg3e1,~sg3e2,~sg3e3,~sg3e4,~sg3e5,~sg3e6,~sg3e7,~sg3e8,~sg3e9,~sg3e10,~sg3e11,~sg3e12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg3e1=~f1,~sg3e2=~f2,~sg3e3=~f3,~sg3e4=~f4,~sg3e5=~f5,~sg3e6=~f6,~sg3e7=~f7,~sg3e8=~f8];});
304         if([~sg3f1,~sg3f2,~sg3f3,~sg3f4,~sg3f5,~sg3f6,~sg3f7,~sg3f8,~sg3f9,~sg3f10,~sg3f11,~sg3f12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg3f1=~f1,~sg3f2=~f2,~sg3f3=~f3,~sg3f4=~f4,~sg3f5=~f5,~sg3f6=~f6,~sg3f7=~f7,~sg3f8=~f8];});
305         if([~sg3g1,~sg3g2,~sg3g3,~sg3g4,~sg3g5,~sg3g6,~sg3g7,~sg3g8,~sg3g9,~sg3g10,~sg3g11,~sg3g12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg3g1=~f1,~sg3g2=~f2,~sg3g3=~f3,~sg3g4=~f4,~sg3g5=~f5,~sg3g6=~f6,~sg3g7=~f7,~sg3g8=~f8];});
306         if([~sg3h1,~sg3h2,~sg3h3,~sg3h4,~sg3h5,~sg3h6,~sg3h7,~sg3h8,~sg3h9,~sg3h10,~sg3h11,~sg3h12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg3h1=~f1,~sg3h2=~f2,~sg3h3=~f3,~sg3h4=~f4,~sg3h5=~f5,~sg3h6=~f6,~sg3h7=~f7,~sg3h8=~f8];});
307         if([~sg4a1,~sg4a2,~sg4a3,~sg4a4,~sg4a5,~sg4a6,~sg4a7,~sg4a8,~sg4a9,~sg4a10,~sg4a11,~sg4a12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg4a1=~f1,~sg4a2=~f2,~sg4a3=~f3,~sg4a4=~f4,~sg4a5=~f5,~sg4a6=~f6,~sg4a7=~f7,~sg4a8=~f8];});
308         if([~sg4b1,~sg4b2,~sg4b3,~sg4b4,~sg4b5,~sg4b6,~sg4b7,~sg4b8,~sg4b9,~sg4b10,~sg4b11,~sg4b12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg4b1=~f1,~sg4b2=~f2,~sg4b3=~f3,~sg4b4=~f4,~sg4b5=~f5,~sg4b6=~f6,~sg4b7=~f7,~sg4b8=~f8];});
309         if([~sg4c1,~sg4c2,~sg4c3,~sg4c4,~sg4c5,~sg4c6,~sg4c7,~sg4c8,~sg4c9,~sg4c10,~sg4c11,~sg4c12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg4c1=~f1,~sg4c2=~f2,~sg4c3=~f3,~sg4c4=~f4,~sg4c5=~f5,~sg4c6=~f6,~sg4c7=~f7,~sg4c8=~f8];});
310         if([~sg4d1,~sg4d2,~sg4d3,~sg4d4,~sg4d5,~sg4d6,~sg4d7,~sg4d8,~sg4d9,~sg4d10,~sg4d11,~sg4d12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg4d1=~f1,~sg4d2=~f2,~sg4d3=~f3,~sg4d4=~f4,~sg4d5=~f5,~sg4d6=~f6,~sg4d7=~f7,~sg4d8=~f8];});
311         if([~sg4e1,~sg4e2,~sg4e3,~sg4e4,~sg4e5,~sg4e6,~sg4e7,~sg4e8,~sg4e9,~sg4e10,~sg4e11,~sg4e12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg4e1=~f1,~sg4e2=~f2,~sg4e3=~f3,~sg4e4=~f4,~sg4e5=~f5,~sg4e6=~f6,~sg4e7=~f7,~sg4e8=~f8];});
312         if([~sg4f1,~sg4f2,~sg4f3,~sg4f4,~sg4f5,~sg4f6,~sg4f7,~sg4f8,~sg4f9,~sg4f10,~sg4f11,~sg4f12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg4f1=~f1,~sg4f2=~f2,~sg4f3=~f3,~sg4f4=~f4,~sg4f5=~f5,~sg4f6=~f6,~sg4f7=~f7,~sg4f8=~f8];});
313         if([~sg4g1,~sg4g2,~sg4g3,~sg4g4,~sg4g5,~sg4g6,~sg4g7,~sg4g8,~sg4g9,~sg4g10,~sg4g11,~sg4g12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg4g1=~f1,~sg4g2=~f2,~sg4g3=~f3,~sg4g4=~f4,~sg4g5=~f5,~sg4g6=~f6,~sg4g7=~f7,~sg4g8=~f8];});
314         if([~sg4h1,~sg4h2,~sg4h3,~sg4h4,~sg4h5,~sg4h6,~sg4h7,~sg4h8,~sg4h9,~sg4h10,~sg4h11,~sg4h12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg4h1=~f1,~sg4h2=~f2,~sg4h3=~f3,~sg4h4=~f4,~sg4h5=~f5,~sg4h6=~f6,~sg4h7=~f7,~sg4h8=~f8];});
315         if([~sg5a1,~sg5a2,~sg5a3,~sg5a4,~sg5a5,~sg5a6,~sg5a7,~sg5a8,~sg5a9,~sg5a10,~sg5a11,~sg5a12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg5a1=~f1,~sg5a2=~f2,~sg5a3=~f3,~sg5a4=~f4,~sg5a5=~f5,~sg5a6=~f6,~sg5a7=~f7,~sg5a8=~f8];});
316         if([~sg5b1,~sg5b2,~sg5b3,~sg5b4,~sg5b5,~sg5b6,~sg5b7,~sg5b8,~sg5b9,~sg5b10,~sg5b11,~sg5b12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg5b1=~f1,~sg5b2=~f2,~sg5b3=~f3,~sg5b4=~f4,~sg5b5=~f5,~sg5b6=~f6,~sg5b7=~f7,~sg5b8=~f8];});
317         if([~sg5c1,~sg5c2,~sg5c3,~sg5c4,~sg5c5,~sg5c6,~sg5c7,~sg5c8,~sg5c9,~sg5c10,~sg5c11,~sg5c12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg5c1=~f1,~sg5c2=~f2,~sg5c3=~f3,~sg5c4=~f4,~sg5c5=~f5,~sg5c6=~f6,~sg5c7=~f7,~sg5c8=~f8];});
318         if([~sg5d1,~sg5d2,~sg5d3,~sg5d4,~sg5d5,~sg5d6,~sg5d7,~sg5d8,~sg5d9,~sg5d10,~sg5d11,~sg5d12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg5d1=~f1,~sg5d2=~f2,~sg5d3=~f3,~sg5d4=~f4,~sg5d5=~f5,~sg5d6=~f6,~sg5d7=~f7,~sg5d8=~f8];});
319         if([~sg5e1,~sg5e2,~sg5e3,~sg5e4,~sg5e5,~sg5e6,~sg5e7,~sg5e8,~sg5e9,~sg5e10,~sg5e11,~sg5e12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg5e1=~f1,~sg5e2=~f2,~sg5e3=~f3,~sg5e4=~f4,~sg5e5=~f5,~sg5e6=~f6,~sg5e7=~f7,~sg5e8=~f8];});
320         if([~sg5f1,~sg5f2,~sg5f3,~sg5f4,~sg5f5,~sg5f6,~sg5f7,~sg5f8,~sg5f9,~sg5f10,~sg5f11,~sg5f12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg5f1=~f1,~sg5f2=~f2,~sg5f3=~f3,~sg5f4=~f4,~sg5f5=~f5,~sg5f6=~f6,~sg5f7=~f7,~sg5f8=~f8];});
321         if([~sg5g1,~sg5g2,~sg5g3,~sg5g4,~sg5g5,~sg5g6,~sg5g7,~sg5g8,~sg5g9,~sg5g10,~sg5g11,~sg5g12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg5g1=~f1,~sg5g2=~f2,~sg5g3=~f3,~sg5g4=~f4,~sg5g5=~f5,~sg5g6=~f6,~sg5g7=~f7,~sg5g8=~f8];});
322         if([~sg5h1,~sg5h2,~sg5h3,~sg5h4,~sg5h5,~sg5h6,~sg5h7,~sg5h8,~sg5h9,~sg5h10,~sg5h11,~sg5h12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg5h1=~f1,~sg5h2=~f2,~sg5h3=~f3,~sg5h4=~f4,~sg5h5=~f5,~sg5h6=~f6,~sg5h7=~f7,~sg5h8=~f8];});
323         if([~sg6a1,~sg6a2,~sg6a3,~sg6a4,~sg6a5,~sg6a6,~sg6a7,~sg6a8,~sg6a9,~sg6a10,~sg6a11,~sg6a12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg6a1=~f1,~sg6a2=~f2,~sg6a3=~f3,~sg6a4=~f4,~sg6a5=~f5,~sg6a6=~f6,~sg6a7=~f7,~sg6a8=~f8];});
324         if([~sg6b1,~sg6b2,~sg6b3,~sg6b4,~sg6b5,~sg6b6,~sg6b7,~sg6b8,~sg6b9,~sg6b10,~sg6b11,~sg6b12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg6b1=~f1,~sg6b2=~f2,~sg6b3=~f3,~sg6b4=~f4,~sg6b5=~f5,~sg6b6=~f6,~sg6b7=~f7,~sg6b8=~f8];});
325         if([~sg6c1,~sg6c2,~sg6c3,~sg6c4,~sg6c5,~sg6c6,~sg6c7,~sg6c8,~sg6c9,~sg6c10,~sg6c11,~sg6c12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg6c1=~f1,~sg6c2=~f2,~sg6c3=~f3,~sg6c4=~f4,~sg6c5=~f5,~sg6c6=~f6,~sg6c7=~f7,~sg6c8=~f8];});
326         if([~sg6d1,~sg6d2,~sg6d3,~sg6d4,~sg6d5,~sg6d6,~sg6d7,~sg6d8,~sg6d9,~sg6d10,~sg6d11,~sg6d12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg6d1=~f1,~sg6d2=~f2,~sg6d3=~f3,~sg6d4=~f4,~sg6d5=~f5,~sg6d6=~f6,~sg6d7=~f7,~sg6d8=~f8];});
327         if([~sg6e1,~sg6e2,~sg6e3,~sg6e4,~sg6e5,~sg6e6,~sg6e7,~sg6e8,~sg6e9,~sg6e10,~sg6e11,~sg6e12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg6e1=~f1,~sg6e2=~f2,~sg6e3=~f3,~sg6e4=~f4,~sg6e5=~f5,~sg6e6=~f6,~sg6e7=~f7,~sg6e8=~f8];});
328         if([~sg6f1,~sg6f2,~sg6f3,~sg6f4,~sg6f5,~sg6f6,~sg6f7,~sg6f8,~sg6f9,~sg6f10,~sg6f11,~sg6f12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg6f1=~f1,~sg6f2=~f2,~sg6f3=~f3,~sg6f4=~f4,~sg6f5=~f5,~sg6f6=~f6,~sg6f7=~f7,~sg6f8=~f8];});
329         if([~sg6g1,~sg6g2,~sg6g3,~sg6g4,~sg6g5,~sg6g6,~sg6g7,~sg6g8,~sg6g9,~sg6g10,~sg6g11,~sg6g12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg6g1=~f1,~sg6g2=~f2,~sg6g3=~f3,~sg6g4=~f4,~sg6g5=~f5,~sg6g6=~f6,~sg6g7=~f7,~sg6g8=~f8];});
330         if([~sg6h1,~sg6h2,~sg6h3,~sg6h4,~sg6h5,~sg6h6,~sg6h7,~sg6h8,~sg6h9,~sg6h10,~sg6h11,~sg6h12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg6h1=~f1,~sg6h2=~f2,~sg6h3=~f3,~sg6h4=~f4,~sg6h5=~f5,~sg6h6=~f6,~sg6h7=~f7,~sg6h8=~f8];});
331         if([~sg7a1,~sg7a2,~sg7a3,~sg7a4,~sg7a5,~sg7a6,~sg7a7,~sg7a8,~sg7a9,~sg7a10,~sg7a11,~sg7a12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg7a1=~f1,~sg7a2=~f2,~sg7a3=~f3,~sg7a4=~f4,~sg7a5=~f5,~sg7a6=~f6,~sg7a7=~f7,~sg7a8=~f8];});
332         if([~sg7b1,~sg7b2,~sg7b3,~sg7b4,~sg7b5,~sg7b6,~sg7b7,~sg7b8,~sg7b9,~sg7b10,~sg7b11,~sg7b12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg7b1=~f1,~sg7b2=~f2,~sg7b3=~f3,~sg7b4=~f4,~sg7b5=~f5,~sg7b6=~f6,~sg7b7=~f7,~sg7b8=~f8];});
333         if([~sg7c1,~sg7c2,~sg7c3,~sg7c4,~sg7c5,~sg7c6,~sg7c7,~sg7c8,~sg7c9,~sg7c10,~sg7c11,~sg7c12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg7c1=~f1,~sg7c2=~f2,~sg7c3=~f3,~sg7c4=~f4,~sg7c5=~f5,~sg7c6=~f6,~sg7c7=~f7,~sg7c8=~f8];});
334         if([~sg7d1,~sg7d2,~sg7d3,~sg7d4,~sg7d5,~sg7d6,~sg7d7,~sg7d8,~sg7d9,~sg7d10,~sg7d11,~sg7d12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg7d1=~f1,~sg7d2=~f2,~sg7d3=~f3,~sg7d4=~f4,~sg7d5=~f5,~sg7d6=~f6,~sg7d7=~f7,~sg7d8=~f8];});
335         if([~sg7e1,~sg7e2,~sg7e3,~sg7e4,~sg7e5,~sg7e6,~sg7e7,~sg7e8,~sg7e9,~sg7e10,~sg7e11,~sg7e12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg7e1=~f1,~sg7e2=~f2,~sg7e3=~f3,~sg7e4=~f4,~sg7e5=~f5,~sg7e6=~f6,~sg7e7=~f7,~sg7e8=~f8];});
336         if([~sg7f1,~sg7f2,~sg7f3,~sg7f4,~sg7f5,~sg7f6,~sg7f7,~sg7f8,~sg7f9,~sg7f10,~sg7f11,~sg7f12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg7f1=~f1,~sg7f2=~f2,~sg7f3=~f3,~sg7f4=~f4,~sg7f5=~f5,~sg7f6=~f6,~sg7f7=~f7,~sg7f8=~f8];});
337         if([~sg7g1,~sg7g2,~sg7g3,~sg7g4,~sg7g5,~sg7g6,~sg7g7,~sg7g8,~sg7g9,~sg7g10,~sg7g11,~sg7g12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg7g1=~f1,~sg7g2=~f2,~sg7g3=~f3,~sg7g4=~f4,~sg7g5=~f5,~sg7g6=~f6,~sg7g7=~f7,~sg7g8=~f8];});
338         if([~sg7h1,~sg7h2,~sg7h3,~sg7h4,~sg7h5,~sg7h6,~sg7h7,~sg7h8,~sg7h9,~sg7h10,~sg7h11,~sg7h12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg7h1=~f1,~sg7h2=~f2,~sg7h3=~f3,~sg7h4=~f4,~sg7h5=~f5,~sg7h6=~f6,~sg7h7=~f7,~sg7h8=~f8];});
339         if([~sg8a1,~sg8a2,~sg8a3,~sg8a4,~sg8a5,~sg8a6,~sg8a7,~sg8a8,~sg8a9,~sg8a10,~sg8a11,~sg8a12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg8a1=~f1,~sg8a2=~f2,~sg8a3=~f3,~sg8a4=~f4,~sg8a5=~f5,~sg8a6=~f6,~sg8a7=~f7,~sg8a8=~f8];});
340         if([~sg8b1,~sg8b2,~sg8b3,~sg8b4,~sg8b5,~sg8b6,~sg8b7,~sg8b8,~sg8b9,~sg8b10,~sg8b11,~sg8b12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg8b1=~f1,~sg8b2=~f2,~sg8b3=~f3,~sg8b4=~f4,~sg8b5=~f5,~sg8b6=~f6,~sg8b7=~f7,~sg8b8=~f8];});
341         if([~sg8c1,~sg8c2,~sg8c3,~sg8c4,~sg8c5,~sg8c6,~sg8c7,~sg8c8,~sg8c9,~sg8c10,~sg8c11,~sg8c12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg8c1=~f1,~sg8c2=~f2,~sg8c3=~f3,~sg8c4=~f4,~sg8c5=~f5,~sg8c6=~f6,~sg8c7=~f7,~sg8c8=~f8];});
342         if([~sg8d1,~sg8d2,~sg8d3,~sg8d4,~sg8d5,~sg8d6,~sg8d7,~sg8d8,~sg8d9,~sg8d10,~sg8d11,~sg8d12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg8d1=~f1,~sg8d2=~f2,~sg8d3=~f3,~sg8d4=~f4,~sg8d5=~f5,~sg8d6=~f6,~sg8d7=~f7,~sg8d8=~f8];});
343         if([~sg8e1,~sg8e2,~sg8e3,~sg8e4,~sg8e5,~sg8e6,~sg8e7,~sg8e8,~sg8e9,~sg8e10,~sg8e11,~sg8e12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg8e1=~f1,~sg8e2=~f2,~sg8e3=~f3,~sg8e4=~f4,~sg8e5=~f5,~sg8e6=~f6,~sg8e7=~f7,~sg8e8=~f8];});
344         if([~sg8f1,~sg8f2,~sg8f3,~sg8f4,~sg8f5,~sg8f6,~sg8f7,~sg8f8,~sg8f9,~sg8f10,~sg8f11,~sg8f12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg8f1=~f1,~sg8f2=~f2,~sg8f3=~f3,~sg8f4=~f4,~sg8f5=~f5,~sg8f6=~f6,~sg8f7=~f7,~sg8f8=~f8];});
345         if([~sg8g1,~sg8g2,~sg8g3,~sg8g4,~sg8g5,~sg8g6,~sg8g7,~sg8g8,~sg8g9,~sg8g10,~sg8g11,~sg8g12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg8g1=~f1,~sg8g2=~f2,~sg8g3=~f3,~sg8g4=~f4,~sg8g5=~f5,~sg8g6=~f6,~sg8g7=~f7,~sg8g8=~f8];});
346         if([~sg8h1,~sg8h2,~sg8h3,~sg8h4,~sg8h5,~sg8h6,~sg8h7,~sg8h8,~sg8h9,~sg8h10,~sg8h11,~sg8h12] == [nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil], {[~sg8h1=~f1,~sg8h2=~f2,~sg8h3=~f3,~sg8h4=~f4,~sg8h5=~f5,~sg8h6=~f6,~sg8h7=~f7,~sg8h8=~f8];});
347
348
349         //set n1-n9 ratio values
350
351         case
352         {~ratio_setting == "psine1";}{~n_value1 = ~gm;    ~n_value2 = ~gm2;   ~n_value6 = ~gm6;}
353         {~ratio_setting == "psine2";}{~n_value1 = ~ngm1;  ~n_value2 = ~ngm2;  ~n_value6 = ~ngm6;}
354         {~ratio_setting == "psine3";}{~n_value1 = ~nngm1; ~n_value2 = ~nngm2; ~n_value6 = ~nngm6;}
355         {~ratio_setting == "hsine1";}{~n_value1 = ~h1;    ~n_value2 = ~h2;    ~n_value6 = ~h6;}
356         {~ratio_setting == "hsine2";}{~n_value1 = ~nh1;   ~n_value2 = ~nh2;   ~n_value6 = ~nh6;}
357         {~ratio_setting == "hsine3";}{~n_value1 = ~nnh1;  ~n_value2 = ~nnh2;  ~n_value6 = ~nnh6;};
358
359
360         //King Wen sequence interpretation settings 1-3 for synthdefs
361
362         ~kws_setting_1_a = {[/*1*/      #a,b,c,d,e,f=[ ~a,~b,~c,~d,~e,~f  ],/*2*/       [ a = a/~bi, b = b/~bi, c = c/~bi, d = d/~bi, e = e/~bi, f = f/~bi ],/*3*/      [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f*~bi  ],/*4*/  [ a = a*~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f/~bi  ],/*5*/    [ a = a/~bi,    b = b*~bi,    c = c,         d = d*~bi,    e = e,         f = f*~bi ],/*6*/     [ a = a*~bi,    b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f/~bi  ],/*7*/    [ a = a/~bi,    b = b/~bi,    c = c/~bi,    d = d,         e = e,         f = f ],/*8*/ [ a = a,         b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f ],/*9*/        [ a = a*~bi,    b = b,         c = c,         d = d*~bi,    e = e*~bi,    f = f*~bi ],/*10*/    [ a = a,         b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f ],/*11*/       [ a = a/~bi,    b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e,         f = f ],/*12*/ [ a = a*~bi, b = b*~bi, c = c*~bi, d = d/~bi, e = e/~bi, f = f/~bi ],/*13*/     [ a = a,         b = b,         c = c,         d = d*~bi,    e = e,         f = f*~bi ],/*14*/  [ a = a,         b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f],/*15*/        [ a = a/~bi,    b = b,         c = c/~bi,    d = d,         e = e/~bi,    f = f/~bi ],/*16*/    [ a = a,         b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f ],/*17*/       [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f*~bi],/*18*/   [ a = a*~bi, b = b/~bi, c = c/~bi, d = d*~bi, e = e*~bi, f = f/~bi ],/*19*/     [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e,         f = f*~bi ],/*20*/   [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f/~bi ],/*21*/    [ a = a,         b = b/~bi,    c = c*~bi,    d = d,         e = e,         f = f*~bi ],/*22*/   [ a = a,         b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f ],/*23*/       [ a = a,         b = b,         c = c,         d = d/~bi,    e = e,         f = f/~bi ],/*24*/  [ a = a/~bi,    b = b,         c = c,         d = d,         e = e,         f = f*~bi ],/*25*/  [ a = a*~bi,    b = b*~bi,    c = c*~bi,    d = d,         e = e,         f = f ],/*26*/        [ a = a,         b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e*~bi,    f = f ],/*27*/ [ a = a,         b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f ],/*28*/       [ a = a/~bi, b = b*~bi, c = c*~bi, d = d*~bi, e = e*~bi, f = f/~bi ],/*29*/     [ a = a,         b = b,         c = c/~bi,    d = d/~bi,    e = e,         f = f ],/*30*/       [ a = a*~bi, b = b/~bi, c = c*~bi, d = d*~bi, e = e/~bi, f = f*~bi ],/*31*/     [ a = a/~bi,    b = b*~bi,    c = c,         d = d,         e = e,         f = f/~bi ],/*32*/   [ a = a,         b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f ],/*33*/       [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f ],/*34*/        [ a = a/~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f*~bi ],/*35*/    [ a = a*~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f/~bi ],/*36*/    [ a = a/~bi,    b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f*~bi ],/*37*/    [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e,         f = f ],/*38*/       [ a = a,         b = b/~bi,    c = c*~bi,    d = d/~bi,    e = e*~bi,    f = f ],/*39*/ [ a = a/~bi, b = b*~bi, c = c/~bi, d = d*~bi, e = e/~bi, f = f/~bi ],/*40*/     [ a = a,         b = b/~bi,    c = c*~bi,    d = d/~bi,    e = e*~bi,    f = f ],/*41*/ [ a = a*~bi,    b = b,         c = c/~bi,    d = d,         e = e,         f = f*~bi ],/*42*/   [ a = a,         b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f ],/*43*/       [ a = a/~bi,    b = b,         c = c*~bi,    d = d*~bi,    e = e*~bi,    f = f ],/*44*/ [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f/~bi ],/*45*/  [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f ],/*46*/        [ a = a,         b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e*~bi,    f = f ],/*47*/ [ a = a,         b = b*~bi,    c = c*~bi,    d = d/~bi,    e = e,         f = f ],/*48*/        [ a = a,         b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f ],/*49*/       [ a = a,         b = b,         c = c*~bi,    d = d,         e = e/~bi,    f = f*~bi ],/*50*/   [ a = a*~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f/~bi ],/*51*/    [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f*~bi ],/*52*/    [ a = a*~bi,    b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f/~bi ],/*53*/    [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f ],/*54*/      [ a = a/~bi, b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f*~bi ],/*55*/     [ a = a,         b = b,         c = c,         d = d*~bi,    e = e/~bi,    f = f ],/*56*/       [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f/~bi ],/*57*/  [ a = a,         b = b*~bi,    c = c/~bi,    d = d,         e = e*~bi,    f = f ],/*58*/        [ a = a/~bi,    b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f*~bi ],/*59*/    [ a = a*~bi,    b = b,         c = c/~bi,    d = d,         e = e,         f = f/~bi ],/*60*/   [ a = a/~bi,    b = b,         c = c,         d = d,         e = e,         f = f*~bi ],/*61*/  [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f ],/*62*/      [ a = a/~bi, b = b/~bi, c = c*~bi, d = d*~bi, e = e/~bi, f = f/~bi ],/*63*/     [ a = a,         b = b*~bi,    c = c/~bi,    d = d,         e = e,         f = f*~bi ],/*64*/   [ a = a*~bi, b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f/~bi ]]};
363         ~kws_setting_1_b = {[/*1*/      [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1*~bi,    e = e*~n1,         f = f*~n1*~bi ],/*2*/    [ a = a/~bi, b = b/~bi, c = c/~bi, d = d/~bi, e = e/~bi, f = f/~bi ],/*3*/      [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f*~bi  ],/*4*/  [ a = a*~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f/~bi  ],/*5*/    [ a = a/~bi,    b = b*~bi,    c = c,         d = d*~bi,    e = e,         f = f*~bi ],/*6*/     [ a = a*~bi,    b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f/~bi  ],/*7*/    [ a = a/~bi,    b = b/~bi,    c = c/~bi,    d = d,         e = e,         f = f ],/*8*/ [ a = a,         b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f ],/*9*/        [ a = a*~bi,    b = b,         c = c,         d = d*~bi,    e = e*~bi,    f = f*~bi ],/*10*/    [ a = a,         b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f ],/*11*/       [ a = a/~bi,    b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e,         f = f ],/*12*/ [ a = a*~bi, b = b*~bi, c = c*~bi, d = d/~bi, e = e/~bi, f = f/~bi ],/*13*/     [ a = a,         b = b,         c = c,         d = d*~bi,    e = e,         f = f*~bi ],/*14*/  [ a = a,         b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f],/*15*/        [ a = a/~bi,    b = b,         c = c/~bi,    d = d,         e = e/~bi,    f = f/~bi ],/*16*/    [ a = a,         b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f ],/*17*/       [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f*~bi],/*18*/   [ a = a*~bi, b = b/~bi, c = c/~bi, d = d*~bi, e = e*~bi, f = f/~bi ],/*19*/     [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e,         f = f*~bi ],/*20*/   [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f/~bi ],/*21*/    [ a = a,         b = b/~bi,    c = c*~bi,    d = d,         e = e,         f = f*~bi ],/*22*/   [ a = a,         b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f ],/*23*/       [ a = a,         b = b,         c = c,         d = d/~bi,    e = e,         f = f/~bi ],/*24*/  [ a = a/~bi,    b = b,         c = c,         d = d,         e = e,         f = f*~bi ],/*25*/  [ a = a*~bi,    b = b*~bi,    c = c*~bi,    d = d,         e = e,         f = f ],/*26*/        [ a = a,         b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e*~bi,    f = f ],/*27*/ [ a = a,         b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f ],/*28*/       [ a = a/~bi, b = b*~bi, c = c*~bi, d = d*~bi, e = e*~bi, f = f/~bi ],/*29*/     [ a = a,         b = b,         c = c/~bi,    d = d/~bi,    e = e,         f = f ],/*30*/       [ a = a*~bi, b = b/~bi, c = c*~bi, d = d*~bi, e = e/~bi, f = f*~bi ],/*31*/     [ a = a/~bi,    b = b*~bi,    c = c,         d = d,         e = e,         f = f/~bi ],/*32*/   [ a = a,         b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f ],/*33*/       [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f ],/*34*/        [ a = a/~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f*~bi ],/*35*/    [ a = a*~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f/~bi ],/*36*/    [ a = a/~bi,    b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f*~bi ],/*37*/    [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e,         f = f ],/*38*/       [ a = a,         b = b/~bi,    c = c*~bi,    d = d/~bi,    e = e*~bi,    f = f ],/*39*/ [ a = a/~bi, b = b*~bi, c = c/~bi, d = d*~bi, e = e/~bi, f = f/~bi ],/*40*/     [ a = a,         b = b/~bi,    c = c*~bi,    d = d/~bi,    e = e*~bi,    f = f ],/*41*/ [ a = a*~bi,    b = b,         c = c/~bi,    d = d,         e = e,         f = f*~bi ],/*42*/   [ a = a,         b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f ],/*43*/       [ a = a/~bi,    b = b,         c = c*~bi,    d = d*~bi,    e = e*~bi,    f = f ],/*44*/ [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f/~bi ],/*45*/  [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f ],/*46*/        [ a = a,         b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e*~bi,    f = f ],/*47*/ [ a = a,         b = b*~bi,    c = c*~bi,    d = d/~bi,    e = e,         f = f ],/*48*/        [ a = a,         b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f ],/*49*/       [ a = a,         b = b,         c = c*~bi,    d = d,         e = e/~bi,    f = f*~bi ],/*50*/   [ a = a*~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f/~bi ],/*51*/    [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f*~bi ],/*52*/    [ a = a*~bi,    b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f/~bi ],/*53*/    [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f ],/*54*/      [ a = a/~bi, b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f*~bi ],/*55*/     [ a = a,         b = b,         c = c,         d = d*~bi,    e = e/~bi,    f = f ],/*56*/       [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f/~bi ],/*57*/  [ a = a,         b = b*~bi,    c = c/~bi,    d = d,         e = e*~bi,    f = f ],/*58*/        [ a = a/~bi,    b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f*~bi ],/*59*/    [ a = a*~bi,    b = b,         c = c/~bi,    d = d,         e = e,         f = f/~bi ],/*60*/   [ a = a/~bi,    b = b,         c = c,         d = d,         e = e,         f = f*~bi ],/*61*/  [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f ],/*62*/      [ a = a/~bi, b = b/~bi, c = c*~bi, d = d*~bi, e = e/~bi, f = f/~bi ],/*63*/     [ a = a,         b = b*~bi,    c = c/~bi,    d = d,         e = e,         f = f*~bi ],/*64*/   [ a = a*~bi, b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f/~bi ]]};
364
365         ~kws_setting_2_a = {[/*1*/      #a,b,c,d,e,f=[ ~a,~b,~c,~d,~e,~f  ],/*2*/       [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1/~bi ],/*3*/      [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f*~bi    ],/*4*/        [ a = a*~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f/~bi    ],/*5*/  [ a = a/~bi,    b = b*~bi,    c = c,         d = d*~bi,    e = e,         f = f*~bi    ],/*6*/  [ a = a*~bi,    b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f/~bi    ],/*7*/  [ a = a/~bi,    b = b/~bi,    c = c/~bi,    d = d,         e = e,         f = f         ],/*8*/ [ a = a,         b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f         ],/*9*/        [ a = a*~bi,    b = b,         c = c,         d = d*~bi,    e = e*~bi,    f = f*~bi    ],/*10*/ [ a = a,         b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f         ],/*11*/       [ a = a/~bi,    b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e,         f = f         ],/*12*/ [ a = a*~n2*~bi, b = b*~n2*~bi, c = c*~n2*~bi, d = d*~n2/~bi, e = e*~n2/~bi, f = f*~n2/~bi ],/*13*/     [ a = a,         b = b,         c = c,         d = d*~bi,    e = e,         f = f*~bi    ],/*14*/       [ a = a,         b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f         ],/*15*/       [ a = a/~bi,    b = b,         c = c/~bi,    d = d,         e = e/~bi,    f = f/~bi    ],/*16*/ [ a = a,         b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f         ],/*17*/       [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f*~bi    ],/*18*/       [ a = a*~n3*~bi, b = b*~n3/~bi, c = c*~n3/~bi, d = d*~n3*~bi, e = e*~n3*~bi, f = f*~n3/~bi ],/*19*/     [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e,         f = f*~bi    ],/*20*/        [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f/~bi    ],/*21*/ [ a = a,         b = b/~bi,    c = c*~bi,    d = d,         e = e,         f = f*~bi    ],/*22*/        [ a = a,         b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f         ],/*23*/       [ a = a,         b = b,         c = c,         d = d/~bi,    e = e,         f = f/~bi    ],/*24*/       [ a = a/~bi,    b = b,         c = c,         d = d,         e = e,         f = f*~bi    ],/*25*/       [ a = a*~bi,    b = b*~bi,    c = c*~bi,    d = d,         e = e,         f = f         ],/*26*/        [ a = a,         b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e*~bi,    f = f         ],/*27*/ [ a = a,         b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f         ],/*28*/       [ a = a*~n4/~bi, b = b*~n4*~bi, c = c*~n4*~bi, d = d*~n4*~bi, e = e*~n4*~bi, f = f*~n4/~bi ],/*29*/     [ a = a,         b = b,         c = c/~bi,    d = d/~bi,    e = e,         f = f         ],/*30*/       [ a = a*~n5*~bi, b = b*~n5/~bi, c = c*~n5*~bi, d = d*~n5*~bi, e = e*~n5/~bi, f = f*~n5*~bi ],/*31*/     [ a = a/~bi,    b = b*~bi,    c = c,         d = d,         e = e,         f = f/~bi    ],/*32*/        [ a = a,         b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f         ],/*33*/       [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f         ],/*34*/        [ a = a/~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f*~bi    ],/*35*/ [ a = a*~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f/~bi    ],/*36*/ [ a = a/~bi,    b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f*~bi    ],/*37*/ [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e,         f = f         ],/*38*/       [ a = a,         b = b/~bi,    c = c*~bi,    d = d/~bi,    e = e*~bi,    f = f         ],/*39*/ [ a = a*~n6/~bi, b = b*~n6*~bi, c = c*~n6/~bi, d = d*~n6*~bi, e = e*~n6/~bi, f = f*~n6/~bi ],/*40*/     [ a = a,         b = b/~bi,    c = c*~bi,    d = d/~bi,    e = e*~bi,    f = f         ],/*41*/ [ a = a*~bi,    b = b,         c = c/~bi,    d = d,         e = e,         f = f*~bi    ],/*42*/        [ a = a,         b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f         ],/*43*/       [ a = a/~bi,    b = b,         c = c*~bi,    d = d*~bi,    e = e*~bi,    f = f         ],/*44*/ [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f/~bi    ],/*45*/       [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f         ],/*46*/        [ a = a,         b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e*~bi,    f = f         ],/*47*/ [ a = a,         b = b*~bi,    c = c*~bi,    d = d/~bi,    e = e,         f = f         ],/*48*/        [ a = a,         b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f         ],/*49*/       [ a = a,         b = b,         c = c*~bi,    d = d,         e = e/~bi,    f = f*~bi    ],/*50*/        [ a = a*~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f/~bi    ],/*51*/ [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f*~bi    ],/*52*/ [ a = a*~bi,    b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f/~bi    ],/*53*/ [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f         ],/*54*/      [ a = a*~n7/~bi, b = b*~n7/~bi, c = c*~n7*~bi, d = d*~n7/~bi, e = e*~n7*~bi, f = f*~n7*~bi ],/*55*/     [ a = a,         b = b,         c = c,         d = d*~bi,    e = e/~bi,    f = f         ],/*56*/       [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f/~bi    ],/*57*/       [ a = a,         b = b*~bi,    c = c/~bi,    d = d,         e = e*~bi,    f = f         ],/*58*/        [ a = a/~bi,    b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f*~bi    ],/*59*/ [ a = a*~bi,    b = b,         c = c/~bi,    d = d,         e = e,         f = f/~bi    ],/*60*/        [ a = a/~bi,    b = b,         c = c,         d = d,         e = e,         f = f*~bi    ],/*61*/       [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f         ],/*62*/      [ a = a*~n8/~bi, b = b*~n8/~bi, c = c*~n8*~bi, d = d*~n8*~bi, e = e*~n8/~bi, f = f*~n8/~bi ],/*63*/     [ a = a,         b = b*~bi,    c = c/~bi,    d = d,         e = e,         f = f*~bi    ],/*64*/        [ a = a*~n9*~bi, b = b*~n9/~bi, c = c*~n9*~bi, d = d*~n9/~bi, e = e*~n9*~bi, f = f*~n9/~bi ]]};
366         ~kws_setting_2_b = {[/*1*/      [ a = a,         b = b*~bi,    c = c,         d = d*~bi,    e = e,         f = f*~bi    ],/*2*/ [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1/~bi ],/*3*/      [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f*~bi    ],/*4*/        [ a = a*~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f/~bi    ],/*5*/  [ a = a/~bi,    b = b*~bi,    c = c,         d = d*~bi,    e = e,         f = f*~bi    ],/*6*/  [ a = a*~bi,    b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f/~bi    ],/*7*/  [ a = a/~bi,    b = b/~bi,    c = c/~bi,    d = d,         e = e,         f = f         ],/*8*/ [ a = a,         b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f         ],/*9*/        [ a = a*~bi,    b = b,         c = c,         d = d*~bi,    e = e*~bi,    f = f*~bi    ],/*10*/ [ a = a,         b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f         ],/*11*/       [ a = a/~bi,    b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e,         f = f         ],/*12*/ [ a = a*~n2*~bi, b = b*~n2*~bi, c = c*~n2*~bi, d = d*~n2/~bi, e = e*~n2/~bi, f = f*~n2/~bi ],/*13*/     [ a = a,         b = b,         c = c,         d = d*~bi,    e = e,         f = f*~bi    ],/*14*/       [ a = a,         b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f         ],/*15*/       [ a = a/~bi,    b = b,         c = c/~bi,    d = d,         e = e/~bi,    f = f/~bi    ],/*16*/ [ a = a,         b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f         ],/*17*/       [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f*~bi    ],/*18*/       [ a = a*~n3*~bi, b = b*~n3/~bi, c = c*~n3/~bi, d = d*~n3*~bi, e = e*~n3*~bi, f = f*~n3/~bi ],/*19*/     [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e,         f = f*~bi    ],/*20*/        [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f/~bi    ],/*21*/ [ a = a,         b = b/~bi,    c = c*~bi,    d = d,         e = e,         f = f*~bi    ],/*22*/        [ a = a,         b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f         ],/*23*/       [ a = a,         b = b,         c = c,         d = d/~bi,    e = e,         f = f/~bi    ],/*24*/       [ a = a/~bi,    b = b,         c = c,         d = d,         e = e,         f = f*~bi    ],/*25*/       [ a = a*~bi,    b = b*~bi,    c = c*~bi,    d = d,         e = e,         f = f         ],/*26*/        [ a = a,         b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e*~bi,    f = f         ],/*27*/ [ a = a,         b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f         ],/*28*/       [ a = a*~n4/~bi, b = b*~n4*~bi, c = c*~n4*~bi, d = d*~n4*~bi, e = e*~n4*~bi, f = f*~n4/~bi ],/*29*/     [ a = a,         b = b,         c = c/~bi,    d = d/~bi,    e = e,         f = f         ],/*30*/       [ a = a*~n5*~bi, b = b*~n5/~bi, c = c*~n5*~bi, d = d*~n5*~bi, e = e*~n5/~bi, f = f*~n5*~bi ],/*31*/     [ a = a/~bi,    b = b*~bi,    c = c,         d = d,         e = e,         f = f/~bi    ],/*32*/        [ a = a,         b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f         ],/*33*/       [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f         ],/*34*/        [ a = a/~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f*~bi    ],/*35*/ [ a = a*~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f/~bi    ],/*36*/ [ a = a/~bi,    b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f*~bi    ],/*37*/ [ a = a*~bi,    b = b*~bi,    c = c,         d = d,         e = e,         f = f         ],/*38*/       [ a = a,         b = b/~bi,    c = c*~bi,    d = d/~bi,    e = e*~bi,    f = f         ],/*39*/ [ a = a*~n6/~bi, b = b*~n6*~bi, c = c*~n6/~bi, d = d*~n6*~bi, e = e*~n6/~bi, f = f*~n6/~bi ],/*40*/     [ a = a,         b = b/~bi,    c = c*~bi,    d = d/~bi,    e = e*~bi,    f = f         ],/*41*/ [ a = a*~bi,    b = b,         c = c/~bi,    d = d,         e = e,         f = f*~bi    ],/*42*/        [ a = a,         b = b*~bi,    c = c,         d = d,         e = e/~bi,    f = f         ],/*43*/       [ a = a/~bi,    b = b,         c = c*~bi,    d = d*~bi,    e = e*~bi,    f = f         ],/*44*/ [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f/~bi    ],/*45*/       [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f         ],/*46*/        [ a = a,         b = b/~bi,    c = c/~bi,    d = d*~bi,    e = e*~bi,    f = f         ],/*47*/ [ a = a,         b = b*~bi,    c = c*~bi,    d = d/~bi,    e = e,         f = f         ],/*48*/        [ a = a,         b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f         ],/*49*/       [ a = a,         b = b,         c = c*~bi,    d = d,         e = e/~bi,    f = f*~bi    ],/*50*/        [ a = a*~bi,    b = b/~bi,    c = c,         d = d,         e = e*~bi,    f = f/~bi    ],/*51*/ [ a = a/~bi,    b = b,         c = c,         d = d/~bi,    e = e/~bi,    f = f*~bi    ],/*52*/ [ a = a*~bi,    b = b,         c = c/~bi,    d = d*~bi,    e = e,         f = f/~bi    ],/*53*/ [ a = a,         b = b*~bi,    c = c,         d = d,         e = e,         f = f         ],/*54*/      [ a = a*~n7/~bi, b = b*~n7/~bi, c = c*~n7*~bi, d = d*~n7/~bi, e = e*~n7*~bi, f = f*~n7*~bi ],/*55*/     [ a = a,         b = b,         c = c,         d = d*~bi,    e = e/~bi,    f = f         ],/*56*/       [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f/~bi    ],/*57*/       [ a = a,         b = b*~bi,    c = c/~bi,    d = d,         e = e*~bi,    f = f         ],/*58*/        [ a = a/~bi,    b = b,         c = c*~bi,    d = d/~bi,    e = e,         f = f*~bi    ],/*59*/ [ a = a*~bi,    b = b,         c = c/~bi,    d = d,         e = e,         f = f/~bi    ],/*60*/        [ a = a/~bi,    b = b,         c = c,         d = d,         e = e,         f = f*~bi    ],/*61*/       [ a = a*~bi,    b = b,         c = c,         d = d,         e = e,         f = f         ],/*62*/      [ a = a*~n8/~bi, b = b*~n8/~bi, c = c*~n8*~bi, d = d*~n8*~bi, e = e*~n8/~bi, f = f*~n8/~bi ],/*63*/     [ a = a,         b = b*~bi,    c = c/~bi,    d = d,         e = e,         f = f*~bi    ],/*64*/        [ a = a*~n9*~bi, b = b*~n9/~bi, c = c*~n9*~bi, d = d*~n9/~bi, e = e*~n9*~bi, f = f*~n9/~bi ]]};
367
368         ~kws_setting_3_a = {[/*1*/      #a,b,c,d,e,f=[ ~a,~b,~c,~d,~e,~f  ],/*2*/       [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1/~bi    ],/*3*/    [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*4*/        [ a = a*~n1*~bi,    b = b*~n1/~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1*~bi,    f = f*~n1/~bi    ],/*5*/  [ a = a*~n1/~bi,    b = b*~n1*~bi,    c = c*~n1,         d = d*~n1*~bi,    e = e*~n1,         f = f*~n1*~bi    ],/*6*/  [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1/~bi    ],/*7*/  [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1         ],/*8*/ [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1/~bi,    f = f*~n1         ],/*9*/        [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1*~bi    ],/*10*/ [ a = a*~n1,         b = b*~n1,         c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1         ],/*11*/       [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1,         f = f*~n1         ],/*12*/ [ a = a*~n1*~bi,    b = b*~n1*~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1/~bi    ],/*13*/   [ a = a*~n1,         b = b*~n1,         c = c*~n1,         d = d*~n1*~bi,    e = e*~n1,         f = f*~n1*~bi    ],/*14*/       [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1*~bi,    f = f*~n1         ],/*15*/       [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1/~bi,    d = d*~n1,         e = e*~n1/~bi,    f = f*~n1/~bi    ],/*16*/ [ a = a*~n1,         b = b*~n1,         c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1         ],/*17*/       [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*18*/       [ a = a*~n1*~bi,    b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1/~bi    ],/*19*/   [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1,         f = f*~n1*~bi    ],/*20*/        [ a = a*~n1*~bi,    b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1/~bi,    f = f*~n1/~bi    ],/*21*/ [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*22*/        [ a = a*~n1,         b = b*~n1,         c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1,         f = f*~n1         ],/*23*/       [ a = a*~n1,         b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1,         f = f*~n1/~bi    ],/*24*/       [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*25*/       [ a = a*~n1*~bi,    b = b*~n1*~bi,    c = c*~n1*~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1         ],/*26*/        [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1         ],/*27*/ [ a = a*~n1,         b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1         ],/*28*/       [ a = a*~n1/~bi,    b = b*~n1*~bi,    c = c*~n1*~bi,    d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1/~bi    ],/*29*/   [ a = a*~n1,         b = b*~n1,         c = c*~n1/~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1         ],/*30*/       [ a = a*~n1*~bi,    b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1*~bi,    e = e*~n1/~bi,    f = f*~n1*~bi    ],/*31*/   [ a = a*~n1/~bi,    b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1/~bi    ],/*32*/        [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1*~bi,    f = f*~n1         ],/*33*/       [ a = a*~n1*~bi,    b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1/~bi,    f = f*~n1         ],/*34*/        [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1*~bi,    f = f*~n1*~bi    ],/*35*/ [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1/~bi    ],/*36*/ [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1,         f = f*~n1*~bi    ],/*37*/ [ a = a*~n1*~bi,    b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1         ],/*38*/       [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1*~bi,    f = f*~n1         ],/*39*/ [ a = a*~n1/~bi,    b = b*~n1*~bi,    c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1/~bi,    f = f*~n1/~bi    ],/*40*/   [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1*~bi,    f = f*~n1         ],/*41*/ [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1/~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*42*/        [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1/~bi,    f = f*~n1         ],/*43*/       [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1*~bi,    d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1         ],/*44*/ [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1/~bi    ],/*45*/       [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1         ],/*46*/        [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1         ],/*47*/ [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1         ],/*48*/        [ a = a*~n1,         b = b*~n1,         c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1,         f = f*~n1         ],/*49*/       [ a = a*~n1,         b = b*~n1,         c = c*~n1*~bi,    d = d*~n1,         e = e*~n1/~bi,    f = f*~n1*~bi    ],/*50*/        [ a = a*~n1*~bi,    b = b*~n1/~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1*~bi,    f = f*~n1/~bi    ],/*51*/ [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1*~bi    ],/*52*/ [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1,         f = f*~n1/~bi    ],/*53*/ [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1         ],/*54*/      [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1*~bi,    f = f*~n1*~bi    ],/*55*/   [ a = a*~n1,         b = b*~n1,         c = c*~n1,         d = d*~n1*~bi,    e = e*~n1/~bi,    f = f*~n1         ],/*56*/       [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1/~bi    ],/*57*/       [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1/~bi,    d = d*~n1,         e = e*~n1*~bi,    f = f*~n1         ],/*58*/        [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1*~bi    ],/*59*/ [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1/~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1/~bi    ],/*60*/        [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*61*/       [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1         ],/*62*/      [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1*~bi,    e = e*~n1/~bi,    f = f*~n1/~bi    ],/*63*/   [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1/~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*64*/        [ a = a*~n1*~bi,    b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1*~bi,    f = f*~n1/~bi    ]]};
369         ~kws_setting_3_b = {[/*1*/      [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1*~bi,    e = e*~n1,         f = f*~n1*~bi    ],/*2*/ [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1/~bi    ],/*3*/    [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*4*/        [ a = a*~n1*~bi,    b = b*~n1/~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1*~bi,    f = f*~n1/~bi    ],/*5*/  [ a = a*~n1/~bi,    b = b*~n1*~bi,    c = c*~n1,         d = d*~n1*~bi,    e = e*~n1,         f = f*~n1*~bi    ],/*6*/  [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1/~bi    ],/*7*/  [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1         ],/*8*/ [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1/~bi,    f = f*~n1         ],/*9*/        [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1*~bi    ],/*10*/ [ a = a*~n1,         b = b*~n1,         c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1         ],/*11*/       [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1,         f = f*~n1         ],/*12*/ [ a = a*~n1*~bi,    b = b*~n1*~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1/~bi    ],/*13*/   [ a = a*~n1,         b = b*~n1,         c = c*~n1,         d = d*~n1*~bi,    e = e*~n1,         f = f*~n1*~bi    ],/*14*/       [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1*~bi,    f = f*~n1         ],/*15*/       [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1/~bi,    d = d*~n1,         e = e*~n1/~bi,    f = f*~n1/~bi    ],/*16*/ [ a = a*~n1,         b = b*~n1,         c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1         ],/*17*/       [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*18*/       [ a = a*~n1*~bi,    b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1/~bi    ],/*19*/   [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1,         f = f*~n1*~bi    ],/*20*/        [ a = a*~n1*~bi,    b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1/~bi,    f = f*~n1/~bi    ],/*21*/ [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*22*/        [ a = a*~n1,         b = b*~n1,         c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1,         f = f*~n1         ],/*23*/       [ a = a*~n1,         b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1,         f = f*~n1/~bi    ],/*24*/       [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*25*/       [ a = a*~n1*~bi,    b = b*~n1*~bi,    c = c*~n1*~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1         ],/*26*/        [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1         ],/*27*/ [ a = a*~n1,         b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1         ],/*28*/       [ a = a*~n1/~bi,    b = b*~n1*~bi,    c = c*~n1*~bi,    d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1/~bi    ],/*29*/   [ a = a*~n1,         b = b*~n1,         c = c*~n1/~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1         ],/*30*/       [ a = a*~n1*~bi,    b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1*~bi,    e = e*~n1/~bi,    f = f*~n1*~bi    ],/*31*/   [ a = a*~n1/~bi,    b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1/~bi    ],/*32*/        [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1*~bi,    f = f*~n1         ],/*33*/       [ a = a*~n1*~bi,    b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1/~bi,    f = f*~n1         ],/*34*/        [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1*~bi,    f = f*~n1*~bi    ],/*35*/ [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1/~bi    ],/*36*/ [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1,         f = f*~n1*~bi    ],/*37*/ [ a = a*~n1*~bi,    b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1         ],/*38*/       [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1*~bi,    f = f*~n1         ],/*39*/ [ a = a*~n1/~bi,    b = b*~n1*~bi,    c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1/~bi,    f = f*~n1/~bi    ],/*40*/   [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1*~bi,    f = f*~n1         ],/*41*/ [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1/~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*42*/        [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1/~bi,    f = f*~n1         ],/*43*/       [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1*~bi,    d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1         ],/*44*/ [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1/~bi    ],/*45*/       [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1         ],/*46*/        [ a = a*~n1,         b = b*~n1/~bi,    c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1*~bi,    f = f*~n1         ],/*47*/ [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1         ],/*48*/        [ a = a*~n1,         b = b*~n1,         c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1,         f = f*~n1         ],/*49*/       [ a = a*~n1,         b = b*~n1,         c = c*~n1*~bi,    d = d*~n1,         e = e*~n1/~bi,    f = f*~n1*~bi    ],/*50*/        [ a = a*~n1*~bi,    b = b*~n1/~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1*~bi,    f = f*~n1/~bi    ],/*51*/ [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1/~bi,    e = e*~n1/~bi,    f = f*~n1*~bi    ],/*52*/ [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1/~bi,    d = d*~n1*~bi,    e = e*~n1,         f = f*~n1/~bi    ],/*53*/ [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1         ],/*54*/      [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1*~bi,    f = f*~n1*~bi    ],/*55*/   [ a = a*~n1,         b = b*~n1,         c = c*~n1,         d = d*~n1*~bi,    e = e*~n1/~bi,    f = f*~n1         ],/*56*/       [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1/~bi    ],/*57*/       [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1/~bi,    d = d*~n1,         e = e*~n1*~bi,    f = f*~n1         ],/*58*/        [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1,         f = f*~n1*~bi    ],/*59*/ [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1/~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1/~bi    ],/*60*/        [ a = a*~n1/~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*61*/       [ a = a*~n1*~bi,    b = b*~n1,         c = c*~n1,         d = d*~n1,         e = e*~n1,         f = f*~n1         ],/*62*/      [ a = a*~n1/~bi,    b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1*~bi,    e = e*~n1/~bi,    f = f*~n1/~bi    ],/*63*/   [ a = a*~n1,         b = b*~n1*~bi,    c = c*~n1/~bi,    d = d*~n1,         e = e*~n1,         f = f*~n1*~bi    ],/*64*/        [ a = a*~n1*~bi,    b = b*~n1/~bi,    c = c*~n1*~bi,    d = d*~n1/~bi,    e = e*~n1*~bi,    f = f*~n1/~bi    ]]};
370
371
372         //synthdefs
373
374         ~gsine = {
375
376                 SynthDef(\gsineicfld1, {arg graindur = 0.04, dur = 2000, atk = 0.007, rel = 0.01, gate = 1, amp = 1, i = 1, vol = ~vol, rate = 20, tune = 0,dseqval,
377                         a, b, c, d, e, f, pan=0, fc = 1;
378                         var s1, out, env1, s2, dseq;
379                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value1)}); //for custom values replace "~n_value1" with "[a, b, c, d, etc...].at(x-1)" with the variable amount the same as the #.do value - for all synthdefs
380                         dseq = Dseq(
381                                 case
382                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
383                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
384                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~first_harmonic -1), {
385                                         case
386                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
387                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
388                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten, inf);
389                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur),Demand.ar(Impulse.ar(dur), 0, dseq));
390                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
391                         OffsetOut.ar(0, s1.dup*vol);
392                 }, [\ir]).add;
393
394                 SynthDef(\gsineicrld1, {arg graindur = 0.04, dur = 2000, atk = 0.007, rel = 0.01, gate = 1, amp = 1, i = 1, vol = ~vol, rate = 20, tune = 0,dseqval,
395                         a, b, c, d, e, f, pan=0, fc = 1, id = -1;
396                         var s1, out, env1, s2, dseq;
397                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value1)});
398                         dseq = Dseq([
399                                 case
400                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
401                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
402                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~first_harmonic -1), {
403                                         case
404                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
405                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
406                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten].flatten.reverse, inf);
407                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur), Demand.ar(Impulse.ar(dur), 0, dseq));
408                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
409                         OffsetOut.ar(0, s1.dup*vol);
410                 }, [\ir]).add;
411
412                 SynthDef(\gsineicfld2, {arg graindur = 0.04, dur = 2000, atk = 0.007, rel = 0.01, gate = 1, amp = 1, i = 1, vol = ~vol, rate = 20, tune = 0,dseqval,
413                         a, b, c, d, e, f, pan=0, fc = 1;
414                         var s1, out, env1, s2, dseq;
415                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value2)});
416                         dseq = Dseq(
417                                 case
418                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
419                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
420                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~second_harmonic -1), {
421                                         case
422                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
423                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
424                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten, inf);
425                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur),Demand.ar(Impulse.ar(dur), 0, dseq));
426                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
427                         OffsetOut.ar(0, s1.dup*vol);
428                 }, [\ir]).add;
429
430                 SynthDef(\gsineicrld2, {arg graindur = 0.04, dur = 2000, atk = 0.007, rel = 0.01, gate = 1, amp = 1, i = 1, vol = ~vol, rate = 20, tune = 0,dseqval,
431                         a, b, c, d, e, f, pan=0, fc = 1, id = -1;
432                         var s1, out, env1, s2, dseq;
433                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value2)});
434                         dseq = Dseq([
435                                 case
436                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
437                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
438                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~second_harmonic -1), {
439                                         case
440                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
441                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
442                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten].flatten.reverse, inf);
443                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur), Demand.ar(Impulse.ar(dur), 0, dseq));
444                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
445                         OffsetOut.ar(0, s1.dup*vol);
446                 }, [\ir]).add;
447
448                 SynthDef(\gsineicfld6, {arg graindur = 0.04, dur = 2000, atk = 0.007, rel = 0.01, gate = 1, amp = 1, i = 1, vol = ~vol, rate = 20, tune = 0,dseqval,
449                         a, b, c, d, e, f, pan=0, fc = 1;
450                         var s1, out, env1, s2, dseq;
451                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value6)});
452                         dseq = Dseq(
453                                 case
454                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
455                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
456                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~third_harmonic -1), {
457                                         case
458                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
459                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
460                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten, inf);
461                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur),Demand.ar(Impulse.ar(dur), 0, dseq));
462                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
463                         OffsetOut.ar(0, s1.dup*vol);
464                 }, [\ir]).add;
465
466                 SynthDef(\gsineicrld6, {arg graindur = 0.04, dur = 2000, atk = 0.007, rel = 0.01, gate = 1, amp = 1, i = 1, vol = ~vol, rate = 20, tune = 0,dseqval,
467                         a, b, c, d, e, f, pan=0, fc = 1;
468                         var s1, out, env1, s2, dseq;
469                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value6)});
470                         dseq = Dseq([
471                                 case
472                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
473                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
474                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~third_harmonic -1), {
475                                         case
476                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
477                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
478                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten].flatten.reverse, inf);
479                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur), Demand.ar(Impulse.ar(dur), 0, dseq));
480                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
481                         OffsetOut.ar(0, s1.dup*vol);
482                 }, [\ir]).add;
483
484                 if(~sendreplysynthdef_on == 1, {
485
486                         ~synthflow_random_sendreply_answer_f1 = '/synthflow_random_sendreply_answer_f1';
487                         ~synthflow_random_sendreply_answer_f2 = '/synthflow_random_sendreply_answer_f2';
488                         ~synthflow_random_sendreply_answer_f3 = '/synthflow_random_sendreply_answer_f3';
489                         ~synthflow_random_sendreply_answer_f4 = '/synthflow_random_sendreply_answer_f4';
490                         ~synthflow_random_sendreply_answer_f5 = '/synthflow_random_sendreply_answer_f5';
491                         ~synthflow_random_sendreply_answer_f6 = '/synthflow_random_sendreply_answer_f6';
492                         ~synthflow_random_sendreply_answer_f7 = '/synthflow_random_sendreply_answer_f7';
493                         ~synthflow_random_sendreply_answer_f8 = '/synthflow_random_sendreply_answer_f8';
494
495                         8.do(~sendreply_x = 0; {
496
497                                 ~sendreply_x=~sendreply_x+1;
498
499                                 SynthDef(\gsineicfld6_f++(~sendreply_x), {arg graindur = 0.04, dur = 2000, atk = 0.007, rel = 0.01, gate = 1, amp = 1, i = 1, vol = ~vol, rate = 20, tune = 0,dseqval,
500                                         a, b, c, d, e, f, pan=0, fc = 1;
501                                         var s1, out, env1, s2, dseq;
502                                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value6)});
503                                         dseq = Dseq(
504                                                 case
505                                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
506                                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
507                                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~third_harmonic -1), {
508                                                         case
509                                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
510                                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
511                                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten, inf);
512                                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur),Demand.ar(Impulse.ar(dur), 0, dseq));
513                                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
514                                         OffsetOut.ar(0, s1.dup*vol);
515                                         SendReply.ar(PulseDivider.ar(Impulse.ar(dur), (~kws_setting_1_a.value.size*(~gsinenum*~third_harmonic))), ("synthflow_random_sendreply_answer_f"++(~sendreply_x)).asSymbol.envirGet, [ dseq]);
516                                 }, [\ir]).add;
517
518                         });
519                 });
520         };
521
522
523         //sendyreply functions
524
525         ~send_reply_func_western = {~freqmap.at(rrand(60, 91));};
526         ~send_reply_func_eastern = {(rrand(~freqmap.at(60), ~freqmap.at(91);))};
527
528         case
529         {~sendreplyfuncswitch == 1;}{~send_reply_func = ~send_reply_func_western;}
530         {~sendreplyfuncswitch == 2;}{~send_reply_func = ~send_reply_func_eastern;};
531
532         OSCFunc({~f1 = ~send_reply_func.value; AppClock.sched(0,{~synthflow.value;});}, '/synthflow_random_sendreply_answer_f1');
533         OSCFunc({~f2 = ~send_reply_func.value; AppClock.sched(0,{~synthflow.value;});}, '/synthflow_random_sendreply_answer_f2');
534         OSCFunc({~f3 = ~send_reply_func.value; AppClock.sched(0,{~synthflow.value;});}, '/synthflow_random_sendreply_answer_f3');
535         OSCFunc({~f4 = ~send_reply_func.value; AppClock.sched(0,{~synthflow.value;});}, '/synthflow_random_sendreply_answer_f4');
536         OSCFunc({~f5 = ~send_reply_func.value; AppClock.sched(0,{~synthflow.value;});}, '/synthflow_random_sendreply_answer_f5');
537         OSCFunc({~f6 = ~send_reply_func.value; AppClock.sched(0,{~synthflow.value;});}, '/synthflow_random_sendreply_answer_f6');
538         OSCFunc({~f7 = ~send_reply_func.value; AppClock.sched(0,{~synthflow.value;});}, '/synthflow_random_sendreply_answer_f7');
539         OSCFunc({~f8 = ~send_reply_func.value; AppClock.sched(0,{~synthflow.value;});}, '/synthflow_random_sendreply_answer_f8');
540
541
542         //set base (lowest) frequencies, set starting values for synthdef, and load synthdef on server boot
543
544         if((~gsinenum == nil) or: (~synthdef != "gsineicld"), {
545                 (
546                         if(~basefreq == nil, {~basefreq = ~base_frequency});
547                         ~fmult = 16;
548                         (#a,b,c,d,e,f = [ ~basefreq,~basefreq,~basefreq,~basefreq,~basefreq,~basefreq  ];
549                                 ~a = a; ~b = b; ~c =c; ~d = d; ~e = e;~f=f;);
550
551                         ~synthdef = "gsineicld"; ~gsinenum = ~synthdefnum;
552
553                         ~gsine.value;
554                 );
555         });
556
557
558         //generate GUI window
559
560         w = Window("Timewave Synth", Rect(0,0,Window.screenBounds.width,Window.screenBounds.height), border:true);
561
562         view = UserView(w, Window.screenBounds);
563         view.clearOnRefresh = false;
564         view.background = Color.black;
565
566         //vertical grid (inactive)
567
568         /*~b1 = Window.screenBounds.width/(12*4) /*25.462962962963*/; ~btu = 31; ~btd = 375; ~bw = 0.5; ~bh = 80; ~bcolor = Color.grey;
569         View(w, Rect(~b1, ~btu, ~bw, ~bh)).background = ~bcolor;
570         View(w, Rect(~b1, ~btd, ~bw, ~bh)).background = ~bcolor;
571         54.do({View(w, Rect(~b1 = ~b1+(Window.screenBounds.width/(12*4)), ~btu, ~bw, ~bh)).background = ~bcolor;});
572         ~b1 = Window.screenBounds.width/(12*4);
573         54.do({View(w, Rect(~b1 = ~b1+(Window.screenBounds.width/(12*4)), ~btd, ~bw, ~bh)).background = ~bcolor;});*/
574
575
576         //horizontal grid
577
578         ~nh = 2;
579         ~nw = ~nh*1.6180339887499;
580
581         ~tgrid = 30;
582         ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
583
584         ~dc1 = ~tgrid-5; ~dc2 = ~bgrid-5; ~dca = 10;
585
586         9.do(x=~tgrid-10; {View(w, Rect(1, x=x+10, Window.screenBounds.width, 0.5)).background = Color.new255(51, 51, 51)});
587         9.do(x=~bgrid-10; {View(w, Rect(1, x=x+10, Window.screenBounds.width, 0.5)).background = Color.new255(51, 51, 51)});
588
589         ~z1 = (View(w, Rect((if(~f1 == nil, {f1.value},{~f1.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
590         ~z2 = (View(w, Rect((if(~f2 == nil, {f2.value},{~f2.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
591         ~z3 = (View(w, Rect((if(~f3 == nil, {f3.value},{~f3.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
592         ~z4 = (View(w, Rect((if(~f4 == nil, {f4.value},{~f4.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
593         ~z5 = (View(w, Rect((if(~f5 == nil, {f5.value},{~f5.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
594         ~z6 = (View(w, Rect((if(~f6 == nil, {f6.value},{~f6.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
595         ~z7 = (View(w, Rect((if(~f7 == nil, {f7.value},{~f7.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
596         ~z8 = (View(w, Rect((if(~f8 == nil, {f8.value},{~f8.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
597         ~zmid = (View(w, Rect(x, 280, ~nw, 2)).background = Color.clear;);
598         ~z25 = (View(w, Rect((if(~f1 == nil, {f1.value},{~f1.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
599         ~z26 = (View(w, Rect((if(~f2 == nil, {f2.value},{~f2.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
600         ~z27 = (View(w, Rect((if(~f3 == nil, {f3.value},{~f3.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
601         ~z28 = (View(w, Rect((if(~f4 == nil, {f4.value},{~f4.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
602         ~z29 = (View(w, Rect((if(~f5 == nil, {f5.value},{~f5.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
603         ~z30 = (View(w, Rect((if(~f6 == nil, {f6.value},{~f6.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
604         ~z31 = (View(w, Rect((if(~f7 == nil, {f7.value},{~f7.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
605         ~z32 = (View(w, Rect((if(~f8 == nil, {f8.value},{~f8.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
606
607
608         ~dc1 = ~tgrid-5; ~dc2 = ~bgrid-5; ~dca = 10;
609
610
611         //synth functions (open, flow, slide, pause, free)
612
613         ~synthopen = {
614                 case
615                 {((~l1a.isRunning == false) and: (~l1a1.isRunning == false)) or: ~l1a1.isRunning == true}{
616                         if(~l1a1.isRunning == true, {
617                                 (1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6,f1,f2,f3,f4,f5,f6,f7,f8;
618                                         #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
619                                         #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
620                                         s.makeBundle(0, {
621                                                 ~l1a1.set(\dur, f1,     \vol, vol1);  ~l1b1.set(\dur, f1,  \vol, vol1);
622                                                 ~l1c1.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d1.set(\dur, f1/~icd3,  \vol, vol1);
623                                                 ~l1e1.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f1.set(\dur, f1/~icd6,  \vol, vol1);
624                                                 ~l2a1.set(\dur, f2,     \vol, vol2);          ~l2b1.set(\dur, f2,  \vol, vol2);
625                                                 ~l2c1.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d1.set(\dur, f2/~icd3,  \vol, vol2);
626                                                 ~l2e1.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f1.set(\dur, f2/~icd6,  \vol, vol2);
627                                                 ~l3a1.set(\dur, f3,     \vol, vol3);          ~l3b1.set(\dur, f3,  \vol, vol3);
628                                                 ~l3c1.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d1.set(\dur, f3/~icd3,  \vol, vol3);
629                                                 ~l3e1.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f1.set(\dur, f3/~icd6,  \vol, vol3);
630                                                 ~l4a1.set(\dur, f4,    \vol, vol4);           ~l4b1.set(\dur, f4,  \vol, vol4);
631                                                 ~l4c1.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d1.set(\dur, f4/~icd3,  \vol, vol4);
632                                                 ~l4e1.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f1.set(\dur, f4/~icd6,  \vol, vol4);
633                                                 ~l5a1.set(\dur, f5,    \vol, vol5);           ~l5b1.set(\dur, f5,  \vol, vol5);
634                                                 ~l5c1.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d1.set(\dur, f5/~icd3,  \vol, vol5);
635                                                 ~l5e1.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f1.set(\dur, f5/~icd6,  \vol, vol5);
636                                                 ~l6a1.set(\dur, f6,    \vol, vol6);           ~l6b1.set(\dur, f6,  \vol, vol6);
637                                                 ~l6c1.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d1.set(\dur, f6/~icd3,  \vol, vol6);
638                                                 ~l6e1.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f1.set(\dur, f6/~icd6,  \vol, vol6);
639                                                 ~l7a1.set(\dur, f7,    \vol, vol7);           ~l7b1.set(\dur, f7,  \vol, vol7);
640                                                 ~l7c1.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d1.set(\dur, f7/~icd3,  \vol, vol7);
641                                                 ~l7e1.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f1.set(\dur, f7/~icd6,  \vol, vol7);
642                                                 ~l8a1.set(\dur, f8,    \vol, vol8);           ~l8b1.set(\dur, f8,  \vol, vol8);
643                                                 ~l8c1.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d1.set(\dur, f8/~icd3,  \vol, vol8);
644                                                 ~l8e1.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f1.set(\dur, f8/~icd6,  \vol, vol8);
645                                         });
646                                 }););
647                         });
648
649                         (
650                                 1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6,s1_1,s1_2,s1_3,s1_4,s1_5,s1_6,s1_7,s1_8;
651                                         #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
652                                         #s1,s2,s3,s4,s5,s6 = [\gsineicfld6, \gsineicrld6, \gsineicfld2, \gsineicrld2, \gsineicfld1, \gsineicrld1];
653                                         case
654                                         {~sendreplysynthdef_on == 0}{#s1_1,s1_2,s1_3,s1_4,s1_5,s1_6,s1_7,s1_8 = \gsineicfld6!8;}
655                                         {~sendreplysynthdef_on == 1}{#s1_1,s1_2,s1_3,s1_4,s1_5,s1_6,s1_7,s1_8 =
656                                                 [\gsineicfld6_f1, \gsineicfld6_f2, \gsineicfld6_f3, \gsineicfld6_f4, \gsineicfld6_f5, \gsineicfld6_f6, \gsineicfld6_f7, \gsineicfld6_f8];};
657                                         s.makeBundle(0, {
658                                                 ~l1a = Synth(s1_1, [\dur, ~f1,    \vol, vol1]).register;    ~l1b = Synth(s2, [\dur, ~f1,    \vol, vol1]);
659                                                 ~l1c = Synth(s3, [\dur, ~f1/~icd3,  \vol, vol1]);   ~l1d = Synth(s4, [\dur, ~f1/~icd3,  \vol, vol1]);
660                                                 ~l1e = Synth(s5, [\dur, ~f1/~icd6,  \vol, vol1]);   ~l1f = Synth(s6, [\dur, ~f1/~icd6,  \vol, vol1]);
661                                                 ~l2a = Synth(s1_2, [\dur, ~f2,    \vol, vol2]);        ~l2b = Synth(s2, [\dur, ~f2,    \vol, vol2]);
662                                                 ~l2c = Synth(s3, [\dur, ~f2/~icd3,  \vol, vol2]);   ~l2d = Synth(s4, [\dur, ~f2/~icd3,  \vol, vol2]);
663                                                 ~l2e = Synth(s5, [\dur, ~f2/~icd6,  \vol, vol2]);   ~l2f = Synth(s6, [\dur, ~f2/~icd6,  \vol, vol2]);
664                                                 ~l3a = Synth(s1_3, [\dur, ~f3,    \vol, vol3]);        ~l3b = Synth(s2, [\dur, ~f3,   \vol, vol3]);
665                                                 ~l3c = Synth(s3, [\dur, ~f3/~icd3,  \vol, vol3]);   ~l3d = Synth(s4, [\dur, ~f3/~icd3, \vol, vol3]);
666                                                 ~l3e = Synth(s5, [\dur, ~f3/~icd6,  \vol, vol3]);   ~l3f = Synth(s6, [\dur, ~f3/~icd6, \vol, vol3]);
667                                                 ~l4a = Synth(s1_4, [\dur, ~f4,    \vol, vol4]);       ~l4b = Synth(s2, [\dur, ~f4,   \vol, vol4]);
668                                                 ~l4c = Synth(s3, [\dur, ~f4/~icd3,  \vol, vol4]);  ~l4d = Synth(s4, [\dur, ~f4/~icd3, \vol, vol4]);
669                                                 ~l4e = Synth(s5, [\dur, ~f4/~icd6,  \vol, vol4]);   ~l4f = Synth(s6, [\dur, ~f4/~icd6, \vol, vol4]);
670                                                 ~l5a = Synth(s1_5, [\dur, ~f5,    \vol, vol5]);       ~l5b = Synth(s2, [\dur, ~f5,   \vol, vol5]);
671                                                 ~l5c = Synth(s3, [\dur, ~f5/~icd3,  \vol, vol5]);   ~l5d = Synth(s4, [\dur, ~f5/~icd3, \vol, vol5]);
672                                                 ~l5e = Synth(s5, [\dur, ~f5/~icd6,  \vol, vol5]);   ~l5f = Synth(s6, [\dur, ~f5/~icd6, \vol, vol5]);
673                                                 ~l6a = Synth(s1_6, [\dur, ~f6,    \vol, vol6]);       ~l6b = Synth(s2, [\dur, ~f6,   \vol, vol6]);
674                                                 ~l6c = Synth(s3, [\dur, ~f6/~icd3,  \vol, vol6]);   ~l6d = Synth(s4, [\dur, ~f6/~icd3, \vol, vol6]);
675                                                 ~l6e = Synth(s5, [\dur, ~f6/~icd6,  \vol, vol6]);   ~l6f = Synth(s6, [\dur, ~f6/~icd6, \vol, vol6]);
676                                                 ~l7a = Synth(s1_7, [\dur, ~f7,    \vol, vol7]);       ~l7b = Synth(s2, [\dur, ~f7,   \vol, vol7]);
677                                                 ~l7c = Synth(s3, [\dur, ~f7/~icd3,  \vol, vol7]);   ~l7d = Synth(s4, [\dur, ~f7/~icd3, \vol, vol7]);
678                                                 ~l7e = Synth(s5, [\dur, ~f7/~icd6,  \vol, vol7]);   ~l7f = Synth(s6, [\dur, ~f7/~icd6, \vol, vol7]);
679                                                 ~l8a = Synth(s1_8, [\dur, ~f8,    \vol, vol8]);  ~l8b = Synth(s2, [\dur, ~f8,   \vol, vol8]);
680                                                 ~l8c = Synth(s3, [\dur, ~f8/~icd3,  \vol, vol8]);   ~l8d = Synth(s4, [\dur, ~f8/~icd3, \vol, vol8]);
681                                                 ~l8e = Synth(s5, [\dur, ~f8/~icd6,  \vol, vol8]);   ~l8f = Synth(s6, [\dur, ~f8/~icd6, \vol, vol8]);
682                                         });
683                                 });
684                         );
685                         if(~l1a1.isRunning == true, {
686                                 AppClock.sched(0.161803398875,{
687                                         ([~l1a1,~l1b1,~l1c1,~l1d1,~l1e1,~l1f1,~l2a1,~l2b1,~l2c1,~l2d1,~l2e1,~l2f1,~l3a1,~l3b1,~l3c1,~l3d1,~l3e1,~l3f1,~l4a1,~l4b1,~l4c1,~l4d1,~l4e1,~l4f1,~l5a1,~l5b1,~l5c1,~l5d1,~l5e1,~l5f1,~l6a1,~l6b1,~l6c1,~l6d1,~l6e1,~l6f1,~l7a1,~l7b1,~l7c1,~l7d1,~l7e1,~l7f1,~l8a1,~l8b1,~l8c1,~l8d1,~l8e1,~l8f1 ].do(_.free)); ~slideroutine.stop;
688                                 });
689                         });
690                 }
691                 {~l1a.isRunning == true}{
692                         (1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6,f1,f2,f3,f4,f5,f6,f7,f8;
693                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
694                                 #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
695                                 s.makeBundle(0, {
696                                         ~l1a.set(\dur, f1,     \vol, vol1);  ~l1b.set(\dur, f1,  \vol, vol1);
697                                         ~l1c.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d.set(\dur, f1/~icd3,  \vol, vol1);
698                                         ~l1e.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f.set(\dur, f1/~icd6,  \vol, vol1);
699                                         ~l2a.set(\dur, f2,     \vol, vol2);          ~l2b.set(\dur, f2,  \vol, vol2);
700                                         ~l2c.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d.set(\dur, f2/~icd3,  \vol, vol2);
701                                         ~l2e.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f.set(\dur, f2/~icd6,  \vol, vol2);
702                                         ~l3a.set(\dur, f3,     \vol, vol3);          ~l3b.set(\dur, f3,  \vol, vol3);
703                                         ~l3c.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d.set(\dur, f3/~icd3,  \vol, vol3);
704                                         ~l3e.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f.set(\dur, f3/~icd6,  \vol, vol3);
705                                         ~l4a.set(\dur, f4,    \vol, vol4);           ~l4b.set(\dur, f4,  \vol, vol4);
706                                         ~l4c.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d.set(\dur, f4/~icd3,  \vol, vol4);
707                                         ~l4e.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f.set(\dur, f4/~icd6,  \vol, vol4);
708                                         ~l5a.set(\dur, f5,    \vol, vol5);           ~l5b.set(\dur, f5,  \vol, vol5);
709                                         ~l5c.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d.set(\dur, f5/~icd3,  \vol, vol5);
710                                         ~l5e.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f.set(\dur, f5/~icd6,  \vol, vol5);
711                                         ~l6a.set(\dur, f6,    \vol, vol6);           ~l6b.set(\dur, f6,  \vol, vol6);
712                                         ~l6c.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d.set(\dur, f6/~icd3,  \vol, vol6);
713                                         ~l6e.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f.set(\dur, f6/~icd6,  \vol, vol6);
714                                         ~l7a.set(\dur, f7,    \vol, vol7);           ~l7b.set(\dur, f7,  \vol, vol7);
715                                         ~l7c.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d.set(\dur, f7/~icd3,  \vol, vol7);
716                                         ~l7e.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f.set(\dur, f7/~icd6,  \vol, vol7);
717                                         ~l8a.set(\dur, f8,    \vol, vol8);           ~l8b.set(\dur, f8,  \vol, vol8);
718                                         ~l8c.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d.set(\dur, f8/~icd3,  \vol, vol8);
719                                         ~l8e.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f.set(\dur, f8/~icd6,  \vol, vol8);
720                                 });
721                         }););
722
723                         (
724                                 1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6,s1_1,s1_2,s1_3,s1_4,s1_5,s1_6,s1_7,s1_8;
725                                         #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
726                                         #s1,s2,s3,s4,s5,s6 = [\gsineicfld6, \gsineicrld6, \gsineicfld2, \gsineicrld2, \gsineicfld1, \gsineicrld1];
727                                         case
728                                         {~sendreplysynthdef_on == 0}{#s1_1,s1_2,s1_3,s1_4,s1_5,s1_6,s1_7,s1_8 = \gsineicfld6!8;}
729                                         {~sendreplysynthdef_on == 1}{#s1_1,s1_2,s1_3,s1_4,s1_5,s1_6,s1_7,s1_8 =
730                                                 [\gsineicfld6_f1, \gsineicfld6_f2, \gsineicfld6_f3, \gsineicfld6_f4, \gsineicfld6_f5, \gsineicfld6_f6, \gsineicfld6_f7, \gsineicfld6_f8];};
731                                         s.makeBundle(0, {
732                                                 ~l1a1 = Synth(s1_1, [\dur, ~f1,    \vol, vol1]).register;    ~l1b1 = Synth(s2, [\dur, ~f1,    \vol, vol1]);
733                                                 ~l1c1 = Synth(s3, [\dur, ~f1/~icd3,  \vol, vol1]);   ~l1d1 = Synth(s4, [\dur, ~f1/~icd3,  \vol, vol1]);
734                                                 ~l1e1 = Synth(s5, [\dur, ~f1/~icd6,  \vol, vol1]);   ~l1f1 = Synth(s6, [\dur, ~f1/~icd6,  \vol, vol1]);
735                                                 ~l2a1 = Synth(s1_2, [\dur, ~f2,    \vol, vol2]);        ~l2b1 = Synth(s2, [\dur, ~f2,    \vol, vol2]);
736                                                 ~l2c1 = Synth(s3, [\dur, ~f2/~icd3,  \vol, vol2]);   ~l2d1 = Synth(s4, [\dur, ~f2/~icd3,  \vol, vol2]);
737                                                 ~l2e1 = Synth(s5, [\dur, ~f2/~icd6,  \vol, vol2]);   ~l2f1 = Synth(s6, [\dur, ~f2/~icd6,  \vol, vol2]);
738                                                 ~l3a1 = Synth(s1_3, [\dur, ~f3,    \vol, vol3]);        ~l3b1 = Synth(s2, [\dur, ~f3,   \vol, vol3]);
739                                                 ~l3c1 = Synth(s3, [\dur, ~f3/~icd3,  \vol, vol3]);   ~l3d1 = Synth(s4, [\dur, ~f3/~icd3, \vol, vol3]);
740                                                 ~l3e1 = Synth(s5, [\dur, ~f3/~icd6,  \vol, vol3]);   ~l3f1 = Synth(s6, [\dur, ~f3/~icd6, \vol, vol3]);
741                                                 ~l4a1 = Synth(s1_4, [\dur, ~f4,    \vol, vol4]);       ~l4b1 = Synth(s2, [\dur, ~f4,   \vol, vol4]);
742                                                 ~l4c1 = Synth(s3, [\dur, ~f4/~icd3,  \vol, vol4]);  ~l4d1 = Synth(s4, [\dur, ~f4/~icd3, \vol, vol4]);
743                                                 ~l4e1 = Synth(s5, [\dur, ~f4/~icd6,  \vol, vol4]);   ~l4f1 = Synth(s6, [\dur, ~f4/~icd6, \vol, vol4]);
744                                                 ~l5a1 = Synth(s1_5, [\dur, ~f5,    \vol, vol5]);       ~l5b1 = Synth(s2, [\dur, ~f5,   \vol, vol5]);
745                                                 ~l5c1 = Synth(s3, [\dur, ~f5/~icd3,  \vol, vol5]);   ~l5d1 = Synth(s4, [\dur, ~f5/~icd3, \vol, vol5]);
746                                                 ~l5e1 = Synth(s5, [\dur, ~f5/~icd6,  \vol, vol5]);   ~l5f1 = Synth(s6, [\dur, ~f5/~icd6, \vol, vol5]);
747                                                 ~l6a1 = Synth(s1_6, [\dur, ~f6,    \vol, vol6]);       ~l6b1 = Synth(s2, [\dur, ~f6,   \vol, vol6]);
748                                                 ~l6c1 = Synth(s3, [\dur, ~f6/~icd3,  \vol, vol6]);   ~l6d1 = Synth(s4, [\dur, ~f6/~icd3, \vol, vol6]);
749                                                 ~l6e1 = Synth(s5, [\dur, ~f6/~icd6,  \vol, vol6]);   ~l6f1 = Synth(s6, [\dur, ~f6/~icd6, \vol, vol6]);
750                                                 ~l7a1 = Synth(s1_7, [\dur, ~f7,    \vol, vol7]);       ~l7b1 = Synth(s2, [\dur, ~f7,   \vol, vol7]);
751                                                 ~l7c1 = Synth(s3, [\dur, ~f7/~icd3,  \vol, vol7]);   ~l7d1 = Synth(s4, [\dur, ~f7/~icd3, \vol, vol7]);
752                                                 ~l7e1 = Synth(s5, [\dur, ~f7/~icd6,  \vol, vol7]);   ~l7f1 = Synth(s6, [\dur, ~f7/~icd6, \vol, vol7]);
753                                                 ~l8a1 = Synth(s1_8, [\dur, ~f8,    \vol, vol8]);  ~l8b1 = Synth(s2, [\dur, ~f8,   \vol, vol8]);
754                                                 ~l8c1 = Synth(s3, [\dur, ~f8/~icd3,  \vol, vol8]);   ~l8d1 = Synth(s4, [\dur, ~f8/~icd3, \vol, vol8]);
755                                                 ~l8e1 = Synth(s5, [\dur, ~f8/~icd6,  \vol, vol8]);   ~l8f1 = Synth(s6, [\dur, ~f8/~icd6, \vol, vol8]);
756                                         });
757                                 });
758                         );
759                         AppClock.sched(0.161803398875,{
760                                 ([~l1a,~l1b,~l1c,~l1d,~l1e,~l1f,~l2a,~l2b,~l2c,~l2d,~l2e,~l2f,~l3a,~l3b,~l3c,~l3d,~l3e,~l3f,~l4a,~l4b,~l4c,~l4d,~l4e,~l4f,~l5a,~l5b,~l5c,~l5d,~l5e,~l5f,~l6a,~l6b,~l6c,~l6d,~l6e,~l6f,~l7a,~l7b,~l7c,~l7d,~l7e,~l7f,~l8a,~l8b,~l8c,~l8d,~l8e,~l8f].do(_.free)); ~slideroutine.stop;
761                         });
762                 };
763
764                 if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (View(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (View(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
765                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (View(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (View(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
766                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (View(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (View(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
767                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (View(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (View(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
768                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (View(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (View(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
769                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (View(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (View(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
770                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (View(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (View(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
771                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (View(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (View(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
772
773                 b3.value = 1;
774         };
775
776         ~synthflow = {
777                 case
778                 {~l1a1.isRunning == true}{
779                         (1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6;
780                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
781                                 s.makeBundle(0, {
782                                         ~l1a1.set(\dur, ~f1,     \vol, vol1);  ~l1b1.set(\dur, ~f1,  \vol, vol1);
783                                         ~l1c1.set(\dur, ~f1/~icd3,       \vol, vol1);  ~l1d1.set(\dur, ~f1/~icd3,  \vol, vol1);
784                                         ~l1e1.set(\dur, ~f1/~icd6,       \vol, vol1);  ~l1f1.set(\dur, ~f1/~icd6,  \vol, vol1);
785                                         ~l2a1.set(\dur, ~f2,     \vol, vol2);          ~l2b1.set(\dur, ~f2,  \vol, vol2);
786                                         ~l2c1.set(\dur, ~f2/~icd3,       \vol, vol2);  ~l2d1.set(\dur, ~f2/~icd3,  \vol, vol2);
787                                         ~l2e1.set(\dur, ~f2/~icd6,       \vol, vol2);  ~l2f1.set(\dur, ~f2/~icd6,  \vol, vol2);
788                                         ~l3a1.set(\dur, ~f3,     \vol, vol3);          ~l3b1.set(\dur, ~f3,  \vol, vol3);
789                                         ~l3c1.set(\dur, ~f3/~icd3,       \vol, vol3);  ~l3d1.set(\dur, ~f3/~icd3,  \vol, vol3);
790                                         ~l3e1.set(\dur, ~f3/~icd6,       \vol, vol3);  ~l3f1.set(\dur, ~f3/~icd6,  \vol, vol3);
791                                         ~l4a1.set(\dur, ~f4,    \vol, vol4);           ~l4b1.set(\dur, ~f4,  \vol, vol4);
792                                         ~l4c1.set(\dur, ~f4/~icd3,       \vol, vol4);  ~l4d1.set(\dur, ~f4/~icd3,  \vol, vol4);
793                                         ~l4e1.set(\dur, ~f4/~icd6,       \vol, vol4);  ~l4f1.set(\dur, ~f4/~icd6,  \vol, vol4);
794                                         ~l5a1.set(\dur, ~f5,    \vol, vol5);           ~l5b1.set(\dur, ~f5,  \vol, vol5);
795                                         ~l5c1.set(\dur, ~f5/~icd3,       \vol, vol5);  ~l5d1.set(\dur, ~f5/~icd3,  \vol, vol5);
796                                         ~l5e1.set(\dur, ~f5/~icd6,       \vol, vol5);  ~l5f1.set(\dur, ~f5/~icd6,  \vol, vol5);
797                                         ~l6a1.set(\dur, ~f6,    \vol, vol6);           ~l6b1.set(\dur, ~f6,  \vol, vol6);
798                                         ~l6c1.set(\dur, ~f6/~icd3,       \vol, vol6);  ~l6d1.set(\dur, ~f6/~icd3,  \vol, vol6);
799                                         ~l6e1.set(\dur, ~f6/~icd6,       \vol, vol6);  ~l6f1.set(\dur, ~f6/~icd6,  \vol, vol6);
800                                         ~l7a1.set(\dur, ~f7,    \vol, vol7);           ~l7b1.set(\dur, ~f7,  \vol, vol7);
801                                         ~l7c1.set(\dur, ~f7/~icd3,       \vol, vol7);  ~l7d1.set(\dur, ~f7/~icd3,  \vol, vol7);
802                                         ~l7e1.set(\dur, ~f7/~icd6,       \vol, vol7);  ~l7f1.set(\dur, ~f7/~icd6,  \vol, vol7);
803                                         ~l8a1.set(\dur, ~f8,    \vol, vol8);           ~l8b1.set(\dur, ~f8,  \vol, vol8);
804                                         ~l8c1.set(\dur, ~f8/~icd3,       \vol, vol8);  ~l8d1.set(\dur, ~f8/~icd3,  \vol, vol8);
805                                         ~l8e1.set(\dur, ~f8/~icd6,       \vol, vol8);  ~l8f1.set(\dur, ~f8/~icd6,  \vol, vol8);
806                                 });
807                         }););
808                 }
809                 {~l1a.isRunning == true} {
810                         (1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6;
811                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
812                                 ~l1a.set(\dur, ~f1,     \vol, vol1);  ~l1b.set(\dur, ~f1,  \vol, vol1);
813                                 s.makeBundle(0, {
814                                         ~l1c.set(\dur, ~f1/~icd3,       \vol, vol1);  ~l1d.set(\dur, ~f1/~icd3,  \vol, vol1);
815                                         ~l1e.set(\dur, ~f1/~icd6,       \vol, vol1);  ~l1f.set(\dur, ~f1/~icd6,  \vol, vol1);
816                                         ~l2a.set(\dur, ~f2,     \vol, vol2);          ~l2b.set(\dur, ~f2,  \vol, vol2);
817                                         ~l2c.set(\dur, ~f2/~icd3,       \vol, vol2);  ~l2d.set(\dur, ~f2/~icd3,  \vol, vol2);
818                                         ~l2e.set(\dur, ~f2/~icd6,       \vol, vol2);  ~l2f.set(\dur, ~f2/~icd6,  \vol, vol2);
819                                         ~l3a.set(\dur, ~f3,     \vol, vol3);          ~l3b.set(\dur, ~f3,  \vol, vol3);
820                                         ~l3c.set(\dur, ~f3/~icd3,       \vol, vol3);  ~l3d.set(\dur, ~f3/~icd3,  \vol, vol3);
821                                         ~l3e.set(\dur, ~f3/~icd6,       \vol, vol3);  ~l3f.set(\dur, ~f3/~icd6,  \vol, vol3);
822                                         ~l4a.set(\dur, ~f4,    \vol, vol4);           ~l4b.set(\dur, ~f4,  \vol, vol4);
823                                         ~l4c.set(\dur, ~f4/~icd3,       \vol, vol4);  ~l4d.set(\dur, ~f4/~icd3,  \vol, vol4);
824                                         ~l4e.set(\dur, ~f4/~icd6,       \vol, vol4);  ~l4f.set(\dur, ~f4/~icd6,  \vol, vol4);
825                                         ~l5a.set(\dur, ~f5,    \vol, vol5);           ~l5b.set(\dur, ~f5,  \vol, vol5);
826                                         ~l5c.set(\dur, ~f5/~icd3,       \vol, vol5);  ~l5d.set(\dur, ~f5/~icd3,  \vol, vol5);
827                                         ~l5e.set(\dur, ~f5/~icd6,       \vol, vol5);  ~l5f.set(\dur, ~f5/~icd6,  \vol, vol5);
828                                         ~l6a.set(\dur, ~f6,    \vol, vol6);           ~l6b.set(\dur, ~f6,  \vol, vol6);
829                                         ~l6c.set(\dur, ~f6/~icd3,       \vol, vol6);  ~l6d.set(\dur, ~f6/~icd3,  \vol, vol6);
830                                         ~l6e.set(\dur, ~f6/~icd6,       \vol, vol6);  ~l6f.set(\dur, ~f6/~icd6,  \vol, vol6);
831                                         ~l7a.set(\dur, ~f7,    \vol, vol7);           ~l7b.set(\dur, ~f7,  \vol, vol7);
832                                         ~l7c.set(\dur, ~f7/~icd3,       \vol, vol7);  ~l7d.set(\dur, ~f7/~icd3,  \vol, vol7);
833                                         ~l7e.set(\dur, ~f7/~icd6,       \vol, vol7);  ~l7f.set(\dur, ~f7/~icd6,  \vol, vol7);
834                                         ~l8a.set(\dur, ~f8,    \vol, vol8);           ~l8b.set(\dur, ~f8,  \vol, vol8);
835                                         ~l8c.set(\dur, ~f8/~icd3,       \vol, vol8);  ~l8d.set(\dur, ~f8/~icd3,  \vol, vol8);
836                                         ~l8e.set(\dur, ~f8/~icd6,       \vol, vol8);  ~l8f.set(\dur, ~f8/~icd6,  \vol, vol8);
837                                 });
838                         }););
839                 };
840
841                 if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (View(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (View(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
842                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (View(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (View(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
843                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (View(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (View(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
844                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (View(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (View(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
845                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (View(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (View(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
846                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (View(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (View(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
847                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (View(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (View(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
848                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (View(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (View(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
849
850         };
851
852         ~synthslide = {
853                 case
854                 {~l1a1.isRunning == true}{(//fprog
855                         ~slideroutine = Routine({1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6;
856                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
857                                 ~slidedo.do({~slidecount=~slidecount-1;
858                                         (
859                                                 [ ~f1=~f1+g,~f2=~f2+h,~f3=~f3+i,~f4=~f4+j,~f5=~f5+k,~f6=~f6+l,~f7=~f7+m,~f8=~f8+n ];
860                                                 s.makeBundle(0, {
861                                                         ~l1a1.set(\dur, ~f1,     \vol, vol1);  ~l1b1.set(\dur, ~f1,  \vol, vol1);
862                                                         ~l1c1.set(\dur, ~f1/~icd3,       \vol, vol1);  ~l1d1.set(\dur, ~f1/~icd3,  \vol, vol1);
863                                                         ~l1e1.set(\dur, ~f1/~icd6,       \vol, vol1);  ~l1f1.set(\dur, ~f1/~icd6,  \vol, vol1);
864                                                         ~l2a1.set(\dur, ~f2,     \vol, vol2);          ~l2b1.set(\dur, ~f2,  \vol, vol2);
865                                                         ~l2c1.set(\dur, ~f2/~icd3,       \vol, vol2);  ~l2d1.set(\dur, ~f2/~icd3,  \vol, vol2);
866                                                         ~l2e1.set(\dur, ~f2/~icd6,       \vol, vol2);  ~l2f1.set(\dur, ~f2/~icd6,  \vol, vol2);
867                                                         ~l3a1.set(\dur, ~f3,     \vol, vol3);          ~l3b1.set(\dur, ~f3,  \vol, vol3);
868                                                         ~l3c1.set(\dur, ~f3/~icd3,       \vol, vol3);  ~l3d1.set(\dur, ~f3/~icd3,  \vol, vol3);
869                                                         ~l3e1.set(\dur, ~f3/~icd6,       \vol, vol3);  ~l3f1.set(\dur, ~f3/~icd6,  \vol, vol3);
870                                                         ~l4a1.set(\dur, ~f4,    \vol, vol4);           ~l4b1.set(\dur, ~f4,  \vol, vol4);
871                                                         ~l4c1.set(\dur, ~f4/~icd3,       \vol, vol4);  ~l4d1.set(\dur, ~f4/~icd3,  \vol, vol4);
872                                                         ~l4e1.set(\dur, ~f4/~icd6,       \vol, vol4);  ~l4f1.set(\dur, ~f4/~icd6,  \vol, vol4);
873                                                         ~l5a1.set(\dur, ~f5,    \vol, vol5);           ~l5b1.set(\dur, ~f5,  \vol, vol5);
874                                                         ~l5c1.set(\dur, ~f5/~icd3,       \vol, vol5);  ~l5d1.set(\dur, ~f5/~icd3,  \vol, vol5);
875                                                         ~l5e1.set(\dur, ~f5/~icd6,       \vol, vol5);  ~l5f1.set(\dur, ~f5/~icd6,  \vol, vol5);
876                                                         ~l6a1.set(\dur, ~f6,    \vol, vol6);           ~l6b1.set(\dur, ~f6,  \vol, vol6);
877                                                         ~l6c1.set(\dur, ~f6/~icd3,       \vol, vol6);  ~l6d1.set(\dur, ~f6/~icd3,  \vol, vol6);
878                                                         ~l6e1.set(\dur, ~f6/~icd6,       \vol, vol6);  ~l6f1.set(\dur, ~f6/~icd6,  \vol, vol6);
879                                                         ~l7a1.set(\dur, ~f7,    \vol, vol7);           ~l7b1.set(\dur, ~f7,  \vol, vol7);
880                                                         ~l7c1.set(\dur, ~f7/~icd3,       \vol, vol7);  ~l7d1.set(\dur, ~f7/~icd3,  \vol, vol7);
881                                                         ~l7e1.set(\dur, ~f7/~icd6,       \vol, vol7);  ~l7f1.set(\dur, ~f7/~icd6,  \vol, vol7);
882                                                         ~l8a1.set(\dur, ~f8,    \vol, vol8);           ~l8b1.set(\dur, ~f8,  \vol, vol8);
883                                                         ~l8c1.set(\dur, ~f8/~icd3,       \vol, vol8);  ~l8d1.set(\dur, ~f8/~icd3,  \vol, vol8);
884                                                         ~l8e1.set(\dur, ~f8/~icd6,       \vol, vol8);  ~l8f1.set(\dur, ~f8/~icd6,  \vol, vol8);
885                                                 });
886                                         );
887
888                                         {if(~slidecount==0,{
889                                                 if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (View(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (View(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
890                                                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (View(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (View(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
891                                                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (View(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (View(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
892                                                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (View(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (View(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
893                                                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (View(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (View(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
894                                                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (View(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (View(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
895                                                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (View(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (View(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
896                                                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (View(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (View(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
897                                         });}.defer;
898
899                                         (~slidetime/~slidedo).wait;});});}).play;);}
900                 {~l1a.isRunning == true} {(//fprog
901                         ~slideroutine = Routine({1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6;
902                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
903                                 ~slidedo.do({~slidecount=~slidecount-1;
904                                         (
905                                                 [ ~f1=~f1+g,~f2=~f2+h,~f3=~f3+i,~f4=~f4+j,~f5=~f5+k,~f6=~f6+l,~f7=~f7+m,~f8=~f8+n ];
906                                                 s.makeBundle(0, {
907                                                         ~l1a.set(\dur, ~f1,     \vol, vol1);  ~l1b.set(\dur, ~f1,  \vol, vol1);
908                                                         ~l1c.set(\dur, ~f1/~icd3,       \vol, vol1);  ~l1d.set(\dur, ~f1/~icd3,  \vol, vol1);
909                                                         ~l1e.set(\dur, ~f1/~icd6,       \vol, vol1);  ~l1f.set(\dur, ~f1/~icd6,  \vol, vol1);
910                                                         ~l2a.set(\dur, ~f2,     \vol, vol2);          ~l2b.set(\dur, ~f2,  \vol, vol2);
911                                                         ~l2c.set(\dur, ~f2/~icd3,       \vol, vol2);  ~l2d.set(\dur, ~f2/~icd3,  \vol, vol2);
912                                                         ~l2e.set(\dur, ~f2/~icd6,       \vol, vol2);  ~l2f.set(\dur, ~f2/~icd6,  \vol, vol2);
913                                                         ~l3a.set(\dur, ~f3,     \vol, vol3);          ~l3b.set(\dur, ~f3,  \vol, vol3);
914                                                         ~l3c.set(\dur, ~f3/~icd3,       \vol, vol3);  ~l3d.set(\dur, ~f3/~icd3,  \vol, vol3);
915                                                         ~l3e.set(\dur, ~f3/~icd6,       \vol, vol3);  ~l3f.set(\dur, ~f3/~icd6,  \vol, vol3);
916                                                         ~l4a.set(\dur, ~f4,    \vol, vol4);           ~l4b.set(\dur, ~f4,  \vol, vol4);
917                                                         ~l4c.set(\dur, ~f4/~icd3,       \vol, vol4);  ~l4d.set(\dur, ~f4/~icd3,  \vol, vol4);
918                                                         ~l4e.set(\dur, ~f4/~icd6,       \vol, vol4);  ~l4f.set(\dur, ~f4/~icd6,  \vol, vol4);
919                                                         ~l5a.set(\dur, ~f5,    \vol, vol5);           ~l5b.set(\dur, ~f5,  \vol, vol5);
920                                                         ~l5c.set(\dur, ~f5/~icd3,       \vol, vol5);  ~l5d.set(\dur, ~f5/~icd3,  \vol, vol5);
921                                                         ~l5e.set(\dur, ~f5/~icd6,       \vol, vol5);  ~l5f.set(\dur, ~f5/~icd6,  \vol, vol5);
922                                                         ~l6a.set(\dur, ~f6,    \vol, vol6);           ~l6b.set(\dur, ~f6,  \vol, vol6);
923                                                         ~l6c.set(\dur, ~f6/~icd3,       \vol, vol6);  ~l6d.set(\dur, ~f6/~icd3,  \vol, vol6);
924                                                         ~l6e.set(\dur, ~f6/~icd6,       \vol, vol6);  ~l6f.set(\dur, ~f6/~icd6,  \vol, vol6);
925                                                         ~l7a.set(\dur, ~f7,    \vol, vol7);           ~l7b.set(\dur, ~f7,  \vol, vol7);
926                                                         ~l7c.set(\dur, ~f7/~icd3,       \vol, vol7);  ~l7d.set(\dur, ~f7/~icd3,  \vol, vol7);
927                                                         ~l7e.set(\dur, ~f7/~icd6,       \vol, vol7);  ~l7f.set(\dur, ~f7/~icd6,  \vol, vol7);
928                                                         ~l8a.set(\dur, ~f8,    \vol, vol8);           ~l8b.set(\dur, ~f8,  \vol, vol8);
929                                                         ~l8c.set(\dur, ~f8/~icd3,       \vol, vol8);  ~l8d.set(\dur, ~f8/~icd3,  \vol, vol8);
930                                                         ~l8e.set(\dur, ~f8/~icd6,       \vol, vol8);  ~l8f.set(\dur, ~f8/~icd6,  \vol, vol8);
931                                                 });
932
933                                         );
934
935                                         {if(~slidecount==0,{if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (View(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (View(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
936                                                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (View(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (View(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
937                                                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (View(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (View(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
938                                                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (View(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (View(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
939                                                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (View(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (View(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
940                                                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (View(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (View(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
941                                                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (View(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (View(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
942                                                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (View(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (View(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
943                                         });}.defer;
944
945                                         (~slidetime/~slidedo).wait;});});}).play;);};
946         };
947
948         ~synthpause = {(
949                 case
950                 {~l1a1.isRunning == true}{
951                         (1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6,f1,f2,f3,f4,f5,f6,f7,f8;
952                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
953                                 #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
954                                 s.makeBundle(0, {
955                                         ~l1a1.set(\dur, f1,     \vol, vol1);          ~l1b1.set(\dur, f1,  \vol, vol1);
956                                         ~l1c1.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d1.set(\dur, f1/~icd3,  \vol, vol1);
957                                         ~l1e1.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f1.set(\dur, f1/~icd6,  \vol, vol1);
958                                         ~l2a1.set(\dur, f2,     \vol, vol2);          ~l2b1.set(\dur, f2,  \vol, vol2);
959                                         ~l2c1.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d1.set(\dur, f2/~icd3,  \vol, vol2);
960                                         ~l2e1.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f1.set(\dur, f2/~icd6,  \vol, vol2);
961                                         ~l3a1.set(\dur, f3,     \vol, vol3);          ~l3b1.set(\dur, f3,  \vol, vol3);
962                                         ~l3c1.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d1.set(\dur, f3/~icd3,  \vol, vol3);
963                                         ~l3e1.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f1.set(\dur, f3/~icd6,  \vol, vol3);
964                                         ~l4a1.set(\dur, f4,    \vol, vol4);           ~l4b1.set(\dur, f4,  \vol, vol4);
965                                         ~l4c1.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d1.set(\dur, f4/~icd3,  \vol, vol4);
966                                         ~l4e1.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f1.set(\dur, f4/~icd6,  \vol, vol4);
967                                         ~l5a1.set(\dur, f5,    \vol, vol5);           ~l5b1.set(\dur, f5,  \vol, vol5);
968                                         ~l5c1.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d1.set(\dur, f5/~icd3,  \vol, vol5);
969                                         ~l5e1.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f1.set(\dur, f5/~icd6,  \vol, vol5);
970                                         ~l6a1.set(\dur, f6,    \vol, vol6);           ~l6b1.set(\dur, f6,  \vol, vol6);
971                                         ~l6c1.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d1.set(\dur, f6/~icd3,  \vol, vol6);
972                                         ~l6e1.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f1.set(\dur, f6/~icd6,  \vol, vol6);
973                                         ~l7a1.set(\dur, f7,    \vol, vol7);           ~l7b1.set(\dur, f7,  \vol, vol7);
974                                         ~l7c1.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d1.set(\dur, f7/~icd3,  \vol, vol7);
975                                         ~l7e1.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f1.set(\dur, f7/~icd6,  \vol, vol7);
976                                         ~l8a1.set(\dur, f8,    \vol, vol8);           ~l8b1.set(\dur, f8,  \vol, vol8);
977                                         ~l8c1.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d1.set(\dur, f8/~icd3,  \vol, vol8);
978                                         ~l8e1.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f1.set(\dur, f8/~icd6,  \vol, vol8);
979                                 });
980                         }););
981                 }
982                 {~l1a.isRunning == true} {
983                         (1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6,f1,f2,f3,f4,f5,f6,f7,f8;
984                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
985                                 #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
986                                 s.makeBundle(0, {
987                                         ~l1a.set(\dur, f1,     \vol, vol1);  ~l1b.set(\dur, f1,  \vol, vol1);
988                                         ~l1c.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d.set(\dur, f1/~icd3,  \vol, vol1);
989                                         ~l1e.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f.set(\dur, f1/~icd6,  \vol, vol1);
990                                         ~l2a.set(\dur, f2,     \vol, vol2);          ~l2b.set(\dur, f2,  \vol, vol2);
991                                         ~l2c.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d.set(\dur, f2/~icd3,  \vol, vol2);
992                                         ~l2e.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f.set(\dur, f2/~icd6,  \vol, vol2);
993                                         ~l3a.set(\dur, f3,     \vol, vol3);          ~l3b.set(\dur, f3,  \vol, vol3);
994                                         ~l3c.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d.set(\dur, f3/~icd3,  \vol, vol3);
995                                         ~l3e.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f.set(\dur, f3/~icd6,  \vol, vol3);
996                                         ~l4a.set(\dur, f4,    \vol, vol4);           ~l4b.set(\dur, f4,  \vol, vol4);
997                                         ~l4c.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d.set(\dur, f4/~icd3,  \vol, vol4);
998                                         ~l4e.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f.set(\dur, f4/~icd6,  \vol, vol4);
999                                         ~l5a.set(\dur, f5,    \vol, vol5);           ~l5b.set(\dur, f5,  \vol, vol5);
1000                                         ~l5c.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d.set(\dur, f5/~icd3,  \vol, vol5);
1001                                         ~l5e.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f.set(\dur, f5/~icd6,  \vol, vol5);
1002                                         ~l6a.set(\dur, f6,    \vol, vol6);           ~l6b.set(\dur, f6,  \vol, vol6);
1003                                         ~l6c.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d.set(\dur, f6/~icd3,  \vol, vol6);
1004                                         ~l6e.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f.set(\dur, f6/~icd6,  \vol, vol6);
1005                                         ~l7a.set(\dur, f7,    \vol, vol7);           ~l7b.set(\dur, f7,  \vol, vol7);
1006                                         ~l7c.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d.set(\dur, f7/~icd3,  \vol, vol7);
1007                                         ~l7e.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f.set(\dur, f7/~icd6,  \vol, vol7);
1008                                         ~l8a.set(\dur, f8,    \vol, vol8);           ~l8b.set(\dur, f8,  \vol, vol8);
1009                                         ~l8c.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d.set(\dur, f8/~icd3,  \vol, vol8);
1010                                         ~l8e.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f.set(\dur, f8/~icd6,  \vol, vol8);
1011                                 });
1012                         }););
1013                 };
1014         );
1015         };
1016
1017         ~synthfree = {
1018                 (
1019                         case
1020                         {~l1a1.isRunning == true}{
1021                                 (1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6,f1,f2,f3,f4,f5,f6,f7,f8;
1022                                         #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
1023                                         #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
1024                                         s.makeBundle(0, {
1025                                                 ~l1a1.set(\dur, f1,     \vol, vol1);  ~l1b1.set(\dur, f1,  \vol, vol1);
1026                                                 ~l1c1.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d1.set(\dur, f1/~icd3,  \vol, vol1);
1027                                                 ~l1e1.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f1.set(\dur, f1/~icd6,  \vol, vol1);
1028                                                 ~l2a1.set(\dur, f2,     \vol, vol2);          ~l2b1.set(\dur, f2,  \vol, vol2);
1029                                                 ~l2c1.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d1.set(\dur, f2/~icd3,  \vol, vol2);
1030                                                 ~l2e1.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f1.set(\dur, f2/~icd6,  \vol, vol2);
1031                                                 ~l3a1.set(\dur, f3,     \vol, vol3);          ~l3b1.set(\dur, f3,  \vol, vol3);
1032                                                 ~l3c1.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d1.set(\dur, f3/~icd3,  \vol, vol3);
1033                                                 ~l3e1.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f1.set(\dur, f3/~icd6,  \vol, vol3);
1034                                                 ~l4a1.set(\dur, f4,    \vol, vol4);           ~l4b1.set(\dur, f4,  \vol, vol4);
1035                                                 ~l4c1.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d1.set(\dur, f4/~icd3,  \vol, vol4);
1036                                                 ~l4e1.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f1.set(\dur, f4/~icd6,  \vol, vol4);
1037                                                 ~l5a1.set(\dur, f5,    \vol, vol5);           ~l5b1.set(\dur, f5,  \vol, vol5);
1038                                                 ~l5c1.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d1.set(\dur, f5/~icd3,  \vol, vol5);
1039                                                 ~l5e1.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f1.set(\dur, f5/~icd6,  \vol, vol5);
1040                                                 ~l6a1.set(\dur, f6,    \vol, vol6);           ~l6b1.set(\dur, f6,  \vol, vol6);
1041                                                 ~l6c1.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d1.set(\dur, f6/~icd3,  \vol, vol6);
1042                                                 ~l6e1.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f1.set(\dur, f6/~icd6,  \vol, vol6);
1043                                                 ~l7a1.set(\dur, f7,    \vol, vol7);           ~l7b1.set(\dur, f7,  \vol, vol7);
1044                                                 ~l7c1.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d1.set(\dur, f7/~icd3,  \vol, vol7);
1045                                                 ~l7e1.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f1.set(\dur, f7/~icd6,  \vol, vol7);
1046                                                 ~l8a1.set(\dur, f8,    \vol, vol8);           ~l8b1.set(\dur, f8,  \vol, vol8);
1047                                                 ~l8c1.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d1.set(\dur, f8/~icd3,  \vol, vol8);
1048                                                 ~l8e1.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f1.set(\dur, f8/~icd6,  \vol, vol8);
1049                                         });
1050                                 }););
1051                                 AppClock.sched(0.161803398875,{
1052                                         ([~l1a1,~l1b1,~l1c1,~l1d1,~l1e1,~l1f1,~l2a1,~l2b1,~l2c1,~l2d1,~l2e1,~l2f1,~l3a1,~l3b1,~l3c1,~l3d1,~l3e1,~l3f1,~l4a1,~l4b1,~l4c1,~l4d1,~l4e1,~l4f1,~l5a1,~l5b1,~l5c1,~l5d1,~l5e1,~l5f1,~l6a1,~l6b1,~l6c1,~l6d1,~l6e1,~l6f1,~l7a1,~l7b1,~l7c1,~l7d1,~l7e1,~l7f1,~l8a1,~l8b1,~l8c1,~l8d1,~l8e1,~l8f1 ].do(_.free)); ~slideroutine.stop;
1053                                 });
1054                         }
1055                         {~l1a.isRunning == true}{
1056                                 (1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6,f1,f2,f3,f4,f5,f6,f7,f8;
1057                                         #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
1058                                         #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
1059                                         s.makeBundle(0, {
1060                                                 ~l1a.set(\dur, f1,     \vol, vol1);  ~l1b.set(\dur, f1,  \vol, vol1);
1061                                                 ~l1c.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d.set(\dur, f1/~icd3,  \vol, vol1);
1062                                                 ~l1e.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f.set(\dur, f1/~icd6,  \vol, vol1);
1063                                                 ~l2a.set(\dur, f2,     \vol, vol2);          ~l2b.set(\dur, f2,  \vol, vol2);
1064                                                 ~l2c.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d.set(\dur, f2/~icd3,  \vol, vol2);
1065                                                 ~l2e.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f.set(\dur, f2/~icd6,  \vol, vol2);
1066                                                 ~l3a.set(\dur, f3,     \vol, vol3);          ~l3b.set(\dur, f3,  \vol, vol3);
1067                                                 ~l3c.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d.set(\dur, f3/~icd3,  \vol, vol3);
1068                                                 ~l3e.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f.set(\dur, f3/~icd6,  \vol, vol3);
1069                                                 ~l4a.set(\dur, f4,    \vol, vol4);           ~l4b.set(\dur, f4,  \vol, vol4);
1070                                                 ~l4c.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d.set(\dur, f4/~icd3,  \vol, vol4);
1071                                                 ~l4e.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f.set(\dur, f4/~icd6,  \vol, vol4);
1072                                                 ~l5a.set(\dur, f5,    \vol, vol5);           ~l5b.set(\dur, f5,  \vol, vol5);
1073                                                 ~l5c.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d.set(\dur, f5/~icd3,  \vol, vol5);
1074                                                 ~l5e.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f.set(\dur, f5/~icd6,  \vol, vol5);
1075                                                 ~l6a.set(\dur, f6,    \vol, vol6);           ~l6b.set(\dur, f6,  \vol, vol6);
1076                                                 ~l6c.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d.set(\dur, f6/~icd3,  \vol, vol6);
1077                                                 ~l6e.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f.set(\dur, f6/~icd6,  \vol, vol6);
1078                                                 ~l7a.set(\dur, f7,    \vol, vol7);           ~l7b.set(\dur, f7,  \vol, vol7);
1079                                                 ~l7c.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d.set(\dur, f7/~icd3,  \vol, vol7);
1080                                                 ~l7e.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f.set(\dur, f7/~icd6,  \vol, vol7);
1081                                                 ~l8a.set(\dur, f8,    \vol, vol8);           ~l8b.set(\dur, f8,  \vol, vol8);
1082                                                 ~l8c.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d.set(\dur, f8/~icd3,  \vol, vol8);
1083                                                 ~l8e.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f.set(\dur, f8/~icd6,  \vol, vol8);
1084                                         });
1085                                 }););
1086                                 AppClock.sched(0.161803398875,{
1087                                         ([~l1a,~l1b,~l1c,~l1d,~l1e,~l1f,~l2a,~l2b,~l2c,~l2d,~l2e,~l2f,~l3a,~l3b,~l3c,~l3d,~l3e,~l3f,~l4a,~l4b,~l4c,~l4d,~l4e,~l4f,~l5a,~l5b,~l5c,~l5d,~l5e,~l5f,~l6a,~l6b,~l6c,~l6d,~l6e,~l6f,~l7a,~l7b,~l7c,~l7d,~l7e,~l7f,~l8a,~l8b,~l8c,~l8d,~l8e,~l8f].do(_.free)); ~slideroutine.stop;
1088                                 });
1089                         };
1090                 );
1091         };
1092
1093
1094         //timer values
1095
1096         case
1097         {~slot1 == nil}{""}
1098         {~slot2 == nil}{""}
1099         {~slot3 == nil}{""}
1100         {~slot4 == nil}{""}
1101         {~slot5 == nil}{""}
1102         {~slot6 == nil}{""}
1103         {~slot7 == nil}{""}
1104         {~slot8 == nil}{""};
1105
1106         ~timevals = {(~tst = TextView(w, Rect(~tspl,~tspt, ~tspw, ~tsph)).background_(Color.black);
1107                 (~tst.string =
1108                         "o1:_"++~time1o.value.asString++"_f1:_"++~time1f.value.asString++"_s1:_"++~time1s.value.asString++"\n" ++
1109                         "o2:_"++~time2o.value.asString++"_f2:_"++~time2f.value.asString++"_s2:_"++~time2s.value.asString++"\n" ++
1110                         "o3:_"++~time3o.value.asString++"_f3:_"++~time3f.value.asString++"_s3:_"++~time3s.value.asString++"\n" ++
1111                         "o4:_"++~time4o.value.asString++"_f4:_"++~time4f.value.asString++"_s4:_"++~time4s.value.asString++"\n" ++
1112                         "o5:_"++~time5o.value.asString++"_f5:_"++~time5f.value.asString++"_s5:_"++~time5s.value.asString++"\n" ++
1113                         "o6:_"++~time6o.value.asString++"_f6:_"++~time6f.value.asString++"_s6:_"++~time6s.value.asString++"\n" ++
1114                         "o7:_"++~time7o.value.asString++"_f7:_"++~time7f.value.asString++"_s7:_"++~time7s.value.asString++"\n" ++
1115                         "o8:_"++~time8o.value.asString++"_f8:_"++~time8f.value.asString++"_s8:_"++~time8s.value.asString++"\n" ++"\n" ++
1116                         if(~slot8 != ~slot, {
1117                                 (~slot1 = ~slot2).asString++"\n" ++
1118                                 (~slot2 = ~slot3).asString++"\n" ++
1119                                 (~slot3 = ~slot4).asString++"\n" ++
1120                                 (~slot4 = ~slot5).asString++"\n" ++
1121                                 (~slot5 = ~slot6).asString++"\n" ++
1122                                 (~slot6 = ~slot7).asString++"\n" ++
1123                                 (~slot7 = ~slot8).asString++"\n" ++
1124                                 (~slot8 = ~slot).asString;
1125                         },{
1126                                 (~slot1).asString++"\n" ++
1127                                 (~slot2).asString++"\n" ++
1128                                 (~slot3).asString++"\n" ++
1129                                 (~slot4).asString++"\n" ++
1130                                 (~slot5).asString++"\n" ++
1131                                 (~slot6).asString++"\n" ++
1132                                 (~slot7).asString++"\n" ++
1133                                 (~slot8).asString;
1134                         });
1135
1136                 );
1137                 ~tst.stringColor = Color.white;
1138         )};
1139
1140
1141         //monitoring number of synths function
1142
1143         ~numsynthsfunc = {
1144                 if((~numsynths != nil) or: (~numsynths.isPlaying == true), {~numsynths.stop;});
1145                 ~numsynths = Routine({inf.do({if((s.numSynths > 49) and: (3.wait; s.numSynths > 49) and: (6.wait; s.numSynths > 49), {
1146
1147                         AppClock.sched(0, {
1148                                 if(~numsynthmessage != nil, {~numsynthmessage.close;});
1149                                 ~numsynthmessage = View(w, Rect(Window.screenBounds.width-(340+46),Window.screenBounds.height-(340+46/1.6180339887499)-110,340+46,340+46/1.6180339887499)).background_(Color.black).front;
1150                                 ~numsynthmessagestring = StaticText(~numsynthmessage, Rect(0,0,340+46,340+46/1.6180339887499)).background_(Color.black);
1151                                 ~numsynthmessagestring.align = \topLeft;
1152                                 ~numsynthmessagestring.string ="Warning:"++"\n"++"\n"++"More than the normal amount of synths are currently running. It is recommended to free the server by pressing "+"ctrl/cmd - period".quote+" and then pressing the "+"ok".quote+" button. Otherwise, you can press the "+"cancel".quote+" button to allow the synths to keep running. If you press the "+"cancel".quote+" button this message will not show again unless "+"synth0".quote+" has been pressed.";
1153                                 ~numsynthmessagestring.stringColor = Color.white;
1154                                 ~numsynthmessagebutton1 = Button.new(~numsynthmessage,Rect(120-46,340/1.6180339887499-30,46,46/1.6180339887499)).states_([["ok",Color.white,Color.black]]).action_({AppClock.sched(0, {~numsynthmessage.close; ~numsynths.play; ~midifunc.value;});});
1155                                 ~numsynthmessagebutton2 = Button.new(~numsynthmessage,Rect(320+46-100,340/1.6180339887499-30,46,46/1.6180339887499)).states_([["cancel",Color.white,Color.black]]).action_({AppClock.sched(0, {~numsynths.stop; ~numsynthmessage.close;});});
1156                                 ~numsynthmessage.front;
1157                         });
1158                 }); 1.wait;});}).play;
1159         };
1160
1161         ~numsynthsfunc.value;
1162
1163
1164         //mouse down action
1165
1166         view.mouseDownAction = {
1167                 |v, x, y, mod, butNum|
1168                 point = [x,y];
1169                 if(butNum == 0, { v.refresh;
1170
1171                         //generate dots on mouse down action
1172
1173                         ~tgrid = 30;
1174                         ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
1175
1176                         case
1177                         {y<~tgrid} {nil}
1178                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z1.close;~z1 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1179                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z2.close;~z2 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1180                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z3.close;~z3 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1181                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z4.close;~z4 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1182                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z5.close;~z5 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1183                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z6.close;~z6 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1184                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {~z7.close;~z7 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1185                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {~z8.close;~z8 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1186                         {y>~tgrid and: y<~bgrid} {nil}
1187                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z1.close;~z1 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1188                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z2.close;~z2 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1189                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z3.close;~z3 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1190                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z4.close;~z4 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1191                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z5.close;~z5 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1192                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z6.close;~z6 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1193                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z7.close;~z7 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1194                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z8.close;~z8 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1195                 }, {});
1196
1197                 ~tgrid = 30;
1198                 ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
1199
1200                 //set synth values on mouse down action
1201
1202                 case
1203                 {~l1a.isRunning == true}{
1204                         case
1205                         {y<~tgrid} {nil}
1206                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1207                                 ~l1a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1208                                 ~l1b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f1=q.value; ~undof1=~f1;
1209                                 ~l1c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1210                                 ~l1d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1211                                 ~l1e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1212                                 ~l1f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1213                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1214                                 ~l2a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1215                                 ~l2b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f2=q.value; ~undof2=~f2;
1216                                 ~l2c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1217                                 ~l2d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1218                                 ~l2e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1219                                 ~l2f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1220                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1221                                 ~l3a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1222                                 ~l3b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f3=q.value; ~undof3=~f3;
1223                                 ~l3c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1224                                 ~l3d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1225                                 ~l3e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1226                                 ~l3f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1227                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1228                                 ~l4a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1229                                 ~l4b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f4=q.value; ~undof4=~f4;
1230                                 ~l4c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1231                                 ~l4d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1232                                 ~l4e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1233                                 ~l4f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1234                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1235                                 ~l5a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1236                                 ~l5b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f5=q.value; ~undof5=~f5;
1237                                 ~l5c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1238                                 ~l5d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1239                                 ~l5e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1240                                 ~l5f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1241                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1242                                 ~l6a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1243                                 ~l6b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f6=q.value; ~undof6=~f6;
1244                                 ~l6c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1245                                 ~l6d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1246                                 ~l6e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1247                                 ~l6f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1248                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1249                                 ~l7a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1250                                 ~l7b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f7=q.value; ~undof7=~f7;
1251                                 ~l7c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1252                                 ~l7d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1253                                 ~l7e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1254                                 ~l7f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1255                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1256                                 ~l8a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1257                                 ~l8b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f8=q.value; ~undof8=~f8;
1258                                 ~l8c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1259                                 ~l8d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1260                                 ~l8e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1261                                 ~l8f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1262                         {y>~tgrid and: y<~bgrid} {nil}
1263                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1264                                 ~l1a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1265                                 ~l1b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f1=q.value; ~undof1=~f1;
1266                                 ~l1c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1267                                 ~l1d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1268                                 ~l1e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1269                                 ~l1f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1270                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1271                                 ~l2a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1272                                 ~l2b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f2=q.value; ~undof2=~f2;
1273                                 ~l2c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1274                                 ~l2d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1275                                 ~l2e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1276                                 ~l2f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1277                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1278                                 ~l3a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1279                                 ~l3b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f3=q.value; ~undof3=~f3;
1280                                 ~l3c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1281                                 ~l3d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1282                                 ~l3e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1283                                 ~l3f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1284                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1285                                 ~l4a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1286                                 ~l4b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f4=q.value; ~undof4=~f4;
1287                                 ~l4c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1288                                 ~l4d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1289                                 ~l4e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1290                                 ~l4f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1291                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1292                                 ~l5a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1293                                 ~l5b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f5=q.value; ~undof5=~f5;
1294                                 ~l5c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1295                                 ~l5d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1296                                 ~l5e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1297                                 ~l5f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1298                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1299                                 ~l6a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1300                                 ~l6b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f6=q.value; ~undof6=~f6;
1301                                 ~l6c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1302                                 ~l6d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1303                                 ~l6e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1304                                 ~l6f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1305                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1306                                 ~l7a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1307                                 ~l7b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f7=q.value; ~undof7=~f7;
1308                                 ~l7c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1309                                 ~l7d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1310                                 ~l7e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1311                                 ~l7f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1312                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1313                                 ~l8a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1314                                 ~l8b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f8=q.value; ~undof8=~f8;
1315                                 ~l8c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1316                                 ~l8d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1317                                 ~l8e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1318                                 ~l8f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);};
1319                 }
1320                 {~l1a1.isRunning == true}{
1321                         case
1322                         {y<~tgrid} {nil}
1323                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1324                                 ~l1a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1325                                 ~l1b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f1=q.value; ~undof1=~f1;
1326                                 ~l1c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1327                                 ~l1d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1328                                 ~l1e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1329                                 ~l1f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1330                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1331                                 ~l2a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1332                                 ~l2b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f2=q.value; ~undof2=~f2;
1333                                 ~l2c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1334                                 ~l2d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1335                                 ~l2e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1336                                 ~l2f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1337                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1338                                 ~l3a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1339                                 ~l3b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f3=q.value; ~undof3=~f3;
1340                                 ~l3c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1341                                 ~l3d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1342                                 ~l3e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1343                                 ~l3f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1344                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1345                                 ~l4a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1346                                 ~l4b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f4=q.value; ~undof4=~f4;
1347                                 ~l4c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1348                                 ~l4d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1349                                 ~l4e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1350                                 ~l4f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1351                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1352                                 ~l5a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1353                                 ~l5b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f5=q.value; ~undof5=~f5;
1354                                 ~l5c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1355                                 ~l5d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1356                                 ~l5e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1357                                 ~l5f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1358                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1359                                 ~l6a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1360                                 ~l6b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f6=q.value; ~undof6=~f6;
1361                                 ~l6c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1362                                 ~l6d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1363                                 ~l6e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1364                                 ~l6f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1365                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1366                                 ~l7a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1367                                 ~l7b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f7=q.value; ~undof7=~f7;
1368                                 ~l7c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1369                                 ~l7d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1370                                 ~l7e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1371                                 ~l7f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1372                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1373                                 ~l8a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1374                                 ~l8b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f8=q.value; ~undof8=~f8;
1375                                 ~l8c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1376                                 ~l8d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1377                                 ~l8e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1378                                 ~l8f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1379                         {y>~tgrid and: y<~bgrid} {nil}
1380                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1381                                 ~l1a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1382                                 ~l1b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f1=q.value; ~undof1=~f1;
1383                                 ~l1c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1384                                 ~l1d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1385                                 ~l1e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1386                                 ~l1f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1387                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1388                                 ~l2a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1389                                 ~l2b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f2=q.value; ~undof2=~f2;
1390                                 ~l2c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1391                                 ~l2d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1392                                 ~l2e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1393                                 ~l2f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1394                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1395                                 ~l3a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1396                                 ~l3b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f3=q.value; ~undof3=~f3;
1397                                 ~l3c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1398                                 ~l3d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1399                                 ~l3e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1400                                 ~l3f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1401                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1402                                 ~l4a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1403                                 ~l4b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f4=q.value; ~undof4=~f4;
1404                                 ~l4c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1405                                 ~l4d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1406                                 ~l4e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1407                                 ~l4f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1408                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1409                                 ~l5a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1410                                 ~l5b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f5=q.value; ~undof5=~f5;
1411                                 ~l5c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1412                                 ~l5d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1413                                 ~l5e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1414                                 ~l5f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1415                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1416                                 ~l6a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1417                                 ~l6b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f6=q.value; ~undof6=~f6;
1418                                 ~l6c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1419                                 ~l6d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1420                                 ~l6e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1421                                 ~l6f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1422                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1423                                 ~l7a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1424                                 ~l7b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f7=q.value; ~undof7=~f7;
1425                                 ~l7c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1426                                 ~l7d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1427                                 ~l7e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1428                                 ~l7f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1429                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1430                                 ~l8a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1431                                 ~l8b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f8=q.value; ~undof8=~f8;
1432                                 ~l8c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1433                                 ~l8d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1434                                 ~l8e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1435                                 ~l8f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);};
1436                 };
1437         };
1438
1439
1440         //mouse move action
1441
1442         view.mouseMoveAction = {
1443                 |v, x, y|
1444
1445                 ~nh = 2;
1446                 ~nw = ~nh*1.6180339887499;
1447
1448                 //generate dots on mouse move action
1449
1450                 ~tgrid = 30;
1451                 ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
1452
1453                 case
1454                 {y<~tgrid} {nil}
1455                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z1.close;~z25.close;~z1 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1456                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z2.close;~z26.close;~z2 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1457                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z3.close;~z27.close;~z3 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1458                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z4.close;~z28.close;~z4 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1459                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z5.close;~z29.close;~z5 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1460                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z6.close;~z30.close;~z6 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1461                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {~z7.close;~z31.close;~z7 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1462                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {~z8.close;~z32.close;~z8 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1463                 {y>~tgrid and: y<~bgrid} {nil}
1464                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z1.close;~z25.close;~z1 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1465                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z2.close;~z26.close;~z2 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1466                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z3.close;~z27.close;~z3 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1467                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z4.close;~z28.close;~z4 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1468                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z5.close;~z29.close;~z5 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1469                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z6.close;~z30.close;~z6 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1470                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z7.close;~z31.close;~z7 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1471                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z8.close;~z32.close;~z8 = (View(w, Rect(x, y, ~nw, 2)).background = Color.white;)};
1472                 w.refresh;
1473
1474                 ~tgrid = 30;
1475                 ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
1476
1477                 //set synth values on mouse move action
1478
1479                 case
1480                 {~l1a.isRunning == true}{
1481                         case
1482                         {y<~tgrid} {nil}
1483                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1484                                 ~l1a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1485                                 ~l1b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f1=q.value; ~undof1=~f1;
1486                                 ~l1c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1487                                 ~l1d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1488                                 ~l1e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1489                                 ~l1f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1490                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1491                                 ~l2a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1492                                 ~l2b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f2=q.value; ~undof2=~f2;
1493                                 ~l2c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1494                                 ~l2d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1495                                 ~l2e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1496                                 ~l2f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1497                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1498                                 ~l3a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1499                                 ~l3b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f3=q.value; ~undof3=~f3;
1500                                 ~l3c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1501                                 ~l3d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1502                                 ~l3e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1503                                 ~l3f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1504                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1505                                 ~l4a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1506                                 ~l4b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f4=q.value; ~undof4=~f4;
1507                                 ~l4c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1508                                 ~l4d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1509                                 ~l4e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1510                                 ~l4f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1511                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1512                                 ~l5a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1513                                 ~l5b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f5=q.value; ~undof5=~f5;
1514                                 ~l5c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1515                                 ~l5d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1516                                 ~l5e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1517                                 ~l5f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1518                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1519                                 ~l6a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1520                                 ~l6b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f6=q.value; ~undof6=~f6;
1521                                 ~l6c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1522                                 ~l6d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1523                                 ~l6e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1524                                 ~l6f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1525                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1526                                 ~l7a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1527                                 ~l7b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f7=q.value; ~undof7=~f7;
1528                                 ~l7c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1529                                 ~l7d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1530                                 ~l7e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1531                                 ~l7f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1532                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1533                                 ~l8a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1534                                 ~l8b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f8=q.value; ~undof8=~f8;
1535                                 ~l8c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1536                                 ~l8d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1537                                 ~l8e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1538                                 ~l8f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1539                         {y>~tgrid and: y<~bgrid} {nil}
1540                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1541                                 ~l1a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1542                                 ~l1b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f1=q.value; ~undof1=~f1;
1543                                 ~l1c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1544                                 ~l1d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1545                                 ~l1e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1546                                 ~l1f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1547                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1548                                 ~l2a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1549                                 ~l2b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f2=q.value; ~undof2=~f2;
1550                                 ~l2c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1551                                 ~l2d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1552                                 ~l2e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1553                                 ~l2f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1554                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1555                                 ~l3a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1556                                 ~l3b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f3=q.value; ~undof3=~f3;
1557                                 ~l3c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1558                                 ~l3d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1559                                 ~l3e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1560                                 ~l3f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1561                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1562                                 ~l4a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1563                                 ~l4b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f4=q.value; ~undof4=~f4;
1564                                 ~l4c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1565                                 ~l4d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1566                                 ~l4e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1567                                 ~l4f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1568                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1569                                 ~l5a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1570                                 ~l5b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f5=q.value; ~undof5=~f5;
1571                                 ~l5c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1572                                 ~l5d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1573                                 ~l5e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1574                                 ~l5f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1575                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1576                                 ~l6a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1577                                 ~l6b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f6=q.value; ~undof6=~f6;
1578                                 ~l6c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1579                                 ~l6d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1580                                 ~l6e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1581                                 ~l6f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1582                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1583                                 ~l7a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1584                                 ~l7b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f7=q.value; ~undof7=~f7;
1585                                 ~l7c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1586                                 ~l7d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1587                                 ~l7e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1588                                 ~l7f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1589                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1590                                 ~l8a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1591                                 ~l8b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f8=q.value; ~undof8=~f8;
1592                                 ~l8c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1593                                 ~l8d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1594                                 ~l8e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1595                                 ~l8f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);};
1596                 }
1597                 {~l1a1.isRunning == true}{
1598                         case
1599                         {y<~tgrid} {nil}
1600                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1601                                 ~l1a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1602                                 ~l1b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f1=q.value; ~undof1=~f1;
1603                                 ~l1c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1604                                 ~l1d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1605                                 ~l1e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1606                                 ~l1f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1607                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1608                                 ~l2a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1609                                 ~l2b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f2=q.value; ~undof2=~f2;
1610                                 ~l2c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1611                                 ~l2d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1612                                 ~l2e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1613                                 ~l2f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1614                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1615                                 ~l3a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1616                                 ~l3b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f3=q.value; ~undof3=~f3;
1617                                 ~l3c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1618                                 ~l3d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1619                                 ~l3e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1620                                 ~l3f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1621                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1622                                 ~l4a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1623                                 ~l4b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f4=q.value; ~undof4=~f4;
1624                                 ~l4c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1625                                 ~l4d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1626                                 ~l4e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1627                                 ~l4f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1628                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1629                                 ~l5a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1630                                 ~l5b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f5=q.value; ~undof5=~f5;
1631                                 ~l5c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1632                                 ~l5d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1633                                 ~l5e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1634                                 ~l5f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1635                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1636                                 ~l6a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1637                                 ~l6b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f6=q.value; ~undof6=~f6;
1638                                 ~l6c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1639                                 ~l6d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1640                                 ~l6e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1641                                 ~l6f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1642                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1643                                 ~l7a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1644                                 ~l7b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f7=q.value; ~undof7=~f7;
1645                                 ~l7c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1646                                 ~l7d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1647                                 ~l7e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1648                                 ~l7f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1649                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1650                                 ~l8a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1651                                 ~l8b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f8=q.value; ~undof8=~f8;
1652                                 ~l8c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1653                                 ~l8d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1654                                 ~l8e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1655                                 ~l8f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1656                         {y>~tgrid and: y<~bgrid} {nil}
1657                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1658                                 ~l1a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1659                                 ~l1b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f1=q.value; ~undof1=~f1;
1660                                 ~l1c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1661                                 ~l1d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1662                                 ~l1e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1663                                 ~l1f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1664                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1665                                 ~l2a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1666                                 ~l2b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f2=q.value; ~undof2=~f2;
1667                                 ~l2c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1668                                 ~l2d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1669                                 ~l2e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1670                                 ~l2f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1671                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1672                                 ~l3a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1673                                 ~l3b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f3=q.value; ~undof3=~f3;
1674                                 ~l3c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1675                                 ~l3d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1676                                 ~l3e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1677                                 ~l3f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1678                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1679                                 ~l4a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1680                                 ~l4b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f4=q.value; ~undof4=~f4;
1681                                 ~l4c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1682                                 ~l4d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1683                                 ~l4e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1684                                 ~l4f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1685                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1686                                 ~l5a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1687                                 ~l5b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f5=q.value; ~undof5=~f5;
1688                                 ~l5c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1689                                 ~l5d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1690                                 ~l5e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1691                                 ~l5f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1692                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1693                                 ~l6a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1694                                 ~l6b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f6=q.value; ~undof6=~f6;
1695                                 ~l6c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1696                                 ~l6d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1697                                 ~l6e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1698                                 ~l6f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1699                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1700                                 ~l7a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1701                                 ~l7b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f7=q.value; ~undof7=~f7;
1702                                 ~l7c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1703                                 ~l7d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1704                                 ~l7e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1705                                 ~l7f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1706                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1707                                 ~l8a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1708                                 ~l8b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f8=q.value; ~undof8=~f8;
1709                                 ~l8c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1710                                 ~l8d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1711                                 ~l8e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1712                                 ~l8f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);};
1713                 };
1714         };
1715
1716         ~tgrid = 30;
1717         ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
1718         ~dc1 = ~tgrid-5; ~dc2 = ~bgrid-5; ~dca = 10;
1719
1720         ~bpl = Window.screenBounds.width-340;
1721         ~bpt = Window.screenBounds.height-88;
1722         ~bph = 40;
1723         ~bpw = 40/1.6180339887499;
1724
1725
1726         //copy button
1727
1728         b = Button.new(w,Rect(Window.screenBounds.width*0+80,Window.screenBounds.height-52,60,60/1.6180339887499)).states_([["copy",Color.white,Color.black],["copy",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
1729                 if(button.value == 1, {
1730
1731                         ~tsc = TextView(w, Rect(0,5, Window.screenBounds.width, 354)).background_(Color.black);
1732                         (~tsc.string =
1733                                 "current chord/frequencies: "++"\n"++"\n"++
1734
1735                                 "[~f1="++~f1.asString++",~f2="++~f2.asString++",~f3="++~f3.asString++",~f4="++~f4.asString++",~f5="++~f5.asString++",~f6="++~f6.asString++",~f7="++~f7.asString++",~f8="++~f8.asString++"]"++"\n"++"\n"++
1736
1737                                 "saved open/flow 1-8 frequencies (in script format): "++"\n"++"\n"++
1738
1739                                 "[~f1="++~fp1.asString++",~f2="++~fp2.asString++",~f3="++~fp3.asString++",~f4="++~fp4.asString++",~f5="++~fp5.asString++",~f6="++~fp6.asString++",~f7="++~fp7.asString++",~f8="++~fp8.asString++"];"++" "++"~synthopen.value; ~trace.value; (a).wait;"++"\n"++
1740                                 "[~f1="++~fp1b.asString++",~f2="++~fp2b.asString++",~f3="++~fp3b.asString++",~f4="++~fp4b.asString++",~f5="++~fp5b.asString++",~f6="++~fp6b.asString++",~f7="++~fp7b.asString++",~f8="++~fp8b.asString++"];"++" "++"~synthflow.value; ~trace.value; (a).wait;"++"\n"++
1741                                 "[~f1="++~fp1c.asString++",~f2="++~fp2c.asString++",~f3="++~fp3c.asString++",~f4="++~fp4c.asString++",~f5="++~fp5c.asString++",~f6="++~fp6c.asString++",~f7="++~fp7c.asString++",~f8="++~fp8c.asString++"];"++" "++"~synthflow.value; ~trace.value; (a).wait;"++"\n"++
1742                                 "[~f1="++~fp1d.asString++",~f2="++~fp2d.asString++",~f3="++~fp3d.asString++",~f4="++~fp4d.asString++",~f5="++~fp5d.asString++",~f6="++~fp6d.asString++",~f7="++~fp7d.asString++",~f8="++~fp8d.asString++"];"++" "++"~synthflow.value; ~trace.value; (a).wait;"++"\n"++
1743                                 "[~f1="++~fp1e.asString++",~f2="++~fp2e.asString++",~f3="++~fp3e.asString++",~f4="++~fp4e.asString++",~f5="++~fp5e.asString++",~f6="++~fp6e.asString++",~f7="++~fp7e.asString++",~f8="++~fp8e.asString++"];"++" "++"~synthflow.value; ~trace.value; (a).wait;"++"\n"++
1744                                 "[~f1="++~fp1f.asString++",~f2="++~fp2f.asString++",~f3="++~fp3f.asString++",~f4="++~fp4f.asString++",~f5="++~fp5f.asString++",~f6="++~fp6f.asString++",~f7="++~fp7f.asString++",~f8="++~fp8f.asString++"];"++" "++"~synthflow.value; ~trace.value; (a).wait;"++"\n"++
1745                                 "[~f1="++~fp1g.asString++",~f2="++~fp2g.asString++",~f3="++~fp3g.asString++",~f4="++~fp4g.asString++",~f5="++~fp5g.asString++",~f6="++~fp6g.asString++",~f7="++~fp7g.asString++",~f8="++~fp8g.asString++"];"++" "++"~synthflow.value; ~trace.value; (a).wait;"++"\n"++
1746                                 "[~f1="++~fp1h.asString++",~f2="++~fp2h.asString++",~f3="++~fp3h.asString++",~f4="++~fp4h.asString++",~f5="++~fp5h.asString++",~f6="++~fp6h.asString++",~f7="++~fp7h.asString++",~f8="++~fp8h.asString++"];"++" "++"~synthflow.value; ~trace.value; (a).wait;"++"\n"++"\n"++
1747
1748                                 "saved slide 1-8 frequencies (in script format): "++"\n"++"\n"++
1749
1750                                 "#s,t,u,v,w,x,y,z = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]; [~f1="++~fp1.asString++",~f2="++~fp2.asString++",~f3="++~fp3.asString++",~f4="++~fp4.asString++",~f5="++~fp5.asString++",~f6="++~fp6.asString++",~f7="++~fp7.asString++",~f8="++~fp8.asString++"];"++" "++"~slidetime = 1; ~slidedo = 432; ~synthslide.value; ~trace.value; (a).wait;"++"\n"++
1751                                 "#s,t,u,v,w,x,y,z = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]; [~f1="++~fp1b.asString++",~f2="++~fp2b.asString++",~f3="++~fp3b.asString++",~f4="++~fp4b.asString++",~f5="++~fp5b.asString++",~f6="++~fp6b.asString++",~f7="++~fp7b.asString++",~f8="++~fp8b.asString++"];"++" "++"~slidetime = 1; ~slidedo = 432; ~synthslide.value; ~trace.value; (a).wait;"++"\n"++
1752                                 "#s,t,u,v,w,x,y,z = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]; [~f1="++~fp1c.asString++",~f2="++~fp2c.asString++",~f3="++~fp3c.asString++",~f4="++~fp4c.asString++",~f5="++~fp5c.asString++",~f6="++~fp6c.asString++",~f7="++~fp7c.asString++",~f8="++~fp8c.asString++"];"++" "++"~slidetime = 1; ~slidedo = 432; ~synthslide.value; ~trace.value; (a).wait;"++"\n"++
1753                                 "#s,t,u,v,w,x,y,z = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]; [~f1="++~fp1d.asString++",~f2="++~fp2d.asString++",~f3="++~fp3d.asString++",~f4="++~fp4d.asString++",~f5="++~fp5d.asString++",~f6="++~fp6d.asString++",~f7="++~fp7d.asString++",~f8="++~fp8d.asString++"];"++" "++"~slidetime = 1; ~slidedo = 432; ~synthslide.value; ~trace.value; (a).wait;"++"\n"++
1754                                 "#s,t,u,v,w,x,y,z = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]; [~f1="++~fp1e.asString++",~f2="++~fp2e.asString++",~f3="++~fp3e.asString++",~f4="++~fp4e.asString++",~f5="++~fp5e.asString++",~f6="++~fp6e.asString++",~f7="++~fp7e.asString++",~f8="++~fp8e.asString++"];"++" "++"~slidetime = 1; ~slidedo = 432; ~synthslide.value; ~trace.value; (a).wait;"++"\n"++
1755                                 "#s,t,u,v,w,x,y,z = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]; [~f1="++~fp1f.asString++",~f2="++~fp2f.asString++",~f3="++~fp3f.asString++",~f4="++~fp4f.asString++",~f5="++~fp5f.asString++",~f6="++~fp6f.asString++",~f7="++~fp7f.asString++",~f8="++~fp8f.asString++"];"++" "++"~slidetime = 1; ~slidedo = 432; ~synthslide.value; ~trace.value; (a).wait;"++"\n"++
1756                                 "#s,t,u,v,w,x,y,z = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]; [~f1="++~fp1g.asString++",~f2="++~fp2g.asString++",~f3="++~fp3g.asString++",~f4="++~fp4g.asString++",~f5="++~fp5g.asString++",~f6="++~fp6g.asString++",~f7="++~fp7g.asString++",~f8="++~fp8g.asString++"];"++" "++"~slidetime = 1; ~slidedo = 432; ~synthslide.value; ~trace.value; (a).wait;"++"\n"++
1757                                 "#s,t,u,v,w,x,y,z = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]; [~f1="++~fp1h.asString++",~f2="++~fp2h.asString++",~f3="++~fp3h.asString++",~f4="++~fp4h.asString++",~f5="++~fp5h.asString++",~f6="++~fp6h.asString++",~f7="++~fp7h.asString++",~f8="++~fp8h.asString++"];"++" "++"~slidetime = 1; ~slidedo = 432; ~synthslide.value; ~trace.value; (a).wait;"
1758                         );
1759                         ~tsc.stringColor = Color.white;
1760                         [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8/*,~f9,~f10,~f11,~f12*/ ].postln;},
1761                 {~tsc.close;});
1762         });
1763
1764
1765         /*//stop timer button
1766
1767         sts = Button.new(w,Rect(Window.screenBounds.width-20-20-20-20,~bpt+69+5,20,20/1.6180339887499)).states_([["st",Color.white,Color.black],["st",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
1768         if(~timer.isPlaying == true, {
1769         if(~tst.value == nil, {~timer.stop; ~systemclock.stop; ~systemclock.clear;},{~tst.close;
1770         ~timevals.value;
1771         ~timer.stop; ~systemclock.stop; ~systemclock.clear;});
1772         });
1773         });*/
1774
1775
1776         //timer button
1777
1778         ~ts = Button.new(w,Rect(Window.screenBounds.width*0+20,Window.screenBounds.height-52,60,60/1.6180339887499)).states_([["tsynth0",Color.white,Color.black],["tsynth1",Color.white,Color.black]]).action_({arg synthbutton; synthbutton.value.postln}).action_({arg synthbutton; if(synthbutton.value == 1, {
1779
1780                 ~sts = Button.new(w,Rect(~bp01l-90,~bp01t,80,20)).states_([["stop timer",Color.white,Color.black],["stop timer",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
1781                         if(~timer.isPlaying == true, {
1782                                 if(~tst.value == nil, {~timer.stop; ~systemclock.stop; ~systemclock.clear;},{~tst.close;
1783                                         ~timevals.value;
1784                                         ~timer.stop; ~systemclock.stop; ~systemclock.clear;});
1785                         });
1786                 });
1787
1788                 if(~tst != nil, {~tst.close});
1789                 ~timevals.value;
1790                 ~timer.stop; ~systemclock.stop; ~systemclock.clear;},{if(~tst.value == nil, {~timer.stop; ~systemclock.stop; ~systemclock.clear;},{~timer.stop; ~systemclock.stop; ~systemclock.clear; ~tst.close; ~sts.close;})});
1791
1792         });
1793
1794
1795         //start/stop synth button
1796
1797         b3 = Button.new(w,Rect(Window.screenBounds.width*0+20,Window.screenBounds.height-88,60,60/1.6180339887499)).states_([["synth0",Color.white,Color.black],["synth1",Color.white,Color.black]]).action_({arg synthbutton; synthbutton.value.postln}).action_({
1798                 arg synthbutton; if(synthbutton.value == 1, {
1799                         ~l1a = Synth(\gsineicfld, [\dur, 432]).register;~l1a1 = Synth(\gsineicfld, [\dur, 432]).register;[~l1a, ~l1a1].do(_.free);~l1a = Synth(\gsineicfld, [\dur, 432]).register;~l1a1 = Synth(\gsineicfld, [\dur, 432]).register;[~l1a, ~l1a1].do(_.free);
1800                         ~synthopen.value;
1801                         ~numsynths.stop; ~numsynthsfunc.value;
1802                         ~midifunc.value;
1803                 },
1804                 {~synthfree.value; b4.value = 0;})
1805         });
1806
1807
1808         //pause/unpause button
1809
1810         b4 = Button.new(w,Rect(Window.screenBounds.width*0+80,Window.screenBounds.height-88,60,60/1.6180339887499)).states_([["pause0",Color.white,Color.black],["pause1",Color.white,Color.black]]).action_({arg synthbutton; synthbutton.value.postln}).action_({
1811                 arg synthbutton; if(synthbutton.value == 1, {~synthpause.value; if(~ts.value == 1, {~timer.stop;});},
1812                         {~synthflow.value; if(~ts.value != 1, {nil}, {SystemClock.play(~timer);})})
1813         });
1814
1815
1816         //generate values for number of KW(King Wen) sequences in a timewave half-cycle (or amplitude x2) pop-up menu
1817
1818         x=0;
1819         ~menu2values = Array.fill(24, {(x=x+1).asString++" kws"});
1820
1821
1822         //number of KW(King Wen) sequences in a timewave half-cycle (or amplitude x2) upon starting value
1823
1824         case
1825         {~gsinenum == nil}{~menu2start = ~menu2values.at(~synthdefnum-1)}
1826         {~gsinenum == 1}{~menu2start = ~menu2values.at(0)}
1827         {~gsinenum == 2}{~menu2start = ~menu2values.at(1)}
1828         {~gsinenum == 3}{~menu2start = ~menu2values.at(2)}
1829         {~gsinenum == 4}{~menu2start = ~menu2values.at(3)}
1830         {~gsinenum == 5}{~menu2start = ~menu2values.at(4)}
1831         {~gsinenum == 6}{~menu2start = ~menu2values.at(5)}
1832         {~gsinenum == 7}{~menu2start = ~menu2values.at(6)}
1833         {~gsinenum == 8}{~menu2start = ~menu2values.at(7)}
1834         {~gsinenum == 9}{~menu2start = ~menu2values.at(8)}
1835         {~gsinenum == 10}{~menu2start = ~menu2values.at(9)}
1836         {~gsinenum == 11}{~menu2start = ~menu2values.at(10)}
1837         {~gsinenum == 12}{~menu2start = ~menu2values.at(11)}
1838         {~gsinenum == 13}{~menu2start = ~menu2values.at(12)}
1839         {~gsinenum == 14}{~menu2start = ~menu2values.at(13)}
1840         {~gsinenum == 15}{~menu2start = ~menu2values.at(14)}
1841         {~gsinenum == 16}{~menu2start = ~menu2values.at(15)}
1842         {~gsinenum == 17}{~menu2start = ~menu2values.at(16)}
1843         {~gsinenum == 18}{~menu2start = ~menu2values.at(17)}
1844         {~gsinenum == 19}{~menu2start = ~menu2values.at(18)}
1845         {~gsinenum == 20}{~menu2start = ~menu2values.at(19)}
1846         {~gsinenum == 21}{~menu2start = ~menu2values.at(20)}
1847         {~gsinenum == 22}{~menu2start = ~menu2values.at(21)}
1848         {~gsinenum == 23}{~menu2start = ~menu2values.at(22)}
1849         {~gsinenum == 24}{~menu2start = ~menu2values.at(23)};
1850         if(~menu2synthdefstart.value == nil, {~menu2synthdefstart = ~synthdefnum}, {~menu2synthdefstart = ~gsinenum});
1851
1852         if(~low_pass_filter_set_value == nil, {~low_pass_filter_set_value = ~low_pass_filter_freq_limit});
1853         if(~low_pass_filter_set_value != ~low_pass_filter_freq_limit, {~low_pass_filter_set_value = ~low_pass_filter_freq_limit});
1854
1855
1856         //settings function
1857
1858         ~settingsbutton = Button.new(w,Rect(20+60*2+15+25,Window.screenBounds.height-88+(30/1.6180339887499*0),60,60/1.6180339887499)).states_([["settings",Color.white,Color.black],["settings",Color.white,Color.black]]).action_({arg button;
1859
1860                 if(button.value == 1, {
1861
1862                         ({
1863                                 arg  top = 0,width=150, revertwidth=75, height = 25,  heightbox = 25, lefttime = 0 , lefttimebox = width+5,  widthbox=165, leftdo = lefttimebox+widthbox+5, leftdobox = leftdo+57, inc=0, lw = 0,  uw = 0, numw = 40;
1864                                 var tall, stall, iall, siall, st1, st2, st3, st4, st5, st6, st7, st8, st9, st10, st11, st12, si1, si2, si3, si4, si5, si6, si7, si8, t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12;
1865                                 ~settingsview = View(w, Rect(20+60*2+15+25,Window.screenBounds.height-340,340,340/1.6180339887499)).front;
1866                                 /*w.view.decorator=FlowLayout(w.view.bounds);
1867                                 w.view.decorator.gap=2@2;*/
1868
1869                                 top = 0;
1870
1871                                 t1 = StaticText(~settingsview, Rect(lefttime , top=top, width, height)).background_(Color.black).string_("KWS number").stringColor_(Color.white);
1872                                 t2 = StaticText(~settingsview, Rect(lefttime , top=top+height+5, width, height)).background_(Color.black).string_("base(lowest) freq(hz)").stringColor_(Color.white);
1873                                 t3 = StaticText(~settingsview, Rect(lefttime , top=top+height+5, width, height)).background_(Color.black).string_("synthdef type").stringColor_(Color.white);
1874                                 t4 = StaticText(~settingsview, Rect(lefttime , top=top+height+5, width, height)).background_(Color.black).string_("lp filter limit(hz)").stringColor_(Color.white);
1875                                 t5 = StaticText(~settingsview, Rect(lefttime , top=top+height+5, width, height)).background_(Color.black).string_("automate").stringColor_(Color.white);
1876
1877
1878                                 top = 0;
1879
1880
1881                                 //number of KW(King Wen) sequences in a timewave half-cycle (or amplitude x2) pop-up menu
1882
1883                                 ~menu2 = PopUpMenu(~settingsview,Rect(lefttimebox , top=top, widthbox, heightbox)).items_(~mvalue = (-1); [~menu2start.asString]++Array.fill(24, {~menu2values.at(~mvalue = ~mvalue+1);});).background_(Color.black).stringColor_(Color.white).action_({arg button;
1884
1885                                         if(~st != nil, {~st.close});
1886                                         ~st = StaticText(~settingsview, Rect(lefttime, top, 200, 20)).background_(Color.black);
1887                                         ~st.stringColor = Color.white;
1888                                         ~st.string = "# of kws in halfcycle selected";
1889                                         AppClock.sched(~gm,{~st.close;});
1890                                 });
1891
1892
1893                                 //pop-menu for timewave base (lowest) frequency
1894
1895                                 ~bfreqstart = ~basefreq;
1896                                 ~bfreq = PopUpMenu(~settingsview, Rect(lefttimebox , top=top+heightbox+5, widthbox, heightbox)).items_(~bfreqv = (-1); [~basefreq.asString]++Array.fill(140, {~basefreqmap.at(~bfreqv=~bfreqv+1).asString})).background_(Color.black).stringColor_(Color.white).action_({arg button;
1897
1898                                         if(~st != nil, {~st.close});
1899                                         ~st = StaticText(~settingsview, Rect(lefttime, top, 200, 20)).background_(Color.black);
1900                                         ~st.stringColor = Color.white;
1901                                         ~st.string = "basefreq selected";
1902                                         AppClock.sched(~gm,{~st.close;});
1903                                 });
1904
1905
1906                                 //synthdef pop-up menu
1907
1908                                 ~gsinemenu = PopUpMenu(~settingsview, Rect(lefttimebox , top=top+heightbox+5, widthbox, heightbox)).items_(["psine1","psine2","psine3","hsine1","hsine2","hsine3","psineuf1","psineuf2","psineuf3","hsineuf1","hsineuf2","hsineuf3"]).background_(Color.black).stringColor_(Color.white).action_({arg button;
1909
1910                                         if(~gsinemenu.value == 0,  {~kws_setting = 1; ~ratio_setting = "psine1"; ~low_pass_filter_on = 1; ~gs = 0;});
1911                                         if(~gsinemenu.value == 1,  {~kws_setting = 2; ~ratio_setting = "psine2"; ~low_pass_filter_on = 1; ~gs = 1;});
1912                                         if(~gsinemenu.value == 2,  {~kws_setting = 3; ~ratio_setting = "psine3"; ~low_pass_filter_on = 1; ~gs = 2;});
1913                                         if(~gsinemenu.value == 3,  {~kws_setting = 1; ~ratio_setting = "hsine1"; ~low_pass_filter_on = 1; ~gs = 3;});
1914                                         if(~gsinemenu.value == 4,  {~kws_setting = 2; ~ratio_setting = "hsine2"; ~low_pass_filter_on = 1; ~gs = 4;});
1915                                         if(~gsinemenu.value == 5,  {~kws_setting = 3; ~ratio_setting = "hsine3"; ~low_pass_filter_on = 1; ~gs = 5;});
1916                                         if(~gsinemenu.value == 6,  {~kws_setting = 1; ~ratio_setting = "psine1"; ~low_pass_filter_on = 0; ~gs = 6;});
1917                                         if(~gsinemenu.value == 7,  {~kws_setting = 2; ~ratio_setting = "psine2"; ~low_pass_filter_on = 0; ~gs = 7;});
1918                                         if(~gsinemenu.value == 8,  {~kws_setting = 3; ~ratio_setting = "psine3"; ~low_pass_filter_on = 0; ~gs = 8;});
1919                                         if(~gsinemenu.value == 9,  {~kws_setting = 1; ~ratio_setting = "hsine1"; ~low_pass_filter_on = 0; ~gs = 9;});
1920                                         if(~gsinemenu.value == 10, {~kws_setting = 2; ~ratio_setting = "hsine2"; ~low_pass_filter_on = 0; ~gs = 10;});
1921                                         if(~gsinemenu.value == 11, {~kws_setting = 3; ~ratio_setting = "hsine3"; ~low_pass_filter_on = 0; ~gs = 11;});
1922
1923                                         if(~st != nil, {~st.close});
1924                                         ~st = StaticText(~settingsview, Rect(lefttime, top, 200, 20)).background_(Color.black);
1925                                         ~st.stringColor = Color.white;
1926                                         ~st.string = "synthdef setting selected";
1927                                         AppClock.sched(~gm,{~st.close;});
1928                                 });
1929
1930                                 if(~gs == nil, {~gs = 0;});
1931
1932                                 case
1933                                 {~gs == 0}{~gsinemenu.value = 0;}
1934                                 {~gs == 1}{~gsinemenu.value = 1;}
1935                                 {~gs == 2}{~gsinemenu.value = 2;}
1936                                 {~gs == 3}{~gsinemenu.value = 3;}
1937                                 {~gs == 4}{~gsinemenu.value = 4;}
1938                                 {~gs == 5}{~gsinemenu.value = 5;}
1939                                 {~gs == 0}{~gsinemenu.value = 6;}
1940                                 {~gs == 1}{~gsinemenu.value = 7;}
1941                                 {~gs == 2}{~gsinemenu.value = 8;}
1942                                 {~gs == 3}{~gsinemenu.value = 9;}
1943                                 {~gs == 4}{~gsinemenu.value = 10;}
1944                                 {~gs == 5}{~gsinemenu.value = 11;};
1945
1946
1947                                 //set low-pass filter frequency limit
1948
1949                                 ~low_pass_filter_textfield = TextField(~settingsview, Rect(lefttimebox , top=top+heightbox+5, widthbox, heightbox));
1950                                 ~low_pass_filter_textfield.string = ~low_pass_filter_set_value.asString;
1951                                 ~low_pass_filter_textfield.background_(Color.black);
1952                                 ~low_pass_filter_textfield.stringColor_(Color.white);
1953                                 ~low_pass_filter_textfield.action = {arg value; ~freqsetvalue = value.value;
1954
1955                                         ~freqset_textfield_func.value; //this function is found after line 2900
1956
1957                                         ~low_pass_filter_set_value = ~freqsetvalue.value;
1958
1959                                         ~low_pass_filter_textfield.string = ~low_pass_filter_set_value.asString;
1960
1961                                         if(~low_pass_filter_set_value != 0, {
1962                                                 if(~st != nil, {~st.close});
1963                                                 ~st = StaticText(~settingsview, Rect(lefttime, top, 240, 20)).background_(Color.black);
1964                                                 ~st.stringColor = Color.white;
1965                                                 ~st.string = "low-pass filter freq limit selected";
1966                                                 AppClock.sched(~gm,{~st.close;});
1967                                         }, {~low_pass_filter_set_value = ~low_pass_filter_freq_limit; ~low_pass_filter_textfield.string = ~low_pass_filter_set_value.asString;});
1968                                 };
1969
1970
1971                                 //switch to sendreply functions
1972
1973                                 ~sendreplymenu = PopUpMenu(~settingsview,Rect(lefttimebox , top=top+heightbox+5, widthbox, heightbox)).items_(["off","western scale","eastern scale"]).background_(Color.black).stringColor_(Color.white).action_({arg button;
1974
1975                                         case
1976                                         {button.value == 0;}{~sendreplymenu_value = 0;}
1977                                         {button.value == 1;}{~sendreplymenu_value = 1;}
1978                                         {button.value == 2;}{~sendreplymenu_value = 2;};
1979
1980                                         if(~st != nil, {~st.close});
1981                                         ~st = StaticText(~settingsview, Rect(lefttime, top, 200, 20)).background_(Color.black);
1982                                         ~st.stringColor = Color.white;
1983                                         ~st.string = "automate setting selected";
1984                                         AppClock.sched(~gm,{~st.close;});
1985                                 });
1986
1987                                 if(~sendreplymenu_value == nil, {~sendreplymenu_value = 0;});
1988
1989                                 case
1990                                 {~sendreplymenu_value == 0}{~sendreplymenu.value = 0;}
1991                                 {~sendreplymenu_value == 1}{~sendreplymenu.value = 1;}
1992                                 {~sendreplymenu_value == 2}{~sendreplymenu.value = 2;};
1993
1994
1995                                 //set button for all settings
1996
1997                                 ~set1=Button(~settingsview,Rect(lefttimebox+widthbox-60, top=top+height+20, 60, 60/~gm)).states_([["set",Color.white,Color.black]]).mouseDownAction_({
1998
1999                                         if(~bfreq.value > 0, {~basefreq = ~basefreqmap.at(~bfreq.value - 1)}, {~basefreq = ~bfreqstart});
2000
2001                                         (#a,b,c,d,e,f = [ ~basefreq,~basefreq,~basefreq,~basefreq,~basefreq,~basefreq  ]; ~a = a; ~b = b; ~c =c; ~d = d; ~e = e;~f=f;);
2002
2003                                         ~low_pass_filter_freq_limit = ~low_pass_filter_set_value;
2004
2005
2006                                         //set n1-n9 values
2007
2008                                         case
2009                                         {~ratio_setting == "psine1";}{~n_value1 = ~gm;    ~n_value2 = ~gm2;   ~n_value6 = ~gm6;}
2010                                         {~ratio_setting == "psine2";}{~n_value1 = ~ngm1;  ~n_value2 = ~ngm2;  ~n_value6 = ~ngm6;}
2011                                         {~ratio_setting == "psine3";}{~n_value1 = ~nngm1; ~n_value2 = ~nngm2; ~n_value6 = ~nngm6;}
2012                                         {~ratio_setting == "hsine1";}{~n_value1 = ~h1;    ~n_value2 = ~h2;    ~n_value6 = ~h6;}
2013                                         {~ratio_setting == "hsine2";}{~n_value1 = ~nh1;   ~n_value2 = ~nh2;   ~n_value6 = ~nh6;}
2014                                         {~ratio_setting == "hsine3";}{~n_value1 = ~nnh1;  ~n_value2 = ~nnh2;  ~n_value6 = ~nnh6;};
2015
2016
2017                                         //sendyreply values
2018
2019                                         case
2020                                         {~sendreplymenu.value ==  0}{~sendreplysynthdef_on = 0;}
2021                                         {~sendreplymenu.value ==  1}{~sendreplysynthdef_on = 1; ~send_reply_func = ~send_reply_func_western; ~sendreplyfuncswitch = 1;}
2022                                         {~sendreplymenu.value ==  2}{~sendreplysynthdef_on = 1; ~send_reply_func = ~send_reply_func_eastern; ~sendreplyfuncswitch = 2;};
2023
2024
2025                                         //evaluate synthdefs(gsine)
2026
2027                                         case
2028                                         {~menu2.value == 0}{~gsinenum = ~menu2synthdefstart; ~gsine.value;}
2029                                         {~menu2.value == 1}{~gsinenum = 1; ~gsine.value;}
2030                                         {~menu2.value == 2}{~gsinenum = 2; ~gsine.value;}
2031                                         {~menu2.value == 3}{~gsinenum = 3; ~gsine.value;}
2032                                         {~menu2.value == 4}{~gsinenum = 4; ~gsine.value;}
2033                                         {~menu2.value == 5}{~gsinenum = 5; ~gsine.value;}
2034                                         {~menu2.value == 6}{~gsinenum = 6; ~gsine.value;}
2035                                         {~menu2.value == 7}{~gsinenum = 7; ~gsine.value;}
2036                                         {~menu2.value == 8}{~gsinenum = 8; ~gsine.value;}
2037                                         {~menu2.value == 9}{~gsinenum = 9; ~gsine.value;}
2038                                         {~menu2.value == 10}{~gsinenum = 10; ~gsine.value;}
2039                                         {~menu2.value == 11}{~gsinenum = 11; ~gsine.value;}
2040                                         {~menu2.value == 12}{~gsinenum = 12; ~gsine.value;}
2041                                         {~menu2.value == 13}{~gsinenum = 13; ~gsine.value;}
2042                                         {~menu2.value == 14}{~gsinenum = 14; ~gsine.value;}
2043                                         {~menu2.value == 15}{~gsinenum = 15; ~gsine.value;}
2044                                         {~menu2.value == 16}{~gsinenum = 16; ~gsine.value;}
2045                                         {~menu2.value == 17}{~gsinenum = 17; ~gsine.value;}
2046                                         {~menu2.value == 18}{~gsinenum = 18; ~gsine.value;}
2047                                         {~menu2.value == 19}{~gsinenum = 19; ~gsine.value;}
2048                                         {~menu2.value == 20}{~gsinenum = 20; ~gsine.value;}
2049                                         {~menu2.value == 21}{~gsinenum = 21; ~gsine.value;}
2050                                         {~menu2.value == 22}{~gsinenum = 22; ~gsine.value;}
2051                                         {~menu2.value == 23}{~gsinenum = 23; ~gsine.value;}
2052                                         {~menu2.value == 24}{~gsinenum = 24; ~gsine.value;};
2053
2054                                         ~st_load = StaticText(~settingsview, Rect(lefttime, top, 200, 20)).background_(Color.black);
2055                                         ~st_load.stringColor = Color.white;
2056                                         ~st_load.string = "loaded.";
2057                                         AppClock.sched(~gm,{if(~st != nil, {~st.close}); ~st_load.close;});
2058
2059                                 });
2060
2061                                 ~settingsview.background_(Color.black);
2062
2063                                 /*~closessettingsbutton = Button.new(~settingsview,Rect(lefttimebox+widthbox-40, top, 40, 40/~gm)).states_([["close",Color.white,Color.black]]).action_({arg button;
2064
2065                                 ~settingsview.close; ~settingsbutton.value = 0;
2066                                 });*/
2067
2068
2069                         }.value);
2070
2071                         ~settingsview.front;
2072                 }, {~settingsview.close});
2073         });
2074
2075
2076         //open/flow/slide buttons coordinate values
2077
2078         ~bph = 26;
2079         ~bpw = 26/1.6180339887499;
2080         ~bpl = Window.screenBounds.width-(~bph*8)-20;
2081         ~bpt = Window.screenBounds.height-88;
2082
2083         ~bp01l = ~bpl;
2084         ~bp02l = ~bpl+(~bph*1);
2085         ~bp03l = ~bpl+(~bph*2);
2086         ~bp04l = ~bpl+(~bph*3);
2087         ~bp05l = ~bpl+(~bph*4);
2088         ~bp06l = ~bpl+(~bph*5);
2089         ~bp07l = ~bpl+(~bph*6);
2090         ~bp08l = ~bpl+(~bph*7);
2091         ~bpf1l = ~bpl;
2092         ~bpf2l = ~bpl+(~bph*1);
2093         ~bpf3l = ~bpl+(~bph*2);
2094         ~bpf4l = ~bpl+(~bph*3);
2095         ~bpf5l = ~bpl+(~bph*4);
2096         ~bpf6l = ~bpl+(~bph*5);
2097         ~bpf7l = ~bpl+(~bph*6);
2098         ~bpf8l = ~bpl+(~bph*7);
2099
2100         ~bp01t = ~bpt;
2101         ~bp02t = ~bpt;
2102         ~bp03t = ~bpt;
2103         ~bp04t = ~bpt;
2104         ~bp05t = ~bpt;
2105         ~bp06t = ~bpt;
2106         ~bp07t = ~bpt;
2107         ~bp08t = ~bpt;
2108         ~bpf1t = ~bpt+~bpw;
2109         ~bpf2t = ~bpt+~bpw;
2110         ~bpf3t = ~bpt+~bpw;
2111         ~bpf4t = ~bpt+~bpw;
2112         ~bpf5t = ~bpt+~bpw;
2113         ~bpf6t = ~bpt+~bpw;
2114         ~bpf7t = ~bpt+~bpw;
2115         ~bpf8t = ~bpt+~bpw;
2116
2117         ~bp01h = ~bph;
2118         ~bp02h = ~bph;
2119         ~bp03h = ~bph;
2120         ~bp04h = ~bph;
2121         ~bp05h = ~bph;
2122         ~bp06h = ~bph;
2123         ~bp07h = ~bph;
2124         ~bp08h = ~bph;
2125         ~bpf1h = ~bph;
2126         ~bpf2h = ~bph;
2127         ~bpf3h = ~bph;
2128         ~bpf4h = ~bph;
2129         ~bpf5h = ~bph;
2130         ~bpf6h = ~bph;
2131         ~bpf7h = ~bph;
2132         ~bpf8h = ~bph;
2133
2134         ~bp01w = ~bpw;
2135         ~bp02w = ~bpw;
2136         ~bp03w = ~bpw;
2137         ~bp04w = ~bpw;
2138         ~bp05w = ~bpw;
2139         ~bp06w = ~bpw;
2140         ~bp07w = ~bpw;
2141         ~bp08w = ~bpw;
2142         ~bpf1w = ~bpw;
2143         ~bpf2w = ~bpw;
2144         ~bpf3w = ~bpw;
2145         ~bpf4w = ~bpw;
2146         ~bpf5w = ~bpw;
2147         ~bpf6w = ~bpw;
2148         ~bpf7w = ~bpw;
2149         ~bpf8w = ~bpw;
2150
2151         ~tspw=280+210;
2152         ~tsph=280+210/~gm;
2153         ~tspl=Window.screenBounds.width-~tspw;
2154         ~tspt=~bpt-310;
2155
2156
2157         //synthopen 1-8 buttons
2158
2159         ~bplaceo1 = Button.new(w,Rect(~bp01l,~bp01t,~bp01h,~bp01w)).states_([["o1",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2160
2161                 [~f1=~fp1,~f2=~fp2,~f3=~fp3,~f4=~fp4,~f5=~fp5,~f6=~fp6,~f7=~fp7,~f8=~fp8];
2162
2163                 ~synthopen.value;
2164                 ~currentsynth = "o1"; ~synthmonitorfunc.value;
2165
2166                 if(~ts.value == 1,
2167                         {if(~tst == nil, {nil}, {~tst.close;});
2168                                 ~timevals.value;
2169                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time1o = 0;
2170                                 ~timer = Routine({inf.do({
2171                                         ~time1o =
2172                                         ~time1o+0.01; ~slot = "o1_"+~time1o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2173                         {nil});
2174         });
2175
2176         ~bplaceo2 = Button.new(w,Rect(~bp02l,~bp02t,~bp02h,~bp02w)).states_([["o2",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2177
2178                 [~f1=~fp1b,~f2=~fp2b,~f3=~fp3b,~f4=~fp4b,~f5=~fp5b,~f6=~fp6b,~f7=~fp7b,~f8=~fp8b];
2179
2180                 ~synthopen.value;
2181                 ~currentsynth = "o2"; ~synthmonitorfunc.value;
2182
2183                 if(~ts.value == 1,
2184                         {if(~tst == nil, {nil}, {~tst.close;});
2185                                 ~timevals.value;
2186                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time2o = 0;
2187                                 ~timer = Routine({inf.do({
2188                                         ~time2o =
2189                                         ~time2o+0.01; ~slot = "o2_"+~time2o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2190                         {nil});
2191         });
2192         ~bplaceo3 = Button.new(w,Rect(~bp03l,~bp03t,~bp03h,~bp03w)).states_([["o3",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2193
2194                 [~f1=~fp1c,~f2=~fp2c,~f3=~fp3c,~f4=~fp4c,~f5=~fp5c,~f6=~fp6c,~f7=~fp7c,~f8=~fp8c];
2195
2196                 ~synthopen.value;
2197                 ~currentsynth = "o3"; ~synthmonitorfunc.value;
2198
2199                 if(~ts.value == 1,
2200                         {if(~tst == nil, {nil}, {~tst.close;});
2201                                 ~timevals.value;
2202                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time3o = 0;
2203                                 ~timer = Routine({inf.do({
2204                                         ~time3o =
2205                                         ~time3o+0.01; ~slot = "o3_"+~time3o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2206                         {nil});
2207         });
2208         ~bplaceo4 = Button.new(w,Rect(~bp04l,~bp04t,~bp04h,~bp04w)).states_([["o4",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2209
2210                 [~f1=~fp1d,~f2=~fp2d,~f3=~fp3d,~f4=~fp4d,~f5=~fp5d,~f6=~fp6d,~f7=~fp7d,~f8=~fp8d];
2211
2212                 ~synthopen.value;
2213                 ~currentsynth = "o4"; ~synthmonitorfunc.value;
2214
2215                 if(~ts.value == 1,
2216                         {if(~tst == nil, {nil}, {~tst.close;});
2217                                 ~timevals.value;
2218                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time4o = 0;
2219                                 ~timer = Routine({inf.do({
2220                                         ~time4o =
2221                                         ~time4o+0.01; ~slot = "o4_"+~time4o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2222                         {nil});
2223
2224         });
2225
2226         ~bplaceo5 = Button.new(w,Rect(~bp05l,~bp05t,~bp05h,~bp05w)).states_([["o5",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2227
2228                 [~f1=~fp1e,~f2=~fp2e,~f3=~fp3e,~f4=~fp4e,~f5=~fp5e,~f6=~fp6e,~f7=~fp7e,~f8=~fp8e];
2229
2230                 ~synthopen.value;
2231                 ~currentsynth = "o5"; ~synthmonitorfunc.value;
2232
2233                 if(~ts.value == 1,
2234                         {if(~tst == nil, {nil}, {~tst.close;});
2235                                 ~timevals.value;
2236                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time5o = 0;
2237                                 ~timer = Routine({inf.do({
2238                                         ~time5o =
2239                                         ~time5o+0.01; ~slot = "o5_"+~time5o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2240                         {nil});
2241
2242         });
2243         ~bplaceo6 = Button.new(w,Rect(~bp06l,~bp06t,~bp06h,~bp06w)).states_([["o6",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2244
2245                 [~f1=~fp1f,~f2=~fp2f,~f3=~fp3f,~f4=~fp4f,~f5=~fp5f,~f6=~fp6f,~f7=~fp7f,~f8=~fp8f];
2246
2247                 ~synthopen.value;
2248                 ~currentsynth = "o6"; ~synthmonitorfunc.value;
2249
2250                 if(~ts.value == 1,
2251                         {if(~tst == nil, {nil}, {~tst.close;});
2252                                 ~timevals.value;
2253                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time6o = 0;
2254                                 ~timer = Routine({inf.do({
2255                                         ~time6o =
2256                                         ~time6o+0.01; ~slot = "o6_"+~time6o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2257                         {nil});
2258         });
2259         ~bplaceo7 = Button.new(w,Rect(~bp07l,~bp07t,~bp07h,~bp07w)).states_([["o7",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2260
2261                 [~f1=~fp1g,~f2=~fp2g,~f3=~fp3g,~f4=~fp4g,~f5=~fp5g,~f6=~fp6g,~f7=~fp7g,~f8=~fp8g];
2262
2263                 ~synthopen.value;
2264                 ~currentsynth = "o7"; ~synthmonitorfunc.value;
2265
2266                 if(~ts.value == 1,
2267                         {if(~tst == nil, {nil}, {~tst.close;});
2268                                 ~timevals.value;
2269                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time7o = 0;
2270                                 ~timer = Routine({inf.do({
2271                                         ~time7o =
2272                                         ~time7o+0.01; ~slot = "o7_"+~time7o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2273                         {nil});
2274         });
2275         ~bplaceo8 = Button.new(w,Rect(~bp08l,~bp08t,~bp08h,~bp08w)).states_([["o8",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2276
2277                 [~f1=~fp1h,~f2=~fp2h,~f3=~fp3h,~f4=~fp4h,~f5=~fp5h,~f6=~fp6h,~f7=~fp7h,~f8=~fp8h];
2278
2279                 ~synthopen.value;
2280                 ~currentsynth = "o8"; ~synthmonitorfunc.value;
2281
2282                 if(~ts.value == 1,
2283                         {if(~tst == nil, {nil}, {~tst.close;});
2284                                 ~timevals.value;
2285                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time8o = 0;
2286                                 ~timer = Routine({inf.do({
2287                                         ~time8o =
2288                                         ~time8o+0.01; ~slot = "o8_"+~time8o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2289                         {nil});
2290         });
2291
2292
2293         //synthflow 1-8 buttons
2294
2295         ~bplacef1 = Button.new(w,Rect(~bpf1l,~bpf1t,~bpf1h,~bpf1w)).states_([["f1",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2296
2297                 [~f1=~fp1,~f2=~fp2,~f3=~fp3,~f4=~fp4,~f5=~fp5,~f6=~fp6,~f7=~fp7,~f8=~fp8];
2298
2299                 ~synthflow.value;
2300                 ~currentsynth = "f1"; ~synthmonitorfunc.value;
2301
2302                 if(~ts.value == 1,
2303                         {if(~tst == nil, {nil}, {~tst.close;});
2304                                 ~timevals.value;
2305                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time1f = 0;
2306                                 ~timer = Routine({inf.do({
2307                                         ~time1f =
2308                                         ~time1f+0.01; ~slot = "f1_"+~time1f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2309                         {nil});
2310         });
2311         ~bplacef2 = Button.new(w,Rect(~bpf2l,~bpf2t,~bpf2h,~bpf2w)).states_([["f2",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2312
2313                 [~f1=~fp1b,~f2=~fp2b,~f3=~fp3b,~f4=~fp4b,~f5=~fp5b,~f6=~fp6b,~f7=~fp7b,~f8=~fp8b];
2314
2315                 ~synthflow.value;
2316                 ~currentsynth = "f2"; ~synthmonitorfunc.value;
2317
2318                 if(~ts.value == 1,
2319                         {if(~tst == nil, {nil}, {~tst.close;});
2320                                 ~timevals.value;
2321                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time2f = 0;
2322                                 ~timer = Routine({inf.do({
2323                                         ~time2f =
2324                                         ~time2f+0.01; ~slot = "f2_"+~time2f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2325                         {nil});
2326         });
2327
2328         ~bplacef3 = Button.new(w,Rect(~bpf3l,~bpf3t,~bpf3h,~bpf3w)).states_([["f3",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2329
2330                 [~f1=~fp1c,~f2=~fp2c,~f3=~fp3c,~f4=~fp4c,~f5=~fp5c,~f6=~fp6c,~f7=~fp7c,~f8=~fp8c];
2331
2332                 ~synthflow.value;
2333                 ~currentsynth = "f3"; ~synthmonitorfunc.value;
2334
2335                 if(~ts.value == 1,
2336                         {if(~tst == nil, {nil}, {~tst.close;});
2337                                 ~timevals.value;
2338                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time3f = 0;
2339                                 ~timer = Routine({inf.do({
2340                                         ~time3f =
2341                                         ~time3f+0.01; ~slot = "f3_"+~time3f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2342                         {nil});
2343         });
2344         ~bplacef4 = Button.new(w,Rect(~bpf4l,~bpf4t,~bpf4h,~bpf4w)).states_([["f4",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2345
2346                 [~f1=~fp1d,~f2=~fp2d,~f3=~fp3d,~f4=~fp4d,~f5=~fp5d,~f6=~fp6d,~f7=~fp7d,~f8=~fp8d];
2347
2348                 ~synthflow.value;
2349                 ~currentsynth = "f4"; ~synthmonitorfunc.value;
2350
2351                 if(~ts.value == 1,
2352                         {if(~tst == nil, {nil}, {~tst.close;});
2353                                 ~timevals.value;
2354                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time4f = 0;
2355                                 ~timer = Routine({inf.do({
2356                                         ~time4f =
2357                                         ~time4f+0.01; ~slot = "f4_"+~time4f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2358                         {nil});
2359         });
2360
2361         ~bplacef5 = Button.new(w,Rect(~bpf5l,~bpf5t,~bpf5h,~bpf5w)).states_([["f5",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2362
2363                 [~f1=~fp1e,~f2=~fp2e,~f3=~fp3e,~f4=~fp4e,~f5=~fp5e,~f6=~fp6e,~f7=~fp7e,~f8=~fp8e];
2364
2365                 ~synthflow.value;
2366                 ~currentsynth = "f5"; ~synthmonitorfunc.value;
2367
2368                 if(~ts.value == 1,
2369                         {if(~tst == nil, {nil}, {~tst.close;});
2370                                 ~timevals.value;
2371                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time5f = 0;
2372                                 ~timer = Routine({inf.do({
2373                                         ~time5f =
2374                                         ~time5f+0.01; ~slot = "f5_"+~time5f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2375                         {nil});
2376         });
2377
2378         ~bplacef6 = Button.new(w,Rect(~bpf6l,~bpf6t,~bpf6h,~bpf6w)).states_([["f6",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2379
2380                 [~f1=~fp1f,~f2=~fp2f,~f3=~fp3f,~f4=~fp4f,~f5=~fp5f,~f6=~fp6f,~f7=~fp7f,~f8=~fp8f];
2381
2382                 ~synthflow.value;
2383                 ~currentsynth = "f6"; ~synthmonitorfunc.value;
2384
2385                 if(~ts.value == 1,
2386                         {if(~tst == nil, {nil}, {~tst.close;});
2387                                 ~timevals.value;
2388                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time6f = 0;
2389                                 ~timer = Routine({inf.do({
2390                                         ~time6f =
2391                                         ~time6f+0.01; ~slot = "f6_"+~time6f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2392                         {nil});
2393         });
2394
2395
2396         ~bplacef7 = Button.new(w,Rect(~bpf7l,~bpf7t,~bpf7h,~bpf7w)).states_([["f7",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2397
2398                 [~f1=~fp1g,~f2=~fp2g,~f3=~fp3g,~f4=~fp4g,~f5=~fp5g,~f6=~fp6g,~f7=~fp7g,~f8=~fp8g];
2399
2400                 ~synthflow.value;
2401                 ~currentsynth = "f7"; ~synthmonitorfunc.value;
2402
2403                 if(~ts.value == 1,
2404                         {if(~tst == nil, {nil}, {~tst.close;});
2405                                 ~timevals.value;
2406                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time7f = 0;
2407                                 ~timer = Routine({inf.do({
2408                                         ~time7f =
2409                                         ~time7f+0.01; ~slot = "f7_"+~time7f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2410                         {nil});
2411         });
2412         ~bplacef8 = Button.new(w,Rect(~bpf8l,~bpf8t,~bpf8h,~bpf8w)).states_([["f8",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2413
2414                 [~f1=~fp1h,~f2=~fp2h,~f3=~fp3h,~f4=~fp4h,~f5=~fp5h,~f6=~fp6h,~f7=~fp7h,~f8=~fp8h];
2415
2416                 ~synthflow.value;
2417                 ~currentsynth = "f8"; ~synthmonitorfunc.value;
2418
2419                 if(~ts.value == 1,
2420                         {if(~tst == nil, {nil}, {~tst.close;});
2421                                 ~timevals.value;
2422                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time8f = 0;
2423                                 ~timer = Routine({inf.do({
2424                                         ~time8f =
2425                                         ~time8f+0.01; ~slot = "f8_"+~time8f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2426                         {nil});
2427         });
2428
2429
2430         //synthslide 1-8 buttons
2431
2432         ~bplaces1 = Button.new(w,Rect(~bpf1l,~bpf1t+~bpf1w,~bpf1h,~bpf1w)).states_([["s1",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2433
2434                 if(~slidetime1 == nil, {~slidetime1 = 4}); if(~slidedo1 == nil, {~slidedo1 = 2000;}); ~slidecount = ~slidedo1;
2435                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2436                         [ ~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8 ])*(-1)/~slidedo1);
2437
2438                 ~slidetime =~slidetime1; ~slidedo = ~slidedo1;
2439
2440                 ~slideroutine.stop;
2441
2442                 ~synthslide.value;
2443                 ~currentsynth = "s1"; ~synthmonitorfunc.value;
2444
2445                 if(~ts.value == 1,
2446                         {if(~tst == nil, {nil}, {~tst.close;});
2447                                 ~timevals.value;
2448                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time1s = 0;
2449                                 ~timer = Routine({inf.do({
2450                                         ~time1s =
2451                                         ~time1s+0.01; ~slot = "s1_"+~time1s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2452                         {nil});
2453
2454         });
2455         ~bplaces2 = Button.new(w,Rect(~bpf2l,~bpf2t+~bpf2w,~bpf2h,~bpf2w)).states_([["s2",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2456
2457                 if(~slidetime2 == nil, {~slidetime2 = 4}); if(~slidedo2 == nil, {~slidedo2 = 2000;}); ~slidecount = ~slidedo2;
2458                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2459                         [ ~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b ])*(-1)/~slidedo2);
2460
2461                 ~slidetime = ~slidetime2; ~slidedo = ~slidedo2;
2462
2463                 ~slideroutine.stop;
2464
2465                 ~synthslide.value;
2466                 ~currentsynth = "s2"; ~synthmonitorfunc.value;
2467
2468                 if(~ts.value == 1,
2469                         {if(~tst == nil, {nil}, {~tst.close;});
2470                                 ~timevals.value;
2471                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time2s = 0;
2472                                 ~timer = Routine({inf.do({
2473                                         ~time2s =
2474                                         ~time2s+0.01; ~slot = "s2_"+~time2s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2475                         {nil});
2476
2477         });
2478         ~bplaces3 = Button.new(w,Rect(~bpf3l,~bpf3t+~bpf3w,~bpf3h,~bpf3w)).states_([["s3",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2479
2480                 if(~slidetime3 == nil, {~slidetime3 = 4}); if(~slidedo3 == nil, {~slidedo3 = 2000;}); ~slidecount = ~slidedo3;
2481                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2482                         [ ~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c ])*(-1)/~slidedo3);
2483
2484                 ~slidetime = ~slidetime3; ~slidedo = ~slidedo3;
2485
2486                 ~slideroutine.stop;
2487
2488                 ~synthslide.value;
2489                 ~currentsynth = "s3"; ~synthmonitorfunc.value;
2490
2491                 if(~ts.value == 1,
2492                         {if(~tst == nil, {nil}, {~tst.close;});
2493                                 ~timevals.value;
2494                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time3s = 0;
2495                                 ~timer = Routine({inf.do({
2496                                         ~time3s =
2497                                         ~time3s+0.01; ~slot = "s3_"+~time3s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2498                         {nil});
2499
2500         });
2501         ~bplaces4 = Button.new(w,Rect(~bpf4l,~bpf4t+~bpf4w,~bpf4h,~bpf4w)).states_([["s4",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2502
2503                 if(~slidetime4 == nil, {~slidetime4 = 4}); if(~slidedo4 == nil, {~slidedo4 = 2000;}); ~slidecount = ~slidedo4;
2504                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2505                         [ ~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d ])*(-1)/~slidedo4);
2506
2507                 ~slidetime = ~slidetime4; ~slidedo = ~slidedo4;
2508
2509                 ~slideroutine.stop;
2510
2511                 ~synthslide.value;
2512                 ~currentsynth = "s4"; ~synthmonitorfunc.value;
2513
2514                 if(~ts.value == 1,
2515                         {if(~tst == nil, {nil}, {~tst.close;});
2516                                 ~timevals.value;
2517                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time4s = 0;
2518                                 ~timer = Routine({inf.do({
2519                                         ~time4s =
2520                                         ~time4s+0.01; ~slot = "s4_"+~time4s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2521                         {nil});
2522         });
2523         ~bplaces5 = Button.new(w,Rect(~bpf5l,~bpf5t+~bpf5w,~bpf5h,~bpf5w)).states_([["s5",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2524
2525                 if(~slidetime5 == nil, {~slidetime5 = 4}); if(~slidedo5 == nil, {~slidedo5 = 2000;}); ~slidecount = ~slidedo5;
2526                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2527                         [ ~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e ])*(-1)/~slidedo5);
2528
2529                 ~slidetime = ~slidetime5; ~slidedo = ~slidedo5;
2530
2531                 ~slideroutine.stop;
2532
2533                 ~synthslide.value;
2534                 ~currentsynth = "s5"; ~synthmonitorfunc.value;
2535
2536                 if(~ts.value == 1,
2537                         {if(~tst == nil, {nil}, {~tst.close;});
2538                                 ~timevals.value;
2539                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time5s = 0;
2540                                 ~timer = Routine({inf.do({
2541                                         ~time5s =
2542                                         ~time5s+0.01; ~slot = "s5_"+~time5s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2543                         {nil});
2544
2545         });
2546         ~bplaces6 = Button.new(w,Rect(~bpf6l,~bpf6t+~bpf6w,~bpf6h,~bpf6w)).states_([["s6",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2547
2548                 if(~slidetime6 == nil, {~slidetime6 = 4}); if(~slidedo6 == nil, {~slidedo6 = 2000;}); ~slidecount = ~slidedo6;
2549                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2550                         [ ~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f ])*(-1)/~slidedo6);
2551
2552                 ~slidetime = ~slidetime6; ~slidedo = ~slidedo6;
2553                 ~slideroutine.stop;
2554
2555                 ~synthslide.value;
2556                 ~currentsynth = "s6"; ~synthmonitorfunc.value;
2557
2558                 if(~ts.value == 1,
2559                         {if(~tst == nil, {nil}, {~tst.close;});
2560                                 ~timevals.value;
2561                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time6s = 0;
2562                                 ~timer = Routine({inf.do({
2563                                         ~time6s =
2564                                         ~time6s+0.01; ~slot = "s6_"+~time6s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2565                         {nil});
2566
2567         });
2568         ~bplaces7 = Button.new(w,Rect(~bpf7l,~bpf7t+~bpf7w,~bpf7h,~bpf7w)).states_([["s7",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2569
2570                 if(~slidetime7 == nil, {~slidetime7 = 4}); if(~slidedo7 == nil, {~slidedo7 = 2000;}); ~slidecount = ~slidedo7;
2571                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2572                         [ ~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g ])*(-1)/~slidedo7);
2573
2574                 ~slidetime = ~slidetime7; ~slidedo = ~slidedo7;
2575                 ~slideroutine.stop;
2576
2577                 ~synthslide.value;
2578                 ~currentsynth = "s7"; ~synthmonitorfunc.value;
2579
2580                 if(~ts.value == 1,
2581                         {if(~tst == nil, {nil}, {~tst.close;});
2582                                 ~timevals.value;
2583                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time7s = 0;
2584                                 ~timer = Routine({inf.do({
2585                                         ~time7s =
2586                                         ~time7s+0.01; ~slot = "s7_"+~time7s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2587                         {nil});
2588
2589         });
2590         ~bplaces8 = Button.new(w,Rect(~bpf8l,~bpf8t+~bpf8w,~bpf8h,~bpf8w)).states_([["s8",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2591
2592                 if(~slidetime8 == nil, {~slidetime8 = 4}); if(~slidedo8 == nil, {~slidedo8 = 2000;}); ~slidecount = ~slidedo8;
2593                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2594                         [ ~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h])*(-1)/~slidedo8);
2595
2596                 ~slidetime = ~slidetime8; ~slidedo = ~slidedo8;
2597
2598                 ~slideroutine.stop;
2599
2600                 ~synthslide.value;
2601                 ~currentsynth = "s8"; ~synthmonitorfunc.value;
2602
2603                 if(~ts.value == 1,
2604                         {if(~tst == nil, {nil}, {~tst.close;});
2605                                 ~timevals.value;
2606                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time8s = 0;
2607                                 ~timer = Routine({inf.do({
2608                                         ~time8s =
2609                                         ~time8s+0.01; ~slot = "s8_"+~time8s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2610                         {nil});
2611         });
2612
2613
2614         //if slidetime/slidedo is nil
2615
2616         if(~slidetimeall == nil, {~slidetimeall = 1});
2617         if(~slidetime1 == nil, {~slidetime1 = 1});
2618         if(~slidetime2 == nil, {~slidetime2 = 1});
2619         if(~slidetime3 == nil, {~slidetime3 = 1});
2620         if(~slidetime4 == nil, {~slidetime4 = 1});
2621         if(~slidetime5 == nil, {~slidetime5 = 1});
2622         if(~slidetime6 == nil, {~slidetime6 = 1});
2623         if(~slidetime7 == nil, {~slidetime7 = 1});
2624         if(~slidetime8 == nil, {~slidetime8 = 1});
2625
2626         if(~slidedoall == nil, {~slidedoall = 432});
2627         if(~slidedo1 == nil, {~slidedo1 = 432});
2628         if(~slidedo2 == nil, {~slidedo2 = 432});
2629         if(~slidedo3 == nil, {~slidedo3 = 432});
2630         if(~slidedo4 == nil, {~slidedo4 = 432});
2631         if(~slidedo5 == nil, {~slidedo5 = 432});
2632         if(~slidedo6 == nil, {~slidedo6 = 432});
2633         if(~slidedo7 == nil, {~slidedo7 = 432});
2634         if(~slidedo8 == nil, {~slidedo8 = 432});
2635
2636
2637         //frequency set function
2638
2639         ~freqset_textfield_func = {
2640                 ~freqsetvalue = ~freqsetvalue.asString;
2641                 ~freqsetvalue = ~freqsetvalue.separate;
2642                 ~freqsetvalue = ~freqsetvalue.reject{arg item;
2643                         (item != "1") and:
2644                         (item != "2") and:
2645                         (item != "3") and:
2646                         (item != "4") and:
2647                         (item != "5") and:
2648                         (item != "6") and:
2649                         (item != "7") and:
2650                         (item != "8") and:
2651                         (item != "9") and:
2652                         (item != "0") and:
2653                         (item != ".") and:
2654                         (item != "+") and:
2655                         (item != "-") and:
2656                         (item != "*") and:
2657                         (item != "/") and:
2658                         (item != "**") and:
2659                         (item != "%")
2660                 };
2661                 ~freqsetvalue = ~freqsetvalue.join.asString.interpret;
2662         };
2663
2664
2665         //extra options button
2666
2667         ~extraoptions = Button.new(w,Rect(Window.screenBounds.width-20-20-20,~bpt+69+5,20,20/1.6180339887499)).states_([["eo",Color.white,Color.black],["eo",Color.white,Color.black]]).action_({arg button;
2668
2669                 if(button.value == 1, {
2670
2671                         ~extraoptionsview = View(w, Rect(Window.screenBounds.width-(540),Window.screenBounds.height-(340+46/1.6180339887499)-150,340+46,380+46/1.6180339887499)).front;
2672                         ~extraoptionsview.background_(Color.black);
2673
2674                         //set slide values button
2675
2676                         ~slidevals = Button.new(~extraoptionsview,Rect(0,25,120,20)).states_([["slide values",Color.white,Color.black],["slide values",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2677
2678                                 if(button.value == 1, {
2679                                         ({
2680                                                 arg lefttime = 0 , lefttimebox = 52, leftdo = lefttimebox+widthbox+6, leftdobox = leftdo+57, top = 0,width=52, height = 16,  widthbox=52, heightbox = 16, inc=0, lw = 0,  uw = 0, numw = 40;
2681                                                 var tall, stall, iall, siall, st1, st2, st3, st4, st5, st6, st7, st8, si1, si2, si3, si4, si5, si6, si7, si8, t1,t2,t3,t4,t5,t6,t7,t8,i1,i2,i3,i4,i5,i6,i7,i8;
2682                                                 ~slideview = View(w, Rect(Window.screenBounds.width-(340+46),Window.screenBounds.height-(340+46/1.6180339887499)-150,340+46,380+46/1.6180339887499)).front;
2683                                                 /*w.view.decorator=FlowLayout(w.view.bounds);
2684                                                 w.view.decorator.gap=2@2;*/
2685
2686                                                 tall = StaticText(~slideview, Rect(lefttime , top=top, width, height)).background_(Color.black).string_("all time").stringColor_(Color.white);
2687                                                 t1 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s1 time").stringColor_(Color.white);
2688                                                 t2 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s2 time").stringColor_(Color.white);
2689                                                 t3 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s3 time").stringColor_(Color.white);
2690                                                 t4 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s4 time").stringColor_(Color.white);
2691                                                 t5 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s5 time").stringColor_(Color.white);
2692                                                 t6 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s6 time").stringColor_(Color.white);
2693                                                 t7 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s7 time").stringColor_(Color.white);
2694                                                 t8 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s8 time").stringColor_(Color.white);
2695
2696                                                 top = 0;
2697
2698                                                 stall=NumberBox(~slideview, Rect(lefttimebox , top=top, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetimeall).maxDecimals_(9);
2699                                                 st1=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime1).maxDecimals_(9);
2700                                                 st2=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime2).maxDecimals_(9);
2701                                                 st3=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime3).maxDecimals_(9);
2702                                                 st4=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime4).maxDecimals_(9);
2703                                                 st5=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime5).maxDecimals_(9);
2704                                                 st6=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime6).maxDecimals_(9);
2705                                                 st7=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime7).maxDecimals_(9);
2706                                                 st8=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime8).maxDecimals_(9);
2707
2708                                                 top = 0;
2709
2710                                                 iall = StaticText(~slideview, Rect(leftdo , top=top, width, height)).background_(Color.black).string_("all incr").stringColor_(Color.white);
2711                                                 i1 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s1 incr").stringColor_(Color.white);
2712                                                 i2 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s2 incr").stringColor_(Color.white);
2713                                                 i3 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s3 incr").stringColor_(Color.white);
2714                                                 i4 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s4 incr").stringColor_(Color.white);
2715                                                 i5 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s5 incr").stringColor_(Color.white);
2716                                                 i6 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s6 incr").stringColor_(Color.white);
2717                                                 i7 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s7 incr").stringColor_(Color.white);
2718                                                 i8 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s8 incr").stringColor_(Color.white);
2719
2720                                                 top = 0;
2721
2722                                                 siall=NumberBox(~slideview, Rect(leftdobox , top=top, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedoall);
2723                                                 si1=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo1);
2724                                                 si2=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo2);
2725                                                 si3=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo3);
2726                                                 si4=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo4);
2727                                                 si5=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo5);
2728                                                 si6=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo6);
2729                                                 si7=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo7);
2730                                                 si8=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo8);
2731
2732                                                 stall.action_({arg val;
2733                                                         ~slidetimeall = val.value;
2734                                                         ~slidetime1 = val.value;
2735                                                         ~slidetime2 = val.value;
2736                                                         ~slidetime3 = val.value;
2737                                                         ~slidetime4 = val.value;
2738                                                         ~slidetime5 = val.value;
2739                                                         ~slidetime6 = val.value;
2740                                                         ~slidetime7 = val.value;
2741                                                         ~slidetime8 = val.value;
2742                                                         ~slideview.close; ~slidevals.valueAction_(1);
2743                                                 });
2744                                                 st1.action_({arg val; ~slidetime1 = val.value;});
2745                                                 st2.action_({arg val; ~slidetime2 = val.value;});
2746                                                 st3.action_({arg val; ~slidetime3 = val.value;});
2747                                                 st4.action_({arg val; ~slidetime4 = val.value;});
2748                                                 st5.action_({arg val; ~slidetime5 = val.value;});
2749                                                 st6.action_({arg val; ~slidetime6 = val.value;});
2750                                                 st7.action_({arg val; ~slidetime7 = val.value;});
2751                                                 st8.action_({arg val; ~slidetime8 = val.value;});
2752
2753                                                 siall.action_({arg val;
2754                                                         ~slidedoall = val.value;
2755                                                         ~slidedo1 = val.value;
2756                                                         ~slidedo2 = val.value;
2757                                                         ~slidedo3 = val.value;
2758                                                         ~slidedo4 = val.value;
2759                                                         ~slidedo5 = val.value;
2760                                                         ~slidedo6 = val.value;
2761                                                         ~slidedo7 = val.value;
2762                                                         ~slidedo8 = val.value;
2763                                                         ~slideview.close; ~slidevals.valueAction_(1);
2764                                                 });
2765                                                 si1.action_({arg val; ~slidedo1 = val.value;});
2766                                                 si2.action_({arg val; ~slidedo2 = val.value;});
2767                                                 si3.action_({arg val; ~slidedo3 = val.value;});
2768                                                 si4.action_({arg val; ~slidedo4 = val.value;});
2769                                                 si5.action_({arg val; ~slidedo5 = val.value;});
2770                                                 si6.action_({arg val; ~slidedo6 = val.value;});
2771                                                 si7.action_({arg val; ~slidedo7 = val.value;});
2772                                                 si8.action_({arg val; ~slidedo8 = val.value;});
2773
2774                                                 ~slideview.background_(Color.black);
2775
2776                                                 ~closeslidebutton = Button.new(~slideview,Rect(leftdobox+widthbox-40, top+40, 40, 40/~gm)).states_([["close",Color.white,Color.black]]).action_({arg button;
2777
2778                                                         ~slideview.close; ~slidevals.value = 0;
2779                                                 });
2780
2781                                         }.value);
2782
2783                                         ~slideview.front;
2784                                 }, {~slideview.close;});
2785                         });
2786
2787
2788                         //set individual or all synth frequencies button
2789
2790                         ~beforefreqsetfreqs = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ];
2791
2792                         ~synthfreqset = Button.new(~extraoptionsview,Rect(0,0,120,20)).states_([["set frequencies",Color.white,Color.black],["set frequencies",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2793
2794                                 if(button.value == 1, {
2795                                         ({
2796                                                 arg  top = 0,width=88, revertwidth=75, height = 16,  heightbox = 16, lefttime = 0 , lefttimebox = width+5,  widthbox=165, leftdo = lefttimebox+widthbox+5, leftdobox = leftdo+57, inc=0, lw = 0,  uw = 0, numw = 40;
2797                                                 var tall, stall, iall, siall, st1, st2, st3, st4, st5, st6, st7, st8, st9, st10, st11, st12, si1, si2, si3, si4, si5, si6, si7, si8, t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12;
2798                                                 ~synthfreqsetview = View(w, Rect(Window.screenBounds.width-(340+46),Window.screenBounds.height-(340+46/1.6180339887499)-150,340+46,380+46/1.6180339887499)).front;
2799                                                 /*w.view.decorator=FlowLayout(w.view.bounds);
2800                                                 w.view.decorator.gap=2@2;*/
2801
2802                                                 t1 = StaticText(~synthfreqsetview, Rect(lefttime , top=top, width, height)).background_(Color.black).string_("freq 1 (f1)").stringColor_(Color.white);
2803                                                 t2 = StaticText(~synthfreqsetview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("freq 2 (f2)").stringColor_(Color.white);
2804                                                 t3 = StaticText(~synthfreqsetview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("freq 3 (f3)").stringColor_(Color.white);
2805                                                 t4 = StaticText(~synthfreqsetview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("freq 4 (f4)").stringColor_(Color.white);
2806                                                 t5 = StaticText(~synthfreqsetview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("freq 5 (f5)").stringColor_(Color.white);
2807                                                 t6 = StaticText(~synthfreqsetview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("freq 6 (f6)").stringColor_(Color.white);
2808                                                 t7 = StaticText(~synthfreqsetview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("freq 7 (f7)").stringColor_(Color.white);
2809                                                 t8 = StaticText(~synthfreqsetview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("freq 8 (f8)").stringColor_(Color.white);
2810                                                 tall = StaticText(~synthfreqsetview, Rect(lefttime , top=top+height+10, width, height)).background_(Color.black).string_("all freqs").stringColor_(Color.white);
2811
2812                                                 top = 0;
2813
2814                                                 st1=TextField(~synthfreqsetview, Rect(lefttimebox , top=top, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~f1);
2815                                                 st2=TextField(~synthfreqsetview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~f2);
2816                                                 st3=TextField(~synthfreqsetview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~f3);
2817                                                 st4=TextField(~synthfreqsetview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~f4);
2818                                                 st5=TextField(~synthfreqsetview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~f5);
2819                                                 st6=TextField(~synthfreqsetview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~f6);
2820                                                 st7=TextField(~synthfreqsetview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~f7);
2821                                                 st8=TextField(~synthfreqsetview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~f8);
2822                                                 stall=TextField(~synthfreqsetview, Rect(lefttimebox , top=top+heightbox+10, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~f1);
2823
2824                                                 top = 0;
2825
2826                                                 i1 = Button.new(~synthfreqsetview, Rect(leftdo , top=top, revertwidth, height)).states_([["f1 revert",Color.white,Color.black],["f1 revert",Color.white,Color.black]]).action_({arg button; if(~f1_revert != nil, {if(~f1 != ~f1_revert, {~f1_un_revert = ~f1; ~f1 = ~f1_revert;}, {if(~f1_un_revert != nil, {~f1 = ~f1_un_revert;});}); ~synthflow.value; st1.string = ~f1.asString;});});
2827                                                 i2 = Button.new(~synthfreqsetview, Rect(leftdo , top=top+height, revertwidth, height)).states_([["f2 revert",Color.white,Color.black],["f2 revert",Color.white,Color.black]]).action_({arg button; if(~f2_revert != nil, {if(~f2 != ~f2_revert, {~f2_un_revert = ~f2; ~f2 = ~f2_revert;}, {if(~f2_un_revert != nil, {~f2 = ~f2_un_revert;});}); ~synthflow.value; st2.string = ~f2.asString;});});
2828                                                 i3 = Button.new(~synthfreqsetview, Rect(leftdo , top=top+height, revertwidth, height)).states_([["f3 revert",Color.white,Color.black],["f3 revert",Color.white,Color.black]]).action_({arg button; if(~f3_revert != nil, {if(~f3 != ~f3_revert, {~f3_un_revert = ~f3; ~f3 = ~f3_revert;}, {if(~f3_un_revert != nil, {~f3 = ~f3_un_revert;});}); ~synthflow.value; st3.string = ~f3.asString;});});
2829                                                 i4 = Button.new(~synthfreqsetview, Rect(leftdo , top=top+height, revertwidth, height)).states_([["f4 revert",Color.white,Color.black],["f4 revert",Color.white,Color.black]]).action_({arg button; if(~f4_revert != nil, {if(~f4 != ~f4_revert, {~f4_un_revert = ~f4; ~f4 = ~f4_revert;}, {if(~f4_un_revert != nil, {~f4 = ~f4_un_revert;});}); ~synthflow.value; st4.string = ~f4.asString;});});
2830                                                 i5 = Button.new(~synthfreqsetview, Rect(leftdo , top=top+height, revertwidth, height)).states_([["f5 revert",Color.white,Color.black],["f5 revert",Color.white,Color.black]]).action_({arg button; if(~f5_revert != nil, {if(~f5 != ~f5_revert, {~f5_un_revert = ~f5; ~f5 = ~f5_revert;}, {if(~f5_un_revert != nil, {~f5 = ~f5_un_revert;});}); ~synthflow.value; st5.string = ~f5.asString;});});
2831                                                 i6 = Button.new(~synthfreqsetview, Rect(leftdo , top=top+height, revertwidth, height)).states_([["f6 revert",Color.white,Color.black],["f6 revert",Color.white,Color.black]]).action_({arg button; if(~f6_revert != nil, {if(~f6 != ~f6_revert, {~f6_un_revert = ~f6; ~f6 = ~f6_revert;}, {if(~f6_un_revert != nil, {~f6 = ~f6_un_revert;});}); ~synthflow.value; st6.string = ~f6.asString;});});
2832                                                 i7 = Button.new(~synthfreqsetview, Rect(leftdo , top=top+height, revertwidth, height)).states_([["f7 revert",Color.white,Color.black],["f7 revert",Color.white,Color.black]]).action_({arg button; if(~f7_revert != nil, {if(~f7 != ~f7_revert, {~f7_un_revert = ~f7; ~f7 = ~f7_revert;}, {if(~f7_un_revert != nil, {~f7 = ~f7_un_revert;});}); ~synthflow.value; st7.string = ~f7.asString;});});
2833                                                 i8 = Button.new(~synthfreqsetview, Rect(leftdo , top=top+height, revertwidth, height)).states_([["f8 revert",Color.white,Color.black],["f8 revert",Color.white,Color.black]]).action_({arg button; if(~f8_revert != nil, {if(~f8 != ~f8_revert, {~f8_un_revert = ~f8; ~f8 = ~f8_revert;}, {if(~f8_un_revert != nil, {~f8 = ~f8_un_revert;});}); ~synthflow.value; st8.string = ~f8.asString;});});
2834                                                 iall = Button.new(~synthfreqsetview, Rect(leftdo , top=top+height+10, revertwidth, height)).states_([["all revert",Color.white,Color.black],["all revert",Color.white,Color.black]]).action_({arg button; if(~f_all_revert != nil, {if([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ] != ~f_all_revert.flatten, {~f_all_un_revert = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ].flatten; 8.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut(~f_all_revert.flatten.at(x-1);)});}, {if(~f_all_un_revert != nil, {8.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut(~f_all_un_revert.flatten.at(x-1);)});});}); ~synthflow.value; stall.string = ~f1.asString;});});
2835
2836
2837                                                 stall.action_({arg val; ~freqsetvalue = val.value; ~freqset_textfield_func.value; ~f_all_revert = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]; 8.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut(~freqsetvalue;)}); ~synthflow.value; stall.string = ~freqsetvalue.asString;});
2838                                                 st1.action_({arg val; ~freqsetvalue = val.value; ~freqset_textfield_func.value; ~f1_revert = ~f1; ~f1 = ~freqsetvalue; ~synthflow.value; st1.string = ~freqsetvalue.asString;});
2839                                                 st2.action_({arg val; ~freqsetvalue = val.value; ~freqset_textfield_func.value; ~f2_revert = ~f2; ~f2 = ~freqsetvalue; ~synthflow.value; st2.string = ~freqsetvalue.asString;});
2840                                                 st3.action_({arg val; ~freqsetvalue = val.value; ~freqset_textfield_func.value; ~f3_revert = ~f3; ~f3 = ~freqsetvalue; ~synthflow.value; st3.string = ~freqsetvalue.asString;});
2841                                                 st4.action_({arg val; ~freqsetvalue = val.value; ~freqset_textfield_func.value; ~f4_revert = ~f4; ~f4 = ~freqsetvalue; ~synthflow.value; st4.string = ~freqsetvalue.asString;});
2842                                                 st5.action_({arg val; ~freqsetvalue = val.value; ~freqset_textfield_func.value; ~f5_revert = ~f5; ~f5 = ~freqsetvalue; ~synthflow.value; st5.string = ~freqsetvalue.asString;});
2843                                                 st6.action_({arg val; ~freqsetvalue = val.value; ~freqset_textfield_func.value; ~f6_revert = ~f6; ~f6 = ~freqsetvalue; ~synthflow.value; st6.string = ~freqsetvalue.asString;});
2844                                                 st7.action_({arg val; ~freqsetvalue = val.value; ~freqset_textfield_func.value; ~f7_revert = ~f7; ~f7 = ~freqsetvalue; ~synthflow.value; st7.string = ~freqsetvalue.asString;});
2845                                                 st8.action_({arg val; ~freqsetvalue = val.value; ~freqset_textfield_func.value; ~f8_revert = ~f8; ~f8 = ~freqsetvalue; ~synthflow.value; st8.string = ~freqsetvalue.asString;});
2846
2847                                                 ~synthfreqsetview.background_(Color.black);
2848
2849                                                 ~closesfreqsetbutton = Button.new(~synthfreqsetview,Rect(leftdo+revertwidth-40, top=top+height+20, 40, 40/~gm)).states_([["close",Color.white,Color.black]]).action_({arg button;
2850
2851                                                         ~synthfreqsetview.close;
2852                                                 });
2853
2854                                                 ~beforefreqsetrevert = Button.new(~synthfreqsetview,Rect(lefttime, top+(40/~gm)-height, revertwidth+150, height)).states_([["restore freqs before opening eo",Color.white,Color.black],["revert",Color.white,Color.black]]).action_({arg button;
2855
2856                                                         if([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ] != ~beforefreqsetfreqs.flatten, {~beforefreqsetfreqs_unrestore = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]; 8.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut(~beforefreqsetfreqs.flatten.at(x-1);)});}, {if(~beforefreqsetfreqs_unrestore != nil, {8.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut(~beforefreqsetfreqs_unrestore.flatten.at(x-1);)});});}); ~synthflow.value;
2857                                                 });
2858
2859
2860                                         }.value);
2861
2862                                         ~synthfreqsetview.front;
2863                                 }, {~synthfreqsetview.close});
2864                         });
2865
2866
2867                         Button.new(~extraoptionsview,Rect(0,80,120,20)).states_([["close eo",Color.white,Color.black],["close eo",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2868
2869                                 ~extraoptionsview.close; ~slideview.close; ~synthfreqsetview.close; ~extraoptions.value = 0;
2870
2871                         });
2872
2873                 }, {~extraoptionsview.close; ~slideview.close; ~synthfreqset.close;});
2874         });
2875
2876
2877         //mute/unmute 1-8 buttons
2878
2879         mute1 = Button.new(w,Rect(~bpl+(16*1),~bpt+69+5,16,16/1.6180339887499)).states_([["1",Color.white,Color.black],["",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2880                 case
2881                 {~l1a1.isRunning == true}{
2882                         if(button.value == 0, {
2883                                 (~vol1 = ~vol;
2884                                         1.do({
2885                                                 ~l1a1.set(\vol, ~vol1);  ~l1b1.set(\vol, ~vol1);
2886                                                 ~l1c1.set(\vol, ~vol1);  ~l1d1.set(\vol, ~vol1);
2887                                                 ~l1e1.set(\vol, ~vol1);  ~l1f1.set(\vol, ~vol1);
2888
2889                                 }););
2890                         }, {(~vol1 = 0;
2891                                 1.do({
2892                                         ~l1a1.set(\vol, ~vol1);  ~l1b1.set(\vol, ~vol1);
2893                                         ~l1c1.set(\vol, ~vol1);  ~l1d1.set(\vol, ~vol1);
2894                                         ~l1e1.set(\vol, ~vol1);  ~l1f1.set(\vol, ~vol1);
2895
2896                         }););
2897                         });
2898                 }
2899                 {~l1a.isRunning == true}{
2900                         if(button.value == 0, {
2901                                 (~vol1 = ~vol;
2902                                         1.do({
2903                                                 ~l1a.set(\vol, ~vol1);  ~l1b.set(\vol, ~vol1);
2904                                                 ~l1c.set(\vol, ~vol1);  ~l1d.set(\vol, ~vol1);
2905                                                 ~l1e.set(\vol, ~vol1);  ~l1f.set(\vol, ~vol1);
2906
2907                                 }););
2908                         }, {(~vol1 = 0;
2909                                 1.do({
2910                                         ~l1a.set(\vol, ~vol1);  ~l1b.set(\vol, ~vol1);
2911                                         ~l1c.set(\vol, ~vol1);  ~l1d.set(\vol, ~vol1);
2912                                         ~l1e.set(\vol, ~vol1);  ~l1f.set(\vol, ~vol1);
2913
2914                         }););
2915                         });
2916                 };
2917         });
2918
2919         mute2 = Button.new(w,Rect(~bpl+(16*2),~bpt+69+5,16,16/1.6180339887499)).states_([["2",Color.white,Color.black],["",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2920                 case
2921                 {~l1a1.isRunning == true}{
2922                         if(button.value == 0, {
2923                                 (~vol2 = ~vol;
2924                                         1.do({
2925                                                 ~l2a1.set(\vol, ~vol2);  ~l2b1.set(\vol, ~vol2);
2926                                                 ~l2c1.set(\vol, ~vol2);  ~l2d1.set(\vol, ~vol2);
2927                                                 ~l2e1.set(\vol, ~vol2);  ~l2f1.set(\vol, ~vol2);
2928
2929                                 }););
2930                         }, {(~vol2 = 0;
2931                                 1.do({
2932                                         ~l2a1.set(\vol, ~vol2);  ~l2b1.set(\vol, ~vol2);
2933                                         ~l2c1.set(\vol, ~vol2);  ~l2d1.set(\vol, ~vol2);
2934                                         ~l2e1.set(\vol, ~vol2);  ~l2f1.set(\vol, ~vol2);
2935
2936                         }););
2937                         });
2938                 }
2939                 {~l1a.isRunning == true}{
2940                         if(button.value == 0, {
2941                                 (~vol2 = ~vol;
2942                                         1.do({
2943                                                 ~l2a.set(\vol, ~vol2);  ~l2b.set(\vol, ~vol2);
2944                                                 ~l2c.set(\vol, ~vol2);  ~l2d.set(\vol, ~vol2);
2945                                                 ~l2e.set(\vol, ~vol2);  ~l2f.set(\vol, ~vol2);
2946
2947                                 }););
2948                         }, {(~vol2 = 0;
2949                                 1.do({
2950                                         ~l2a.set(\vol, ~vol2);  ~l2b.set(\vol, ~vol2);
2951                                         ~l2c.set(\vol, ~vol2);  ~l2d.set(\vol, ~vol2);
2952                                         ~l2e.set(\vol, ~vol2);  ~l2f.set(\vol, ~vol2);
2953
2954                         }););
2955                         });
2956                 };
2957         });
2958         mute3 = Button.new(w,Rect(~bpl+(16*3),~bpt+69+5,16,16/1.6180339887499)).states_([["3",Color.white,Color.black],["",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2959                 case
2960                 {~l1a1.isRunning == true}{
2961                         if(button.value == 0, {
2962                                 (~vol3 = ~vol;
2963                                         1.do({
2964                                                 ~l3a1.set(\vol, ~vol3);  ~l3b1.set(\vol, ~vol3);
2965                                                 ~l3c1.set(\vol, ~vol3);  ~l3d1.set(\vol, ~vol3);
2966                                                 ~l3e1.set(\vol, ~vol3);  ~l3f1.set(\vol, ~vol3);
2967
2968                                 }););
2969                         }, {(~vol3 = 0;
2970                                 1.do({
2971                                         ~l3a1.set(\vol, ~vol3);  ~l3b1.set(\vol, ~vol3);
2972                                         ~l3c1.set(\vol, ~vol3);  ~l3d1.set(\vol, ~vol3);
2973                                         ~l3e1.set(\vol, ~vol3);  ~l3f1.set(\vol, ~vol3);
2974
2975                         }););
2976                         });
2977                 }
2978                 {~l1a.isRunning == true}{
2979                         if(button.value == 0, {
2980                                 (~vol3 = ~vol;
2981                                         1.do({
2982                                                 ~l3a.set(\vol, ~vol3);  ~l3b.set(\vol, ~vol3);
2983                                                 ~l3c.set(\vol, ~vol3);  ~l3d.set(\vol, ~vol3);
2984                                                 ~l3e.set(\vol, ~vol3);  ~l3f.set(\vol, ~vol3);
2985
2986                                 }););
2987                         }, {(~vol3 = 0;
2988                                 1.do({
2989                                         ~l3a.set(\vol, ~vol3);  ~l3b.set(\vol, ~vol3);
2990                                         ~l3c.set(\vol, ~vol3);  ~l3d.set(\vol, ~vol3);
2991                                         ~l3e.set(\vol, ~vol3);  ~l3f.set(\vol, ~vol3);
2992
2993                         }););
2994                         });
2995                 };
2996         });
2997         mute4 = Button.new(w,Rect(~bpl+(16*4),~bpt+69+5,16,16/1.6180339887499)).states_([["4",Color.white,Color.black],["",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2998                 case
2999                 {~l1a1.isRunning == true}{
3000                         if(button.value == 0, {
3001                                 (~vol4 = ~vol;
3002                                         1.do({
3003                                                 ~l4a1.set(\vol, ~vol4);  ~l4b1.set(\vol, ~vol4);
3004                                                 ~l4c1.set(\vol, ~vol4);  ~l4d1.set(\vol, ~vol4);
3005                                                 ~l4e1.set(\vol, ~vol4);  ~l4f1.set(\vol, ~vol4);
3006
3007                                 }););
3008                         }, {(~vol4 = 0;
3009                                 1.do({
3010                                         ~l4a1.set(\vol, ~vol4);  ~l4b1.set(\vol, ~vol4);
3011                                         ~l4c1.set(\vol, ~vol4);  ~l4d1.set(\vol, ~vol4);
3012                                         ~l4e1.set(\vol, ~vol4);  ~l4f1.set(\vol, ~vol4);
3013
3014                         }););
3015                         });
3016                 }
3017                 {~l1a.isRunning == true}{
3018                         if(button.value == 0, {
3019                                 (~vol4 = ~vol;
3020                                         1.do({
3021                                                 ~l4a.set(\vol, ~vol4);  ~l4b.set(\vol, ~vol4);
3022                                                 ~l4c.set(\vol, ~vol4);  ~l4d.set(\vol, ~vol4);
3023                                                 ~l4e.set(\vol, ~vol4);  ~l4f.set(\vol, ~vol4);
3024
3025                                 }););
3026                         }, {(~vol4 = 0;
3027                                 1.do({
3028                                         ~l4a.set(\vol, ~vol4);  ~l4b.set(\vol, ~vol4);
3029                                         ~l4c.set(\vol, ~vol4);  ~l4d.set(\vol, ~vol4);
3030                                         ~l4e.set(\vol, ~vol4);  ~l4f.set(\vol, ~vol4);
3031
3032                         }););
3033                         });
3034                 };
3035         });
3036         mute5 = Button.new(w,Rect(~bpl+(16*5),~bpt+69+5,16,16/1.6180339887499)).states_([["5",Color.white,Color.black],["",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
3037                 case
3038                 {~l1a1.isRunning == true}{
3039                         if(button.value == 0, {
3040                                 (~vol5 = ~vol;
3041                                         1.do({
3042                                                 ~l5a1.set(\vol, ~vol5);  ~l5b1.set(\vol, ~vol5);
3043                                                 ~l5c1.set(\vol, ~vol5);  ~l5d1.set(\vol, ~vol5);
3044                                                 ~l5e1.set(\vol, ~vol5);  ~l5f1.set(\vol, ~vol5);
3045
3046                                 }););
3047                         }, {(~vol5 = 0;
3048                                 1.do({
3049                                         ~l5a1.set(\vol, ~vol5);  ~l5b1.set(\vol, ~vol5);
3050                                         ~l5c1.set(\vol, ~vol5);  ~l5d1.set(\vol, ~vol5);
3051                                         ~l5e1.set(\vol, ~vol5);  ~l5f1.set(\vol, ~vol5);
3052
3053                         }););
3054                         });
3055                 }
3056                 {~l1a.isRunning == true}{
3057                         if(button.value == 0, {
3058                                 (~vol5 = ~vol;
3059                                         1.do({
3060                                                 ~l5a.set(\vol, ~vol5);  ~l5b.set(\vol, ~vol5);
3061                                                 ~l5c.set(\vol, ~vol5);  ~l5d.set(\vol, ~vol5);
3062                                                 ~l5e.set(\vol, ~vol5);  ~l5f.set(\vol, ~vol5);
3063
3064                                 }););
3065                         }, {(~vol5 = 0;
3066                                 1.do({
3067                                         ~l5a.set(\vol, ~vol5);  ~l5b.set(\vol, ~vol5);
3068                                         ~l5c.set(\vol, ~vol5);  ~l5d.set(\vol, ~vol5);
3069                                         ~l5e.set(\vol, ~vol5);  ~l5f.set(\vol, ~vol5);
3070
3071                         }););
3072                         });
3073                 };
3074         });
3075         mute6 = Button.new(w,Rect(~bpl+(16*6),~bpt+69+5,16,16/1.6180339887499)).states_([["6",Color.white,Color.black],["",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
3076                 case
3077                 {~l1a1.isRunning == true}{
3078                         if(button.value == 0, {
3079                                 (~vol6 = ~vol;
3080                                         1.do({
3081                                                 ~l6a1.set(\vol, ~vol6);  ~l6b1.set(\vol, ~vol6);
3082                                                 ~l6c1.set(\vol, ~vol6);  ~l6d1.set(\vol, ~vol6);
3083                                                 ~l6e1.set(\vol, ~vol6);  ~l6f1.set(\vol, ~vol6);
3084
3085                                 }););
3086                         }, {(~vol6 = 0;
3087                                 1.do({
3088                                         ~l6a1.set(\vol, ~vol6);  ~l6b1.set(\vol, ~vol6);
3089                                         ~l6c1.set(\vol, ~vol6);  ~l6d1.set(\vol, ~vol6);
3090                                         ~l6e1.set(\vol, ~vol6);  ~l6f1.set(\vol, ~vol6);
3091
3092                         }););
3093                         });
3094                 }
3095                 {~l1a.isRunning == true}{
3096                         if(button.value == 0, {
3097                                 (~vol6 = ~vol;
3098                                         1.do({
3099                                                 ~l6a.set(\vol, ~vol6);  ~l6b.set(\vol, ~vol6);
3100                                                 ~l6c.set(\vol, ~vol6);  ~l6d.set(\vol, ~vol6);
3101                                                 ~l6e.set(\vol, ~vol6);  ~l6f.set(\vol, ~vol6);
3102
3103                                 }););
3104                         }, {(~vol6 = 0;
3105                                 1.do({
3106                                         ~l6a.set(\vol, ~vol6);  ~l6b.set(\vol, ~vol6);
3107                                         ~l6c.set(\vol, ~vol6);  ~l6d.set(\vol, ~vol6);
3108                                         ~l6e.set(\vol, ~vol6);  ~l6f.set(\vol, ~vol6);
3109
3110                         }););
3111                         });
3112                 };
3113
3114         });
3115         mute7 = Button.new(w,Rect(~bpl+(16*7),~bpt+69+5,16,16/1.6180339887499)).states_([["7",Color.white,Color.black],["",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
3116                 case
3117                 {~l1a1.isRunning == true}{
3118                         if(button.value == 0, {
3119                                 (~vol7 = ~vol;
3120                                         1.do({
3121                                                 ~l7a1.set(\vol, ~vol7);  ~l7b1.set(\vol, ~vol7);
3122                                                 ~l7c1.set(\vol, ~vol7);  ~l7d1.set(\vol, ~vol7);
3123                                                 ~l7e1.set(\vol, ~vol7);  ~l7f1.set(\vol, ~vol7);
3124
3125                                 }););
3126                         }, {(~vol7 = 0;
3127                                 1.do({
3128                                         ~l7a1.set(\vol, ~vol7);  ~l7b1.set(\vol, ~vol7);
3129                                         ~l7c1.set(\vol, ~vol7);  ~l7d1.set(\vol, ~vol7);
3130                                         ~l7e1.set(\vol, ~vol7);  ~l7f1.set(\vol, ~vol7);
3131
3132                         }););
3133                         });
3134                 }
3135                 {~l1a.isRunning == true}{
3136                         if(button.value == 0, {
3137                                 (~vol7 = ~vol;
3138                                         1.do({
3139                                                 ~l7a.set(\vol, ~vol7);  ~l7b.set(\vol, ~vol7);
3140                                                 ~l7c.set(\vol, ~vol7);  ~l7d.set(\vol, ~vol7);
3141                                                 ~l7e.set(\vol, ~vol7);  ~l7f.set(\vol, ~vol7);
3142
3143                                 }););
3144                         }, {(~vol7 = 0;
3145                                 1.do({
3146                                         ~l7a.set(\vol, ~vol7);  ~l7b.set(\vol, ~vol7);
3147                                         ~l7c.set(\vol, ~vol7);  ~l7d.set(\vol, ~vol7);
3148                                         ~l7e.set(\vol, ~vol7);  ~l7f.set(\vol, ~vol7);
3149
3150                         }););
3151                         });
3152                 };
3153         });
3154         mute8 = Button.new(w,Rect(~bpl+(16*8),~bpt+69+5,16,16/1.6180339887499)).states_([["8",Color.white,Color.black],["",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
3155                 case
3156                 {~l1a1.isRunning == true}{
3157                         if(button.value == 0, {
3158                                 (~vol8 = ~vol;
3159                                         1.do({
3160                                                 ~l8a1.set(\vol, ~vol8);  ~l8b1.set(\vol, ~vol8);
3161                                                 ~l8c1.set(\vol, ~vol8);  ~l8d1.set(\vol, ~vol8);
3162                                                 ~l8e1.set(\vol, ~vol8);  ~l8f1.set(\vol, ~vol8);
3163
3164                                 }););
3165                         }, {(~vol8 = 0;
3166                                 1.do({
3167                                         ~l8a1.set(\vol, ~vol8);  ~l8b1.set(\vol, ~vol8);
3168                                         ~l8c1.set(\vol, ~vol8);  ~l8d1.set(\vol, ~vol8);
3169                                         ~l8e1.set(\vol, ~vol8);  ~l8f1.set(\vol, ~vol8);
3170
3171                         }););
3172                         });
3173                 }
3174                 {~l1a.isRunning == true}{
3175                         if(button.value == 0, {
3176                                 (~vol8 = ~vol;
3177                                         1.do({
3178                                                 ~l8a.set(\vol, ~vol8);  ~l8b.set(\vol, ~vol8);
3179                                                 ~l8c.set(\vol, ~vol8);  ~l8d.set(\vol, ~vol8);
3180                                                 ~l8e.set(\vol, ~vol8);  ~l8f.set(\vol, ~vol8);
3181
3182                                 }););
3183                         }, {(~vol8 = 0;
3184                                 1.do({
3185                                         ~l8a.set(\vol, ~vol8);  ~l8b.set(\vol, ~vol8);
3186                                         ~l8c.set(\vol, ~vol8);  ~l8d.set(\vol, ~vol8);
3187                                         ~l8e.set(\vol, ~vol8);  ~l8f.set(\vol, ~vol8);
3188
3189                         }););
3190                         });
3191                 };
3192         });
3193
3194
3195         //mute/unmute all button
3196
3197         muteall = Button.new(w,Rect(~bpl+(0),~bpt+69+5,16,16/1.6180339887499)).states_([["m",Color.white,Color.black],["u",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
3198
3199                 if(button.value == 0, {
3200                         mute1.value = 0;
3201                         mute2.value = 0;
3202                         mute3.value = 0;
3203                         mute4.value = 0;
3204                         mute5.value = 0;
3205                         mute6.value = 0;
3206                         mute7.value = 0;
3207                         mute8.value = 0;
3208
3209                         ~vol1 = ~vol;
3210                         ~vol2 = ~vol;
3211                         ~vol3 = ~vol;
3212                         ~vol4 = ~vol;
3213                         ~vol5 = ~vol;
3214                         ~vol6 = ~vol;
3215                         ~vol7 = ~vol;
3216                         ~vol8 = ~vol;
3217
3218                 },
3219                 {
3220                         mute1.value = 1;
3221                         mute2.value = 1;
3222                         mute3.value = 1;
3223                         mute4.value = 1;
3224                         mute5.value = 1;
3225                         mute6.value = 1;
3226                         mute7.value = 1;
3227                         mute8.value = 1;
3228
3229                         ~vol1 = 0;
3230                         ~vol2 = 0;
3231                         ~vol3 = 0;
3232                         ~vol4 = 0;
3233                         ~vol5 = 0;
3234                         ~vol6 = 0;
3235                         ~vol7 = 0;
3236                         ~vol8 = 0;
3237
3238                 });
3239                 ~synthflow.value;
3240         });
3241
3242
3243         //midi Korg NanoKontrol function
3244
3245         ~midifunc = {
3246                 ~snb = 0;
3247                 /*~etemp = EqualTemperament(12, calibratefreq: 432, calibratenote: 69);*/
3248
3249
3250                 //midi set frequency
3251
3252                 MIDIFunc.cc({if(~snb == 0, {~snb = 1},{~snb = 0});}, ccNum: 60);
3253                 MIDIdef.cc('l1', { |val|
3254                         case
3255                         {~l1a.isRunning == true}{
3256                                 ~l1a.set(\dur, ~f1 = \dur.asSpec.map(val / 127));
3257                                 ~l1b.set(\dur,      \dur.asSpec.map(val / 127));
3258                                 ~l1c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3259                                 ~l1d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3260                                 ~l1e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3261                                 ~l1f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3262                         }{~l1a1.isRunning == true}{
3263                                 ~l1a1.set(\dur, ~f1 = \dur.asSpec.map(val / 127));
3264                                 ~l1b1.set(\dur,      \dur.asSpec.map(val / 127));
3265                                 ~l1c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3266                                 ~l1d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3267                                 ~l1e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3268                                 ~l1f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3269                         };
3270                         ~tunefreq1 = ~f1; ~f1 = ~f1+~f1t;
3271                         {if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (View(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (View(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
3272                         }.defer;
3273                 }, ccNum: [0]);
3274                 MIDIdef.cc('l2', { |val|
3275                         case
3276                         {~l1a.isRunning == true}{
3277                                 ~l2a.set(\dur, ~f2 = \dur.asSpec.map(val / 127));
3278                                 ~l2b.set(\dur,      \dur.asSpec.map(val / 127));
3279                                 ~l2c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3280                                 ~l2d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3281                                 ~l2e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3282                                 ~l2f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3283                         }{~l1a1.isRunning == true}{
3284                                 ~l2a1.set(\dur, ~f2 = \dur.asSpec.map(val / 127));
3285                                 ~l2b1.set(\dur,      \dur.asSpec.map(val / 127));
3286                                 ~l2c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3287                                 ~l2d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3288                                 ~l2e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3289                                 ~l2f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3290                         };
3291                         ~tunefreq2 = ~f2; ~f2 = ~f2+~f2t;
3292                         {if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (View(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (View(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
3293                         }.defer;
3294                 }, ccNum: [1]);
3295                 MIDIdef.cc('l3', { |val|
3296                         case
3297                         {~l1a.isRunning == true}{
3298                                 ~l3a.set(\dur, ~f3 = \dur.asSpec.map(val / 127));
3299                                 ~l3b.set(\dur,      \dur.asSpec.map(val / 127));
3300                                 ~l3c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3301                                 ~l3d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3302                                 ~l3e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3303                                 ~l3f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3304                         }{~l1a1.isRunning == true}{
3305                                 ~l3a1.set(\dur, ~f3 = \dur.asSpec.map(val / 127));
3306                                 ~l3b1.set(\dur,      \dur.asSpec.map(val / 127));
3307                                 ~l3c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3308                                 ~l3d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3309                                 ~l3e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3310                                 ~l3f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3311                         };
3312                         ~tunefreq3 = ~f3; ~f3 = ~f3+~f3t;
3313                         {if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (View(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (View(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
3314                         }.defer;
3315                 }, ccNum: 2);
3316                 MIDIdef.cc('l4', { |val|
3317                         case
3318                         {~l1a.isRunning == true}{
3319                                 ~l4a.set(\dur, ~f4 = \dur.asSpec.map(val / 127));
3320                                 ~l4b.set(\dur,      \dur.asSpec.map(val / 127));
3321                                 ~l4c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3322                                 ~l4d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3323                                 ~l4e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3324                                 ~l4f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3325                         }{~l1a1.isRunning == true}{
3326                                 ~l4a1.set(\dur, ~f4 = \dur.asSpec.map(val / 127));
3327                                 ~l4b1.set(\dur,      \dur.asSpec.map(val / 127));
3328                                 ~l4c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3329                                 ~l4d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3330                                 ~l4e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3331                                 ~l4f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3332                         };
3333                         ~tunefreq4 = ~f4; ~f4 = ~f4+~f4t;
3334                         {if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (View(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (View(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
3335                         }.defer;
3336                 }, ccNum: 3);
3337                 MIDIdef.cc('l5', { |val|
3338                         case
3339                         {~l1a.isRunning == true}{
3340                                 ~l5a.set(\dur, ~f5 = \dur.asSpec.map(val / 127));
3341                                 ~l5b.set(\dur,      \dur.asSpec.map(val / 127));
3342                                 ~l5c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3343                                 ~l5d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3344                                 ~l5e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3345                                 ~l5f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3346                         }{~l1a1.isRunning == true}{
3347                                 ~l5a1.set(\dur, ~f5 = \dur.asSpec.map(val / 127));
3348                                 ~l5b1.set(\dur,      \dur.asSpec.map(val / 127));
3349                                 ~l5c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3350                                 ~l5d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3351                                 ~l5e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3352                                 ~l5f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3353                         };
3354                         ~tunefreq5 = ~f5; ~f5 = ~f5+~f5t;
3355                         {if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (View(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (View(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
3356                         }.defer;
3357                 }, ccNum: 4);
3358                 MIDIdef.cc('l6', { |val|
3359                         case
3360                         {~l1a.isRunning == true}{
3361                                 ~l6a.set(\dur, ~f6 = \dur.asSpec.map(val / 127));
3362                                 ~l6b.set(\dur,      \dur.asSpec.map(val / 127));
3363                                 ~l6c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3364                                 ~l6d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3365                                 ~l6e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3366                                 ~l6f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3367                         }{~l1a1.isRunning == true}{
3368                                 ~l6a1.set(\dur, ~f6 = \dur.asSpec.map(val / 127));
3369                                 ~l6b1.set(\dur,      \dur.asSpec.map(val / 127));
3370                                 ~l6c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3371                                 ~l6d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3372                                 ~l6e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3373                                 ~l6f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3374                         };
3375                         ~tunefreq6 = ~f6; ~f6 = ~f6+~f6t;
3376                         {if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (View(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (View(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
3377                         }.defer;
3378                 }, ccNum: 5);
3379                 MIDIdef.cc('l7', { |val|
3380                         case
3381                         {~l1a.isRunning == true}{
3382                                 ~l7a.set(\dur, ~f7 = \dur.asSpec.map(val / 127));
3383                                 ~l7b.set(\dur,      \dur.asSpec.map(val / 127));
3384                                 ~l7c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3385                                 ~l7d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3386                                 ~l7e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3387                                 ~l7f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3388                         }{~l1a1.isRunning == true}{
3389                                 ~l7a1.set(\dur, ~f7 = \dur.asSpec.map(val / 127));
3390                                 ~l7b1.set(\dur,      \dur.asSpec.map(val / 127));
3391                                 ~l7c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3392                                 ~l7d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3393                                 ~l7e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3394                                 ~l7f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3395                         };
3396                         ~tunefreq7 = ~f7; ~f7 = ~f7+~f7t;
3397                         {if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (View(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (View(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
3398                         }.defer;
3399                 }, ccNum: 6);
3400                 MIDIdef.cc('l8', { |val|
3401                         case
3402                         {~l1a.isRunning == true}{
3403                                 ~l8a.set(\dur, ~f8 = \dur.asSpec.map(val / 127));
3404                                 ~l8b.set(\dur,      \dur.asSpec.map(val / 127));
3405                                 ~l8c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3406                                 ~l8d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3407                                 ~l8e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3408                                 ~l8f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3409                         }{~l1a1.isRunning == true}{
3410                                 ~l8a1.set(\dur, ~f8 = \dur.asSpec.map(val / 127));
3411                                 ~l8b1.set(\dur,      \dur.asSpec.map(val / 127));
3412                                 ~l8c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3413                                 ~l8d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3414                                 ~l8e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3415                                 ~l8f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3416                         };
3417                         ~tunefreq8 = ~f8; ~f8 = ~f8+~f8t;
3418                         {if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (View(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (View(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
3419                         }.defer;
3420                 }, ccNum: 7);
3421
3422
3423                 //if midi tuning frequency values are nil
3424
3425                 if(~f1t == nil, {~f1t = 0});
3426                 if(~f2t == nil, {~f2t = 0});
3427                 if(~f3t == nil, {~f3t = 0});
3428                 if(~f4t == nil, {~f4t = 0});
3429                 if(~f5t == nil, {~f5t = 0});
3430                 if(~f6t == nil, {~f6t = 0});
3431                 if(~f7t == nil, {~f7t = 0});
3432                 if(~f8t == nil, {~f8t = 0});
3433
3434
3435                 //midi set tuning frequency
3436
3437                 MIDIFunc.cc({|val|
3438                         ~f1 = ~f1-~f1t;
3439                         Spec.add(\tune, ([0, ~tunefreq1*~stepratio-~tunefreq1, \lin]));
3440                         case
3441                         {~l1a.isRunning == true}{
3442                                 ~l1a.set(\tune, ~f1t = \tune.asSpec.map(val / 127));
3443                                 ~l1b.set(\tune,      \tune.asSpec.map(val / 127));
3444                                 ~l1c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3445                                 ~l1d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3446                                 ~l1e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3447                                 ~l1f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3448                         }{~l1a1.isRunning == true}{
3449                                 ~l1a1.set(\tune, ~f1t = \tune.asSpec.map(val / 127));
3450                                 ~l1b1.set(\tune,      \tune.asSpec.map(val / 127));
3451                                 ~l1c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3452                                 ~l1d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3453                                 ~l1e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3454                                 ~l1f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3455                         };
3456                         ~f1 = ~f1+~f1t;
3457                         {if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (View(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (View(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
3458                         }.defer;
3459                 }, ccNum: 16);
3460                 MIDIFunc.cc({|val|
3461                         ~f2 = ~f2-~f2t;
3462                         Spec.add(\tune, ([0, ~tunefreq2*~stepratio-~tunefreq2, \lin]));
3463                         case
3464                         {~l1a.isRunning == true}{
3465                                 ~l2a.set(\tune, ~f2t = \tune.asSpec.map(val / 127));
3466                                 ~l2b.set(\tune,      \tune.asSpec.map(val / 127));
3467                                 ~l2c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3468                                 ~l2d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3469                                 ~l2e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3470                                 ~l2f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3471                         }{~l1a1.isRunning == true}{
3472                                 ~l2a1.set(\tune, ~f2t = \tune.asSpec.map(val / 127));
3473                                 ~l2b1.set(\tune,      \tune.asSpec.map(val / 127));
3474                                 ~l2c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3475                                 ~l2d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3476                                 ~l2e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3477                                 ~l2f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3478                         };
3479                         ~f2 = ~f2+~f2t;
3480                         {if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (View(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (View(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
3481                         }.defer;
3482                 }, ccNum: 17);
3483                 MIDIFunc.cc({|val|
3484                         ~f3 = ~f3-~f3t;
3485                         Spec.add(\tune, ([0, ~tunefreq3*~stepratio-~tunefreq3, \lin]));
3486                         case
3487                         {~l1a.isRunning == true}{
3488                                 ~l3a.set(\tune, ~f3t = \tune.asSpec.map(val / 127));
3489                                 ~l3b.set(\tune,      \tune.asSpec.map(val / 127));
3490                                 ~l3c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3491                                 ~l3d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3492                                 ~l3e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3493                                 ~l3f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3494                         }{~l1a1.isRunning == true}{
3495                                 ~l3a1.set(\tune, ~f3t = \tune.asSpec.map(val / 127));
3496                                 ~l3b1.set(\tune,      \tune.asSpec.map(val / 127));
3497                                 ~l3c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3498                                 ~l3d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3499                                 ~l3e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3500                                 ~l3f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3501                         };
3502                         ~f3 = ~f3+~f3t;
3503                         {if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (View(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (View(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
3504                         }.defer;
3505                 }, ccNum: 18);
3506                 MIDIFunc.cc({|val|
3507                         ~f4 = ~f4-~f4t;
3508                         Spec.add(\tune, ([0, ~tunefreq4*~stepratio-~tunefreq4, \lin]));
3509                         case
3510                         {~l1a.isRunning == true}{
3511                                 ~l4a.set(\tune, ~f4t = \tune.asSpec.map(val / 127));
3512                                 ~l4b.set(\tune,      \tune.asSpec.map(val / 127));
3513                                 ~l4c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3514                                 ~l4d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3515                                 ~l4e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3516                                 ~l4f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3517                         }{~l1a1.isRunning == true}{
3518                                 ~l4a1.set(\tune, ~f4t = \tune.asSpec.map(val / 127));
3519                                 ~l4b1.set(\tune,      \tune.asSpec.map(val / 127));
3520                                 ~l4c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3521                                 ~l4d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3522                                 ~l4e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3523                                 ~l4f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3524                         };
3525                         ~f4 = ~f4+~f4t;
3526                         {if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (View(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (View(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
3527                         }.defer;
3528                 }, ccNum: 19);
3529                 MIDIFunc.cc({|val|
3530                         ~f5 = ~f5-~f5t;
3531                         Spec.add(\tune, ([0, ~tunefreq5*~stepratio-~tunefreq5, \lin]));
3532                         case
3533                         {~l1a.isRunning == true}{
3534                                 ~l5a.set(\tune, ~f5t = \tune.asSpec.map(val / 127));
3535                                 ~l5b.set(\tune,      \tune.asSpec.map(val / 127));
3536                                 ~l5c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3537                                 ~l5d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3538                                 ~l5e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3539                                 ~l5f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3540                         }{~l1a1.isRunning == true}{
3541                                 ~l5a1.set(\tune, ~f5t = \tune.asSpec.map(val / 127));
3542                                 ~l5b1.set(\tune,      \tune.asSpec.map(val / 127));
3543                                 ~l5c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3544                                 ~l5d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3545                                 ~l5e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3546                                 ~l5f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3547                         };
3548                         ~f5 = ~f5+~f5t;
3549                         {if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (View(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (View(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
3550                         }.defer;
3551                 }, ccNum: 20);
3552                 MIDIFunc.cc({|val|
3553                         ~f6 = ~f6-~f6t;
3554                         Spec.add(\tune, ([0, ~tunefreq6*~stepratio-~tunefreq6, \lin]));
3555                         case
3556                         {~l1a.isRunning == true}{
3557                                 ~l6a.set(\tune, ~f6t = \tune.asSpec.map(val / 127));
3558                                 ~l6b.set(\tune,      \tune.asSpec.map(val / 127));
3559                                 ~l6c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3560                                 ~l6d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3561                                 ~l6e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3562                                 ~l6f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3563                         }{~l1a1.isRunning == true}{
3564                                 ~l6a1.set(\tune, ~f6t = \tune.asSpec.map(val / 127));
3565                                 ~l6b1.set(\tune,      \tune.asSpec.map(val / 127));
3566                                 ~l6c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3567                                 ~l6d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3568                                 ~l6e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3569                                 ~l6f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3570                         };
3571                         ~f6 = ~f6+~f6t;
3572                         {if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (View(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (View(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
3573                         }.defer;
3574                 }, ccNum: 21);
3575                 MIDIFunc.cc({|val|
3576                         ~f7 = ~f7-~f7t;
3577                         Spec.add(\tune, ([0, ~tunefreq7*~stepratio-~tunefreq7, \lin]));
3578                         case
3579                         {~l1a.isRunning == true}{
3580                                 ~l7a.set(\tune, ~f7t = \tune.asSpec.map(val / 127));
3581                                 ~l7b.set(\tune,      \tune.asSpec.map(val / 127));
3582                                 ~l7c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3583                                 ~l7d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3584                                 ~l7e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3585                                 ~l7f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3586                         }{~l1a1.isRunning == true}{
3587                                 ~l7a1.set(\tune, ~f7t = \tune.asSpec.map(val / 127));
3588                                 ~l7b1.set(\tune,      \tune.asSpec.map(val / 127));
3589                                 ~l7c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3590                                 ~l7d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3591                                 ~l7e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3592                                 ~l7f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3593                         };
3594                         ~f7 = ~f7+~f7t;
3595                         {if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (View(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (View(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
3596                         }.defer;
3597                 }, ccNum: 22);
3598                 MIDIFunc.cc({|val|
3599                         ~f8 = ~f8-~f8t;
3600                         Spec.add(\tune, ([0, ~tunefreq8*~stepratio-~tunefreq8, \lin]));
3601                         case
3602                         {~l1a.isRunning == true}{
3603                                 ~l8a.set(\tune, ~f8t = \tune.asSpec.map(val / 127));
3604                                 ~l8b.set(\tune,      \tune.asSpec.map(val / 127));
3605                                 ~l8c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3606                                 ~l8d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3607                                 ~l8e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3608                                 ~l8f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3609                         }{~l1a1.isRunning == true}{
3610                                 ~l8a1.set(\tune, ~f7t = \tune.asSpec.map(val / 127));
3611                                 ~l8b1.set(\tune,      \tune.asSpec.map(val / 127));
3612                                 ~l8c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3613                                 ~l8d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3614                                 ~l8e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3615                                 ~l8f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3616                         };
3617                         ~f8 = ~f8+~f8t;
3618                         {if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (View(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (View(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
3619                         }.defer;
3620                 }, ccNum: 23);
3621
3622
3623                 //Korg NanoKontrol button assignments
3624
3625
3626                 //start/stop synth and pause/unpause synth buttons
3627
3628                 MIDIFunc.cc({|val| {case{b3.value == 0}{b3.valueAction = 1};}.defer;}, ccNum: 41);
3629                 MIDIFunc.cc({|val| {case{b3.value == 1}{b3.valueAction = 0};}.defer;}, ccNum: 42);
3630                 MIDIFunc.cc({|val| {case{b4.value == 0}{b4.valueAction = 1};}.defer;}, ccNum: 43);
3631                 MIDIFunc.cc({|val| {case{b4.value == 1}{b4.valueAction = 0};}.defer;}, ccNum: 44);
3632
3633
3634                 //open/flow/slide buttons (inactive)
3635
3636                 /*MIDIFunc.cc({|val| {~bplaceo1.valueAction=0}.defer;}, ccNum: 32);
3637                 MIDIFunc.cc({|val| {~bplaceo2.valueAction=0}.defer;}, ccNum: 33);
3638                 MIDIFunc.cc({|val| {~bplaceo3.valueAction=0}.defer;}, ccNum: 34);
3639                 MIDIFunc.cc({|val| {~bplaceo4.valueAction=0}.defer;}, ccNum: 35);
3640                 MIDIFunc.cc({|val| {~bplaceo5.valueAction=0}.defer;}, ccNum: 36);
3641                 MIDIFunc.cc({|val| {~bplaceo6.valueAction=0}.defer;}, ccNum: 37);
3642                 MIDIFunc.cc({|val| {~bplaceo7.valueAction=0}.defer;}, ccNum: 38);
3643                 MIDIFunc.cc({|val| {~bplaceo8.valueAction=0}.defer;}, ccNum: 39);
3644                 MIDIFunc.cc({|val| {~bplacef1.valueAction=0}.defer;}, ccNum: 48);
3645                 MIDIFunc.cc({|val| {~bplacef2.valueAction=0}.defer;}, ccNum: 49);
3646                 MIDIFunc.cc({|val| {~bplacef3.valueAction=0}.defer;}, ccNum: 50);
3647                 MIDIFunc.cc({|val| {~bplacef4.valueAction=0}.defer;}, ccNum: 51);
3648                 MIDIFunc.cc({|val| {~bplacef5.valueAction=0}.defer;}, ccNum: 52);
3649                 MIDIFunc.cc({|val| {~bplacef6.valueAction=0}.defer;}, ccNum: 53);
3650                 MIDIFunc.cc({|val| {~bplacef7.valueAction=0}.defer;}, ccNum: 54);
3651                 MIDIFunc.cc({|val| {~bplacef8.valueAction=0}.defer;}, ccNum: 55);
3652                 MIDIFunc.cc({|val| {~bplaces1.valueAction=0}.defer;}, ccNum: 64);
3653                 MIDIFunc.cc({|val| {~bplaces2.valueAction=0}.defer;}, ccNum: 65);
3654                 MIDIFunc.cc({|val| {~bplaces3.valueAction=0}.defer;}, ccNum: 66);
3655                 MIDIFunc.cc({|val| {~bplaces4.valueAction=0}.defer;}, ccNum: 67);
3656                 MIDIFunc.cc({|val| {~bplaces5.valueAction=0}.defer;}, ccNum: 68);
3657                 MIDIFunc.cc({|val| {~bplaces6.valueAction=0}.defer;}, ccNum: 69);
3658                 MIDIFunc.cc({|val| {~bplaces7.valueAction=0}.defer;}, ccNum: 70);
3659                 MIDIFunc.cc({|val| {~bplaces8.valueAction=0}.defer;}, ccNum: 71);
3660                 */
3661
3662
3663                 //mute/unmute buttons
3664
3665                 MIDIFunc.cc({|val| {mute1.valueAction = 1;}.defer;}, ccNum: 48);
3666                 MIDIFunc.cc({|val| {mute2.valueAction = 1;}.defer;}, ccNum: 49);
3667                 MIDIFunc.cc({|val| {mute3.valueAction = 1;}.defer;}, ccNum: 50);
3668                 MIDIFunc.cc({|val| {mute4.valueAction = 1;}.defer;}, ccNum: 51);
3669                 MIDIFunc.cc({|val| {mute5.valueAction = 1;}.defer;}, ccNum: 52);
3670                 MIDIFunc.cc({|val| {mute6.valueAction = 1;}.defer;}, ccNum: 53);
3671                 MIDIFunc.cc({|val| {mute7.valueAction = 1;}.defer;}, ccNum: 54);
3672                 MIDIFunc.cc({|val| {mute8.valueAction = 1;}.defer;}, ccNum: 55);
3673                 MIDIFunc.cc({|val| {mute1.valueAction = 1;mute2.valueAction = 1;mute3.valueAction = 1;mute4.valueAction = 1;mute5.valueAction = 1;mute6.valueAction = 1;mute7.valueAction = 1;mute8.valueAction = 1;}.defer;}, ccNum: 58);
3674                 MIDIFunc.cc({|val| {mute1.valueAction = 0;}.defer;}, ccNum: 32);
3675                 MIDIFunc.cc({|val| {mute2.valueAction = 0;}.defer;}, ccNum: 33);
3676                 MIDIFunc.cc({|val| {mute3.valueAction = 0;}.defer;}, ccNum: 34);
3677                 MIDIFunc.cc({|val| {mute4.valueAction = 0;}.defer;}, ccNum: 35);
3678                 MIDIFunc.cc({|val| {mute5.valueAction = 0;}.defer;}, ccNum: 36);
3679                 MIDIFunc.cc({|val| {mute6.valueAction = 0;}.defer;}, ccNum: 37);
3680                 MIDIFunc.cc({|val| {mute7.valueAction = 0;}.defer;}, ccNum: 38);
3681                 MIDIFunc.cc({|val| {mute8.valueAction = 0;}.defer;}, ccNum: 39);
3682                 MIDIFunc.cc({|val| {mute1.valueAction = 0;mute2.valueAction = 0;mute3.valueAction = 0;mute4.valueAction = 0;mute5.valueAction = 0;mute6.valueAction = 0;mute7.valueAction = 0;mute8.valueAction = 1;}.defer;}, ccNum: 59);
3683
3684                 /*MIDIFunc.cc({ |val| ([~a2,~b2,~c2,~d2,~e2,~f2]).postln;}, ccNum: [0]);*/
3685                 /*MIDIFunc.cc({ |val|~l1.set(\tune, 0);}, ccNum: [32]);*/
3686                 /*MIDIFunc.cc({ |val| ([(~w),(~x),(~y),(~z),(~u),(~v),~r,~s]).postln;}, ccNum: [64]);*/
3687                 /*~basefreq= 432.cpsmidi-69;*/
3688                 /*Spec.add(\dur, ~etemp.cps([0, 127, \exp]));*/
3689
3690                 Spec.add(\dur, ([~freqmap.at(0), ~freqmap.at(127), \exp]));
3691                 /*Spec.add(\tune, ([0, 128, \lin]));*/
3692         };
3693
3694
3695         //evaluate midi function
3696
3697         ~midifunc.value;
3698
3699
3700         //keyboard number buttons to choose synth
3701
3702         keycodeb = Button.new(w,Rect(Window.screenBounds.width-20-16,~bpt+160,16,16/1.6180339887499)).states_([
3703                 ["1",Color.white,Color.black],
3704                 ["2",Color.white,Color.black],
3705                 ["3",Color.white,Color.black],
3706                 ["4",Color.white,Color.black],
3707                 ["5",Color.white,Color.black],
3708                 ["6",Color.white,Color.black],
3709                 ["7",Color.white,Color.black],
3710                 ["8",Color.white,Color.black]]).action_({arg button;
3711
3712                 case
3713                 {button.value == 0}{
3714                         ~z25.background = Color.green; ~z1.background = Color.green;
3715                         ~z26.background = Color.white; ~z2.background = Color.white;
3716                         ~z27.background = Color.white; ~z3.background = Color.white;
3717                         ~z28.background = Color.white; ~z4.background = Color.white;
3718                         ~z29.background = Color.white; ~z5.background = Color.white;
3719                         ~z30.background = Color.white; ~z6.background = Color.white;
3720                         ~z31.background = Color.white; ~z7.background = Color.white;
3721                         ~z32.background = Color.white; ~z8.background = Color.white;
3722                 }
3723                 {button.value == 1}{
3724                         ~z25.background = Color.white; ~z1.background = Color.white;
3725                         ~z26.background = Color.green; ~z2.background = Color.green;
3726                         ~z27.background = Color.white; ~z3.background = Color.white;
3727                         ~z28.background = Color.white; ~z4.background = Color.white;
3728                         ~z29.background = Color.white; ~z5.background = Color.white;
3729                         ~z30.background = Color.white; ~z6.background = Color.white;
3730                         ~z31.background = Color.white; ~z7.background = Color.white;
3731                         ~z32.background = Color.white; ~z8.background = Color.white;
3732                 }
3733                 {button.value == 2}{
3734                         ~z25.background = Color.white; ~z1.background = Color.white;
3735                         ~z26.background = Color.white; ~z2.background = Color.white;
3736                         ~z27.background = Color.green; ~z3.background = Color.green;
3737                         ~z28.background = Color.white; ~z4.background = Color.white;
3738                         ~z29.background = Color.white; ~z5.background = Color.white;
3739                         ~z30.background = Color.white; ~z6.background = Color.white;
3740                         ~z31.background = Color.white; ~z7.background = Color.white;
3741                         ~z32.background = Color.white; ~z8.background = Color.white;
3742                 }
3743                 {button.value == 3}{
3744                         ~z25.background = Color.white; ~z1.background = Color.white;
3745                         ~z26.background = Color.white; ~z2.background = Color.white;
3746                         ~z27.background = Color.white; ~z3.background = Color.white;
3747                         ~z28.background = Color.green; ~z4.background = Color.green;
3748                         ~z29.background = Color.white; ~z5.background = Color.white;
3749                         ~z30.background = Color.white; ~z6.background = Color.white;
3750                         ~z31.background = Color.white; ~z7.background = Color.white;
3751                         ~z32.background = Color.white; ~z8.background = Color.white;
3752                 }
3753                 {button.value == 4}{
3754                         ~z25.background = Color.white; ~z1.background = Color.white;
3755                         ~z26.background = Color.white; ~z2.background = Color.white;
3756                         ~z27.background = Color.white; ~z3.background = Color.white;
3757                         ~z28.background = Color.white; ~z4.background = Color.white;
3758                         ~z29.background = Color.green; ~z5.background = Color.green;
3759                         ~z30.background = Color.white; ~z6.background = Color.white;
3760                         ~z31.background = Color.white; ~z7.background = Color.white;
3761                         ~z32.background = Color.white; ~z8.background = Color.white;
3762                 }
3763                 {button.value == 5}{
3764                         ~z25.background = Color.white; ~z1.background = Color.white;
3765                         ~z26.background = Color.white; ~z2.background = Color.white;
3766                         ~z27.background = Color.white; ~z3.background = Color.white;
3767                         ~z28.background = Color.white; ~z4.background = Color.white;
3768                         ~z29.background = Color.white; ~z5.background = Color.white;
3769                         ~z30.background = Color.green; ~z6.background = Color.green;
3770                         ~z31.background = Color.white; ~z7.background = Color.white;
3771                         ~z32.background = Color.white; ~z8.background = Color.white;
3772                 }
3773                 {button.value == 6}{
3774                         ~z25.background = Color.white; ~z1.background = Color.white;
3775                         ~z26.background = Color.white; ~z2.background = Color.white;
3776                         ~z27.background = Color.white; ~z3.background = Color.white;
3777                         ~z28.background = Color.white; ~z4.background = Color.white;
3778                         ~z29.background = Color.white; ~z5.background = Color.white;
3779                         ~z30.background = Color.white; ~z6.background = Color.white;
3780                         ~z31.background = Color.green; ~z7.background = Color.green;
3781                         ~z32.background = Color.white; ~z8.background = Color.white;
3782                 }
3783                 {button.value == 7}{
3784                         ~z25.background = Color.white; ~z1.background = Color.white;
3785                         ~z26.background = Color.white; ~z2.background = Color.white;
3786                         ~z27.background = Color.white; ~z3.background = Color.white;
3787                         ~z28.background = Color.white; ~z4.background = Color.white;
3788                         ~z29.background = Color.white; ~z5.background = Color.white;
3789                         ~z30.background = Color.white; ~z6.background = Color.white;
3790                         ~z31.background = Color.white; ~z7.background = Color.white;
3791                         ~z32.background = Color.green; ~z8.background = Color.green;
3792                 }
3793
3794         });
3795
3796
3797         //misc. keyboard buttons
3798
3799         w.view.keyDownAction = { arg view, char, modifiers, unicode, keycode;
3800                 [char, modifiers, unicode, keycode];
3801
3802                 //copy
3803                 if(unicode == ~c_unicode, {
3804                         case
3805                         {b.value == 0}{b.valueAction = 1}
3806                         {b.value == 1}{b.valueAction = 0};
3807                 });
3808
3809                 //start/stop synth
3810                 if(unicode == ~s_unicode, {
3811                         case
3812                         {b3.value == 0}{b3.valueAction = 1}
3813                         {b3.value == 1}{b3.valueAction = 0};
3814                 });
3815
3816                 //pause/unpause synth
3817                 if(unicode == ~spacebar_unicode, {
3818                         case
3819                         {b4.value == 0}{b4.valueAction = 1}
3820                         {b4.value == 1}{b4.valueAction = 0};
3821                 });
3822
3823                 //timer function
3824                 if(unicode == ~t_unicode, {
3825                         case
3826                         {~ts.value == 0}{~ts.valueAction = 1}
3827                         {~ts.value == 1}{~ts.valueAction = 0};
3828                 });
3829
3830                 //routine function
3831                 if(unicode == ~r_unicode, {
3832                         case
3833                         {~rviewbutton.value == 0}{~rviewbutton.valueAction = 1}
3834                         {~rviewbutton.value == 1}{~rviewbutton.valueAction = 0};
3835                 });
3836
3837                 //mute/unmute all synths
3838                 if(unicode == ~m_unicode, {
3839                         case
3840                         {muteall.value == 0}{muteall.valueAction = 1}
3841                         {muteall.value == 1}{muteall.valueAction = 0};
3842                 });
3843
3844                 //minimize GUI window
3845                 if(unicode == ~escape_unicode, {w.minimize;
3846
3847                         ~fullscreen_correct = {w.fullScreen};
3848                         ~fscview = UserView(w, Rect(0,0, Window.screenBounds.width-100, Window.screenBounds.height;));
3849                         ~fullscreen_button = Button.new(w,Rect(Window.screenBounds.width/2-35,Window.screenBounds.height/2+120,150,20)).states_([["re-adjust to fullscreen",Color.white,Color.black]]).action_({arg button; w.fullScreen; ~fullscreen_button.close; ~fullscreen_button = nil;});
3850                         ~fscview.mouseEnterAction_{|v, x, y| ~fullscreen_correct.value; ~fullscreen_correct = nil; ~fscview.close; ~fscview = nil; ~fullscreen_button.close; ~fullscreen_button = nil;};
3851                 });
3852
3853                 /*if((unicode == ~escape_unicode) and: (info.isClosed == false), {info.close;});
3854                 if((unicode == ~escape_unicode) and: (b.isClosed == false), {b.close;});
3855
3856                 //minimize GUI window
3857                 if((unicode == ~escape_unicode) and: (((b.isClosed == true) and: (info.isClosed == true)) or: ((b.isClosed == true)) or: (info.isClosed == true)), {w.minimize;});
3858                 */
3859                 /*if(unicode == ~escape_unicode , {
3860                 if((b.isClosed == true) and: (info.isClosed == true), {~min.value});
3861                 if(info.isClosed == false, {info.valueAction  = 0;});
3862                 if(b.isClosed == false, {b.valueAction = 0;});
3863                 });*/
3864
3865
3866                 //keyboard number actions
3867
3868                 case
3869                 {unicode == ~one_unicode}{keycodeb.valueAction_(0)}
3870                 {unicode == ~two_unicode}{keycodeb.valueAction_(1)}
3871                 {unicode == ~three_unicode}{keycodeb.valueAction_(2)}
3872                 {unicode == ~four_unicode}{keycodeb.valueAction_(3)}
3873                 {unicode == ~five_unicode}{keycodeb.valueAction_(4)}
3874                 {unicode == ~six_unicode}{keycodeb.valueAction_(5)}
3875                 {unicode == ~seven_unicode}{keycodeb.valueAction_(6)}
3876                 {unicode == ~eight_unicode}{keycodeb.valueAction_(7)}
3877
3878
3879                 //keyboard up/down arrow actions
3880
3881                 {(keycode == ~uparrow_keycode) or: (unicode == ~i_unicode)}{keycodeb.valueAction_(keycodeb.value-1)}
3882                 {(keycode == ~downarrow_keycode) or: (unicode == ~k_unicode)}{keycodeb.valueAction_(keycodeb.value+1)};
3883
3884
3885                 //set synth frequency using left/right arrow keys or j/l keys
3886
3887                 if((~f1 >= ~freqmap.at(127)), {~freqmap.at(127)},
3888                         {if((keycodeb.value == 0) and: (((keycode == ~rightarrow_keycode) or: (keycode == ~rightarrow_keycode1)) or: (unicode == ~l_unicode)), {
3889                                 ~freqmapval1 = ~f1.cpsmidi.round;
3890                                 case
3891                                 {~l1a.isRunning == true}{
3892                                         ~l1a.set(\dur, ~f1 = ~freqmap.at(~freqmapval1 = ~freqmapval1.value+1));
3893                                         ~l1b.set(\dur, ~f1);
3894                                         ~l1c.set(\dur, ~f1/~icd3);
3895                                         ~l1d.set(\dur, ~f1/~icd3);
3896                                         ~l1e.set(\dur, ~f1/~icd6);
3897                                         ~l1f.set(\dur, ~f1/~icd6);
3898                                 }
3899                                 {~l1a1.isRunning == true}{
3900                                         ~l1a1.set(\dur, ~f1 = ~freqmap.at(~freqmapval1 = ~freqmapval1.value+1));
3901                                         ~l1b1.set(\dur, ~f1);
3902                                         ~l1c1.set(\dur, ~f1/~icd3);
3903                                         ~l1d1.set(\dur, ~f1/~icd3);
3904                                         ~l1e1.set(\dur, ~f1/~icd6);
3905                                         ~l1f1.set(\dur, ~f1/~icd6);
3906                                 };
3907                                 if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (View(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (View(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
3908                                 ~z25.background = Color.green; ~z1.background = Color.green;
3909                                 ~z26.background = Color.white; ~z2.background = Color.white;
3910                                 ~z27.background = Color.white; ~z3.background = Color.white;
3911                                 ~z28.background = Color.white; ~z4.background = Color.white;
3912                                 ~z29.background = Color.white; ~z5.background = Color.white;
3913                                 ~z30.background = Color.white; ~z6.background = Color.white;
3914                                 ~z31.background = Color.white; ~z7.background = Color.white;
3915                                 ~z32.background = Color.white; ~z8.background = Color.white;
3916                 });});
3917                 if((~f1 <= ~freqmap.at(0)), {~freqmap.at(0)},
3918                         {if((keycodeb.value == 0) and: (((keycode == ~leftarrow_keycode) or: (keycode == ~leftarrow_keycode1)) or: (unicode == ~j_unicode)), {
3919                                 ~freqmapval1 = ~f1.cpsmidi.round;
3920                                 case
3921                                 {~l1a.isRunning == true}{
3922                                         ~l1a.set(\dur, ~f1 = ~freqmap.at(~freqmapval1 = ~freqmapval1.value-1));
3923                                         ~l1b.set(\dur, ~f1);
3924                                         ~l1c.set(\dur, ~f1/~icd3);
3925                                         ~l1d.set(\dur, ~f1/~icd3);
3926                                         ~l1e.set(\dur, ~f1/~icd6);
3927                                         ~l1f.set(\dur, ~f1/~icd6);
3928                                 }
3929                                 {~l1a1.isRunning == true}{
3930                                         ~l1a1.set(\dur, ~f1 = ~freqmap.at(~freqmapval1 = ~freqmapval1.value-1));
3931                                         ~l1b1.set(\dur, ~f1);
3932                                         ~l1c1.set(\dur, ~f1/~icd3);
3933                                         ~l1d1.set(\dur, ~f1/~icd3);
3934                                         ~l1e1.set(\dur, ~f1/~icd6);
3935                                         ~l1f1.set(\dur, ~f1/~icd6);
3936                                 };
3937                                 if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (View(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (View(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
3938
3939                                 ~z25.background = Color.green; ~z1.background = Color.green;
3940                                 ~z26.background = Color.white; ~z2.background = Color.white;
3941                                 ~z27.background = Color.white; ~z3.background = Color.white;
3942                                 ~z28.background = Color.white; ~z4.background = Color.white;
3943                                 ~z29.background = Color.white; ~z5.background = Color.white;
3944                                 ~z30.background = Color.white; ~z6.background = Color.white;
3945                                 ~z31.background = Color.white; ~z7.background = Color.white;
3946                                 ~z32.background = Color.white; ~z8.background = Color.white;
3947                 });});
3948
3949                 if((~f2 >= ~freqmap.at(127)), {~freqmap.at(127)},
3950                         {if((keycodeb.value == 1) and: (((keycode == ~rightarrow_keycode) or: (keycode == ~rightarrow_keycode1)) or: (unicode == ~l_unicode)), {
3951                                 ~freqmapval2 = ~f2.cpsmidi.round;
3952                                 case
3953                                 {~l1a.isRunning == true}{
3954                                         ~l2a.set(\dur, ~f2 = ~freqmap.at(~freqmapval2 = ~freqmapval2.value+1));
3955                                         ~l2b.set(\dur, ~f2);
3956                                         ~l2c.set(\dur, ~f2/~icd3);
3957                                         ~l2d.set(\dur, ~f2/~icd3);
3958                                         ~l2e.set(\dur, ~f2/~icd6);
3959                                         ~l2f.set(\dur, ~f2/~icd6);
3960                                 }
3961                                 {~l1a1.isRunning == true}{
3962                                         ~l2a1.set(\dur, ~f2 = ~freqmap.at(~freqmapval2 = ~freqmapval2.value+1));
3963                                         ~l2b1.set(\dur, ~f2);
3964                                         ~l2c1.set(\dur, ~f2/~icd3);
3965                                         ~l2d1.set(\dur, ~f2/~icd3);
3966                                         ~l2e1.set(\dur, ~f2/~icd6);
3967                                         ~l2f1.set(\dur, ~f2/~icd6);
3968                                 };
3969                                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (View(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (View(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
3970                                 ~z25.background = Color.white; ~z1.background = Color.white;
3971                                 ~z26.background = Color.green; ~z2.background = Color.green;
3972                                 ~z27.background = Color.white; ~z3.background = Color.white;
3973                                 ~z28.background = Color.white; ~z4.background = Color.white;
3974                                 ~z29.background = Color.white; ~z5.background = Color.white;
3975                                 ~z30.background = Color.white; ~z6.background = Color.white;
3976                                 ~z31.background = Color.white; ~z7.background = Color.white;
3977                                 ~z32.background = Color.white; ~z8.background = Color.white;
3978                 });});
3979                 if((~f2 <= ~freqmap.at(0)), {~freqmap.at(0)},
3980                         {if((keycodeb.value == 1) and: (((keycode == ~leftarrow_keycode) or: (keycode == ~leftarrow_keycode1)) or: (unicode == ~j_unicode)), {
3981                                 ~freqmapval2 = ~f2.cpsmidi.round;
3982                                 case
3983                                 {~l1a.isRunning == true}{
3984                                         ~l2a.set(\dur, ~f2 = ~freqmap.at(~freqmapval2 = ~freqmapval2.value-1));
3985                                         ~l2b.set(\dur, ~f2);
3986                                         ~l2c.set(\dur, ~f2/~icd3);
3987                                         ~l2d.set(\dur, ~f2/~icd3);
3988                                         ~l2e.set(\dur, ~f2/~icd6);
3989                                         ~l2f.set(\dur, ~f2/~icd6);
3990                                 }
3991                                 {~l1a1.isRunning == true}{
3992                                         ~l2a1.set(\dur, ~f2 = ~freqmap.at(~freqmapval2 = ~freqmapval2.value-1));
3993                                         ~l2b1.set(\dur, ~f2);
3994                                         ~l2c1.set(\dur, ~f2/~icd3);
3995                                         ~l2d1.set(\dur, ~f2/~icd3);
3996                                         ~l2e1.set(\dur, ~f2/~icd6);
3997                                         ~l2f1.set(\dur, ~f2/~icd6);
3998                                 };
3999                                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (View(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (View(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
4000
4001                                 ~z25.background = Color.white; ~z1.background = Color.white;
4002                                 ~z26.background = Color.green; ~z2.background = Color.green;
4003                                 ~z27.background = Color.white; ~z3.background = Color.white;
4004                                 ~z28.background = Color.white; ~z4.background = Color.white;
4005                                 ~z29.background = Color.white; ~z5.background = Color.white;
4006                                 ~z30.background = Color.white; ~z6.background = Color.white;
4007                                 ~z31.background = Color.white; ~z7.background = Color.white;
4008                                 ~z32.background = Color.white; ~z8.background = Color.white;
4009                 });});
4010
4011                 if((~f3 >= ~freqmap.at(127)), {~freqmap.at(127)},
4012                         {if((keycodeb.value == 2) and: (((keycode == ~rightarrow_keycode) or: (keycode == ~rightarrow_keycode1)) or: (unicode == ~l_unicode)), {
4013                                 ~freqmapval3 = ~f3.cpsmidi.round;
4014                                 case
4015                                 {~l1a.isRunning == true}{
4016                                         ~l3a.set(\dur, ~f3 = ~freqmap.at(~freqmapval3 = ~freqmapval3.value+1));
4017                                         ~l3b.set(\dur, ~f3);
4018                                         ~l3c.set(\dur, ~f3/~icd3);
4019                                         ~l3d.set(\dur, ~f3/~icd3);
4020                                         ~l3e.set(\dur, ~f3/~icd6);
4021                                         ~l3f.set(\dur, ~f3/~icd6);
4022                                 }
4023                                 {~l1a1.isRunning == true}{
4024                                         ~l3a1.set(\dur, ~f3 = ~freqmap.at(~freqmapval3 = ~freqmapval3.value+1));
4025                                         ~l3b1.set(\dur, ~f3);
4026                                         ~l3c1.set(\dur, ~f3/~icd3);
4027                                         ~l3d1.set(\dur, ~f3/~icd3);
4028                                         ~l3e1.set(\dur, ~f3/~icd6);
4029                                         ~l3f1.set(\dur, ~f3/~icd6);
4030                                 };
4031                                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (View(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (View(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
4032                                 ~z25.background = Color.white; ~z1.background = Color.white;
4033                                 ~z26.background = Color.white; ~z2.background = Color.white;
4034                                 ~z27.background = Color.green; ~z3.background = Color.green;
4035                                 ~z28.background = Color.white; ~z4.background = Color.white;
4036                                 ~z29.background = Color.white; ~z5.background = Color.white;
4037                                 ~z30.background = Color.white; ~z6.background = Color.white;
4038                                 ~z31.background = Color.white; ~z7.background = Color.white;
4039                                 ~z32.background = Color.white; ~z8.background = Color.white;
4040                 });});
4041                 if((~f3 <= ~freqmap.at(0)), {~freqmap.at(0)},
4042                         {if((keycodeb.value == 2) and: (((keycode == ~leftarrow_keycode) or: (keycode == ~leftarrow_keycode1)) or: (unicode == ~j_unicode)), {
4043                                 ~freqmapval3 = ~f3.cpsmidi.round;
4044                                 case
4045                                 {~l1a.isRunning == true}{
4046                                         ~l3a.set(\dur, ~f3 = ~freqmap.at(~freqmapval3 = ~freqmapval3.value-1));
4047                                         ~l3b.set(\dur, ~f3);
4048                                         ~l3c.set(\dur, ~f3/~icd3);
4049                                         ~l3d.set(\dur, ~f3/~icd3);
4050                                         ~l3e.set(\dur, ~f3/~icd6);
4051                                         ~l3f.set(\dur, ~f3/~icd6);
4052                                 }
4053                                 {~l1a1.isRunning == true}{
4054                                         ~l3a1.set(\dur, ~f3 = ~freqmap.at(~freqmapval3 = ~freqmapval3.value-1));
4055                                         ~l3b1.set(\dur, ~f3);
4056                                         ~l3c1.set(\dur, ~f3/~icd3);
4057                                         ~l3d1.set(\dur, ~f3/~icd3);
4058                                         ~l3e1.set(\dur, ~f3/~icd6);
4059                                         ~l3f1.set(\dur, ~f3/~icd6);
4060                                 };
4061                                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (View(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (View(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
4062
4063                                 ~z25.background = Color.white; ~z1.background = Color.white;
4064                                 ~z26.background = Color.white; ~z2.background = Color.white;
4065                                 ~z27.background = Color.green; ~z3.background = Color.green;
4066                                 ~z28.background = Color.white; ~z4.background = Color.white;
4067                                 ~z29.background = Color.white; ~z5.background = Color.white;
4068                                 ~z30.background = Color.white; ~z6.background = Color.white;
4069                                 ~z31.background = Color.white; ~z7.background = Color.white;
4070                                 ~z32.background = Color.white; ~z8.background = Color.white;
4071                 });});
4072
4073                 if((~f4 >= ~freqmap.at(127)), {~freqmap.at(127)},
4074                         {if((keycodeb.value == 3) and: (((keycode == ~rightarrow_keycode) or: (keycode == ~rightarrow_keycode1)) or: (unicode == ~l_unicode)), {
4075                                 ~freqmapval4 = ~f4.cpsmidi.round;
4076                                 case
4077                                 {~l1a.isRunning == true}{
4078                                         ~l4a.set(\dur, ~f4 = ~freqmap.at(~freqmapval4 = ~freqmapval4.value+1));
4079                                         ~l4b.set(\dur, ~f4);
4080                                         ~l4c.set(\dur, ~f4/~icd3);
4081                                         ~l4d.set(\dur, ~f4/~icd3);
4082                                         ~l4e.set(\dur, ~f4/~icd6);
4083                                         ~l4f.set(\dur, ~f4/~icd6);
4084                                 }
4085                                 {~l1a1.isRunning == true}{
4086                                         ~l4a1.set(\dur, ~f4 = ~freqmap.at(~freqmapval4 = ~freqmapval4.value+1));
4087                                         ~l4b1.set(\dur, ~f4);
4088                                         ~l4c1.set(\dur, ~f4/~icd3);
4089                                         ~l4d1.set(\dur, ~f4/~icd3);
4090                                         ~l4e1.set(\dur, ~f4/~icd6);
4091                                         ~l4f1.set(\dur, ~f4/~icd6);
4092                                 };
4093                                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (View(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (View(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
4094                                 ~z25.background = Color.white; ~z1.background = Color.white;
4095                                 ~z26.background = Color.white; ~z2.background = Color.white;
4096                                 ~z27.background = Color.white; ~z3.background = Color.white;
4097                                 ~z28.background = Color.green; ~z4.background = Color.green;
4098                                 ~z29.background = Color.white; ~z5.background = Color.white;
4099                                 ~z30.background = Color.white; ~z6.background = Color.white;
4100                                 ~z31.background = Color.white; ~z7.background = Color.white;
4101                                 ~z32.background = Color.white; ~z8.background = Color.white;
4102                 });});
4103                 if((~f4 <= ~freqmap.at(0)), {~freqmap.at(0)},
4104                         {if((keycodeb.value == 3) and: (((keycode == ~leftarrow_keycode) or: (keycode == ~leftarrow_keycode1)) or: (unicode == ~j_unicode)), {
4105                                 ~freqmapval4 = ~f4.cpsmidi.round;
4106                                 case
4107                                 {~l1a.isRunning == true}{
4108                                         ~l4a.set(\dur, ~f4 = ~freqmap.at(~freqmapval4 = ~freqmapval4.value-1));
4109                                         ~l4b.set(\dur, ~f4);
4110                                         ~l4c.set(\dur, ~f4/~icd3);
4111                                         ~l4d.set(\dur, ~f4/~icd3);
4112                                         ~l4e.set(\dur, ~f4/~icd6);
4113                                         ~l4f.set(\dur, ~f4/~icd6);
4114                                 }
4115                                 {~l1a1.isRunning == true}{
4116                                         ~l4a1.set(\dur, ~f4 = ~freqmap.at(~freqmapval4 = ~freqmapval4.value-1));
4117                                         ~l4b1.set(\dur, ~f4);
4118                                         ~l4c1.set(\dur, ~f4/~icd3);
4119                                         ~l4d1.set(\dur, ~f4/~icd3);
4120                                         ~l4e1.set(\dur, ~f4/~icd6);
4121                                         ~l4f1.set(\dur, ~f4/~icd6);
4122                                 };
4123                                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (View(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (View(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
4124
4125                                 ~z25.background = Color.white; ~z1.background = Color.white;
4126                                 ~z26.background = Color.white; ~z2.background = Color.white;
4127                                 ~z27.background = Color.white; ~z3.background = Color.white;
4128                                 ~z28.background = Color.green; ~z4.background = Color.green;
4129                                 ~z29.background = Color.white; ~z5.background = Color.white;
4130                                 ~z30.background = Color.white; ~z6.background = Color.white;
4131                                 ~z31.background = Color.white; ~z7.background = Color.white;
4132                                 ~z32.background = Color.white; ~z8.background = Color.white;
4133                 });});
4134
4135                 if((~f5 >= ~freqmap.at(127)), {~freqmap.at(127)},
4136                         {if((keycodeb.value == 4) and: (((keycode == ~rightarrow_keycode) or: (keycode == ~rightarrow_keycode1)) or: (unicode == ~l_unicode)), {
4137                                 ~freqmapval5 = ~f5.cpsmidi.round;
4138                                 case
4139                                 {~l1a.isRunning == true}{
4140                                         ~l5a.set(\dur, ~f5 = ~freqmap.at(~freqmapval5 = ~freqmapval5.value+1));
4141                                         ~l5b.set(\dur, ~f5);
4142                                         ~l5c.set(\dur, ~f5/~icd3);
4143                                         ~l5d.set(\dur, ~f5/~icd3);
4144                                         ~l5e.set(\dur, ~f5/~icd6);
4145                                         ~l5f.set(\dur, ~f5/~icd6);
4146                                 }
4147                                 {~l1a1.isRunning == true}{
4148                                         ~l5a1.set(\dur, ~f5 = ~freqmap.at(~freqmapval5 = ~freqmapval5.value+1));
4149                                         ~l5b1.set(\dur, ~f5);
4150                                         ~l5c1.set(\dur, ~f5/~icd3);
4151                                         ~l5d1.set(\dur, ~f5/~icd3);
4152                                         ~l5e1.set(\dur, ~f5/~icd6);
4153                                         ~l5f1.set(\dur, ~f5/~icd6);
4154                                 };
4155                                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (View(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (View(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
4156                                 ~z25.background = Color.white; ~z1.background = Color.white;
4157                                 ~z26.background = Color.white; ~z2.background = Color.white;
4158                                 ~z27.background = Color.white; ~z3.background = Color.white;
4159                                 ~z28.background = Color.white; ~z4.background = Color.white;
4160                                 ~z29.background = Color.green; ~z5.background = Color.green;
4161                                 ~z30.background = Color.white; ~z6.background = Color.white;
4162                                 ~z31.background = Color.white; ~z7.background = Color.white;
4163                                 ~z32.background = Color.white; ~z8.background = Color.white;
4164                 });});
4165                 if((~f5 <= ~freqmap.at(0)), {~freqmap.at(0)},
4166                         {if((keycodeb.value == 4) and: (((keycode == ~leftarrow_keycode) or: (keycode == ~leftarrow_keycode1)) or: (unicode == ~j_unicode)), {
4167                                 ~freqmapval5 = ~f5.cpsmidi.round;
4168                                 case
4169                                 {~l1a.isRunning == true}{
4170                                         ~l5a.set(\dur, ~f5 = ~freqmap.at(~freqmapval5 = ~freqmapval5.value-1));
4171                                         ~l5b.set(\dur, ~f5);
4172                                         ~l5c.set(\dur, ~f5/~icd3);
4173                                         ~l5d.set(\dur, ~f5/~icd3);
4174                                         ~l5e.set(\dur, ~f5/~icd6);
4175                                         ~l5f.set(\dur, ~f5/~icd6);
4176                                 }
4177                                 {~l1a1.isRunning == true}{
4178                                         ~l5a1.set(\dur, ~f5 = ~freqmap.at(~freqmapval5 = ~freqmapval5.value-1));
4179                                         ~l5b1.set(\dur, ~f5);
4180                                         ~l5c1.set(\dur, ~f5/~icd3);
4181                                         ~l5d1.set(\dur, ~f5/~icd3);
4182                                         ~l5e1.set(\dur, ~f5/~icd6);
4183                                         ~l5f1.set(\dur, ~f5/~icd6);
4184                                 };
4185                                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (View(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (View(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
4186
4187                                 ~z25.background = Color.white; ~z1.background = Color.white;
4188                                 ~z26.background = Color.white; ~z2.background = Color.white;
4189                                 ~z27.background = Color.white; ~z3.background = Color.white;
4190                                 ~z28.background = Color.white; ~z4.background = Color.white;
4191                                 ~z29.background = Color.green; ~z5.background = Color.green;
4192                                 ~z30.background = Color.white; ~z6.background = Color.white;
4193                                 ~z31.background = Color.white; ~z7.background = Color.white;
4194                                 ~z32.background = Color.white; ~z8.background = Color.white;
4195                 });});
4196
4197                 if((~f6 >= ~freqmap.at(127)), {~freqmap.at(127)},
4198                         {if((keycodeb.value == 5) and: (((keycode == ~rightarrow_keycode) or: (keycode == ~rightarrow_keycode1)) or: (unicode == ~l_unicode)), {
4199                                 ~freqmapval6 = ~f6.cpsmidi.round;
4200                                 case
4201                                 {~l1a.isRunning == true}{
4202                                         ~l6a.set(\dur, ~f6 = ~freqmap.at(~freqmapval6 = ~freqmapval6.value+1));
4203                                         ~l6b.set(\dur, ~f6);
4204                                         ~l6c.set(\dur, ~f6/~icd3);
4205                                         ~l6d.set(\dur, ~f6/~icd3);
4206                                         ~l6e.set(\dur, ~f6/~icd6);
4207                                         ~l6f.set(\dur, ~f6/~icd6);
4208                                 }
4209                                 {~l1a1.isRunning == true}{
4210                                         ~l6a1.set(\dur, ~f6 = ~freqmap.at(~freqmapval6 = ~freqmapval6.value+1));
4211                                         ~l6b1.set(\dur, ~f6);
4212                                         ~l6c1.set(\dur, ~f6/~icd3);
4213                                         ~l6d1.set(\dur, ~f6/~icd3);
4214                                         ~l6e1.set(\dur, ~f6/~icd6);
4215                                         ~l6f1.set(\dur, ~f6/~icd6);
4216                                 };
4217                                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (View(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (View(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
4218                                 ~z25.background = Color.white; ~z1.background = Color.white;
4219                                 ~z26.background = Color.white; ~z2.background = Color.white;
4220                                 ~z27.background = Color.white; ~z3.background = Color.white;
4221                                 ~z28.background = Color.white; ~z4.background = Color.white;
4222                                 ~z29.background = Color.white; ~z5.background = Color.white;
4223                                 ~z30.background = Color.green; ~z6.background = Color.green;
4224                                 ~z31.background = Color.white; ~z7.background = Color.white;
4225                                 ~z32.background = Color.white; ~z8.background = Color.white;
4226                 });});
4227                 if((~f6 <= ~freqmap.at(0)), {~freqmap.at(0)},
4228                         {if((keycodeb.value == 5) and: (((keycode == ~leftarrow_keycode) or: (keycode == ~leftarrow_keycode1)) or: (unicode == ~j_unicode)), {
4229                                 ~freqmapval6 = ~f6.cpsmidi.round;
4230                                 case
4231                                 {~l1a.isRunning == true}{
4232                                         ~l6a.set(\dur, ~f6 = ~freqmap.at(~freqmapval6 = ~freqmapval6.value-1));
4233                                         ~l6b.set(\dur, ~f6);
4234                                         ~l6c.set(\dur, ~f6/~icd3);
4235                                         ~l6d.set(\dur, ~f6/~icd3);
4236                                         ~l6e.set(\dur, ~f6/~icd6);
4237                                         ~l6f.set(\dur, ~f6/~icd6);
4238                                 }
4239                                 {~l1a1.isRunning == true}{
4240                                         ~l6a1.set(\dur, ~f6 = ~freqmap.at(~freqmapval6 = ~freqmapval6.value-1));
4241                                         ~l6b1.set(\dur, ~f6);
4242                                         ~l6c1.set(\dur, ~f6/~icd3);
4243                                         ~l6d1.set(\dur, ~f6/~icd3);
4244                                         ~l6e1.set(\dur, ~f6/~icd6);
4245                                         ~l6f1.set(\dur, ~f6/~icd6);
4246                                 };
4247                                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (View(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (View(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
4248
4249                                 ~z25.background = Color.white; ~z1.background = Color.white;
4250                                 ~z26.background = Color.white; ~z2.background = Color.white;
4251                                 ~z27.background = Color.white; ~z3.background = Color.white;
4252                                 ~z28.background = Color.white; ~z4.background = Color.white;
4253                                 ~z29.background = Color.white; ~z5.background = Color.white;
4254                                 ~z30.background = Color.green; ~z6.background = Color.green;
4255                                 ~z31.background = Color.white; ~z7.background = Color.white;
4256                                 ~z32.background = Color.white; ~z8.background = Color.white;
4257                 });});
4258
4259                 if((~f7 >= ~freqmap.at(127)), {~freqmap.at(127)},
4260                         {if((keycodeb.value == 6) and: (((keycode == ~rightarrow_keycode) or: (keycode == ~rightarrow_keycode1)) or: (unicode == ~l_unicode)), {
4261                                 ~freqmapval7 = ~f7.cpsmidi.round;
4262                                 case
4263                                 {~l1a.isRunning == true}{
4264                                         ~l7a.set(\dur, ~f7 = ~freqmap.at(~freqmapval7 = ~freqmapval7.value+1));
4265                                         ~l7b.set(\dur, ~f7);
4266                                         ~l7c.set(\dur, ~f7/~icd3);
4267                                         ~l7d.set(\dur, ~f7/~icd3);
4268                                         ~l7e.set(\dur, ~f7/~icd6);
4269                                         ~l7f.set(\dur, ~f7/~icd6);
4270                                 }
4271                                 {~l1a1.isRunning == true}{
4272                                         ~l7a1.set(\dur, ~f7 = ~freqmap.at(~freqmapval7 = ~freqmapval7.value+1));
4273                                         ~l7b1.set(\dur, ~f7);
4274                                         ~l7c1.set(\dur, ~f7/~icd3);
4275                                         ~l7d1.set(\dur, ~f7/~icd3);
4276                                         ~l7e1.set(\dur, ~f7/~icd6);
4277                                         ~l7f1.set(\dur, ~f7/~icd6);
4278                                 };
4279                                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (View(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (View(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
4280                                 ~z25.background = Color.white; ~z1.background = Color.white;
4281                                 ~z26.background = Color.white; ~z2.background = Color.white;
4282                                 ~z27.background = Color.white; ~z3.background = Color.white;
4283                                 ~z28.background = Color.white; ~z4.background = Color.white;
4284                                 ~z29.background = Color.white; ~z5.background = Color.white;
4285                                 ~z30.background = Color.white; ~z6.background = Color.white;
4286                                 ~z31.background = Color.green; ~z7.background = Color.green;
4287                                 ~z32.background = Color.white; ~z8.background = Color.white;
4288                 });});
4289                 if((~f7 <= ~freqmap.at(0)), {~freqmap.at(0)},
4290                         {if((keycodeb.value == 6) and: (((keycode == ~leftarrow_keycode) or: (keycode == ~leftarrow_keycode1)) or: (unicode == ~j_unicode)), {
4291                                 ~freqmapval7 = ~f7.cpsmidi.round;
4292                                 case
4293                                 {~l1a.isRunning == true}{
4294                                         ~l7a.set(\dur, ~f7 = ~freqmap.at(~freqmapval7 = ~freqmapval7.value-1));
4295                                         ~l7b.set(\dur, ~f7);
4296                                         ~l7c.set(\dur, ~f7/~icd3);
4297                                         ~l7d.set(\dur, ~f7/~icd3);
4298                                         ~l7e.set(\dur, ~f7/~icd6);
4299                                         ~l7f.set(\dur, ~f7/~icd6);
4300                                 }
4301                                 {~l1a1.isRunning == true}{
4302                                         ~l7a1.set(\dur, ~f7 = ~freqmap.at(~freqmapval7 = ~freqmapval7.value-1));
4303                                         ~l7b1.set(\dur, ~f7);
4304                                         ~l7c1.set(\dur, ~f7/~icd3);
4305                                         ~l7d1.set(\dur, ~f7/~icd3);
4306                                         ~l7e1.set(\dur, ~f7/~icd6);
4307                                         ~l7f1.set(\dur, ~f7/~icd6);
4308                                 };
4309                                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (View(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (View(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
4310
4311                                 ~z25.background = Color.white; ~z1.background = Color.white;
4312                                 ~z26.background = Color.white; ~z2.background = Color.white;
4313                                 ~z27.background = Color.white; ~z3.background = Color.white;
4314                                 ~z28.background = Color.white; ~z4.background = Color.white;
4315                                 ~z29.background = Color.white; ~z5.background = Color.white;
4316                                 ~z30.background = Color.white; ~z6.background = Color.white;
4317                                 ~z31.background = Color.green; ~z7.background = Color.green;
4318                                 ~z32.background = Color.white; ~z8.background = Color.white;
4319                 });});
4320
4321                 if((~f8 >= ~freqmap.at(127)), {~freqmap.at(127)},
4322                         {if((keycodeb.value == 7) and: (((keycode == ~rightarrow_keycode) or: (keycode == ~rightarrow_keycode1)) or: (unicode == ~l_unicode)), {
4323                                 ~freqmapval8 = ~f8.cpsmidi.round;
4324                                 case
4325                                 {~l1a.isRunning == true}{
4326                                         ~l8a.set(\dur, ~f8 = ~freqmap.at(~freqmapval8 = ~freqmapval8.value+1));
4327                                         ~l8b.set(\dur, ~f8);
4328                                         ~l8c.set(\dur, ~f8/~icd3);
4329                                         ~l8d.set(\dur, ~f8/~icd3);
4330                                         ~l8e.set(\dur, ~f8/~icd6);
4331                                         ~l8f.set(\dur, ~f8/~icd6);
4332                                 }
4333                                 {~l1a1.isRunning == true}{
4334                                         ~l8a1.set(\dur, ~f8 = ~freqmap.at(~freqmapval8 = ~freqmapval8.value+1));
4335                                         ~l8b1.set(\dur, ~f8);
4336                                         ~l8c1.set(\dur, ~f8/~icd3);
4337                                         ~l8d1.set(\dur, ~f8/~icd3);
4338                                         ~l8e1.set(\dur, ~f8/~icd6);
4339                                         ~l8f1.set(\dur, ~f8/~icd6);
4340                                 };
4341                                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (View(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (View(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
4342                                 ~z25.background = Color.white; ~z1.background = Color.white;
4343                                 ~z26.background = Color.white; ~z2.background = Color.white;
4344                                 ~z27.background = Color.white; ~z3.background = Color.white;
4345                                 ~z28.background = Color.white; ~z4.background = Color.white;
4346                                 ~z29.background = Color.white; ~z5.background = Color.white;
4347                                 ~z30.background = Color.white; ~z6.background = Color.white;
4348                                 ~z31.background = Color.white; ~z7.background = Color.white;
4349                                 ~z32.background = Color.green; ~z8.background = Color.green;
4350                 });});
4351                 if((~f8 <= ~freqmap.at(0)), {~freqmap.at(0)},
4352                         {if((keycodeb.value == 7) and: (((keycode == ~leftarrow_keycode) or: (keycode == ~leftarrow_keycode1)) or: (unicode == ~j_unicode)), {
4353                                 ~freqmapval8 = ~f8.cpsmidi.round;
4354                                 case
4355                                 {~l1a.isRunning == true}{
4356                                         ~l8a.set(\dur, ~f8 = ~freqmap.at(~freqmapval8 = ~freqmapval8.value-1));
4357                                         ~l8b.set(\dur, ~f8);
4358                                         ~l8c.set(\dur, ~f8/~icd3);
4359                                         ~l8d.set(\dur, ~f8/~icd3);
4360                                         ~l8e.set(\dur, ~f8/~icd6);
4361                                         ~l8f.set(\dur, ~f8/~icd6);
4362                                 }
4363                                 {~l1a1.isRunning == true}{
4364                                         ~l8a1.set(\dur, ~f8 = ~freqmap.at(~freqmapval8 = ~freqmapval8.value-1));
4365                                         ~l8b1.set(\dur, ~f8);
4366                                         ~l8c1.set(\dur, ~f8/~icd3);
4367                                         ~l8d1.set(\dur, ~f8/~icd3);
4368                                         ~l8e1.set(\dur, ~f8/~icd6);
4369                                         ~l8f1.set(\dur, ~f8/~icd6);
4370                                 };
4371                                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (View(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (View(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
4372
4373                                 ~z25.background = Color.white; ~z1.background = Color.white;
4374                                 ~z26.background = Color.white; ~z2.background = Color.white;
4375                                 ~z27.background = Color.white; ~z3.background = Color.white;
4376                                 ~z28.background = Color.white; ~z4.background = Color.white;
4377                                 ~z29.background = Color.white; ~z5.background = Color.white;
4378                                 ~z30.background = Color.white; ~z6.background = Color.white;
4379                                 ~z31.background = Color.white; ~z7.background = Color.white;
4380                                 ~z32.background = Color.green; ~z8.background = Color.green;
4381                 });});
4382
4383
4384         };
4385
4386
4387         //if routine function values are nil
4388
4389         if(~rslot1a == nil, {~rslot1a = ~bplaceo1;}); if(~rslot1b == nil, {~rslot1b = ~bplacef1;});
4390         if(~rslot2 == nil, {~rslot2 = ~bplacef2;});
4391         if(~rslot3 == nil, {~rslot3 = ~bplacef3;});
4392         if(~rslot4 == nil, {~rslot4 = ~bplacef4;});
4393         if(~rslot5 == nil, {~rslot5 = ~bplacef5;});
4394         if(~rslot6 == nil, {~rslot6 = ~bplacef6;});
4395         if(~rslot7 == nil, {~rslot7 = ~bplacef7;});
4396         if(~rslot8 == nil, {~rslot8 = ~bplacef8;});
4397         if(~rtimeall == nil, {~rtimeall = 4;});
4398         if(~rtime1 == nil, {~rtime1 = 4;});
4399         if(~rtime2 == nil, {~rtime2 = 4;});
4400         if(~rtime3 == nil, {~rtime3 = 4;});
4401         if(~rtime4 == nil, {~rtime4 = 4;});
4402         if(~rtime5 == nil, {~rtime5 = 4;});
4403         if(~rtime6 == nil, {~rtime6 = 4;});
4404         if(~rtime7 == nil, {~rtime7 = 4;});
4405         if(~rtime8 == nil, {~rtime8 = 4;});
4406         if(~rdoall == nil, {~rdoall = 1;});
4407         if(~rdo1a == nil, {~rdo1a = "o1";}); if(~rdo1b == nil, {~rdo1b = "f1";});
4408         if(~rdo2 == nil, {~rdo2 = "f2";});
4409         if(~rdo3 == nil, {~rdo3 = "f3";});
4410         if(~rdo4 == nil, {~rdo4 = "f4";});
4411         if(~rdo5 == nil, {~rdo5 = "f5";});
4412         if(~rdo6 == nil, {~rdo6 = "f6";});
4413         if(~rdo7 == nil, {~rdo7 = "f7";});
4414         if(~rdo8 == nil, {~rdo8 = "f8";});
4415
4416
4417         //misc. routine button functions (see below)
4418
4419         ~si1aset = {
4420                 if(~si1a.value == "o1", {~rslot1a = ~bplaceo1; ~rdo1a = ~si1a.value;});
4421                 if(~si1a.value == "f1", {~rslot1a = ~bplacef1; ~rdo1a = ~si1a.value;});
4422                 if(~si1a.value == "s1", {~rslot1a = ~bplaces1; ~rdo1a = ~si1a.value;});
4423                 if(~si1a.value == "o2", {~rslot1a = ~bplaceo2; ~rdo1a = ~si1a.value;});
4424                 if(~si1a.value == "f2", {~rslot1a = ~bplacef2; ~rdo1a = ~si1a.value;});
4425                 if(~si1a.value == "s2", {~rslot1a = ~bplaces2; ~rdo1a = ~si1a.value;});
4426                 if(~si1a.value == "o3", {~rslot1a = ~bplaceo3; ~rdo1a = ~si1a.value;});
4427                 if(~si1a.value == "f3", {~rslot1a = ~bplacef3; ~rdo1a = ~si1a.value;});
4428                 if(~si1a.value == "s3", {~rslot1a = ~bplaces3; ~rdo1a = ~si1a.value;});
4429                 if(~si1a.value == "o4", {~rslot1a = ~bplaceo4; ~rdo1a = ~si1a.value;});
4430                 if(~si1a.value == "f4", {~rslot1a = ~bplacef4; ~rdo1a = ~si1a.value;});
4431                 if(~si1a.value == "s4", {~rslot1a = ~bplaces4; ~rdo1a = ~si1a.value;});
4432                 if(~si1a.value == "o5", {~rslot1a = ~bplaceo5; ~rdo1a = ~si1a.value;});
4433                 if(~si1a.value == "f5", {~rslot1a = ~bplacef5; ~rdo1a = ~si1a.value;});
4434                 if(~si1a.value == "s5", {~rslot1a = ~bplaces5; ~rdo1a = ~si1a.value;});
4435                 if(~si1a.value == "o6", {~rslot1a = ~bplaceo6; ~rdo1a = ~si1a.value;});
4436                 if(~si1a.value == "f6", {~rslot1a = ~bplacef6; ~rdo1a = ~si1a.value;});
4437                 if(~si1a.value == "s6", {~rslot1a = ~bplaces6; ~rdo1a = ~si1a.value;});
4438                 if(~si1a.value == "o7", {~rslot1a = ~bplaceo7; ~rdo1a = ~si1a.value;});
4439                 if(~si1a.value == "f7", {~rslot1a = ~bplacef7; ~rdo1a = ~si1a.value;});
4440                 if(~si1a.value == "s7", {~rslot1a = ~bplaces7; ~rdo1a = ~si1a.value;});
4441                 if(~si1a.value == "o8", {~rslot1a = ~bplaceo8; ~rdo1a = ~si1a.value;});
4442                 if(~si1a.value == "f8", {~rslot1a = ~bplacef8; ~rdo1a = ~si1a.value;});
4443                 if(~si1a.value == "s8", {~rslot1a = ~bplaces8; ~rdo1a = ~si1a.value;});
4444         };
4445         ~si1bset = {
4446                 if(~si1b.value == "o1", {~rslot1b = ~bplaceo1; ~rdo1b = ~si1b.value;});
4447                 if(~si1b.value == "f1", {~rslot1b = ~bplacef1; ~rdo1b = ~si1b.value;});
4448                 if(~si1b.value == "s1", {~rslot1b = ~bplaces1; ~rdo1b = ~si1b.value;});
4449                 if(~si1b.value == "o2", {~rslot1b = ~bplaceo2; ~rdo1b = ~si1b.value;});
4450                 if(~si1b.value == "f2", {~rslot1b = ~bplacef2; ~rdo1b = ~si1b.value;});
4451                 if(~si1b.value == "s2", {~rslot1b = ~bplaces2; ~rdo1b = ~si1b.value;});
4452                 if(~si1b.value == "o3", {~rslot1b = ~bplaceo3; ~rdo1b = ~si1b.value;});
4453                 if(~si1b.value == "f3", {~rslot1b = ~bplacef3; ~rdo1b = ~si1b.value;});
4454                 if(~si1b.value == "s3", {~rslot1b = ~bplaces3; ~rdo1b = ~si1b.value;});
4455                 if(~si1b.value == "o4", {~rslot1b = ~bplaceo4; ~rdo1b = ~si1b.value;});
4456                 if(~si1b.value == "f4", {~rslot1b = ~bplacef4; ~rdo1b = ~si1b.value;});
4457                 if(~si1b.value == "s4", {~rslot1b = ~bplaces4; ~rdo1b = ~si1b.value;});
4458                 if(~si1b.value == "o5", {~rslot1b = ~bplaceo5; ~rdo1b = ~si1b.value;});
4459                 if(~si1b.value == "f5", {~rslot1b = ~bplacef5; ~rdo1b = ~si1b.value;});
4460                 if(~si1b.value == "s5", {~rslot1b = ~bplaces5; ~rdo1b = ~si1b.value;});
4461                 if(~si1b.value == "o6", {~rslot1b = ~bplaceo6; ~rdo1b = ~si1b.value;});
4462                 if(~si1b.value == "f6", {~rslot1b = ~bplacef6; ~rdo1b = ~si1b.value;});
4463                 if(~si1b.value == "s6", {~rslot1b = ~bplaces6; ~rdo1b = ~si1b.value;});
4464                 if(~si1b.value == "o7", {~rslot1b = ~bplaceo7; ~rdo1b = ~si1b.value;});
4465                 if(~si1b.value == "f7", {~rslot1b = ~bplacef7; ~rdo1b = ~si1b.value;});
4466                 if(~si1b.value == "s7", {~rslot1b = ~bplaces7; ~rdo1b = ~si1b.value;});
4467                 if(~si1b.value == "o8", {~rslot1b = ~bplaceo8; ~rdo1b = ~si1b.value;});
4468                 if(~si1b.value == "f8", {~rslot1b = ~bplacef8; ~rdo1b = ~si1b.value;});
4469                 if(~si1b.value == "s8", {~rslot1b = ~bplaces8; ~rdo1b = ~si1b.value;});
4470         };
4471         ~si2set = {
4472                 if(~si2.value == "o1", {~rslot2 = ~bplaceo1; ~rdo2 = ~si2.value;});
4473                 if(~si2.value == "f1", {~rslot2 = ~bplacef1; ~rdo2 = ~si2.value;});
4474                 if(~si2.value == "s1", {~rslot2 = ~bplaces1; ~rdo2 = ~si2.value;});
4475                 if(~si2.value == "o2", {~rslot2 = ~bplaceo2; ~rdo2 = ~si2.value;});
4476                 if(~si2.value == "f2", {~rslot2 = ~bplacef2; ~rdo2 = ~si2.value;});
4477                 if(~si2.value == "s2", {~rslot2 = ~bplaces2; ~rdo2 = ~si2.value;});
4478                 if(~si2.value == "o3", {~rslot2 = ~bplaceo3; ~rdo2 = ~si2.value;});
4479                 if(~si2.value == "f3", {~rslot2 = ~bplacef3; ~rdo2 = ~si2.value;});
4480                 if(~si2.value == "s3", {~rslot2 = ~bplaces3; ~rdo2 = ~si2.value;});
4481                 if(~si2.value == "o4", {~rslot2 = ~bplaceo4; ~rdo2 = ~si2.value;});
4482                 if(~si2.value == "f4", {~rslot2 = ~bplacef4; ~rdo2 = ~si2.value;});
4483                 if(~si2.value == "s4", {~rslot2 = ~bplaces4; ~rdo2 = ~si2.value;});
4484                 if(~si2.value == "o5", {~rslot2 = ~bplaceo5; ~rdo2 = ~si2.value;});
4485                 if(~si2.value == "f5", {~rslot2 = ~bplacef5; ~rdo2 = ~si2.value;});
4486                 if(~si2.value == "s5", {~rslot2 = ~bplaces5; ~rdo2 = ~si2.value;});
4487                 if(~si2.value == "o6", {~rslot2 = ~bplaceo6; ~rdo2 = ~si2.value;});
4488                 if(~si2.value == "f6", {~rslot2 = ~bplacef6; ~rdo2 = ~si2.value;});
4489                 if(~si2.value == "s6", {~rslot2 = ~bplaces6; ~rdo2 = ~si2.value;});
4490                 if(~si2.value == "o7", {~rslot2 = ~bplaceo7; ~rdo2 = ~si2.value;});
4491                 if(~si2.value == "f7", {~rslot2 = ~bplacef7; ~rdo2 = ~si2.value;});
4492                 if(~si2.value == "s7", {~rslot2 = ~bplaces7; ~rdo2 = ~si2.value;});
4493                 if(~si2.value == "o8", {~rslot2 = ~bplaceo8; ~rdo2 = ~si2.value;});
4494                 if(~si2.value == "f8", {~rslot2 = ~bplacef8; ~rdo2 = ~si2.value;});
4495                 if(~si2.value == "s8", {~rslot2 = ~bplaces8; ~rdo2 = ~si2.value;});
4496         };
4497         ~si3set = {
4498                 if(~si3.value == "o1", {~rslot3 = ~bplaceo1; ~rdo3 = ~si3.value;});
4499                 if(~si3.value == "f1", {~rslot3 = ~bplacef1; ~rdo3 = ~si3.value;});
4500                 if(~si3.value == "s1", {~rslot3 = ~bplaces1; ~rdo3 = ~si3.value;});
4501                 if(~si3.value == "o2", {~rslot3 = ~bplaceo2; ~rdo3 = ~si3.value;});
4502                 if(~si3.value == "f2", {~rslot3 = ~bplacef2; ~rdo3 = ~si3.value;});
4503                 if(~si3.value == "s2", {~rslot3 = ~bplaces2; ~rdo3 = ~si3.value;});
4504                 if(~si3.value == "o3", {~rslot3 = ~bplaceo3; ~rdo3 = ~si3.value;});
4505                 if(~si3.value == "f3", {~rslot3 = ~bplacef3; ~rdo3 = ~si3.value;});
4506                 if(~si3.value == "s3", {~rslot3 = ~bplaces3; ~rdo3 = ~si3.value;});
4507                 if(~si3.value == "o4", {~rslot3 = ~bplaceo4; ~rdo3 = ~si3.value;});
4508                 if(~si3.value == "f4", {~rslot3 = ~bplacef4; ~rdo3 = ~si3.value;});
4509                 if(~si3.value == "s4", {~rslot3 = ~bplaces4; ~rdo3 = ~si3.value;});
4510                 if(~si3.value == "o5", {~rslot3 = ~bplaceo5; ~rdo3 = ~si3.value;});
4511                 if(~si3.value == "f5", {~rslot3 = ~bplacef5; ~rdo3 = ~si3.value;});
4512                 if(~si3.value == "s5", {~rslot3 = ~bplaces5; ~rdo3 = ~si3.value;});
4513                 if(~si3.value == "o6", {~rslot3 = ~bplaceo6; ~rdo3 = ~si3.value;});
4514                 if(~si3.value == "f6", {~rslot3 = ~bplacef6; ~rdo3 = ~si3.value;});
4515                 if(~si3.value == "s6", {~rslot3 = ~bplaces6; ~rdo3 = ~si3.value;});
4516                 if(~si3.value == "o7", {~rslot3 = ~bplaceo7; ~rdo3 = ~si3.value;});
4517                 if(~si3.value == "f7", {~rslot3 = ~bplacef7; ~rdo3 = ~si3.value;});
4518                 if(~si3.value == "s7", {~rslot3 = ~bplaces7; ~rdo3 = ~si3.value;});
4519                 if(~si3.value == "o8", {~rslot3 = ~bplaceo8; ~rdo3 = ~si3.value;});
4520                 if(~si3.value == "f8", {~rslot3 = ~bplacef8; ~rdo3 = ~si3.value;});
4521                 if(~si3.value == "s8", {~rslot3 = ~bplaces8; ~rdo3 = ~si3.value;});
4522         };
4523         ~si4set = {
4524                 if(~si4.value == "o1", {~rslot4 = ~bplaceo1; ~rdo4 = ~si4.value;});
4525                 if(~si4.value == "f1", {~rslot4 = ~bplacef1; ~rdo4 = ~si4.value;});
4526                 if(~si4.value == "s1", {~rslot4 = ~bplaces1; ~rdo4 = ~si4.value;});
4527                 if(~si4.value == "o2", {~rslot4 = ~bplaceo2; ~rdo4 = ~si4.value;});
4528                 if(~si4.value == "f2", {~rslot4 = ~bplacef2; ~rdo4 = ~si4.value;});
4529                 if(~si4.value == "s2", {~rslot4 = ~bplaces2; ~rdo4 = ~si4.value;});
4530                 if(~si4.value == "o3", {~rslot4 = ~bplaceo3; ~rdo4 = ~si4.value;});
4531                 if(~si4.value == "f3", {~rslot4 = ~bplacef3; ~rdo4 = ~si4.value;});
4532                 if(~si4.value == "s3", {~rslot4 = ~bplaces3; ~rdo4 = ~si4.value;});
4533                 if(~si4.value == "o4", {~rslot4 = ~bplaceo4; ~rdo4 = ~si4.value;});
4534                 if(~si4.value == "f4", {~rslot4 = ~bplacef4; ~rdo4 = ~si4.value;});
4535                 if(~si4.value == "s4", {~rslot4 = ~bplaces4; ~rdo4 = ~si4.value;});
4536                 if(~si4.value == "o5", {~rslot4 = ~bplaceo5; ~rdo4 = ~si4.value;});
4537                 if(~si4.value == "f5", {~rslot4 = ~bplacef5; ~rdo4 = ~si4.value;});
4538                 if(~si4.value == "s5", {~rslot4 = ~bplaces5; ~rdo4 = ~si4.value;});
4539                 if(~si4.value == "o6", {~rslot4 = ~bplaceo6; ~rdo4 = ~si4.value;});
4540                 if(~si4.value == "f6", {~rslot4 = ~bplacef6; ~rdo4 = ~si4.value;});
4541                 if(~si4.value == "s6", {~rslot4 = ~bplaces6; ~rdo4 = ~si4.value;});
4542                 if(~si4.value == "o7", {~rslot4 = ~bplaceo7; ~rdo4 = ~si4.value;});
4543                 if(~si4.value == "f7", {~rslot4 = ~bplacef7; ~rdo4 = ~si4.value;});
4544                 if(~si4.value == "s7", {~rslot4 = ~bplaces7; ~rdo4 = ~si4.value;});
4545                 if(~si4.value == "o8", {~rslot4 = ~bplaceo8; ~rdo4 = ~si4.value;});
4546                 if(~si4.value == "f8", {~rslot4 = ~bplacef8; ~rdo4 = ~si4.value;});
4547                 if(~si4.value == "s8", {~rslot4 = ~bplaces8; ~rdo4 = ~si4.value;});
4548         };
4549         ~si5set = {
4550                 if(~si5.value == "o1", {~rslot5 = ~bplaceo1; ~rdo5 = ~si5.value;});
4551                 if(~si5.value == "f1", {~rslot5 = ~bplacef1; ~rdo5 = ~si5.value;});
4552                 if(~si5.value == "s1", {~rslot5 = ~bplaces1; ~rdo5 = ~si5.value;});
4553                 if(~si5.value == "o2", {~rslot5 = ~bplaceo2; ~rdo5 = ~si5.value;});
4554                 if(~si5.value == "f2", {~rslot5 = ~bplacef2; ~rdo5 = ~si5.value;});
4555                 if(~si5.value == "s2", {~rslot5 = ~bplaces2; ~rdo5 = ~si5.value;});
4556                 if(~si5.value == "o3", {~rslot5 = ~bplaceo3; ~rdo5 = ~si5.value;});
4557                 if(~si5.value == "f3", {~rslot5 = ~bplacef3; ~rdo5 = ~si5.value;});
4558                 if(~si5.value == "s3", {~rslot5 = ~bplaces3; ~rdo5 = ~si5.value;});
4559                 if(~si5.value == "o4", {~rslot5 = ~bplaceo4; ~rdo5 = ~si5.value;});
4560                 if(~si5.value == "f4", {~rslot5 = ~bplacef4; ~rdo5 = ~si5.value;});
4561                 if(~si5.value == "s4", {~rslot5 = ~bplaces4; ~rdo5 = ~si5.value;});
4562                 if(~si5.value == "o5", {~rslot5 = ~bplaceo5; ~rdo5 = ~si5.value;});
4563                 if(~si5.value == "f5", {~rslot5 = ~bplacef5; ~rdo5 = ~si5.value;});
4564                 if(~si5.value == "s5", {~rslot5 = ~bplaces5; ~rdo5 = ~si5.value;});
4565                 if(~si5.value == "o6", {~rslot5 = ~bplaceo6; ~rdo5 = ~si5.value;});
4566                 if(~si5.value == "f6", {~rslot5 = ~bplacef6; ~rdo5 = ~si5.value;});
4567                 if(~si5.value == "s6", {~rslot5 = ~bplaces6; ~rdo5 = ~si5.value;});
4568                 if(~si5.value == "o7", {~rslot5 = ~bplaceo7; ~rdo5 = ~si5.value;});
4569                 if(~si5.value == "f7", {~rslot5 = ~bplacef7; ~rdo5 = ~si5.value;});
4570                 if(~si5.value == "s7", {~rslot5 = ~bplaces7; ~rdo5 = ~si5.value;});
4571                 if(~si5.value == "o8", {~rslot5 = ~bplaceo8; ~rdo5 = ~si5.value;});
4572                 if(~si5.value == "f8", {~rslot5 = ~bplacef8; ~rdo5 = ~si5.value;});
4573                 if(~si5.value == "s8", {~rslot5 = ~bplaces8; ~rdo5 = ~si5.value;});
4574         };
4575         ~si6set = {
4576                 if(~si6.value == "o1", {~rslot6 = ~bplaceo1; ~rdo6 = ~si6.value;});
4577                 if(~si6.value == "f1", {~rslot6 = ~bplacef1; ~rdo6 = ~si6.value;});
4578                 if(~si6.value == "s1", {~rslot6 = ~bplaces1; ~rdo6 = ~si6.value;});
4579                 if(~si6.value == "o2", {~rslot6 = ~bplaceo2; ~rdo6 = ~si6.value;});
4580                 if(~si6.value == "f2", {~rslot6 = ~bplacef2; ~rdo6 = ~si6.value;});
4581                 if(~si6.value == "s2", {~rslot6 = ~bplaces2; ~rdo6 = ~si6.value;});
4582                 if(~si6.value == "o3", {~rslot6 = ~bplaceo3; ~rdo6 = ~si6.value;});
4583                 if(~si6.value == "f3", {~rslot6 = ~bplacef3; ~rdo6 = ~si6.value;});
4584                 if(~si6.value == "s3", {~rslot6 = ~bplaces3; ~rdo6 = ~si6.value;});
4585                 if(~si6.value == "o4", {~rslot6 = ~bplaceo4; ~rdo6 = ~si6.value;});
4586                 if(~si6.value == "f4", {~rslot6 = ~bplacef4; ~rdo6 = ~si6.value;});
4587                 if(~si6.value == "s4", {~rslot6 = ~bplaces4; ~rdo6 = ~si6.value;});
4588                 if(~si6.value == "o5", {~rslot6 = ~bplaceo5; ~rdo6 = ~si6.value;});
4589                 if(~si6.value == "f5", {~rslot6 = ~bplacef5; ~rdo6 = ~si6.value;});
4590                 if(~si6.value == "s5", {~rslot6 = ~bplaces5; ~rdo6 = ~si6.value;});
4591                 if(~si6.value == "o6", {~rslot6 = ~bplaceo6; ~rdo6 = ~si6.value;});
4592                 if(~si6.value == "f6", {~rslot6 = ~bplacef6; ~rdo6 = ~si6.value;});
4593                 if(~si6.value == "s6", {~rslot6 = ~bplaces6; ~rdo6 = ~si6.value;});
4594                 if(~si6.value == "o7", {~rslot6 = ~bplaceo7; ~rdo6 = ~si6.value;});
4595                 if(~si6.value == "f7", {~rslot6 = ~bplacef7; ~rdo6 = ~si6.value;});
4596                 if(~si6.value == "s7", {~rslot6 = ~bplaces7; ~rdo6 = ~si6.value;});
4597                 if(~si6.value == "o8", {~rslot6 = ~bplaceo8; ~rdo6 = ~si6.value;});
4598                 if(~si6.value == "f8", {~rslot6 = ~bplacef8; ~rdo6 = ~si6.value;});
4599                 if(~si6.value == "s8", {~rslot6 = ~bplaces8; ~rdo6 = ~si6.value;});
4600         };
4601         ~si7set = {
4602                 if(~si7.value == "o1", {~rslot7 = ~bplaceo1; ~rdo7 = ~si7.value;});
4603                 if(~si7.value == "f1", {~rslot7 = ~bplacef1; ~rdo7 = ~si7.value;});
4604                 if(~si7.value == "s1", {~rslot7 = ~bplaces1; ~rdo7 = ~si7.value;});
4605                 if(~si7.value == "o2", {~rslot7 = ~bplaceo2; ~rdo7 = ~si7.value;});
4606                 if(~si7.value == "f2", {~rslot7 = ~bplacef2; ~rdo7 = ~si7.value;});
4607                 if(~si7.value == "s2", {~rslot7 = ~bplaces2; ~rdo7 = ~si7.value;});
4608                 if(~si7.value == "o3", {~rslot7 = ~bplaceo3; ~rdo7 = ~si7.value;});
4609                 if(~si7.value == "f3", {~rslot7 = ~bplacef3; ~rdo7 = ~si7.value;});
4610                 if(~si7.value == "s3", {~rslot7 = ~bplaces3; ~rdo7 = ~si7.value;});
4611                 if(~si7.value == "o4", {~rslot7 = ~bplaceo4; ~rdo7 = ~si7.value;});
4612                 if(~si7.value == "f4", {~rslot7 = ~bplacef4; ~rdo7 = ~si7.value;});
4613                 if(~si7.value == "s4", {~rslot7 = ~bplaces4; ~rdo7 = ~si7.value;});
4614                 if(~si7.value == "o5", {~rslot7 = ~bplaceo5; ~rdo7 = ~si7.value;});
4615                 if(~si7.value == "f5", {~rslot7 = ~bplacef5; ~rdo7 = ~si7.value;});
4616                 if(~si7.value == "s5", {~rslot7 = ~bplaces5; ~rdo7 = ~si7.value;});
4617                 if(~si7.value == "o6", {~rslot7 = ~bplaceo6; ~rdo7 = ~si7.value;});
4618                 if(~si7.value == "f6", {~rslot7 = ~bplacef6; ~rdo7 = ~si7.value;});
4619                 if(~si7.value == "s6", {~rslot7 = ~bplaces6; ~rdo7 = ~si7.value;});
4620                 if(~si7.value == "o7", {~rslot7 = ~bplaceo7; ~rdo7 = ~si7.value;});
4621                 if(~si7.value == "f7", {~rslot7 = ~bplacef7; ~rdo7 = ~si7.value;});
4622                 if(~si7.value == "s7", {~rslot7 = ~bplaces7; ~rdo7 = ~si7.value;});
4623                 if(~si7.value == "o8", {~rslot7 = ~bplaceo8; ~rdo7 = ~si7.value;});
4624                 if(~si7.value == "f8", {~rslot7 = ~bplacef8; ~rdo7 = ~si7.value;});
4625                 if(~si7.value == "s8", {~rslot7 = ~bplaces8; ~rdo7 = ~si7.value;});
4626         };
4627         ~si8set = {
4628                 if(~si8.value == "o1", {~rslot8 = ~bplaceo1; ~rdo8 = ~si8.value;});
4629                 if(~si8.value == "f1", {~rslot8 = ~bplacef1; ~rdo8 = ~si8.value;});
4630                 if(~si8.value == "s1", {~rslot8 = ~bplaces1; ~rdo8 = ~si8.value;});
4631                 if(~si8.value == "o2", {~rslot8 = ~bplaceo2; ~rdo8 = ~si8.value;});
4632                 if(~si8.value == "f2", {~rslot8 = ~bplacef2; ~rdo8 = ~si8.value;});
4633                 if(~si8.value == "s2", {~rslot8 = ~bplaces2; ~rdo8 = ~si8.value;});
4634                 if(~si8.value == "o3", {~rslot8 = ~bplaceo3; ~rdo8 = ~si8.value;});
4635                 if(~si8.value == "f3", {~rslot8 = ~bplacef3; ~rdo8 = ~si8.value;});
4636                 if(~si8.value == "s3", {~rslot8 = ~bplaces3; ~rdo8 = ~si8.value;});
4637                 if(~si8.value == "o4", {~rslot8 = ~bplaceo4; ~rdo8 = ~si8.value;});
4638                 if(~si8.value == "f4", {~rslot8 = ~bplacef4; ~rdo8 = ~si8.value;});
4639                 if(~si8.value == "s4", {~rslot8 = ~bplaces4; ~rdo8 = ~si8.value;});
4640                 if(~si8.value == "o5", {~rslot8 = ~bplaceo5; ~rdo8 = ~si8.value;});
4641                 if(~si8.value == "f5", {~rslot8 = ~bplacef5; ~rdo8 = ~si8.value;});
4642                 if(~si8.value == "s5", {~rslot8 = ~bplaces5; ~rdo8 = ~si8.value;});
4643                 if(~si8.value == "o6", {~rslot8 = ~bplaceo6; ~rdo8 = ~si8.value;});
4644                 if(~si8.value == "f6", {~rslot8 = ~bplacef6; ~rdo8 = ~si8.value;});
4645                 if(~si8.value == "s6", {~rslot8 = ~bplaces6; ~rdo8 = ~si8.value;});
4646                 if(~si8.value == "o7", {~rslot8 = ~bplaceo7; ~rdo8 = ~si8.value;});
4647                 if(~si8.value == "f7", {~rslot8 = ~bplacef7; ~rdo8 = ~si8.value;});
4648                 if(~si8.value == "s7", {~rslot8 = ~bplaces7; ~rdo8 = ~si8.value;});
4649                 if(~si8.value == "o8", {~rslot8 = ~bplaceo8; ~rdo8 = ~si8.value;});
4650                 if(~si8.value == "f8", {~rslot8 = ~bplacef8; ~rdo8 = ~si8.value;});
4651                 if(~si8.value == "s8", {~rslot8 = ~bplaces8; ~rdo8 = ~si8.value;});
4652         };
4653
4654
4655         //routine function button
4656
4657         ~rviewbutton = Button.new(w,Rect(Window.screenBounds.width-20-20,~bpt+69+5-(20/~gm),20,20/1.6180339887499)).states_([["r",Color.white,Color.black],["r",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
4658
4659                 if(button.value == 1, {
4660                         ({
4661                                 arg leftdo = 0 , leftdobox = 52, lefttime = leftdobox+widthbox+6, lefttimebox = lefttime+57, top = 0,width=52, height = 16,  widthbox=52, heightbox = 16, inc=0, lw = 0,  uw = 0, numw = 40;
4662                                 var tall, stall, iall, siall, st1, st2, st3, st4, st5, st6, st7, st8,  t1,t2,t3,t4,t5,t6,t7,t8,i1,i2,i3,i4,i5,i6,i7,i8;
4663                                 ~rview = View(w, Rect(Window.screenBounds.width-(340+46),Window.screenBounds.height-(340+46/1.6180339887499)-110,340+46,340+46/1.6180339887499)).front;
4664                                 /*w.view.decorator=FlowLayout(w.view.bounds);
4665                                 w.view.decorator.gap=2@2;*/
4666
4667                                 top = 0;
4668
4669                                 i1 = StaticText(~rview, Rect(leftdo , top=top, width, height)).background_(Color.black).string_("rslot1").stringColor_(Color.white);
4670                                 i2 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot2").stringColor_(Color.white);
4671                                 i3 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot3").stringColor_(Color.white);
4672                                 i4 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot4").stringColor_(Color.white);
4673                                 i5 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot5").stringColor_(Color.white);
4674                                 i6 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot6").stringColor_(Color.white);
4675                                 i7 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot7").stringColor_(Color.white);
4676                                 i8 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot8").stringColor_(Color.white);
4677
4678                                 top = 0;
4679
4680                                 ~si1a=TextField(~rview, Rect(leftdobox , top=top, widthbox/2, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo1a);
4681                                 ~si1b=TextField(~rview, Rect(leftdobox+(widthbox/2) , top=top, widthbox/2, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo1b);
4682                                 ~si2=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo2);
4683                                 ~si3=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo3);
4684                                 ~si4=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo4);
4685                                 ~si5=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo5);
4686                                 ~si6=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo6);
4687                                 ~si7=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo7);
4688                                 ~si8=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo8);
4689
4690                                 top = 0;
4691
4692                                 t1 = StaticText(~rview, Rect(lefttime , top=top, width, height)).background_(Color.black).string_("rtime1").stringColor_(Color.white);
4693                                 t2 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime2").stringColor_(Color.white);
4694                                 t3 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime3").stringColor_(Color.white);
4695                                 t4 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime4").stringColor_(Color.white);
4696                                 t5 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime5").stringColor_(Color.white);
4697                                 t6 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime6").stringColor_(Color.white);
4698                                 t7 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime7").stringColor_(Color.white);
4699                                 t8 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime8").stringColor_(Color.white);
4700                                 tall = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("all time").stringColor_(Color.white);
4701
4702
4703                                 top = 0;
4704
4705                                 st1=NumberBox(~rview, Rect(lefttimebox , top=top, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime1);
4706                                 st2=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime2);
4707                                 st3=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime3);
4708                                 st4=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime4);
4709                                 st5=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime5);
4710                                 st6=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime6);
4711                                 st7=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime7);
4712                                 st8=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime8);
4713                                 stall=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtimeall);
4714
4715                                 ~si1a.action_({~si1aset.value});
4716                                 ~si1b.action_({~si1bset.value});
4717                                 ~si2.action_({~si2set.value});
4718                                 ~si3.action_({~si3set.value});
4719                                 ~si4.action_({~si4set.value});
4720                                 ~si5.action_({~si5set.value});
4721                                 ~si6.action_({~si6set.value});
4722                                 ~si7.action_({~si7set.value});
4723                                 ~si8.action_({~si8set.value});
4724
4725                                 stall.action_({arg val;
4726                                         ~rtimeall = val.value;
4727                                         ~rtime1 = val.value;
4728                                         ~rtime2 = val.value;
4729                                         ~rtime3 = val.value;
4730                                         ~rtime4 = val.value;
4731                                         ~rtime5 = val.value;
4732                                         ~rtime6 = val.value;
4733                                         ~rtime7 = val.value;
4734                                         ~rtime8 = val.value;
4735                                         ~rview.close; ~rviewbutton.valueAction_(1);
4736                                 });
4737                                 st1.action_({arg val; ~rtime1 = val.value;});
4738                                 st2.action_({arg val; ~rtime2 = val.value;});
4739                                 st3.action_({arg val; ~rtime3 = val.value;});
4740                                 st4.action_({arg val; ~rtime4 = val.value;});
4741                                 st5.action_({arg val; ~rtime5 = val.value;});
4742                                 st6.action_({arg val; ~rtime6 = val.value;});
4743                                 st7.action_({arg val; ~rtime7 = val.value;});
4744                                 st8.action_({arg val; ~rtime8 = val.value;});
4745
4746                                 ~rview.background_(Color.black);
4747
4748                                 ~metronomeincr = 1;
4749
4750                                 ~routinebutton = Button.new(~rview,Rect(0, top+40, 40, 40/~gm)).states_([["loop",Color.white,Color.black],["stop",Color.white,Color.black]]).action_({arg button;
4751
4752                                         if(button.value == 1, {
4753
4754                                                 ~metronome = Task({
4755                                                         inf.do({
4756                                                                 AppClock.sched(0, {~metronomebutton.value = 1;});
4757                                                                 ~metronomeincr.wait;
4758                                                                 AppClock.sched(0, {~metronomebutton.value = 0;});
4759                                                                 ~metronomeincr.wait;
4760                                                         });
4761                                                 });
4762
4763                                                 ~loop = Task({
4764                                                         1.do({
4765                                                                 {~rslot1a.valueAction_(0)}.defer;
4766                                                                 ~rtime1.wait;
4767                                                                 {~rslot2.valueAction_(0)}.defer;
4768                                                                 ~rtime2.wait;
4769                                                                 {~rslot3.valueAction_(0)}.defer;
4770                                                                 ~rtime3.wait;
4771                                                                 {~rslot4.valueAction_(0)}.defer;
4772                                                                 ~rtime4.wait;
4773                                                                 {~rslot5.valueAction_(0)}.defer;
4774                                                                 ~rtime5.wait;
4775                                                                 {~rslot6.valueAction_(0)}.defer;
4776                                                                 ~rtime6.wait;
4777                                                                 {~rslot7.valueAction_(0)}.defer;
4778                                                                 ~rtime7.wait;
4779                                                                 {~rslot8.valueAction_(0)}.defer;
4780                                                                 ~rtime8.wait;
4781                                                         });
4782                                                         inf.do({
4783                                                                 {~rslot1b.valueAction_(0)}.defer;
4784                                                                 ~rtime1.wait;
4785                                                                 {~rslot2.valueAction_(0)}.defer;
4786                                                                 ~rtime2.wait;
4787                                                                 {~rslot3.valueAction_(0)}.defer;
4788                                                                 ~rtime3.wait;
4789                                                                 {~rslot4.valueAction_(0)}.defer;
4790                                                                 ~rtime4.wait;
4791                                                                 {~rslot5.valueAction_(0)}.defer;
4792                                                                 ~rtime5.wait;
4793                                                                 {~rslot6.valueAction_(0)}.defer;
4794                                                                 ~rtime6.wait;
4795                                                                 {~rslot7.valueAction_(0)}.defer;
4796                                                                 ~rtime7.wait;
4797                                                                 {~rslot8.valueAction_(0)}.defer;
4798                                                                 ~rtime8.wait;
4799                                                         });
4800                                         }); SystemClock(~metronome.start); SystemClock(~loop.start); ~numsynths.stop;}, {
4801
4802                                                 SystemClock(~metronome.stop); SystemClock(~loop.stop); SystemClock(~loop.reset); ~synthfree.value; ~pauseroutinebutton.value = 0; ~numsynths.stop; ~numsynthsfunc.value;});
4803                                 });
4804
4805                                 ~pauseroutinebutton = Button.new(~rview,Rect(50, top+40, 40, 40/~gm)).states_([["pause",Color.white,Color.black],["loop",Color.white,Color.black]]).action_({arg button;
4806
4807                                         if(button.value == 1, {SystemClock(~loop.pause); ~synthpause.value;}, {SystemClock(~loop.resume); ~synthflow.value;});
4808                                 });
4809
4810                                 ~closeroutinebutton = Button.new(~rview,Rect(220, top+40, 40, 40/~gm)).states_([["close",Color.white,Color.black]]).action_({arg button;
4811
4812                                         ~rview.close; ~rviewbutton.value = 0;
4813                                 });
4814
4815                                 ~metronomebutton = Button.new(~rview,Rect(120, top+40, 40, 40/~gm)).states_([["",Color.white,Color.red],["",Color.white,Color.blue]]).action_({arg button;});
4816
4817                         }.value);
4818
4819                         if(~loop.isPlaying == true, {~routinebutton.value = 1;});
4820                         ~rview.front;
4821                 }, {~rview.close});
4822         });
4823
4824
4825         //synth identifier function
4826
4827         ~synthmonitor = StaticText(w, Rect(Window.screenBounds.width-14,~bpt+49,18,18/1.6180339887499)).background_(Color.black).stringColor_(Color.white);
4828         ~synthmonitor.string = if(~currentsynth == nil, {"nil".asString});
4829
4830         ~synthmonitorfunc = {
4831                 ~synthmonitor.close;
4832                 ~synthmonitor = StaticText(w, Rect(Window.screenBounds.width-14,~bpt+49,18,18/1.6180339887499)).background_(Color.black).stringColor_(Color.white);
4833                 ~synthmonitor.string = ~currentsynth.asString;
4834                 ~synthmonitor.font = Font(size: 10);
4835         };
4836
4837         ~synthmonitorfunc.value;
4838
4839
4840         //cpu, # of ugens, # of synths, and current frequencies display
4841
4842         ~cpumonitor = StaticText(w, Rect(Window.screenBounds.width-500,~bpt-200,500,90/1.6180339887499)).background_(Color.black).stringColor_(Color.white);
4843         ~cpumonitor.close;
4844
4845         ~cpumonitorfunc =  {
4846                 ~cpumonitor.close;
4847                 ~cpumonitor = StaticText(w, Rect(20,~bpt-100,800,124/1.6180339887499)).background_(Color.black).stringColor_(Color.white);
4848                 if(~settingsbutton.value == 1, {~cpumonitorroutine.stop; ~cpumonitor.close; ~cpumonitorbutton.value = 0;});
4849                 ~cpumonitor.string =
4850                 "cpu: "+s.avgCPU.asString+"%"++"\n" ++
4851                 "ugens: "+s.numUGens.asString++"\n" ++
4852                 "synths: "+s.numSynths.asString++"\n" ++
4853                 /*"f1 = "++~f1.round(0.01)++", f2 = "++~f2.round(0.01)++", f3 = "++~f3.round(0.01)++", f4 = "++~f4.round(0.01)++", f5 = "++~f5.round(0.01)++", f6 = "++~f6.round(0.01)++","++"f7 = "++~f7.round(0.01)++", f8 = "++~f8.round(0.01);
4854                 */              ~f1.round(0.01)++", "++~f2.round(0.01)++", "++~f3.round(0.01)++", "++~f4.round(0.01)++", "++~f5.round(0.01)++", "++~f6.round(0.01)++", "++~f7.round(0.01)++", "++~f8.round(0.01);
4855                 /*[ ~f1.round(0.01), ~f2.round(0.01), ~f3.round(0.01),~f4.round(0.01),~f5.round(0.01),~f6.round(0.01),~f7.round(0.01),~f8.round(0.01) ].asString;
4856                 */      ~cpumonitor.font = Font(size: 14);
4857         };
4858
4859         ~cpumonitorroutine = Routine({
4860                 inf.do({
4861                         AppClock.sched(0, {
4862                                 ~cpumonitorfunc.value;
4863                         });
4864                         1.wait;
4865                 });
4866         });
4867
4868         ~cpumonitorbutton = Button.new(w,Rect(Window.screenBounds.width-20-20-20-20,~bpt+69+5,20,20/1.6180339887499)).states_([["cm",Color.white,Color.black],["cm",Color.white,Color.black]]).action_({arg button;
4869
4870                 if(button.value == 1, {
4871                         ~cpumonitorroutine.reset;
4872                         ~cpumonitorroutine.play;
4873                 }, {~cpumonitorroutine.stop; ~cpumonitor.close;});
4874
4875         });
4876
4877
4878         //information button
4879
4880         info = Button.new(w,Rect(Window.screenBounds.width-20-20,~bpt+69+5,20,20/1.6180339887499)).states_([["i",Color.white,Color.black],["i",Color.white,Color.black]]).action_({arg button;
4881
4882                 if(button.value == 1, {
4883                         ~hb = TextView(w, Rect(0,0, Window.screenBounds.width, Window.screenBounds.height-200)).background_(Color.black);
4884                         (~hb.string =
4885                                 "(scroll down to see more)"++"\n"++"\n"++"\n"++
4886                                 "ctrl/cmd-period: stop synth/free server"++"\n"++"\n"++"\n"++
4887                                 "GUI Buttons"++"\n"++"\n"++"\n"++
4888                                 "synth0/synth1: start/stop synth set"++"\n"++"\n"++
4889                                 "pause0/pause1: pause/unpause synth set"++"\n"++"\n"++
4890                                 "tsynth0/tsynth1: tsynth0 to allow timed synth set, then click on any o, f, or s button to time a progression. click on the stop timer button in the bottom right to stop the timer."++"\n"++"tsynth1 to dis-allow timed synth set"++"\n"++"\n"++
4891                                 "copy: copy frequency/note info"++"\n"++"\n"++
4892                                 "settings button:"++"\n"++"\n"++
4893                                 "     KWS number: change number of kw(King Wen) sequences in a timewave half-cycle (or amplitude x2). press set to load."++"\n"++"\n"++
4894                                 "     base(lowest) freq(hz): set the base(lowest) frequency of timewave cycle. press set to load."++"\n"++"\n"++
4895                                 "     synthdef type: psine1-psine3 (based on phi, with low-pass filter), hsine1-hsine3 (based on 19.47:360, with low-pass filter), psineuf1-psineuf3 (based on phi, without low-pass filter),"++"\n"++"     hsineuf1-hsineuf3 (based on 19.47:360, without low-pass filter) - set synthdef type. press set to load."++"\n"++"\n"++
4896                                 "     lp filter limit(hz): change the low-pass filter frequency limit. default is 1728. press set to load."++"\n"++"\n"++
4897                                 "     automate: setting for automated mid-timewave sequence events. press set to load."++"\n"++"\n"++
4898                                 "s1-s8: set/save note positions"++"\n"++"\n"++
4899                                 "g1-g8: groups of saved note positions"++"\n"++"\n"++
4900                                 "uc-u8: undo changes to set note positions. press set to load"++"\n"++"\n"++
4901                                 "rc, /rc: start recording/stop recording"++"\n"++"\n"++
4902                                 "prc: pause recording"++"\n"++"\n"++
4903                                 "o1-o8: play set/saved note positions by opening a new synth set"++"\n"++"\n"++
4904                                 "f1-f8: flow transition to set/saved note positions"++"\n"++"\n"++
4905                                 "s1-s8: slide transition to set/saved note positions"++"\n"++"\n"++
4906                                 "m/u: mute/unmute all"++"\n"++"\n"++
4907                                 "1-8: mute or unmute individual synth"++"\n"++"\n"++
4908                                 "cm: cpu percentage/number of ugens/number of synths display"++"\n"++"\n"++
4909                                 "rw: random western scale"++"\n"++"\n"++
4910                                 "re: random eastern scale"++"\n"++"\n"++
4911                                 "r: routine/loop function - rslot for synth set, rtime for time between transitions"++"\n"++"\n"++
4912                                 "eo: extra options - set frequencies, set slide time/increment"++"\n"++"\n"++
4913                                 "i: help"++"\n"++"\n"++
4914                                 "m: minimize window"++"\n"++"\n"++
4915                                 "c: close window"++"\n"++"\n"++"\n"++
4916                                 "Keyboard Functions (functionality will vary with device)"++"\n"++"\n"++"\n"++
4917                                 "s: start/stop synth set"++"\n"++"\n"++
4918                                 "space bar: pause/unpause synth set"++"\n"++"\n"++
4919                                 "ctrl-period/cmd-period: stop synth/free server"++"\n"++"\n"++
4920                                 "left/right arrow(or J and L): move down/up note"++"\n"++"\n"++
4921                                 "up/down arrow(or I and K): change synth for left/right arrow note function"++"\n"++"\n"++
4922                                 "#1-8 on keyboard: choose synth for left/right arrow note function"++"\n"++"\n"++
4923                                 "r: routine/loop function - rslot for synth set, rtime for time between transitions"++"\n"++"\n"++
4924                                 "m: mute/unmute all"++"\n"++"\n"++
4925                                 "c: copy function"++"\n"++"\n"++
4926                                 "t: timed synth function"++"\n"++"\n"++
4927                                 "esc: minimize window"
4928                                 ;
4929                         );
4930                         ~hb.stringColor = Color.white;
4931                 },
4932                 {~hb.close;});
4933         });
4934
4935
4936         //random notes button 1
4937
4938         ~randombutton1 = Button.new(w,Rect(Window.screenBounds.width-20-20-20-20,~bpt+69+5-(20/~gm),20,20/1.6180339887499)).states_([["rw",Color.white,Color.black]]).action_({arg button;
4939
4940                 if((~l1a.isRunning == true) or: (~l1a1.isRunning == true), {
4941                         8.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut(~freqmap.at(rrand(36, 91));)});
4942                         ~synthflow.value;
4943                 });
4944         });
4945
4946
4947         //random notes button 2
4948
4949         ~randombutton2 = Button.new(w,Rect(Window.screenBounds.width-20-20-20,~bpt+69+5-(20/~gm),20,20/1.6180339887499)).states_([["re",Color.white,Color.black]]).action_({arg button;
4950
4951                 if((~l1a.isRunning == true) or: (~l1a1.isRunning == true), {
4952                         8.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut((~freqmap.at(127)/8).rand;)});
4953                         ~synthflow.value;
4954                 });
4955         });
4956
4957
4958         //setgroup buttons, sg1-sg8
4959
4960         ~setgroup1 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)-(20*4),~bpt+69+5,20,20/1.6180339887499)).states_([["g1",Color.white,Color.black],["s1",Color.green,Color.black]]).action_({arg button;
4961
4962                 if(button.value == 1, {
4963                         12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([~sg1a1,~sg1a2,~sg1a3,~sg1a4,~sg1a5,~sg1a6,~sg1a7,~sg1a8,~sg1a9,~sg1a10,~sg1a11,~sg1a12].at(x-1))});
4964                         12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([~sg1b1,~sg1b2,~sg1b3,~sg1b4,~sg1b5,~sg1b6,~sg1b7,~sg1b8,~sg1b9,~sg1b10,~sg1b11,~sg1b12].at(x-1))});
4965                         12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([~sg1c1,~sg1c2,~sg1c3,~sg1c4,~sg1c5,~sg1c6,~sg1c7,~sg1c8,~sg1c9,~sg1c10,~sg1c11,~sg1c12].at(x-1))});
4966                         12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([~sg1d1,~sg1d2,~sg1d3,~sg1d4,~sg1d5,~sg1d6,~sg1d7,~sg1d8,~sg1d9,~sg1d10,~sg1d11,~sg1d12].at(x-1))});
4967                         12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([~sg1e1,~sg1e2,~sg1e3,~sg1e4,~sg1e5,~sg1e6,~sg1e7,~sg1e8,~sg1e9,~sg1e10,~sg1e11,~sg1e12].at(x-1))});
4968                         12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([~sg1f1,~sg1f2,~sg1f3,~sg1f4,~sg1f5,~sg1f6,~sg1f7,~sg1f8,~sg1f9,~sg1f10,~sg1f11,~sg1f12].at(x-1))});
4969                         12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([~sg1g1,~sg1g2,~sg1g3,~sg1g4,~sg1g5,~sg1g6,~sg1g7,~sg1g8,~sg1g9,~sg1g10,~sg1g11,~sg1g12].at(x-1))});
4970                         12.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([~sg1h1,~sg1h2,~sg1h3,~sg1h4,~sg1h5,~sg1h6,~sg1h7,~sg1h8,~sg1h9,~sg1h10,~sg1h11,~sg1h12].at(x-1))});
4971
4972                         ~setgroup2.value = 0;
4973                         ~setgroup3.value = 0;
4974                         ~setgroup4.value = 0;
4975                         ~setgroup5.value = 0;
4976                         ~setgroup6.value = 0;
4977                         ~setgroup7.value = 0;
4978                         ~setgroup8.value = 0;
4979
4980                         ~setgroupval = 1;
4981                 });
4982         });
4983         ~setgroup2 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)-(20*3),~bpt+69+5,20,20/1.6180339887499)).states_([["g2",Color.white,Color.black],["s2",Color.green,Color.black]]).action_({arg button;
4984
4985                 if(button.value == 1, {
4986                         12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([~sg2a1,~sg2a2,~sg2a3,~sg2a4,~sg2a5,~sg2a6,~sg2a7,~sg2a8,~sg2a9,~sg2a10,~sg2a11,~sg2a12].at(x-1))});
4987                         12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([~sg2b1,~sg2b2,~sg2b3,~sg2b4,~sg2b5,~sg2b6,~sg2b7,~sg2b8,~sg2b9,~sg2b10,~sg2b11,~sg2b12].at(x-1))});
4988                         12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([~sg2c1,~sg2c2,~sg2c3,~sg2c4,~sg2c5,~sg2c6,~sg2c7,~sg2c8,~sg2c9,~sg2c10,~sg2c11,~sg2c12].at(x-1))});
4989                         12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([~sg2d1,~sg2d2,~sg2d3,~sg2d4,~sg2d5,~sg2d6,~sg2d7,~sg2d8,~sg2d9,~sg2d10,~sg2d11,~sg2d12].at(x-1))});
4990                         12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([~sg2e1,~sg2e2,~sg2e3,~sg2e4,~sg2e5,~sg2e6,~sg2e7,~sg2e8,~sg2e9,~sg2e10,~sg2e11,~sg2e12].at(x-1))});
4991                         12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([~sg2f1,~sg2f2,~sg2f3,~sg2f4,~sg2f5,~sg2f6,~sg2f7,~sg2f8,~sg2f9,~sg2f10,~sg2f11,~sg2f12].at(x-1))});
4992                         12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([~sg2g1,~sg2g2,~sg2g3,~sg2g4,~sg2g5,~sg2g6,~sg2g7,~sg2g8,~sg2g9,~sg2g10,~sg2g11,~sg2g12].at(x-1))});
4993                         12.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([~sg2h1,~sg2h2,~sg2h3,~sg2h4,~sg2h5,~sg2h6,~sg2h7,~sg2h8,~sg2h9,~sg2h10,~sg2h11,~sg2h12].at(x-1))});
4994
4995                         ~setgroup1.value = 0;
4996                         ~setgroup3.value = 0;
4997                         ~setgroup4.value = 0;
4998                         ~setgroup5.value = 0;
4999                         ~setgroup6.value = 0;
5000                         ~setgroup7.value = 0;
5001                         ~setgroup8.value = 0;
5002
5003                         ~setgroupval = 2;
5004                 });
5005         });
5006         ~setgroup3 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)-(20*2),~bpt+69+5,20,20/1.6180339887499)).states_([["g3",Color.white,Color.black],["s3",Color.green,Color.black]]).action_({arg button;
5007
5008                 if(button.value == 1, {
5009                         12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([~sg3a1,~sg3a2,~sg3a3,~sg3a4,~sg3a5,~sg3a6,~sg3a7,~sg3a8,~sg3a9,~sg3a10,~sg3a11,~sg3a12].at(x-1))});
5010                         12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([~sg3b1,~sg3b2,~sg3b3,~sg3b4,~sg3b5,~sg3b6,~sg3b7,~sg3b8,~sg3b9,~sg3b10,~sg3b11,~sg3b12].at(x-1))});
5011                         12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([~sg3c1,~sg3c2,~sg3c3,~sg3c4,~sg3c5,~sg3c6,~sg3c7,~sg3c8,~sg3c9,~sg3c10,~sg3c11,~sg3c12].at(x-1))});
5012                         12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([~sg3d1,~sg3d2,~sg3d3,~sg3d4,~sg3d5,~sg3d6,~sg3d7,~sg3d8,~sg3d9,~sg3d10,~sg3d11,~sg3d12].at(x-1))});
5013                         12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([~sg3e1,~sg3e2,~sg3e3,~sg3e4,~sg3e5,~sg3e6,~sg3e7,~sg3e8,~sg3e9,~sg3e10,~sg3e11,~sg3e12].at(x-1))});
5014                         12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([~sg3f1,~sg3f2,~sg3f3,~sg3f4,~sg3f5,~sg3f6,~sg3f7,~sg3f8,~sg3f9,~sg3f10,~sg3f11,~sg3f12].at(x-1))});
5015                         12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([~sg3g1,~sg3g2,~sg3g3,~sg3g4,~sg3g5,~sg3g6,~sg3g7,~sg3g8,~sg3g9,~sg3g10,~sg3g11,~sg3g12].at(x-1))});
5016                         12.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([~sg3h1,~sg3h2,~sg3h3,~sg3h4,~sg3h5,~sg3h6,~sg3h7,~sg3h8,~sg3h9,~sg3h10,~sg3h11,~sg3h12].at(x-1))});
5017
5018                         ~setgroup1.value = 0;
5019                         ~setgroup2.value = 0;
5020                         ~setgroup4.value = 0;
5021                         ~setgroup5.value = 0;
5022                         ~setgroup6.value = 0;
5023                         ~setgroup7.value = 0;
5024                         ~setgroup8.value = 0;
5025
5026                         ~setgroupval = 3;
5027                 });
5028         });
5029         ~setgroup4 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)-(20*1),~bpt+69+5,20,20/1.6180339887499)).states_([["g4",Color.white,Color.black],["s4",Color.green,Color.black]]).action_({arg button;
5030
5031                 if(button.value == 1, {
5032                         12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([~sg4a1,~sg4a2,~sg4a3,~sg4a4,~sg4a5,~sg4a6,~sg4a7,~sg4a8,~sg4a9,~sg4a10,~sg4a11,~sg4a12].at(x-1))});
5033                         12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([~sg4b1,~sg4b2,~sg4b3,~sg4b4,~sg4b5,~sg4b6,~sg4b7,~sg4b8,~sg4b9,~sg4b10,~sg4b11,~sg4b12].at(x-1))});
5034                         12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([~sg4c1,~sg4c2,~sg4c3,~sg4c4,~sg4c5,~sg4c6,~sg4c7,~sg4c8,~sg4c9,~sg4c10,~sg4c11,~sg4c12].at(x-1))});
5035                         12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([~sg4d1,~sg4d2,~sg4d3,~sg4d4,~sg4d5,~sg4d6,~sg4d7,~sg4d8,~sg4d9,~sg4d10,~sg4d11,~sg4d12].at(x-1))});
5036                         12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([~sg4e1,~sg4e2,~sg4e3,~sg4e4,~sg4e5,~sg4e6,~sg4e7,~sg4e8,~sg4e9,~sg4e10,~sg4e11,~sg4e12].at(x-1))});
5037                         12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([~sg4f1,~sg4f2,~sg4f3,~sg4f4,~sg4f5,~sg4f6,~sg4f7,~sg4f8,~sg4f9,~sg4f10,~sg4f11,~sg4f12].at(x-1))});
5038                         12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([~sg4g1,~sg4g2,~sg4g3,~sg4g4,~sg4g5,~sg4g6,~sg4g7,~sg4g8,~sg4g9,~sg4g10,~sg4g11,~sg4g12].at(x-1))});
5039                         12.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([~sg4h1,~sg4h2,~sg4h3,~sg4h4,~sg4h5,~sg4h6,~sg4h7,~sg4h8,~sg4h9,~sg4h10,~sg4h11,~sg4h12].at(x-1))});
5040
5041                         ~setgroup1.value = 0;
5042                         ~setgroup2.value = 0;
5043                         ~setgroup3.value = 0;
5044                         ~setgroup5.value = 0;
5045                         ~setgroup6.value = 0;
5046                         ~setgroup7.value = 0;
5047                         ~setgroup8.value = 0;
5048
5049                         ~setgroupval = 4;
5050                 });
5051         });
5052         ~setgroup5 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)+(0*1),~bpt+69+5,20,20/1.6180339887499)).states_([["g5",Color.white,Color.black],["s5",Color.green,Color.black]]).action_({arg button;
5053
5054                 if(button.value == 1, {
5055                         12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([~sg5a1,~sg5a2,~sg5a3,~sg5a4,~sg5a5,~sg5a6,~sg5a7,~sg5a8,~sg5a9,~sg5a10,~sg5a11,~sg5a12].at(x-1))});
5056                         12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([~sg5b1,~sg5b2,~sg5b3,~sg5b4,~sg5b5,~sg5b6,~sg5b7,~sg5b8,~sg5b9,~sg5b10,~sg5b11,~sg5b12].at(x-1))});
5057                         12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([~sg5c1,~sg5c2,~sg5c3,~sg5c4,~sg5c5,~sg5c6,~sg5c7,~sg5c8,~sg5c9,~sg5c10,~sg5c11,~sg5c12].at(x-1))});
5058                         12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([~sg5d1,~sg5d2,~sg5d3,~sg5d4,~sg5d5,~sg5d6,~sg5d7,~sg5d8,~sg5d9,~sg5d10,~sg5d11,~sg5d12].at(x-1))});
5059                         12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([~sg5e1,~sg5e2,~sg5e3,~sg5e4,~sg5e5,~sg5e6,~sg5e7,~sg5e8,~sg5e9,~sg5e10,~sg5e11,~sg5e12].at(x-1))});
5060                         12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([~sg5f1,~sg5f2,~sg5f3,~sg5f4,~sg5f5,~sg5f6,~sg5f7,~sg5f8,~sg5f9,~sg5f10,~sg5f11,~sg5f12].at(x-1))});
5061                         12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([~sg5g1,~sg5g2,~sg5g3,~sg5g4,~sg5g5,~sg5g6,~sg5g7,~sg5g8,~sg5g9,~sg5g10,~sg5g11,~sg5g12].at(x-1))});
5062                         12.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([~sg5h1,~sg5h2,~sg5h3,~sg5h4,~sg5h5,~sg5h6,~sg5h7,~sg5h8,~sg5h9,~sg5h10,~sg5h11,~sg5h12].at(x-1))});
5063
5064                         ~setgroup1.value = 0;
5065                         ~setgroup2.value = 0;
5066                         ~setgroup3.value = 0;
5067                         ~setgroup4.value = 0;
5068                         ~setgroup6.value = 0;
5069                         ~setgroup7.value = 0;
5070                         ~setgroup8.value = 0;
5071
5072                         ~setgroupval = 5;
5073                 });
5074         });
5075         ~setgroup6 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)+(20*1),~bpt+69+5,20,20/1.6180339887499)).states_([["g6",Color.white,Color.black],["s6",Color.green,Color.black]]).action_({arg button;
5076
5077                 if(button.value == 1, {
5078                         12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([~sg6a1,~sg6a2,~sg6a3,~sg6a4,~sg6a5,~sg6a6,~sg6a7,~sg6a8,~sg6a9,~sg6a10,~sg6a11,~sg6a12].at(x-1))});
5079                         12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([~sg6b1,~sg6b2,~sg6b3,~sg6b4,~sg6b5,~sg6b6,~sg6b7,~sg6b8,~sg6b9,~sg6b10,~sg6b11,~sg6b12].at(x-1))});
5080                         12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([~sg6c1,~sg6c2,~sg6c3,~sg6c4,~sg6c5,~sg6c6,~sg6c7,~sg6c8,~sg6c9,~sg6c10,~sg6c11,~sg6c12].at(x-1))});
5081                         12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([~sg6d1,~sg6d2,~sg6d3,~sg6d4,~sg6d5,~sg6d6,~sg6d7,~sg6d8,~sg6d9,~sg6d10,~sg6d11,~sg6d12].at(x-1))});
5082                         12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([~sg6e1,~sg6e2,~sg6e3,~sg6e4,~sg6e5,~sg6e6,~sg6e7,~sg6e8,~sg6e9,~sg6e10,~sg6e11,~sg6e12].at(x-1))});
5083                         12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([~sg6f1,~sg6f2,~sg6f3,~sg6f4,~sg6f5,~sg6f6,~sg6f7,~sg6f8,~sg6f9,~sg6f10,~sg6f11,~sg6f12].at(x-1))});
5084                         12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([~sg6g1,~sg6g2,~sg6g3,~sg6g4,~sg6g5,~sg6g6,~sg6g7,~sg6g8,~sg6g9,~sg6g10,~sg6g11,~sg6g12].at(x-1))});
5085                         12.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([~sg6h1,~sg6h2,~sg6h3,~sg6h4,~sg6h5,~sg6h6,~sg6h7,~sg6h8,~sg6h9,~sg6h10,~sg6h11,~sg6h12].at(x-1))});
5086
5087                         ~setgroup1.value = 0;
5088                         ~setgroup2.value = 0;
5089                         ~setgroup3.value = 0;
5090                         ~setgroup4.value = 0;
5091                         ~setgroup5.value = 0;
5092                         ~setgroup7.value = 0;
5093                         ~setgroup8.value = 0;
5094
5095                         ~setgroupval = 6;
5096                 });
5097         });
5098         ~setgroup7 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)+(20*2),~bpt+69+5,20,20/1.6180339887499)).states_([["g7",Color.white,Color.black],["s7",Color.green,Color.black]]).action_({arg button;
5099
5100                 if(button.value == 1, {
5101                         12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([~sg7a1,~sg7a2,~sg7a3,~sg7a4,~sg7a5,~sg7a6,~sg7a7,~sg7a8,~sg7a9,~sg7a10,~sg7a11,~sg7a12].at(x-1))});
5102                         12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([~sg7b1,~sg7b2,~sg7b3,~sg7b4,~sg7b5,~sg7b6,~sg7b7,~sg7b8,~sg7b9,~sg7b10,~sg7b11,~sg7b12].at(x-1))});
5103                         12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([~sg7c1,~sg7c2,~sg7c3,~sg7c4,~sg7c5,~sg7c6,~sg7c7,~sg7c8,~sg7c9,~sg7c10,~sg7c11,~sg7c12].at(x-1))});
5104                         12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([~sg7d1,~sg7d2,~sg7d3,~sg7d4,~sg7d5,~sg7d6,~sg7d7,~sg7d8,~sg7d9,~sg7d10,~sg7d11,~sg7d12].at(x-1))});
5105                         12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([~sg7e1,~sg7e2,~sg7e3,~sg7e4,~sg7e5,~sg7e6,~sg7e7,~sg7e8,~sg7e9,~sg7e10,~sg7e11,~sg7e12].at(x-1))});
5106                         12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([~sg7f1,~sg7f2,~sg7f3,~sg7f4,~sg7f5,~sg7f6,~sg7f7,~sg7f8,~sg7f9,~sg7f10,~sg7f11,~sg7f12].at(x-1))});
5107                         12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([~sg7g1,~sg7g2,~sg7g3,~sg7g4,~sg7g5,~sg7g6,~sg7g7,~sg7g8,~sg7g9,~sg7g10,~sg7g11,~sg7g12].at(x-1))});
5108                         12.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([~sg7h1,~sg7h2,~sg7h3,~sg7h4,~sg7h5,~sg7h6,~sg7h7,~sg7h8,~sg7h9,~sg7h10,~sg7h11,~sg7h12].at(x-1))});
5109
5110                         ~setgroup1.value = 0;
5111                         ~setgroup2.value = 0;
5112                         ~setgroup3.value = 0;
5113                         ~setgroup4.value = 0;
5114                         ~setgroup5.value = 0;
5115                         ~setgroup6.value = 0;
5116                         ~setgroup8.value = 0;
5117
5118                         ~setgroupval = 7;
5119                 });
5120         });
5121         ~setgroup8 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)+(20*3),~bpt+69+5,20,20/1.6180339887499)).states_([["g8",Color.white,Color.black],["s8",Color.green,Color.black]]).action_({arg button;
5122
5123                 if(button.value == 1, {
5124                         12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([~sg8a1,~sg8a2,~sg8a3,~sg8a4,~sg8a5,~sg8a6,~sg8a7,~sg8a8,~sg8a9,~sg8a10,~sg8a11,~sg8a12].at(x-1))});
5125                         12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([~sg8b1,~sg8b2,~sg8b3,~sg8b4,~sg8b5,~sg8b6,~sg8b7,~sg8b8,~sg8b9,~sg8b10,~sg8b11,~sg8b12].at(x-1))});
5126                         12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([~sg8c1,~sg8c2,~sg8c3,~sg8c4,~sg8c5,~sg8c6,~sg8c7,~sg8c8,~sg8c9,~sg8c10,~sg8c11,~sg8c12].at(x-1))});
5127                         12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([~sg8d1,~sg8d2,~sg8d3,~sg8d4,~sg8d5,~sg8d6,~sg8d7,~sg8d8,~sg8d9,~sg8d10,~sg8d11,~sg8d12].at(x-1))});
5128                         12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([~sg8e1,~sg8e2,~sg8e3,~sg8e4,~sg8e5,~sg8e6,~sg8e7,~sg8e8,~sg8e9,~sg8e10,~sg8e11,~sg8e12].at(x-1))});
5129                         12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([~sg8f1,~sg8f2,~sg8f3,~sg8f4,~sg8f5,~sg8f6,~sg8f7,~sg8f8,~sg8f9,~sg8f10,~sg8f11,~sg8f12].at(x-1))});
5130                         12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([~sg8g1,~sg8g2,~sg8g3,~sg8g4,~sg8g5,~sg8g6,~sg8g7,~sg8g8,~sg8g9,~sg8g10,~sg8g11,~sg8g12].at(x-1))});
5131                         12.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([~sg8h1,~sg8h2,~sg8h3,~sg8h4,~sg8h5,~sg8h6,~sg8h7,~sg8h8,~sg8h9,~sg8h10,~sg8h11,~sg8h12].at(x-1))});
5132
5133                         ~setgroup1.value = 0;
5134                         ~setgroup2.value = 0;
5135                         ~setgroup3.value = 0;
5136                         ~setgroup4.value = 0;
5137                         ~setgroup5.value = 0;
5138                         ~setgroup6.value = 0;
5139                         ~setgroup7.value = 0;
5140
5141                         ~setgroupval = 8;
5142                 });
5143         });
5144
5145
5146         //if setgroup values are nil
5147
5148         if(~setgroupval == nil, {~setgroup1.value = 1;});
5149         if(~setgroupval == 1, {~setgroup1.value = 1;});
5150         if(~setgroupval == 2, {~setgroup2.value = 1;});
5151         if(~setgroupval == 3, {~setgroup3.value = 1;});
5152         if(~setgroupval == 4, {~setgroup4.value = 1;});
5153         if(~setgroupval == 5, {~setgroup5.value = 1;});
5154         if(~setgroupval == 6, {~setgroup6.value = 1;});
5155         if(~setgroupval == 7, {~setgroup7.value = 1;});
5156         if(~setgroupval == 8, {~setgroup8.value = 1;});
5157
5158
5159         //save chord notes buttons, s1-s8
5160
5161         n1 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)-(60*2),Window.screenBounds.height-88,60,60/1.6180339887499)).states_([["s1",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button; if(((button.value == 0) or: (button.value == 1)), {~r1=~fp1;~r2=~fp2;~r3=~fp3;~r4=~fp4;~r5=~fp5;~r6=~fp6;~r7=~fp7;~r8=~fp8;~r9=~fp9;~r10=~fp10;~r11=~fp11;~r12=~fp12; 12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))}); "s"++"\n"++[ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].asString.postString; ~u1=~f1;~u2=~f2;~u3=~f3;~u4=~f4;~u5=~f5;~u6=~f6;~u7=~f7;~u8=~f8;~u9=~f9;~u10=~f10;~u11=~f11;~u12=~f12; ~si1aset.value;~si1bset.value;
5162
5163                 if(~setgroup1.value == 1, {12.do(x = 0; {("sg1a"++(x=x+1)).asSymbol.envirPut([~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8,~fp9,~fp10,~fp11,~fp12].at(x-1))});});
5164                 if(~setgroup2.value == 1, {12.do(x = 0; {("sg2a"++(x=x+1)).asSymbol.envirPut([~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8,~fp9,~fp10,~fp11,~fp12].at(x-1))});});
5165                 if(~setgroup3.value == 1, {12.do(x = 0; {("sg3a"++(x=x+1)).asSymbol.envirPut([~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8,~fp9,~fp10,~fp11,~fp12].at(x-1))});});
5166                 if(~setgroup4.value == 1, {12.do(x = 0; {("sg4a"++(x=x+1)).asSymbol.envirPut([~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8,~fp9,~fp10,~fp11,~fp12].at(x-1))});});
5167                 if(~setgroup5.value == 1, {12.do(x = 0; {("sg5a"++(x=x+1)).asSymbol.envirPut([~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8,~fp9,~fp10,~fp11,~fp12].at(x-1))});});
5168                 if(~setgroup6.value == 1, {12.do(x = 0; {("sg6a"++(x=x+1)).asSymbol.envirPut([~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8,~fp9,~fp10,~fp11,~fp12].at(x-1))});});
5169                 if(~setgroup7.value == 1, {12.do(x = 0; {("sg7a"++(x=x+1)).asSymbol.envirPut([~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8,~fp9,~fp10,~fp11,~fp12].at(x-1))});});
5170                 if(~setgroup8.value == 1, {12.do(x = 0; {("sg8a"++(x=x+1)).asSymbol.envirPut([~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8,~fp9,~fp10,~fp11,~fp12].at(x-1))});});
5171
5172                 n1.states_([["s1",Color.green,Color.black]]);
5173                 n2.states_([["s2",Color.white,Color.black]]);
5174                 n3.states_([["s3",Color.white,Color.black]]);
5175                 n4.states_([["s4",Color.white,Color.black]]);
5176                 n5.states_([["s5",Color.white,Color.black]]);
5177                 n6.states_([["s6",Color.white,Color.black]]);
5178                 n7.states_([["s7",Color.white,Color.black]]);
5179                 n8.states_([["s8",Color.white,Color.black]]);
5180         });});
5181
5182         n2 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)-(60*1),Window.screenBounds.height-88,60,60/1.6180339887499)).states_([["s2",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button; if(((button.value == 0) or: (button.value == 1)), {~r1b=~fp1b;~r2b=~fp2b;~r3b=~fp3b;~r4b=~fp4b;~r5b=~fp5b;~r6b=~fp6b;~r7b=~fp7b;~r8b=~fp8b;~r9b=~fp9b;~r10b=~fp10b;~r11b=~fp11b;~r12b=~fp12b; 12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))}); "s"++"\n"++[ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].asString.postString; ~u1b=~f1;~u2b=~f2;~u3b=~f3;~u4b=~f4;~u5b=~f5;~u6b=~f6;~u7b=~f7;~u8b=~f8;~u9b=~f9;~u10b=~f10;~u11b=~f11;~u12b=~f12; ~si2set.value;
5183
5184                 if(~setgroup1.value == 1, {12.do(x = 0; {("sg1b"++(x=x+1)).asSymbol.envirPut([~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b,~fp9b,~fp10b,~fp11b,~fp12b].at(x-1))});});
5185                 if(~setgroup2.value == 1, {12.do(x = 0; {("sg2b"++(x=x+1)).asSymbol.envirPut([~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b,~fp9b,~fp10b,~fp11b,~fp12b].at(x-1))});});
5186                 if(~setgroup3.value == 1, {12.do(x = 0; {("sg3b"++(x=x+1)).asSymbol.envirPut([~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b,~fp9b,~fp10b,~fp11b,~fp12b].at(x-1))});});
5187                 if(~setgroup4.value == 1, {12.do(x = 0; {("sg4b"++(x=x+1)).asSymbol.envirPut([~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b,~fp9b,~fp10b,~fp11b,~fp12b].at(x-1))});});
5188                 if(~setgroup5.value == 1, {12.do(x = 0; {("sg5b"++(x=x+1)).asSymbol.envirPut([~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b,~fp9b,~fp10b,~fp11b,~fp12b].at(x-1))});});
5189                 if(~setgroup6.value == 1, {12.do(x = 0; {("sg6b"++(x=x+1)).asSymbol.envirPut([~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b,~fp9b,~fp10b,~fp11b,~fp12b].at(x-1))});});
5190                 if(~setgroup7.value == 1, {12.do(x = 0; {("sg7b"++(x=x+1)).asSymbol.envirPut([~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b,~fp9b,~fp10b,~fp11b,~fp12b].at(x-1))});});
5191                 if(~setgroup8.value == 1, {12.do(x = 0; {("sg8b"++(x=x+1)).asSymbol.envirPut([~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b,~fp9b,~fp10b,~fp11b,~fp12b].at(x-1))});});
5192
5193                 n1.states_([["s1",Color.white,Color.black]]);
5194                 n2.states_([["s2",Color.green,Color.black]]);
5195                 n3.states_([["s3",Color.white,Color.black]]);
5196                 n4.states_([["s4",Color.white,Color.black]]);
5197                 n5.states_([["s5",Color.white,Color.black]]);
5198                 n6.states_([["s6",Color.white,Color.black]]);
5199                 n7.states_([["s7",Color.white,Color.black]]);
5200                 n8.states_([["s8",Color.white,Color.black]]);
5201         });});
5202         n3 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)+(0),   Window.screenBounds.height-88,60,60/1.6180339887499)).states_([["s3",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button; if(((button.value == 0) or: (button.value == 1)), {~r1c=~fp1c;~r2c=~fp2c;~r3c=~fp3c;~r4c=~fp4c;~r5c=~fp5c;~r6c=~fp6c;~r7c=~fp7c;~r8c=~fp8c;~r9c=~fp9c;~r10c=~fp10c;~r11c=~fp11c;~r12c=~fp12c; 12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))}); "s"++"\n"++[ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].asString.postString; ~u1c=~f1;~u2c=~f2;~u3c=~f3;~u4c=~f4;~u5c=~f5;~u6c=~f6;~u7c=~f7;~u8c=~f8;~u9c=~f9;~u10c=~f10;~u11c=~f11;~u12c=~f12; ~si3set.value;
5203
5204                 if(~setgroup1.value == 1, {12.do(x = 0; {("sg1c"++(x=x+1)).asSymbol.envirPut([~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c,~fp9c,~fp10c,~fp11c,~fp12c].at(x-1))});});
5205                 if(~setgroup2.value == 1, {12.do(x = 0; {("sg2c"++(x=x+1)).asSymbol.envirPut([~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c,~fp9c,~fp10c,~fp11c,~fp12c].at(x-1))});});
5206                 if(~setgroup3.value == 1, {12.do(x = 0; {("sg3c"++(x=x+1)).asSymbol.envirPut([~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c,~fp9c,~fp10c,~fp11c,~fp12c].at(x-1))});});
5207                 if(~setgroup4.value == 1, {12.do(x = 0; {("sg4c"++(x=x+1)).asSymbol.envirPut([~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c,~fp9c,~fp10c,~fp11c,~fp12c].at(x-1))});});
5208                 if(~setgroup5.value == 1, {12.do(x = 0; {("sg5c"++(x=x+1)).asSymbol.envirPut([~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c,~fp9c,~fp10c,~fp11c,~fp12c].at(x-1))});});
5209                 if(~setgroup6.value == 1, {12.do(x = 0; {("sg6c"++(x=x+1)).asSymbol.envirPut([~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c,~fp9c,~fp10c,~fp11c,~fp12c].at(x-1))});});
5210                 if(~setgroup7.value == 1, {12.do(x = 0; {("sg7c"++(x=x+1)).asSymbol.envirPut([~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c,~fp9c,~fp10c,~fp11c,~fp12c].at(x-1))});});
5211                 if(~setgroup8.value == 1, {12.do(x = 0; {("sg8c"++(x=x+1)).asSymbol.envirPut([~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c,~fp9c,~fp10c,~fp11c,~fp12c].at(x-1))});});
5212
5213                 n1.states_([["s1",Color.white,Color.black]]);
5214                 n2.states_([["s2",Color.white,Color.black]]);
5215                 n3.states_([["s3",Color.green,Color.black]]);
5216                 n4.states_([["s4",Color.white,Color.black]]);
5217                 n5.states_([["s5",Color.white,Color.black]]);
5218                 n6.states_([["s6",Color.white,Color.black]]);
5219                 n7.states_([["s7",Color.white,Color.black]]);
5220                 n8.states_([["s8",Color.white,Color.black]]);
5221         });});
5222         n4 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)+(60*1),Window.screenBounds.height-88,60,60/1.6180339887499)).states_([["s4",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button; if(((button.value == 0) or: (button.value == 1)), {~r1d=~fp1d;~r2d=~fp2d;~r3d=~fp3d;~r4d=~fp4d;~r5d=~fp5d;~r6d=~fp6d;~r7d=~fp7d;~r8d=~fp8d;~r9d=~fp9d;~r10d=~fp10d;~r11d=~fp11d;~r12d=~fp12d; 12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))}); "s"++"\n"++[ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].asString.postString; ~u1d=~f1;~u2d=~f2;~u3d=~f3;~u4d=~f4;~u5d=~f5;~u6d=~f6;~u7d=~f7;~u8d=~f8;~u9d=~f9;~u10d=~f10;~u11d=~f11;~u12d=~f12; ~si4set.value;
5223
5224                 if(~setgroup1.value == 1, {12.do(x = 0; {("sg1d"++(x=x+1)).asSymbol.envirPut([~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d,~fp9d,~fp10d,~fp11d,~fp12d].at(x-1))});});
5225                 if(~setgroup2.value == 1, {12.do(x = 0; {("sg2d"++(x=x+1)).asSymbol.envirPut([~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d,~fp9d,~fp10d,~fp11d,~fp12d].at(x-1))});});
5226                 if(~setgroup3.value == 1, {12.do(x = 0; {("sg3d"++(x=x+1)).asSymbol.envirPut([~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d,~fp9d,~fp10d,~fp11d,~fp12d].at(x-1))});});
5227                 if(~setgroup4.value == 1, {12.do(x = 0; {("sg4d"++(x=x+1)).asSymbol.envirPut([~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d,~fp9d,~fp10d,~fp11d,~fp12d].at(x-1))});});
5228                 if(~setgroup5.value == 1, {12.do(x = 0; {("sg5d"++(x=x+1)).asSymbol.envirPut([~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d,~fp9d,~fp10d,~fp11d,~fp12d].at(x-1))});});
5229                 if(~setgroup6.value == 1, {12.do(x = 0; {("sg6d"++(x=x+1)).asSymbol.envirPut([~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d,~fp9d,~fp10d,~fp11d,~fp12d].at(x-1))});});
5230                 if(~setgroup7.value == 1, {12.do(x = 0; {("sg7d"++(x=x+1)).asSymbol.envirPut([~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d,~fp9d,~fp10d,~fp11d,~fp12d].at(x-1))});});
5231                 if(~setgroup8.value == 1, {12.do(x = 0; {("sg8d"++(x=x+1)).asSymbol.envirPut([~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d,~fp9d,~fp10d,~fp11d,~fp12d].at(x-1))});});
5232
5233                 n1.states_([["s1",Color.white,Color.black]]);
5234                 n2.states_([["s2",Color.white,Color.black]]);
5235                 n3.states_([["s3",Color.white,Color.black]]);
5236                 n4.states_([["s4",Color.green,Color.black]]);
5237                 n5.states_([["s5",Color.white,Color.black]]);
5238                 n6.states_([["s6",Color.white,Color.black]]);
5239                 n7.states_([["s7",Color.white,Color.black]]);
5240                 n8.states_([["s8",Color.white,Color.black]]);
5241         });});
5242         n5 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)-(60*2),Window.screenBounds.height-52,60,60/1.6180339887499)).states_([["s5",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button; if(((button.value == 0) or: (button.value == 1)), {~r1e=~fp1e;~r2e=~fp2e;~r3e=~fp3e;~r4e=~fp4e;~r5e=~fp5e;~r6e=~fp6e;~r7e=~fp7e;~r8e=~fp8e;~r9e=~fp9e;~r10e=~fp10e;~r11e=~fp11e;~r12e=~fp12e; 12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))}); "s"++"\n"++[ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].asString.postString; ~u1e=~f1;~u2e=~f2;~u3e=~f3;~u4e=~f4;~u5e=~f5;~u6e=~f6;~u7e=~f7;~u8e=~f8;~u9e=~f9;~u10e=~f10;~u11e=~f11;~u12e=~f12; ~si5set.value;
5243
5244                 if(~setgroup1.value == 1, {12.do(x = 0; {("sg1e"++(x=x+1)).asSymbol.envirPut([~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e,~fp9e,~fp10e,~fp11e,~fp12e].at(x-1))});});
5245                 if(~setgroup2.value == 1, {12.do(x = 0; {("sg2e"++(x=x+1)).asSymbol.envirPut([~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e,~fp9e,~fp10e,~fp11e,~fp12e].at(x-1))});});
5246                 if(~setgroup3.value == 1, {12.do(x = 0; {("sg3e"++(x=x+1)).asSymbol.envirPut([~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e,~fp9e,~fp10e,~fp11e,~fp12e].at(x-1))});});
5247                 if(~setgroup4.value == 1, {12.do(x = 0; {("sg4e"++(x=x+1)).asSymbol.envirPut([~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e,~fp9e,~fp10e,~fp11e,~fp12e].at(x-1))});});
5248                 if(~setgroup5.value == 1, {12.do(x = 0; {("sg5e"++(x=x+1)).asSymbol.envirPut([~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e,~fp9e,~fp10e,~fp11e,~fp12e].at(x-1))});});
5249                 if(~setgroup6.value == 1, {12.do(x = 0; {("sg6e"++(x=x+1)).asSymbol.envirPut([~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e,~fp9e,~fp10e,~fp11e,~fp12e].at(x-1))});});
5250                 if(~setgroup7.value == 1, {12.do(x = 0; {("sg7e"++(x=x+1)).asSymbol.envirPut([~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e,~fp9e,~fp10e,~fp11e,~fp12e].at(x-1))});});
5251                 if(~setgroup8.value == 1, {12.do(x = 0; {("sg8e"++(x=x+1)).asSymbol.envirPut([~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e,~fp9e,~fp10e,~fp11e,~fp12e].at(x-1))});});
5252
5253                 n1.states_([["s1",Color.white,Color.black]]);
5254                 n2.states_([["s2",Color.white,Color.black]]);
5255                 n3.states_([["s3",Color.white,Color.black]]);
5256                 n4.states_([["s4",Color.white,Color.black]]);
5257                 n5.states_([["s5",Color.green,Color.black]]);
5258                 n6.states_([["s6",Color.white,Color.black]]);
5259                 n7.states_([["s7",Color.white,Color.black]]);
5260                 n8.states_([["s8",Color.white,Color.black]]);
5261         });});
5262         n6 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)-(60*1),Window.screenBounds.height-52,60,60/1.6180339887499)).states_([["s6",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button; if(((button.value == 0) or: (button.value == 1)), {~r1f=~fp1f;~r2f=~fp2f;~r3f=~fp3f;~r4f=~fp4f;~r5f=~fp5f;~r6f=~fp6f;~r7f=~fp7f;~r8f=~fp8f;~r9f=~fp9f;~r10f=~fp10f;~r11f=~fp11f;~r12f=~fp12f; 12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))}); "s"++"\n"++[ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].asString.postString; ~u1f=~f1;~u2f=~f2;~u3f=~f3;~u4f=~f4;~u5f=~f5;~u6f=~f6;~u7f=~f7;~u8f=~f8;~u9f=~f9;~u10f=~f10;~u11e=~f11;~u12f=~f12; ~si6set.value;
5263
5264                 if(~setgroup1.value == 1, {12.do(x = 0; {("sg1f"++(x=x+1)).asSymbol.envirPut([~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f,~fp9f,~fp10f,~fp11f,~fp12f].at(x-1))});});
5265                 if(~setgroup2.value == 1, {12.do(x = 0; {("sg2f"++(x=x+1)).asSymbol.envirPut([~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f,~fp9f,~fp10f,~fp11f,~fp12f].at(x-1))});});
5266                 if(~setgroup3.value == 1, {12.do(x = 0; {("sg3f"++(x=x+1)).asSymbol.envirPut([~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f,~fp9f,~fp10f,~fp11f,~fp12f].at(x-1))});});
5267                 if(~setgroup4.value == 1, {12.do(x = 0; {("sg4f"++(x=x+1)).asSymbol.envirPut([~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f,~fp9f,~fp10f,~fp11f,~fp12f].at(x-1))});});
5268                 if(~setgroup5.value == 1, {12.do(x = 0; {("sg5f"++(x=x+1)).asSymbol.envirPut([~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f,~fp9f,~fp10f,~fp11f,~fp12f].at(x-1))});});
5269                 if(~setgroup6.value == 1, {12.do(x = 0; {("sg6f"++(x=x+1)).asSymbol.envirPut([~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f,~fp9f,~fp10f,~fp11f,~fp12f].at(x-1))});});
5270                 if(~setgroup7.value == 1, {12.do(x = 0; {("sg7f"++(x=x+1)).asSymbol.envirPut([~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f,~fp9f,~fp10f,~fp11f,~fp12f].at(x-1))});});
5271                 if(~setgroup8.value == 1, {12.do(x = 0; {("sg8f"++(x=x+1)).asSymbol.envirPut([~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f,~fp9f,~fp10f,~fp11f,~fp12f].at(x-1))});});
5272
5273                 n1.states_([["s1",Color.white,Color.black]]);
5274                 n2.states_([["s2",Color.white,Color.black]]);
5275                 n3.states_([["s3",Color.white,Color.black]]);
5276                 n4.states_([["s4",Color.white,Color.black]]);
5277                 n5.states_([["s5",Color.white,Color.black]]);
5278                 n6.states_([["s6",Color.green,Color.black]]);
5279                 n7.states_([["s7",Color.white,Color.black]]);
5280                 n8.states_([["s8",Color.white,Color.black]]);
5281         });});
5282         n7 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)+(0),   Window.screenBounds.height-52,60,60/1.6180339887499)).states_([["s7",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button; if(((button.value == 0) or: (button.value == 1)), {~r1g=~fp1g;~r2g=~fp2g;~r3g=~fp3g;~r4g=~fp4g;~r5g=~fp5g;~r6g=~fp6g;~r7g=~fp7g;~r8g=~fp8g;~r9g=~fp9g;~r10g=~fp10g;~r11g=~fp11g;~r12g=~fp12g; 12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))}); "s"++"\n"++[ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].asString.postString; ~u1g=~f1;~u2g=~f2;~u3g=~f3;~u4g=~f4;~u5g=~f5;~u6g=~f6;~u7g=~f7;~u8g=~f8;~u9g=~f9;~u10g=~f10;~u11f=~f11;~u12g=~f12; ~si7set.value;
5283
5284                 if(~setgroup1.value == 1, {12.do(x = 0; {("sg1g"++(x=x+1)).asSymbol.envirPut([~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g,~fp9g,~fp10g,~fp11g,~fp12g].at(x-1))});});
5285                 if(~setgroup2.value == 1, {12.do(x = 0; {("sg2g"++(x=x+1)).asSymbol.envirPut([~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g,~fp9g,~fp10g,~fp11g,~fp12g].at(x-1))});});
5286                 if(~setgroup3.value == 1, {12.do(x = 0; {("sg3g"++(x=x+1)).asSymbol.envirPut([~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g,~fp9g,~fp10g,~fp11g,~fp12g].at(x-1))});});
5287                 if(~setgroup4.value == 1, {12.do(x = 0; {("sg4g"++(x=x+1)).asSymbol.envirPut([~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g,~fp9g,~fp10g,~fp11g,~fp12g].at(x-1))});});
5288                 if(~setgroup5.value == 1, {12.do(x = 0; {("sg5g"++(x=x+1)).asSymbol.envirPut([~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g,~fp9g,~fp10g,~fp11g,~fp12g].at(x-1))});});
5289                 if(~setgroup6.value == 1, {12.do(x = 0; {("sg6g"++(x=x+1)).asSymbol.envirPut([~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g,~fp9g,~fp10g,~fp11g,~fp12g].at(x-1))});});
5290                 if(~setgroup7.value == 1, {12.do(x = 0; {("sg7g"++(x=x+1)).asSymbol.envirPut([~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g,~fp9g,~fp10g,~fp11g,~fp12g].at(x-1))});});
5291                 if(~setgroup8.value == 1, {12.do(x = 0; {("sg8g"++(x=x+1)).asSymbol.envirPut([~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g,~fp9g,~fp10g,~fp11g,~fp12g].at(x-1))});});
5292
5293                 n1.states_([["s1",Color.white,Color.black]]);
5294                 n2.states_([["s2",Color.white,Color.black]]);
5295                 n3.states_([["s3",Color.white,Color.black]]);
5296                 n4.states_([["s4",Color.white,Color.black]]);
5297                 n5.states_([["s5",Color.white,Color.black]]);
5298                 n6.states_([["s6",Color.white,Color.black]]);
5299                 n7.states_([["s7",Color.green,Color.black]]);
5300                 n8.states_([["s8",Color.white,Color.black]]);
5301         });});
5302         n8 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/2)+(60*1),Window.screenBounds.height-52,60,60/1.6180339887499)).states_([["s8",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button; if(((button.value == 0) or: (button.value == 1)), {~r1h=~fp1h;~r2h=~fp2h;~r3h=~fp3h;~r4h=~fp4h;~r5h=~fp5h;~r6h=~fp6h;~r7h=~fp7h;~r8h=~fp8h;~r9h=~fp9h;~r10h=~fp10h;~r11h=~fp11h;~r12h=~fp12h; 12.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].at(x-1))}); "s"++"\n"++[ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ].asString.postString; ~u1h=~f1;~u2h=~f2;~u3h=~f3;~u4h=~f4;~u5h=~f5;~u6h=~f6;~u7h=~f7;~u8h=~f8;~u9h=~f9;~u10h=~f10;~u11g=~f11;~u12h=~f12; ~si8set.value;
5303
5304                 if(~setgroup1.value == 1, {12.do(x = 0; {("sg1h"++(x=x+1)).asSymbol.envirPut([~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h,~fp9h,~fp10h,~fp11h,~fp12h].at(x-1))});});
5305                 if(~setgroup2.value == 1, {12.do(x = 0; {("sg2h"++(x=x+1)).asSymbol.envirPut([~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h,~fp9h,~fp10h,~fp11h,~fp12h].at(x-1))});});
5306                 if(~setgroup3.value == 1, {12.do(x = 0; {("sg3h"++(x=x+1)).asSymbol.envirPut([~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h,~fp9h,~fp10h,~fp11h,~fp12h].at(x-1))});});
5307                 if(~setgroup4.value == 1, {12.do(x = 0; {("sg4h"++(x=x+1)).asSymbol.envirPut([~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h,~fp9h,~fp10h,~fp11h,~fp12h].at(x-1))});});
5308                 if(~setgroup5.value == 1, {12.do(x = 0; {("sg5h"++(x=x+1)).asSymbol.envirPut([~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h,~fp9h,~fp10h,~fp11h,~fp12h].at(x-1))});});
5309                 if(~setgroup6.value == 1, {12.do(x = 0; {("sg6h"++(x=x+1)).asSymbol.envirPut([~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h,~fp9h,~fp10h,~fp11h,~fp12h].at(x-1))});});
5310                 if(~setgroup7.value == 1, {12.do(x = 0; {("sg7h"++(x=x+1)).asSymbol.envirPut([~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h,~fp9h,~fp10h,~fp11h,~fp12h].at(x-1))});});
5311                 if(~setgroup8.value == 1, {12.do(x = 0; {("sg8h"++(x=x+1)).asSymbol.envirPut([~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h,~fp9h,~fp10h,~fp11h,~fp12h].at(x-1))});});
5312
5313                 n1.states_([["s1",Color.white,Color.black]]);
5314                 n2.states_([["s2",Color.white,Color.black]]);
5315                 n3.states_([["s3",Color.white,Color.black]]);
5316                 n4.states_([["s4",Color.white,Color.black]]);
5317                 n5.states_([["s5",Color.white,Color.black]]);
5318                 n6.states_([["s6",Color.white,Color.black]]);
5319                 n7.states_([["s7",Color.white,Color.black]]);
5320                 n8.states_([["s8",Color.green,Color.black]]);
5321         });});
5322
5323
5324         //undo saved chord pop-up menu
5325
5326         ~undo = PopUpMenu(w, Rect(Window.screenBounds.width-(Window.screenBounds.width/3)+39,Window.screenBounds.height-52+19.777087639995-(40/1.6180339887499)-8,40,40/1.6180339887499)).items_(["uc","u1","u2","u3","u4","u5","u6","u7","u8"]).background_(Color.black).stringColor_(Color.white).action_({arg button;});
5327
5328
5329         //set button for undo pop-up menu
5330
5331         set2 = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/3)+40+39,Window.screenBounds.height-52+19.777087639995-(40/1.6180339887499)-8,40,40/1.6180339887499)).states_([["set",Color.white,Color.black]]).action_({arg button;
5332                 case
5333                 {~undo.value == 0}{if(([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ] != [~undof1,~undof2,~undof3,~undof4,~undof5,~undof6,~undof7,~undof8,~undof9,~undof10,~undof11,~undof12]).postln, {12.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut([~undof1,~undof2,~undof3,~undof4,~undof5,~undof6,~undof7,~undof8,~undof9,~undof10,~undof11,~undof12].at(x-1))});}/*,{12.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut([~redof1,~redof2,~redof3,~redof4,~redof5,~redof6,~redof7,~redof8,~redof9,~redof10,~redof11,~redof12].at(x-1))});}*/);~undo.value = 0;}
5334                 {~undo.value == 1}{if(([~fp1,~fp2,~fp3,~fp4,~fp5,~fp6,~fp7,~fp8,~fp9,~fp10,~fp11,~fp12] == [~r1,~r2,~r3,~r4,~r5,~r6,~r7,~r8,~r9,~r10,~r11,~r12]).postln, {12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([~u1,~u2,~u3,~u4,~u5,~u6,~u7,~u8,~u9,~u10,~u11,~u12].at(x-1))});},{12.do(x = 0; {("fp"++(x=x+1)).asSymbol.envirPut([~r1,~r2,~r3,~r4,~r5,~r6,~r7,~r8,~r9,~r10,~r11,~r12].at(x-1))});});~undo.value = 0;}
5335                 {~undo.value == 2}{if([~fp1b,~fp2b,~fp3b,~fp4b,~fp5b,~fp6b,~fp7b,~fp8b,~fp9b,~fp10b,~fp11b,~fp12b] == [~r1b,~r2b,~r3b,~r4b,~r5b,~r6b,~r7b,~r8b,~r9b,~r10b,~r11b,~r12b], {12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([~u1b,~u2b,~u3b,~u4b,~u5b,~u6b,~u7b,~u8b,~u9b,~u10b,~u11b,~u12b].at(x-1))});},{12.do(x = 0; {("fp"++(x=x+1)++"b").asSymbol.envirPut([~r1b,~r2b,~r3b,~r4b,~r5b,~r6b,~r7b,~r8b,~r9b,~r10b,~r11b,~r12b].at(x-1))});});~undo.value = 0;}
5336                 {~undo.value == 3}{if([~fp1c,~fp2c,~fp3c,~fp4c,~fp5c,~fp6c,~fp7c,~fp8c,~fp9c,~fp10c,~fp11c,~fp12c] == [~r1c,~r2c,~r3c,~r4c,~r5c,~r6c,~r7c,~r8c,~r9c,~r10c,~r11c,~r12c], {12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([~u1c,~u2c,~u3c,~u4c,~u5c,~u6c,~u7c,~u8c,~u9c,~u10c,~u11c,~u12c].at(x-1))});},{12.do(x = 0; {("fp"++(x=x+1)++"c").asSymbol.envirPut([~r1c,~r2c,~r3c,~r4c,~r5c,~r6c,~r7c,~r8c,~r9c,~r10c,~r11c,~r12c].at(x-1))});});~undo.value = 0;}
5337                 {~undo.value == 4}{if([~fp1d,~fp2d,~fp3d,~fp4d,~fp5d,~fp6d,~fp7d,~fp8d,~fp9d,~fp10d,~fp11d,~fp12d] == [~r1d,~r2d,~r3d,~r4d,~r5d,~r6d,~r7d,~r8d,~r9d,~r10d,~r11d,~r12d], {12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([~u1d,~u2d,~u3d,~u4d,~u5d,~u6d,~u7d,~u8d,~u9d,~u10d,~u11d,~u12d].at(x-1))});},{12.do(x = 0; {("fp"++(x=x+1)++"d").asSymbol.envirPut([~r1d,~r2d,~r3d,~r4d,~r5d,~r6d,~r7d,~r8d,~r9d,~r10d,~r11d,~r12d].at(x-1))});});~undo.value = 0;}
5338                 {~undo.value == 5}{if([~fp1e,~fp2e,~fp3e,~fp4e,~fp5e,~fp6e,~fp7e,~fp8e,~fp9e,~fp10e,~fp11e,~fp12e] == [~r1e,~r2e,~r3e,~r4e,~r5e,~r6e,~r7e,~r8e,~r9e,~r10e,~r11e,~r12e], {12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([~u1e,~u2e,~u3e,~u4e,~u5e,~u6e,~u7e,~u8e,~u9e,~u10e,~u11e,~u12e].at(x-1))});},{12.do(x = 0; {("fp"++(x=x+1)++"e").asSymbol.envirPut([~r1e,~r2e,~r3e,~r4e,~r5e,~r6e,~r7e,~r8e,~r9e,~r10e,~r11e,~r12e].at(x-1))});});~undo.value = 0;}
5339                 {~undo.value == 6}{if([~fp1f,~fp2f,~fp3f,~fp4f,~fp5f,~fp6f,~fp7f,~fp8f,~fp9f,~fp10f,~fp11f,~fp12f] == [~r1f,~r2f,~r3f,~r4f,~r5f,~r6f,~r7f,~r8f,~r9f,~r10f,~r11f,~r12f], {12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([~u1f,~u2f,~u3f,~u4f,~u5f,~u6f,~u7f,~u8f,~u9f,~u10f,~u11f,~u12f].at(x-1))});},{12.do(x = 0; {("fp"++(x=x+1)++"f").asSymbol.envirPut([~r1f,~r2f,~r3f,~r4f,~r5f,~r6f,~r7f,~r8f,~r9f,~r10f,~r11f,~r12f].at(x-1))});});~undo.value = 0;}
5340                 {~undo.value == 7}{if([~fp1g,~fp2g,~fp3g,~fp4g,~fp5g,~fp6g,~fp7g,~fp8g,~fp9g,~fp10g,~fp11g,~fp12g] == [~r1g,~r2g,~r3g,~r4g,~r5g,~r6g,~r7g,~r8g,~r9g,~r10g,~r11g,~r12g], {12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([~u1g,~u2g,~u3g,~u4g,~u5g,~u6g,~u7g,~u8g,~u9g,~u10g,~u11g,~u12g].at(x-1))});},{12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([~r1g,~r2g,~r3g,~r4g,~r5g,~r6g,~r7g,~r8g,~r9g,~r10g,~r11g,~r12g].at(x-1))});});~undo.value = 0;}
5341                 {~undo.value == 8}{if([~fp1h,~fp2h,~fp3h,~fp4h,~fp5h,~fp6h,~fp7h,~fp8h,~fp9h,~fp10h,~fp11h,~fp12h] == [~r1h,~r2h,~r3h,~r4h,~r5h,~r6h,~r7h,~r8h,~r9h,~r10h,~r11h,~r12h], {12.do(x = 0; {("fp"++(x=x+1)++"h").asSymbol.envirPut([~u1h,~u2h,~u3h,~u4h,~u5h,~u6h,~u7h,~u8h,~u9h,~u10h,~u11h,~u12h].at(x-1))});},{12.do(x = 0; {("fp"++(x=x+1)++"g").asSymbol.envirPut([~r1h,~r2h,~r3h,~r4h,~r5h,~r6h,~r7h,~r8h,~r9h,~r10h,~r11h,~r12h].at(x-1))});});~undo.value = 0;};
5342         });
5343
5344
5345         //record/stop record button
5346
5347         ~startrecord = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/3)+39,Window.screenBounds.height-52+19.777087639995,28,28/1.6180339887499)).states_([["rc",Color.white,Color.black],["/rc",Color.black,Color.red]]).action_({arg button;
5348
5349                 if(button.value == 1, {~numsynths.stop; s.record; if(button.value == 0, {button.value = 1});},
5350                         {s.stopRecording; ~startrecord.value = 0; ~pauserecord.value = 0; ~numsynths.stop; ~numsynths.play;});
5351         });
5352
5353
5354         //pause record button
5355
5356         ~pauserecord = Button.new(w,Rect(Window.screenBounds.width-(Window.screenBounds.width/3)+28+39,Window.screenBounds.height-52+19.777087639995,28,28/1.6180339887499)).states_([["prc",Color.white,Color.black],["/prc",Color.black,Color.blue]]).action_({arg button; if(button == 1, {Server.default.pauseRecording;}, {Server.default.record});});
5357
5358
5359         //minimize GUI window button
5360
5361         ~min = Button.new(w,Rect(Window.screenBounds.width-20,~bpt+69+5-(20/1.6180339887499),20,20/1.6180339887499)).states_([["m",Color.white,Color.black]]).action_({arg button; w.minimize;
5362
5363                 ~fullscreen_correct = {w.fullScreen};
5364                 ~fscview = UserView(w, Rect(0,0, Window.screenBounds.width-100, Window.screenBounds.height;));
5365                 ~fullscreen_button = Button.new(w,Rect(Window.screenBounds.width/2-35,Window.screenBounds.height/2+120,150,20)).states_([["re-adjust to fullscreen",Color.white,Color.black]]).action_({arg button; w.fullScreen; ~fullscreen_button.close; ~fullscreen_button = nil;});
5366                 ~fscview.mouseEnterAction_{|v, x, y| ~fullscreen_correct.value; ~fullscreen_correct = nil; ~fscview.close; ~fscview = nil; ~fullscreen_button.close; ~fullscreen_button = nil;};
5367         });
5368
5369
5370         //close GUI window button
5371
5372         ~close = Button.new(w,Rect(Window.screenBounds.width-20,~bpt+69+5,20,20/1.6180339887499)).states_([["c",Color.white,Color.black]]).action_({arg button;
5373
5374                 if(~closemessage != nil, {~closemessage.close}, {nil});
5375                 ~closemessage = View(w, Rect(Window.screenBounds.width-(340+46),Window.screenBounds.height-(340+46/1.6180339887499)-110,340+46,340+46/1.6180339887499)).background_(Color.black).front;
5376                 ~closemessagestring = StaticText(~closemessage, Rect(0,0,340+46,340+46/1.6180339887499)).background_(Color.black);
5377                 ~closemessagestring.align = \center;
5378                 ~closemessagestring.string ="Close Timewave Synth?";
5379                 ~closemessagestring.stringColor = Color.white;
5380                 ~closemessagebutton1 = Button.new(~closemessage,Rect(120-46+40,340/1.6180339887499-30,46,46/1.6180339887499)).states_([["Yes",Color.white,Color.black]]).action_({AppClock.sched(0, {~cpumonitorroutine.stop; ~metronome.stop; ~loop.stop; ~loop.reset; ~numsynths.stop; w.close; Task({1.do({if(~l1a.isRunning == true or: ~l1a1.isRunning == true, {~synthfree.value;}, {nil}); 1.wait; Server.freeAll;});}).play;});});
5381                 ~closemessagebutton2 = Button.new(~closemessage,Rect(320+46-130,340/1.6180339887499-30,46,46/1.6180339887499)).states_([["No",Color.white,Color.black]]).action_({AppClock.sched(0, {~closemessage.close;});});
5382                 ~closemessage.front;
5383
5384         });
5385
5386
5387         w.front; w.fullScreen;
5388
5389         /* e-mail: ken_brant@ymail.com */
5390
5391 }.value);
5392 );
5393 );
5394
5395
5396 //Interpreted King Wen Sequences
5397
5398 /*
5399
5400 (#a,b,c,d,e,f = /*[ 128.43436842029,128.43436842029,128.43436842029,128.43436842029,128.43436842029,128.43436842029  ]*/
5401 [ ~basefreq,~basefreq,~basefreq,~basefreq,~basefreq,~basefreq  ];
5402 ~a = a; ~b = b; ~c =c; ~d = d; ~e = e;~f=f;);
5403
5404 ~fth = 1.4142135623729;
5405 ~bi  = ~fth; (~bi  = "binary interval" - intverval of key change to a hexagram line's opposite in King Wen sequence)
5406
5407
5408 (First Setting)
5409
5410 /*1*/   #a,b,c,d,e,f=[ ~a,~b,~c,~d,~e,~f  ],
5411 /*2*/   [ a = a/~bi, b = b/~bi, c = c/~bi, d = d/~bi, e = e/~bi, f = f/~bi ],
5412 /*3*/   [ a = a,     b = b*~bi, c = c,     d = d,     e = e,     f = f*~bi ],
5413 /*4*/   [ a = a*~bi, b = b/~bi, c = c,     d = d,     e = e*~bi, f = f/~bi ],
5414 /*5*/   [ a = a/~bi, b = b*~bi, c = c,     d = d*~bi, e = e,     f = f*~bi ],
5415 /*6*/   [ a = a*~bi, b = b,     c = c*~bi, d = d/~bi, e = e,     f = f/~bi ],
5416 /*7*/   [ a = a/~bi, b = b/~bi, c = c/~bi, d = d,     e = e,     f = f     ],
5417 /*8*/   [ a = a,     b = b*~bi, c = c,     d = d,     e = e/~bi, f = f     ],
5418 /*9*/   [ a = a*~bi, b = b,     c = c,     d = d*~bi, e = e*~bi, f = f*~bi ],
5419 /*10*/  [ a = a,     b = b,     c = c*~bi, d = d/~bi, e = e,     f = f     ],
5420 /*11*/  [ a = a/~bi, b = b/~bi, c = c/~bi, d = d*~bi, e = e,     f = f     ],
5421 /*12*/  [ a = a*~bi, b = b*~bi, c = c*~bi, d = d/~bi, e = e/~bi, f = f/~bi ],
5422 /*13*/  [ a = a,     b = b,     c = c,     d = d*~bi, e = e,     f = f*~bi ],
5423 /*14*/  [ a = a,     b = b/~bi, c = c,     d = d,     e = e*~bi, f = f     ],
5424 /*15*/  [ a = a/~bi, b = b,     c = c/~bi, d = d,     e = e/~bi, f = f/~bi ],
5425 /*16*/  [ a = a,     b = b,     c = c*~bi, d = d/~bi, e = e,     f = f     ],
5426 /*17*/  [ a = a,     b = b*~bi, c = c,     d = d,     e = e,     f = f*~bi ],
5427 /*18*/  [ a = a*~bi, b = b/~bi, c = c/~bi, d = d*~bi, e = e*~bi, f = f/~bi ],
5428 /*19*/  [ a = a/~bi, b = b,     c = c,     d = d/~bi, e = e,     f = f*~bi ],
5429 /*20*/  [ a = a*~bi, b = b*~bi, c = c,     d = d,     e = e/~bi, f = f/~bi ],
5430 /*21*/  [ a = a,     b = b/~bi, c = c*~bi, d = d,     e = e,     f = f*~bi ],
5431 /*22*/  [ a = a,     b = b,     c = c/~bi, d = d*~bi, e = e,     f = f     ],
5432 /*23*/  [ a = a,     b = b,     c = c,     d = d/~bi, e = e,     f = f/~bi ],
5433 /*24*/  [ a = a/~bi, b = b,     c = c,     d = d,     e = e,     f = f*~bi ],
5434 /*25*/  [ a = a*~bi, b = b*~bi, c = c*~bi, d = d,     e = e,     f = f     ],
5435 /*26*/  [ a = a,     b = b/~bi, c = c/~bi, d = d*~bi, e = e*~bi, f = f     ],
5436 /*27*/  [ a = a,     b = b,     c = c,     d = d/~bi, e = e/~bi, f = f     ],
5437 /*28*/  [ a = a/~bi, b = b*~bi, c = c*~bi, d = d*~bi, e = e*~bi, f = f/~bi ],
5438 /*29*/  [ a = a,     b = b,     c = c/~bi, d = d/~bi, e = e,     f = f     ],
5439 /*30*/  [ a = a*~bi, b = b/~bi, c = c*~bi, d = d*~bi, e = e/~bi, f = f*~bi ],
5440 /*31*/  [ a = a/~bi, b = b*~bi, c = c,     d = d,     e = e,     f = f/~bi ],
5441 /*32*/  [ a = a,     b = b/~bi, c = c,     d = d,     e = e*~bi, f = f     ],
5442 /*33*/  [ a = a*~bi, b = b*~bi, c = c,     d = d,     e = e/~bi, f = f     ],
5443 /*34*/  [ a = a/~bi, b = b/~bi, c = c,     d = d,     e = e*~bi, f = f*~bi ],
5444 /*35*/  [ a = a*~bi, b = b,     c = c,     d = d/~bi, e = e/~bi, f = f/~bi ],
5445 /*36*/  [ a = a/~bi, b = b,     c = c/~bi, d = d*~bi, e = e,     f = f*~bi ],
5446 /*37*/  [ a = a*~bi, b = b*~bi, c = c,     d = d,     e = e,     f = f     ],
5447 /*38*/  [ a = a,     b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f     ],
5448 /*39*/  [ a = a/~bi, b = b*~bi, c = c/~bi, d = d*~bi, e = e/~bi, f = f/~bi ],
5449 /*40*/  [ a = a,     b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f     ],
5450 /*41*/  [ a = a*~bi, b = b,     c = c/~bi, d = d,     e = e,     f = f*~bi ],
5451 /*42*/  [ a = a,     b = b*~bi, c = c,     d = d,     e = e/~bi, f = f     ],
5452 /*43*/  [ a = a/~bi, b = b,     c = c*~bi, d = d*~bi, e = e*~bi, f = f     ],
5453 /*44*/  [ a = a*~bi, b = b,     c = c,     d = d,     e = e,     f = f/~bi ],
5454 /*45*/  [ a = a/~bi, b = b,     c = c,     d = d/~bi, e = e/~bi, f = f     ],
5455 /*46*/  [ a = a,     b = b/~bi, c = c/~bi, d = d*~bi, e = e*~bi, f = f     ],
5456 /*47*/  [ a = a,     b = b*~bi, c = c*~bi, d = d/~bi, e = e,     f = f     ],
5457 /*48*/  [ a = a,     b = b,     c = c/~bi, d = d*~bi, e = e,     f = f     ],
5458 /*49*/  [ a = a,     b = b,     c = c*~bi, d = d,     e = e/~bi, f = f*~bi ],
5459 /*50*/  [ a = a*~bi, b = b/~bi, c = c,     d = d,     e = e*~bi, f = f/~bi ],
5460 /*51*/  [ a = a/~bi, b = b,     c = c,     d = d/~bi, e = e/~bi, f = f*~bi ],
5461 /*52*/  [ a = a*~bi, b = b,     c = c/~bi, d = d*~bi, e = e,     f = f/~bi ],
5462 /*53*/  [ a = a,     b = b*~bi, c = c,     d = d,     e = e,     f = f     ],
5463 /*54*/  [ a = a/~bi, b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f*~bi ],
5464 /*55*/  [ a = a,     b = b,     c = c,     d = d*~bi, e = e/~bi, f = f     ],
5465 /*56*/  [ a = a*~bi, b = b,     c = c,     d = d,     e = e,     f = f/~bi ],
5466 /*57*/  [ a = a,     b = b*~bi, c = c/~bi, d = d,     e = e*~bi, f = f     ],
5467 /*58*/  [ a = a/~bi, b = b,     c = c*~bi, d = d/~bi, e = e,     f = f*~bi ],
5468 /*59*/  [ a = a*~bi, b = b,     c = c/~bi, d = d,     e = e,     f = f/~bi ],
5469 /*60*/  [ a = a/~bi, b = b,     c = c,     d = d,     e = e,     f = f*~bi ],
5470 /*61*/  [ a = a*~bi, b = b,     c = c,     d = d,     e = e,     f = f     ],
5471 /*62*/  [ a = a/~bi, b = b/~bi, c = c*~bi, d = d*~bi, e = e/~bi, f = f/~bi ],
5472 /*63*/  [ a = a,     b = b*~bi, c = c/~bi, d = d,     e = e,     f = f*~bi ],
5473 /*64*/  [ a = a*~bi, b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f/~bi ]
5474
5475 /*1*/   [ a = a*~n1, b = b*~n1*~bi, c = c*~n1, d = d*~n1*~bi, e = e*~n1, f = f*~n1*~bi ],...
5476
5477
5478 (Second Setting)
5479
5480 /*1*/   #a,b,c,d,e,f=[ ~a,~b,~c,~d,~e,~f  ],
5481 /*2*/   [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1/~bi ],
5482 /*3*/   [ a = a,         b = b*~bi,     c = c,         d = d,         e = e,         f = f*~bi     ],
5483 /*4*/   [ a = a*~bi,     b = b/~bi,     c = c,         d = d,         e = e*~bi,     f = f/~bi     ],
5484 /*5*/   [ a = a/~bi,     b = b*~bi,     c = c,         d = d*~bi,     e = e,         f = f*~bi     ],
5485 /*6*/   [ a = a*~bi,     b = b,         c = c*~bi,     d = d/~bi,     e = e,         f = f/~bi     ],
5486 /*7*/   [ a = a/~bi,     b = b/~bi,     c = c/~bi,     d = d,         e = e,         f = f         ],
5487 /*8*/   [ a = a,         b = b*~bi,     c = c,         d = d,         e = e/~bi,     f = f         ],
5488 /*9*/   [ a = a*~bi,     b = b,         c = c,         d = d*~bi,     e = e*~bi,     f = f*~bi     ],
5489 /*10*/  [ a = a,         b = b,         c = c*~bi,     d = d/~bi,     e = e,         f = f         ],
5490 /*11*/  [ a = a/~bi,     b = b/~bi,     c = c/~bi,     d = d*~bi,     e = e,         f = f         ],
5491 /*12*/  [ a = a*~n2*~bi, b = b*~n2*~bi, c = c*~n2*~bi, d = d*~n2/~bi, e = e*~n2/~bi, f = f*~n2/~bi ],
5492 /*13*/  [ a = a,         b = b,         c = c,         d = d*~bi,     e = e,         f = f*~bi     ],
5493 /*14*/  [ a = a,         b = b/~bi,     c = c,         d = d,         e = e*~bi,     f = f         ],
5494 /*15*/  [ a = a/~bi,     b = b,         c = c/~bi,     d = d,         e = e/~bi,     f = f/~bi     ],
5495 /*16*/  [ a = a,         b = b,         c = c*~bi,     d = d/~bi,     e = e,         f = f         ],
5496 /*17*/  [ a = a,         b = b*~bi,     c = c,         d = d,         e = e,         f = f*~bi     ],
5497 /*18*/  [ a = a*~n3*~bi, b = b*~n3/~bi, c = c*~n3/~bi, d = d*~n3*~bi, e = e*~n3*~bi, f = f*~n3/~bi ],
5498 /*19*/  [ a = a/~bi,     b = b,         c = c,         d = d/~bi,     e = e,         f = f*~bi     ],
5499 /*20*/  [ a = a*~bi,     b = b*~bi,     c = c,         d = d,         e = e/~bi,     f = f/~bi     ],
5500 /*21*/  [ a = a,         b = b/~bi,     c = c*~bi,     d = d,         e = e,         f = f*~bi     ],
5501 /*22*/  [ a = a,         b = b,         c = c/~bi,     d = d*~bi,     e = e,         f = f         ],
5502 /*23*/  [ a = a,         b = b,         c = c,         d = d/~bi,     e = e,         f = f/~bi     ],
5503 /*24*/  [ a = a/~bi,     b = b,         c = c,         d = d,         e = e,         f = f*~bi     ],
5504 /*25*/  [ a = a*~bi,     b = b*~bi,     c = c*~bi,     d = d,         e = e,         f = f         ],
5505 /*26*/  [ a = a,         b = b/~bi,     c = c/~bi,     d = d*~bi,     e = e*~bi,     f = f         ],
5506 /*27*/  [ a = a,         b = b,         c = c,         d = d/~bi,     e = e/~bi,     f = f         ],
5507 /*28*/  [ a = a*~n4/~bi, b = b*~n4*~bi, c = c*~n4*~bi, d = d*~n4*~bi, e = e*~n4*~bi, f = f*~n4/~bi ],
5508 /*29*/  [ a = a,         b = b,         c = c/~bi,     d = d/~bi,     e = e,         f = f         ],
5509 /*30*/  [ a = a*~n5*~bi, b = b*~n5/~bi, c = c*~n5*~bi, d = d*~n5*~bi, e = e*~n5/~bi, f = f*~n5*~bi ],
5510 /*31*/  [ a = a/~bi,     b = b*~bi,     c = c,         d = d,         e = e,         f = f/~bi     ],
5511 /*32*/  [ a = a,         b = b/~bi,     c = c,         d = d,         e = e*~bi,     f = f         ],
5512 /*33*/  [ a = a*~bi,     b = b*~bi,     c = c,         d = d,         e = e/~bi,     f = f         ],
5513 /*34*/  [ a = a/~bi,     b = b/~bi,     c = c,         d = d,         e = e*~bi,     f = f*~bi     ],
5514 /*35*/  [ a = a*~bi,     b = b,         c = c,         d = d/~bi,     e = e/~bi,     f = f/~bi     ],
5515 /*36*/  [ a = a/~bi,     b = b,         c = c/~bi,     d = d*~bi,     e = e,         f = f*~bi     ],
5516 /*37*/  [ a = a*~bi,     b = b*~bi,     c = c,         d = d,         e = e,         f = f         ],
5517 /*38*/  [ a = a,         b = b/~bi,     c = c*~bi,     d = d/~bi,     e = e*~bi,     f = f         ],
5518 /*39*/  [ a = a*~n6/~bi, b = b*~n6*~bi, c = c*~n6/~bi, d = d*~n6*~bi, e = e*~n6/~bi, f = f*~n6/~bi ],
5519 /*40*/  [ a = a,         b = b/~bi,     c = c*~bi,     d = d/~bi,     e = e*~bi,     f = f         ],
5520 /*41*/  [ a = a*~bi,     b = b,         c = c/~bi,     d = d,         e = e,         f = f*~bi     ],
5521 /*42*/  [ a = a,         b = b*~bi,     c = c,         d = d,         e = e/~bi,     f = f         ],
5522 /*43*/  [ a = a/~bi,     b = b,         c = c*~bi,     d = d*~bi,     e = e*~bi,     f = f         ],
5523 /*44*/  [ a = a*~bi,     b = b,         c = c,         d = d,         e = e,         f = f/~bi     ],
5524 /*45*/  [ a = a/~bi,     b = b,         c = c,         d = d/~bi,     e = e/~bi,     f = f         ],
5525 /*46*/  [ a = a,         b = b/~bi,     c = c/~bi,     d = d*~bi,     e = e*~bi,     f = f         ],
5526 /*47*/  [ a = a,         b = b*~bi,     c = c*~bi,     d = d/~bi,     e = e,         f = f         ],
5527 /*48*/  [ a = a,         b = b,         c = c/~bi,     d = d*~bi,     e = e,         f = f         ],
5528 /*49*/  [ a = a,         b = b,         c = c*~bi,     d = d,         e = e/~bi,     f = f*~bi     ],
5529 /*50*/  [ a = a*~bi,     b = b/~bi,     c = c,         d = d,         e = e*~bi,     f = f/~bi     ],
5530 /*51*/  [ a = a/~bi,     b = b,         c = c,         d = d/~bi,     e = e/~bi,     f = f*~bi     ],
5531 /*52*/  [ a = a*~bi,     b = b,         c = c/~bi,     d = d*~bi,     e = e,         f = f/~bi     ],
5532 /*53*/  [ a = a,         b = b*~bi,     c = c,         d = d,         e = e,         f = f         ],
5533 /*54*/  [ a = a*~n7/~bi, b = b*~n7/~bi, c = c*~n7*~bi, d = d*~n7/~bi, e = e*~n7*~bi, f = f*~n7*~bi ],
5534 /*55*/  [ a = a,         b = b,         c = c,         d = d*~bi,     e = e/~bi,     f = f         ],
5535 /*56*/  [ a = a*~bi,     b = b,         c = c,         d = d,         e = e,         f = f/~bi     ],
5536 /*57*/  [ a = a,         b = b*~bi,     c = c/~bi,     d = d,         e = e*~bi,     f = f         ],
5537 /*58*/  [ a = a/~bi,     b = b,         c = c*~bi,     d = d/~bi,     e = e,         f = f*~bi     ],
5538 /*59*/  [ a = a*~bi,     b = b,         c = c/~bi,     d = d,         e = e,         f = f/~bi     ],
5539 /*60*/  [ a = a/~bi,     b = b,         c = c,         d = d,         e = e,         f = f*~bi     ],
5540 /*61*/  [ a = a*~bi,     b = b,         c = c,         d = d,         e = e,         f = f         ],
5541 /*62*/  [ a = a*~n8/~bi, b = b*~n8/~bi, c = c*~n8*~bi, d = d*~n8*~bi, e = e*~n8/~bi, f = f*~n8/~bi ],
5542 /*63*/  [ a = a,         b = b*~bi,     c = c/~bi,     d = d,         e = e,         f = f*~bi     ],
5543 /*64*/  [ a = a*~n9*~bi, b = b*~n9/~bi, c = c*~n9*~bi, d = d*~n9/~bi, e = e*~n9*~bi, f = f*~n9/~bi ]
5544
5545 /*1*/   [ a = a,         b = b*~bi,     c = c,         d = d*~bi,     e = e,         f = f*~bi     ],...
5546
5547
5548 (Third Setting)
5549
5550 /*1*/   #a,b,c,d,e,f=[ ~a,~b,~c,~d,~e,~f  ],
5551 /*2*/   [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1/~bi ],
5552 /*3*/   [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5553 /*4*/   [ a = a*~n1*~bi, b = b*~n1/~bi, c = c*~n1,     d = d*~n1,     e = e*~n1*~bi, f = f*~n1/~bi ],
5554 /*5*/   [ a = a*~n1/~bi, b = b*~n1*~bi, c = c*~n1,     d = d*~n1*~bi, e = e*~n1,     f = f*~n1*~bi ],
5555 /*6*/   [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1/~bi ],
5556 /*7*/   [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1,     e = e*~n1,     f = f*~n1     ],
5557 /*8*/   [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1/~bi, f = f*~n1     ],
5558 /*9*/   [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1,     d = d*~n1*~bi, e = e*~n1*~bi, f = f*~n1*~bi ],
5559 /*10*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1     ],
5560 /*11*/  [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1,     f = f*~n1     ],
5561 /*12*/  [ a = a*~n1*~bi, b = b*~n1*~bi, c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1/~bi ],
5562 /*13*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1,     d = d*~n1*~bi, e = e*~n1,     f = f*~n1*~bi ],
5563 /*14*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1,     d = d*~n1,     e = e*~n1*~bi, f = f*~n1     ],
5564 /*15*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1/~bi, d = d*~n1,     e = e*~n1/~bi, f = f*~n1/~bi ],
5565 /*16*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1     ],
5566 /*17*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5567 /*18*/  [ a = a*~n1*~bi, b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1*~bi, f = f*~n1/~bi ],
5568 /*19*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1,     f = f*~n1*~bi ],
5569 /*20*/  [ a = a*~n1*~bi, b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1/~bi, f = f*~n1/~bi ],
5570 /*21*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1*~bi, d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5571 /*22*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1,     f = f*~n1     ],
5572 /*23*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1,     f = f*~n1/~bi ],
5573 /*24*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5574 /*25*/  [ a = a*~n1*~bi, b = b*~n1*~bi, c = c*~n1*~bi, d = d*~n1,     e = e*~n1,     f = f*~n1     ],
5575 /*26*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1*~bi, f = f*~n1     ],
5576 /*27*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1     ],
5577 /*28*/  [ a = a*~n1/~bi, b = b*~n1*~bi, c = c*~n1*~bi, d = d*~n1*~bi, e = e*~n1*~bi, f = f*~n1/~bi ],
5578 /*29*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1/~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1     ],
5579 /*30*/  [ a = a*~n1*~bi, b = b*~n1/~bi, c = c*~n1*~bi, d = d*~n1*~bi, e = e*~n1/~bi, f = f*~n1*~bi ],
5580 /*31*/  [ a = a*~n1/~bi, b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1/~bi ],
5581 /*32*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1,     d = d*~n1,     e = e*~n1*~bi, f = f*~n1     ],
5582 /*33*/  [ a = a*~n1*~bi, b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1/~bi, f = f*~n1     ],
5583 /*34*/  [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1,     d = d*~n1,     e = e*~n1*~bi, f = f*~n1*~bi ],
5584 /*35*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1/~bi ],
5585 /*36*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1,     f = f*~n1*~bi ],
5586 /*37*/  [ a = a*~n1*~bi, b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1     ],
5587 /*38*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1*~bi, f = f*~n1     ],
5588 /*39*/  [ a = a*~n1/~bi, b = b*~n1*~bi, c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1/~bi, f = f*~n1/~bi ],
5589 /*40*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1*~bi, f = f*~n1     ],
5590 /*41*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1/~bi, d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5591 /*42*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1/~bi, f = f*~n1     ],
5592 /*43*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1*~bi, d = d*~n1*~bi, e = e*~n1*~bi, f = f*~n1     ],
5593 /*44*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1/~bi ],
5594 /*45*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1     ],
5595 /*46*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1*~bi, f = f*~n1     ],
5596 /*47*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1     ],
5597 /*48*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1,     f = f*~n1     ],
5598 /*49*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1*~bi, d = d*~n1,     e = e*~n1/~bi, f = f*~n1*~bi ],
5599 /*50*/  [ a = a*~n1*~bi, b = b*~n1/~bi, c = c*~n1,     d = d*~n1,     e = e*~n1*~bi, f = f*~n1/~bi ],
5600 /*51*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1*~bi ],
5601 /*52*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1,     f = f*~n1/~bi ],
5602 /*53*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1     ],
5603 /*54*/  [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1*~bi, f = f*~n1*~bi ],
5604 /*55*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1,     d = d*~n1*~bi, e = e*~n1/~bi, f = f*~n1     ],
5605 /*56*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1/~bi ],
5606 /*57*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1/~bi, d = d*~n1,     e = e*~n1*~bi, f = f*~n1     ],
5607 /*58*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1*~bi ],
5608 /*59*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1/~bi, d = d*~n1,     e = e*~n1,     f = f*~n1/~bi ],
5609 /*60*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5610 /*61*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1     ],
5611 /*62*/  [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1*~bi, d = d*~n1*~bi, e = e*~n1/~bi, f = f*~n1/~bi ],
5612 /*63*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1/~bi, d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5613 /*64*/  [ a = a*~n1*~bi, b = b*~n1/~bi, c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1*~bi, f = f*~n1/~bi ]
5614
5615 /*1*/   [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1*~bi, e = e*~n1,     f = f*~n1*~bi ],...
5616
5617 */