OSDN Git Service

Added new synthdefs. Fixed bugs.
[timewavesynth/Timewave_Synthesizer.git] / timewavesynth8.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         fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12,
28         fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b,
29         fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c,
30         fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d,
31         fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e,
32         fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f,
33         fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g,
34         fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h;
35
36
37         //VARIABLES YOU MAY WISH TO CHANGE
38
39
40         //note A tuning frequency in hz
41
42         ~tuning_frequency = 432; //default 432 hz
43
44         ~freqmap = (
45                 i = ~tuning_frequency
46                 / (2 ** (69 / 12)); a = (-1); b = (-1);
47                 Array.fill(128, {i * (2 ** (((a=a+1) / 12).trunc)) * ( (2 ** (12.reciprocal)) ** ((b=b+1)  % 12));
48         }));/*~freqmap = (i = 8.0271480262684/*-0.0000000000024*/; ~stepratio = 1.0594630943593; Array.fill(128, { i = i*~stepratio;}));*/
49
50
51         //number of KW(King Wen) sequences in a timewave half-cycle (or amplitude x2)
52
53         ~synthdefnum = 12; //default 12
54
55
56         //timewave starting base (lowest) frequency
57
58         ~base_frequency = ~freqmap.at(38); //default 38 (72.081352125182 hz), replace "~freqmap.at(#)" for custom value
59
60
61         //starting synthdef setting
62
63         if((~kws_setting == nil) or: (~ratio_setting == nil), {
64
65                 ~kws_setting = 1; //default type of King Wen sequence interpretation
66
67                 ~ratio_setting = "psine1"; //default ratio setting for synthdef
68         });
69
70
71         //low-pass filter settings
72
73         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.
74
75         if(~low_pass_filter_set_value == nil, {~low_pass_filter_freq_limit = 1364.0007331375 * 1.6180339887499; //frequency limit for low-pass filter in synthdefs. default is (1500 * 1.6180339887499 or 2427.0509831249).
76         });
77
78         //volume
79
80         ~vol = 0.005; //default 0.005
81         ~vol1 = ~vol;
82         ~vol2 = ~vol;
83         ~vol3 = ~vol;
84         ~vol4 = ~vol;
85         ~vol5 = ~vol;
86         ~vol6 = ~vol;
87         ~vol7 = ~vol;
88         ~vol8 = ~vol;
89         ~vol9 = ~vol;
90         ~vol10 = ~vol;
91         ~vol11 = ~vol;
92         ~vol12 = ~vol;
93
94
95         //Key codes for keyboard functions - either unicode or keycode. To find key codes, see below:
96
97         ~rightarrow_keycode = 114; //next note change increase
98         ~leftarrow_keycode = 113; //next note change decrease
99         ~uparrow_keycode = 111; //change synth up
100         ~downarrow_keycode = 116; //change synth down
101         ~enter_unicode = 13; //
102         ~s_unicode = 115; //start synth
103         ~m_unicode = 109; //mute/unmute all synths
104         ~r_unicode = 114; //routine/loop function
105         ~u_unicode = 117; //
106         ~t_unicode = 116; //timer function
107         ~c_unicode = 99; //copy function
108         ~i_unicode = 105; //change synth up
109         ~k_unicode = 107; //change synth down
110         ~j_unicode = 106; //next note change decrease
111         ~l_unicode = 108; //next note change increase
112         ~spacebar_unicode = 32; //pause all synths
113         ~one_unicode = 49; //choose synth 1
114         ~two_unicode = 50; //choose synth 2
115         ~three_unicode = 51; //choose synth 3
116         ~four_unicode = 52; //choose synth 4
117         ~five_unicode = 53; //choose synth 5
118         ~six_unicode = 54; //choose synth 6
119         ~seven_unicode = 55; //choose synth 7
120         ~eight_unicode = 56; //choose synth 8
121         ~nine_unicode = 57; //choose synth 9
122         ~ten_unicode = 48; //choose synth 10
123         ~eleven_unicode = 45; //choose synth 11
124         ~twelve_unicode = 61; //choose synth 12
125         ~escape_unicode = 27; //escape function
126
127
128         //To find key codes in post window... Hightlight the function and its parenthesis in red below,
129         //and press "ctrl - enter" or "cmd - return" - then a small window called "test" will pop up...
130         //Press the "type" button inside of the window, then press anywhere on the keyboard to find
131         //the key codes in the right-hand side post window. Layout: [unicode, keycode, modifiers]. It is either a unicode
132         //or a keycode. Do not delete the /* and */ characters, or else the
133         //program will not run.
134
135         /*
136
137         (
138         var win = Window(\test, Rect(10, 100, 100, 50)),
139         btn = Button(win, Rect(5, 5, 90, 40)).states_([["type"]]);
140         btn.keyDownAction =
141         { arg view, char, modifiers, unicode, keycode;
142         ["unicode:"+unicode, "keycode:"+keycode, "modifiers:"+modifiers].postln;
143         };
144         win.front;
145         )
146
147         */
148
149
150         //gui set frequency ranges - currently set at the lowest and highest notes on a 128 key range using 432 hz A tuning
151         //you can change the tuning near top
152         //to insert custom ranges, replace "~freqmap.at()" with a hz frequency
153
154         ~outmin1 = ~freqmap.at(0);       // 8.0271480262684 hz                       //base frequency of upper set
155         ~outmax1 = ~freqmap.at(127);     // 12315.783879572 hz                       //high frequency of upper set
156         ~outmin2 = ~freqmap.at(0)*8;     // (8.0271480262684)*8 hz                   //base frequency of lower set
157         ~outmax2 = ~freqmap.at(127)/8;   // (12315.783879572)/8 hz;                  //high frequency of lower set
158
159         ~outmina = ~outmin2;
160         ~outmaxa = ~outmax2;
161         ~outminb = ~outmin1;
162         ~outmaxb = ~outmax1;
163
164
165         //increase or decrease magnitude of second and third harmonics for synthdefs and synth functions (not recommend changing if uncertain of effects)
166
167         //synthdefs
168
169         ~first_harmonic = 1;  //1
170         ~second_harmonic = 2; //2
171         ~third_harmonic = 6;  //6
172
173         //synth functions
174
175         ~icd3 = 3; //3
176         ~icd6 = 6; //6
177
178
179         //ratio values
180
181         ~fth = 1.4142135623729; //default kws binary interval
182         ~bi = ~fth; //~bi = "binary interval" - intverval of key change to hexgram's opposite in King Wen sequence
183         ~stepratio = 1.0594630943593;
184         ~nval = 1.0355417528;
185         ~n9s = 1.86;
186         ~n9 = 1.080059789899;
187         ~n18 = 1.0392592260319;
188         ~n27 = 1.0260044847071;
189         ~n36 = 1.0194406437022;
190         ~n45 = 1.0155225125043;
191         ~n54 = 1.012918794725;
192         ~n63 = 1.0110630844869;
193         ~n72 = 1.0096735332285;
194         ~gm = 1.6180339887499; //phi (golden mean), scaled on 1 key change per King Wen sequence
195         ~gm2 = 1.2720196495141;
196         ~gm6 = 1.0835058821738;
197         ~ngm1 = 1.0549232131786; //phi (golden mean), scaled on 9 key changes per King Wen sequence
198         ~ngm2 = 1.0270945492887;
199         ~ngm6 = 1.0089511542031;
200         ~nngm1 = 1.0075472729363; //phi (golden mean), scaled on 64 key changes per King Wen sequence
201         ~nngm2 = 1.0037665430449;
202         ~nngm6 = 1.0012539413222;
203         ~h1 = 11.10101010101; //based on 19.47:360, scaled on 1 key change per King Wen sequence
204         ~h2 = 4.2999982083345;
205         ~h6 = 1.6261331058274;
206         ~nh1 = 1.3828361607663; //based on 19.47:360, scaled on 9 key changes per King Wen sequence
207         ~nh2 = 1.1759405430404;
208         ~nh6 = 1.0555086286213;
209         ~nnh1 = 1.0466365180627; //based on 19.47:360, scaled on 64 key changes per King Wen sequence
210         ~nnh2 = 1.0230525490231;
211         ~nnh6 = 1.0076258811195;
212
213
214         ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
215
216
217         //starting notes
218
219         #f1,f2,f3,f4,f5,f6,f7,f8 = [
220                 (~freqmap.at(127)/8).rand,
221                 (~freqmap.at(127)/8).rand,
222                 (~freqmap.at(127)/8).rand,
223                 (~freqmap.at(127)/8).rand,
224                 (~freqmap.at(127)/8).rand,
225                 (~freqmap.at(127)/8).rand,
226                 (~freqmap.at(127)/8).rand,
227                 (~freqmap.at(127)/8).rand,
228         ];
229
230         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))});});
231
232         #fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12 = [~u1,~u2,~u3,~u4,~u5,~u6,~u7,~u8,~u9,~u10,~u11,~u12];
233         #fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b = [~u1b,~u2b,~u3b,~u4b,~u5b,~u6b,~u7b,~u8b,~u9b,~u10b,~u11b,~u12b];
234         #fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c = [~u1c,~u2c,~u3c,~u4c,~u5c,~u6c,~u7c,~u8c,~u9c,~u10c,~u11c,~u12c];
235         #fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d = [~u1d,~u2d,~u3d,~u4d,~u5d,~u6d,~u7d,~u8d,~u9d,~u10d,~u11d,~u12d];
236         #fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e = [~u1e,~u2e,~u3e,~u4e,~u5e,~u6e,~u7e,~u8e,~u9e,~u10e,~u11e,~u12e];
237         #fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f = [~u1f,~u2f,~u3f,~u4f,~u5f,~u6f,~u7f,~u8f,~u9f,~u10f,~u11f,~u12f];
238         #fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g = [~u1g,~u2g,~u3g,~u4g,~u5g,~u6g,~u7g,~u8g,~u9g,~u10g,~u11g,~u12g];
239         #fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h = [~u1h,~u2h,~u3h,~u4h,~u5h,~u6h,~u7h,~u8h,~u9h,~u10h,~u11h,~u12h];
240
241         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], {#fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12 = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ];});
242         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], {#fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ];});
243         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], {#fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ];});
244         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], {#fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ];});
245         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], {#fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ];});
246         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], {#fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ];});
247         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], {#fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ];});
248         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], {#fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ];});
249
250         /*#fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12 = [];
251         #fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b = [];
252         #fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c = [];
253         #fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d = [];
254         #fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e = [];
255         #fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f = [];
256         #fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g = [];
257         #fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h = [];
258
259         [];*/
260
261         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];});
262         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];});
263         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];});
264         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];});
265         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];});
266         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];});
267         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];});
268         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];});
269         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];});
270         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];});
271         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];});
272         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];});
273         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];});
274         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];});
275         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];});
276         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];});
277         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];});
278         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];});
279         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];});
280         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];});
281         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];});
282         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];});
283         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];});
284         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];});
285         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];});
286         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];});
287         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];});
288         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];});
289         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];});
290         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];});
291         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];});
292         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];});
293         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];});
294         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];});
295         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];});
296         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];});
297         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];});
298         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];});
299         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];});
300         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];});
301         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];});
302         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];});
303         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];});
304         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];});
305         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];});
306         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];});
307         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];});
308         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];});
309         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];});
310         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];});
311         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];});
312         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];});
313         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];});
314         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];});
315         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];});
316         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];});
317         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];});
318         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];});
319         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];});
320         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];});
321         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];});
322         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];});
323         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];});
324         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];});
325
326
327         //set n1-n9 ratio values
328
329         case
330         {~ratio_setting == "psine1";}{~n_value1 = ~gm;    ~n_value2 = ~gm2;   ~n_value6 = ~gm6;}
331         {~ratio_setting == "psine2";}{~n_value1 = ~ngm1;  ~n_value2 = ~ngm2;  ~n_value6 = ~ngm6;}
332         {~ratio_setting == "psine3";}{~n_value1 = ~nngm1; ~n_value2 = ~nngm2; ~n_value6 = ~nngm6;}
333         {~ratio_setting == "hsine1";}{~n_value1 = ~h1;    ~n_value2 = ~h2;    ~n_value6 = ~h6;}
334         {~ratio_setting == "hsine2";}{~n_value1 = ~nh1;   ~n_value2 = ~nh2;   ~n_value6 = ~nh6;}
335         {~ratio_setting == "hsine3";}{~n_value1 = ~nnh1;  ~n_value2 = ~nnh2;  ~n_value6 = ~nnh6;};
336
337
338         //King Wen sequence interpretation settings 1-3 for synthdefs
339
340         ~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 ]]};
341         ~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 ]]};
342
343         ~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 ]]};
344         ~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 ]]};
345
346         ~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    ]]};
347         ~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    ]]};
348
349
350         //synthdefs
351
352         ~gsine = {
353
354                 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,
355                         a, b, c, d, e, f, pan=0, fc = 1;
356                         var s1, out, env1, s2, dseq;
357                         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
358                         dseq = Dseq(
359                                 case
360                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
361                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
362                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~first_harmonic -1), {
363                                         case
364                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
365                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
366                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten, inf);
367                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur),Demand.ar(Impulse.ar(dur), 0, dseq));
368                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
369                         OffsetOut.ar(0, s1.dup*vol);
370                 }, [\ir]).add;
371
372                 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,
373                         a, b, c, d, e, f, pan=0, fc = 1, id = -1;
374                         var s1, out, env1, s2, dseq;
375                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value1)});
376                         dseq = Dseq([
377                                 case
378                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
379                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
380                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~first_harmonic -1), {
381                                         case
382                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
383                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
384                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten].flatten.reverse, inf);
385                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur), Demand.ar(Impulse.ar(dur), 0, dseq));
386                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
387                         OffsetOut.ar(0, s1.dup*vol);
388                 }, [\ir]).add;
389
390                 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,
391                         a, b, c, d, e, f, pan=0, fc = 1;
392                         var s1, out, env1, s2, dseq;
393                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value2)});
394                         dseq = Dseq(
395                                 case
396                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
397                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
398                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~second_harmonic -1), {
399                                         case
400                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
401                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
402                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten, inf);
403                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur),Demand.ar(Impulse.ar(dur), 0, dseq));
404                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
405                         OffsetOut.ar(0, s1.dup*vol);
406                 }, [\ir]).add;
407
408                 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,
409                         a, b, c, d, e, f, pan=0, fc = 1, id = -1;
410                         var s1, out, env1, s2, dseq;
411                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value2)});
412                         dseq = Dseq([
413                                 case
414                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
415                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
416                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~second_harmonic -1), {
417                                         case
418                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
419                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
420                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten].flatten.reverse, inf);
421                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur), Demand.ar(Impulse.ar(dur), 0, dseq));
422                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
423                         OffsetOut.ar(0, s1.dup*vol);
424                 }, [\ir]).add;
425
426                 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,
427                         a, b, c, d, e, f, pan=0, fc = 1;
428                         var s1, out, env1, s2, dseq;
429                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value6)});
430                         dseq = Dseq(
431                                 case
432                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
433                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
434                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~third_harmonic -1), {
435                                         case
436                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
437                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
438                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten, inf);
439                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur),Demand.ar(Impulse.ar(dur), 0, dseq));
440                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
441                         OffsetOut.ar(0, s1.dup*vol);
442                 }, [\ir]).add;
443
444                 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,
445                         a, b, c, d, e, f, pan=0, fc = 1;
446                         var s1, out, env1, s2, dseq;
447                         9.do(x = 0; {("n"++(x=x+1)).asSymbol.envirPut(~n_value6)});
448                         dseq = Dseq([
449                                 case
450                                 {~kws_setting == 1}{~kws_setting_1_a.value;}
451                                 {~kws_setting == 2}{~kws_setting_2_a.value;}
452                                 {~kws_setting == 3}{~kws_setting_3_a.value;} ++ Array.fill((~gsinenum*~third_harmonic -1), {
453                                         case
454                                         {~kws_setting == 1}{~kws_setting_1_b.value;}
455                                         {~kws_setting == 2}{~kws_setting_2_b.value;}
456                                         {~kws_setting == 3}{~kws_setting_3_b.value;}}).flatten].flatten.reverse, inf);
457                         s1 = GrainSin.ar(1, Impulse.ar(dur), 1/(dur), Demand.ar(Impulse.ar(dur), 0, dseq));
458                         if(~low_pass_filter_on == 1, {s1 = BLowPass.ar(s1, ~low_pass_filter_freq_limit);}, {s1 = s1});
459                         OffsetOut.ar(0, s1.dup*vol);
460                 }, [\ir]).add;
461         };
462
463
464         //set base (lowest) frequencies, set starting values for synthdef, and load synthdef on server boot
465
466         if((~gsinenum == nil) or: (~synthdef != "gsineicld"), {
467                 (
468                         if(~basefreq == nil, {~basefreq = ~base_frequency});
469                         ~fmult = 16;
470                         (#a,b,c,d,e,f = [ ~basefreq,~basefreq,~basefreq,~basefreq,~basefreq,~basefreq  ];
471                                 ~a = a; ~b = b; ~c =c; ~d = d; ~e = e;~f=f;);
472
473                         ~synthdef = "gsineicld"; ~gsinenum = ~synthdefnum;
474
475                         ~gsine.value;
476                 );
477         });
478
479
480         //generate GUI window
481
482         w = Window("Timewave Synth", Rect(0,0,Window.screenBounds.width,Window.screenBounds.height), border:true);
483
484         view = UserView(w, Window.screenBounds);
485         view.clearOnRefresh = false;
486         view.background = Color.black;
487
488         //vertical grid (inactive)
489
490         /*~b1 = Window.screenBounds.width/(12*4) /*25.462962962963*/; ~btu = 31; ~btd = 375; ~bw = 0.5; ~bh = 80; ~bcolor = Color.grey;
491         CompositeView(w, Rect(~b1, ~btu, ~bw, ~bh)).background = ~bcolor;
492         CompositeView(w, Rect(~b1, ~btd, ~bw, ~bh)).background = ~bcolor;
493         54.do({CompositeView(w, Rect(~b1 = ~b1+(Window.screenBounds.width/(12*4)), ~btu, ~bw, ~bh)).background = ~bcolor;});
494         ~b1 = Window.screenBounds.width/(12*4);
495         54.do({CompositeView(w, Rect(~b1 = ~b1+(Window.screenBounds.width/(12*4)), ~btd, ~bw, ~bh)).background = ~bcolor;});*/
496
497         ~nh = 2;
498         ~nw = ~nh*1.6180339887499;
499
500         ~tgrid = 30;
501         ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
502
503         ~dc1 = ~tgrid-5; ~dc2 = ~bgrid-5; ~dca = 10;
504
505         //horizontal grid
506
507         9.do(x=~tgrid-10; {CompositeView(w, Rect(1, x=x+10, Window.screenBounds.width, 0.5)).background = Color.new255(51, 51, 51)});
508         9.do(x=~bgrid-10; {CompositeView(w, Rect(1, x=x+10, Window.screenBounds.width, 0.5)).background = Color.new255(51, 51, 51)});
509
510         ~z1 = (CompositeView(w, Rect((if(~f1 == nil, {f1.value},{~f1.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
511         ~z2 = (CompositeView(w, Rect((if(~f2 == nil, {f2.value},{~f2.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
512         ~z3 = (CompositeView(w, Rect((if(~f3 == nil, {f3.value},{~f3.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
513         ~z4 = (CompositeView(w, Rect((if(~f4 == nil, {f4.value},{~f4.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
514         ~z5 = (CompositeView(w, Rect((if(~f5 == nil, {f5.value},{~f5.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
515         ~z6 = (CompositeView(w, Rect((if(~f6 == nil, {f6.value},{~f6.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
516         ~z7 = (CompositeView(w, Rect((if(~f7 == nil, {f7.value},{~f7.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
517         ~z8 = (CompositeView(w, Rect((if(~f8 == nil, {f8.value},{~f8.value}).explin(~outmin1,~outmax1,0,Window.screenBounds.width)), ~dc1=~dc1+10, ~nw, 2)).background = Color.white;);
518         ~zmid = (CompositeView(w, Rect(x, 280, ~nw, 2)).background = Color.clear;);
519         ~z25 = (CompositeView(w, Rect((if(~f1 == nil, {f1.value},{~f1.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
520         ~z26 = (CompositeView(w, Rect((if(~f2 == nil, {f2.value},{~f2.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
521         ~z27 = (CompositeView(w, Rect((if(~f3 == nil, {f3.value},{~f3.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
522         ~z28 = (CompositeView(w, Rect((if(~f4 == nil, {f4.value},{~f4.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
523         ~z29 = (CompositeView(w, Rect((if(~f5 == nil, {f5.value},{~f5.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
524         ~z30 = (CompositeView(w, Rect((if(~f6 == nil, {f6.value},{~f6.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
525         ~z31 = (CompositeView(w, Rect((if(~f7 == nil, {f7.value},{~f7.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
526         ~z32 = (CompositeView(w, Rect((if(~f8 == nil, {f8.value},{~f8.value}).explin(~outmin2,~outmax2,0,Window.screenBounds.width)), ~dc2=~dc2+10, ~nw, 2)).background = Color.white;);
527
528
529         ~dc1 = ~tgrid-5; ~dc2 = ~bgrid-5; ~dca = 10;
530
531
532         //synth functions (open, flow, slide, pause, free)
533
534         ~synthopen = {
535                 case
536                 {((~l1a.isRunning == false) and: (~l1a1.isRunning == false)) or: ~l1a1.isRunning == true}{
537                         if(~l1a1.isRunning == true, {
538                                 (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;
539                                         #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
540                                         #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
541                                         ~l1a1.set(\dur, f1,     \vol, vol1);  ~l1b1.set(\dur, f1,  \vol, vol1);
542                                         ~l1c1.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d1.set(\dur, f1/~icd3,  \vol, vol1);
543                                         ~l1e1.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f1.set(\dur, f1/~icd6,  \vol, vol1);
544                                         ~l2a1.set(\dur, f2,     \vol, vol2);          ~l2b1.set(\dur, f2,  \vol, vol2);
545                                         ~l2c1.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d1.set(\dur, f2/~icd3,  \vol, vol2);
546                                         ~l2e1.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f1.set(\dur, f2/~icd6,  \vol, vol2);
547                                         ~l3a1.set(\dur, f3,     \vol, vol3);          ~l3b1.set(\dur, f3,  \vol, vol3);
548                                         ~l3c1.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d1.set(\dur, f3/~icd3,  \vol, vol3);
549                                         ~l3e1.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f1.set(\dur, f3/~icd6,  \vol, vol3);
550                                         ~l4a1.set(\dur, f4,    \vol, vol4);           ~l4b1.set(\dur, f4,  \vol, vol4);
551                                         ~l4c1.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d1.set(\dur, f4/~icd3,  \vol, vol4);
552                                         ~l4e1.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f1.set(\dur, f4/~icd6,  \vol, vol4);
553                                         ~l5a1.set(\dur, f5,    \vol, vol5);           ~l5b1.set(\dur, f5,  \vol, vol5);
554                                         ~l5c1.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d1.set(\dur, f5/~icd3,  \vol, vol5);
555                                         ~l5e1.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f1.set(\dur, f5/~icd6,  \vol, vol5);
556                                         ~l6a1.set(\dur, f6,    \vol, vol6);           ~l6b1.set(\dur, f6,  \vol, vol6);
557                                         ~l6c1.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d1.set(\dur, f6/~icd3,  \vol, vol6);
558                                         ~l6e1.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f1.set(\dur, f6/~icd6,  \vol, vol6);
559                                         ~l7a1.set(\dur, f7,    \vol, vol7);           ~l7b1.set(\dur, f7,  \vol, vol7);
560                                         ~l7c1.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d1.set(\dur, f7/~icd3,  \vol, vol7);
561                                         ~l7e1.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f1.set(\dur, f7/~icd6,  \vol, vol7);
562                                         ~l8a1.set(\dur, f8,    \vol, vol8);           ~l8b1.set(\dur, f8,  \vol, vol8);
563                                         ~l8c1.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d1.set(\dur, f8/~icd3,  \vol, vol8);
564                                         ~l8e1.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f1.set(\dur, f8/~icd6,  \vol, vol8);
565                                 }););
566                         });
567
568                         (
569                                 1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6;
570                                         #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
571                                         #s1,s2,s3,s4,s5,s6 = [\gsineicfld6, \gsineicrld6, \gsineicfld2, \gsineicrld2, \gsineicfld1, \gsineicrld1];
572                                         ~l1a = Synth(s1, [\dur, ~f1,    \vol, vol1]).register;    ~l1b = Synth(s2, [\dur, ~f1,    \vol, vol1]);
573                                         ~l1c = Synth(s3, [\dur, ~f1/~icd3,  \vol, vol1]);   ~l1d = Synth(s4, [\dur, ~f1/~icd3,  \vol, vol1]);
574                                         ~l1e = Synth(s5, [\dur, ~f1/~icd6,  \vol, vol1]);   ~l1f = Synth(s6, [\dur, ~f1/~icd6,  \vol, vol1]);
575                                         ~l2a = Synth(s1, [\dur, ~f2,    \vol, vol2]);        ~l2b = Synth(s2, [\dur, ~f2,    \vol, vol2]);
576                                         ~l2c = Synth(s3, [\dur, ~f2/~icd3,  \vol, vol2]);   ~l2d = Synth(s4, [\dur, ~f2/~icd3,  \vol, vol2]);
577                                         ~l2e = Synth(s5, [\dur, ~f2/~icd6,  \vol, vol2]);   ~l2f = Synth(s6, [\dur, ~f2/~icd6,  \vol, vol2]);
578                                         ~l3a = Synth(s1, [\dur, ~f3,    \vol, vol3]);        ~l3b = Synth(s2, [\dur, ~f3,   \vol, vol3]);
579                                         ~l3c = Synth(s3, [\dur, ~f3/~icd3,  \vol, vol3]);   ~l3d = Synth(s4, [\dur, ~f3/~icd3, \vol, vol3]);
580                                         ~l3e = Synth(s5, [\dur, ~f3/~icd6,  \vol, vol3]);   ~l3f = Synth(s6, [\dur, ~f3/~icd6, \vol, vol3]);
581                                         ~l4a = Synth(s1, [\dur, ~f4,    \vol, vol4]);       ~l4b = Synth(s2, [\dur, ~f4,   \vol, vol4]);
582                                         ~l4c = Synth(s3, [\dur, ~f4/~icd3,  \vol, vol4]);  ~l4d = Synth(s4, [\dur, ~f4/~icd3, \vol, vol4]);
583                                         ~l4e = Synth(s5, [\dur, ~f4/~icd6,  \vol, vol4]);   ~l4f = Synth(s6, [\dur, ~f4/~icd6, \vol, vol4]);
584                                         ~l5a = Synth(s1, [\dur, ~f5,    \vol, vol5]);       ~l5b = Synth(s2, [\dur, ~f5,   \vol, vol5]);
585                                         ~l5c = Synth(s3, [\dur, ~f5/~icd3,  \vol, vol5]);   ~l5d = Synth(s4, [\dur, ~f5/~icd3, \vol, vol5]);
586                                         ~l5e = Synth(s5, [\dur, ~f5/~icd6,  \vol, vol5]);   ~l5f = Synth(s6, [\dur, ~f5/~icd6, \vol, vol5]);
587                                         ~l6a = Synth(s1, [\dur, ~f6,    \vol, vol6]);       ~l6b = Synth(s2, [\dur, ~f6,   \vol, vol6]);
588                                         ~l6c = Synth(s3, [\dur, ~f6/~icd3,  \vol, vol6]);   ~l6d = Synth(s4, [\dur, ~f6/~icd3, \vol, vol6]);
589                                         ~l6e = Synth(s5, [\dur, ~f6/~icd6,  \vol, vol6]);   ~l6f = Synth(s6, [\dur, ~f6/~icd6, \vol, vol6]);
590                                         ~l7a = Synth(s1, [\dur, ~f7,    \vol, vol7]);       ~l7b = Synth(s2, [\dur, ~f7,   \vol, vol7]);
591                                         ~l7c = Synth(s3, [\dur, ~f7/~icd3,  \vol, vol7]);   ~l7d = Synth(s4, [\dur, ~f7/~icd3, \vol, vol7]);
592                                         ~l7e = Synth(s5, [\dur, ~f7/~icd6,  \vol, vol7]);   ~l7f = Synth(s6, [\dur, ~f7/~icd6, \vol, vol7]);
593                                         ~l8a = Synth(s1, [\dur, ~f8,    \vol, vol8]);  ~l8b = Synth(s2, [\dur, ~f8,   \vol, vol8]);
594                                         ~l8c = Synth(s3, [\dur, ~f8/~icd3,  \vol, vol8]);   ~l8d = Synth(s4, [\dur, ~f8/~icd3, \vol, vol8]);
595                                         ~l8e = Synth(s5, [\dur, ~f8/~icd6,  \vol, vol8]);   ~l8f = Synth(s6, [\dur, ~f8/~icd6, \vol, vol8]);
596
597                                 });
598                         );
599                         if(~l1a1.isRunning == true, {
600                                 AppClock.sched(0.161803398875,{
601                                         ([~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;
602                                 });
603                         });
604                 }
605                 {~l1a.isRunning == true}{
606                         (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;
607                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
608                                 #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
609                                 ~l1a.set(\dur, f1,     \vol, vol1);  ~l1b.set(\dur, f1,  \vol, vol1);
610                                 ~l1c.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d.set(\dur, f1/~icd3,  \vol, vol1);
611                                 ~l1e.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f.set(\dur, f1/~icd6,  \vol, vol1);
612                                 ~l2a.set(\dur, f2,     \vol, vol2);          ~l2b.set(\dur, f2,  \vol, vol2);
613                                 ~l2c.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d.set(\dur, f2/~icd3,  \vol, vol2);
614                                 ~l2e.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f.set(\dur, f2/~icd6,  \vol, vol2);
615                                 ~l3a.set(\dur, f3,     \vol, vol3);          ~l3b.set(\dur, f3,  \vol, vol3);
616                                 ~l3c.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d.set(\dur, f3/~icd3,  \vol, vol3);
617                                 ~l3e.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f.set(\dur, f3/~icd6,  \vol, vol3);
618                                 ~l4a.set(\dur, f4,    \vol, vol4);           ~l4b.set(\dur, f4,  \vol, vol4);
619                                 ~l4c.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d.set(\dur, f4/~icd3,  \vol, vol4);
620                                 ~l4e.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f.set(\dur, f4/~icd6,  \vol, vol4);
621                                 ~l5a.set(\dur, f5,    \vol, vol5);           ~l5b.set(\dur, f5,  \vol, vol5);
622                                 ~l5c.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d.set(\dur, f5/~icd3,  \vol, vol5);
623                                 ~l5e.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f.set(\dur, f5/~icd6,  \vol, vol5);
624                                 ~l6a.set(\dur, f6,    \vol, vol6);           ~l6b.set(\dur, f6,  \vol, vol6);
625                                 ~l6c.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d.set(\dur, f6/~icd3,  \vol, vol6);
626                                 ~l6e.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f.set(\dur, f6/~icd6,  \vol, vol6);
627                                 ~l7a.set(\dur, f7,    \vol, vol7);           ~l7b.set(\dur, f7,  \vol, vol7);
628                                 ~l7c.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d.set(\dur, f7/~icd3,  \vol, vol7);
629                                 ~l7e.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f.set(\dur, f7/~icd6,  \vol, vol7);
630                                 ~l8a.set(\dur, f8,    \vol, vol8);           ~l8b.set(\dur, f8,  \vol, vol8);
631                                 ~l8c.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d.set(\dur, f8/~icd3,  \vol, vol8);
632                                 ~l8e.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f.set(\dur, f8/~icd6,  \vol, vol8);
633                         }););
634
635                         (
636                                 1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6;
637                                         #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
638                                         #s1,s2,s3,s4,s5,s6 = [\gsineicfld6, \gsineicrld6, \gsineicfld2, \gsineicrld2, \gsineicfld1, \gsineicrld1];
639                                         ~l1a1 = Synth(s1, [\dur, ~f1,    \vol, vol1]).register;    ~l1b1 = Synth(s2, [\dur, ~f1,    \vol, vol1]);
640                                         ~l1c1 = Synth(s3, [\dur, ~f1/~icd3,  \vol, vol1]);   ~l1d1 = Synth(s4, [\dur, ~f1/~icd3,  \vol, vol1]);
641                                         ~l1e1 = Synth(s5, [\dur, ~f1/~icd6,  \vol, vol1]);   ~l1f1 = Synth(s6, [\dur, ~f1/~icd6,  \vol, vol1]);
642                                         ~l2a1 = Synth(s1, [\dur, ~f2,    \vol, vol2]);        ~l2b1 = Synth(s2, [\dur, ~f2,    \vol, vol2]);
643                                         ~l2c1 = Synth(s3, [\dur, ~f2/~icd3,  \vol, vol2]);   ~l2d1 = Synth(s4, [\dur, ~f2/~icd3,  \vol, vol2]);
644                                         ~l2e1 = Synth(s5, [\dur, ~f2/~icd6,  \vol, vol2]);   ~l2f1 = Synth(s6, [\dur, ~f2/~icd6,  \vol, vol2]);
645                                         ~l3a1 = Synth(s1, [\dur, ~f3,    \vol, vol3]);        ~l3b1 = Synth(s2, [\dur, ~f3,   \vol, vol3]);
646                                         ~l3c1 = Synth(s3, [\dur, ~f3/~icd3,  \vol, vol3]);   ~l3d1 = Synth(s4, [\dur, ~f3/~icd3, \vol, vol3]);
647                                         ~l3e1 = Synth(s5, [\dur, ~f3/~icd6,  \vol, vol3]);   ~l3f1 = Synth(s6, [\dur, ~f3/~icd6, \vol, vol3]);
648                                         ~l4a1 = Synth(s1, [\dur, ~f4,    \vol, vol4]);       ~l4b1 = Synth(s2, [\dur, ~f4,   \vol, vol4]);
649                                         ~l4c1 = Synth(s3, [\dur, ~f4/~icd3,  \vol, vol4]);  ~l4d1 = Synth(s4, [\dur, ~f4/~icd3, \vol, vol4]);
650                                         ~l4e1 = Synth(s5, [\dur, ~f4/~icd6,  \vol, vol4]);   ~l4f1 = Synth(s6, [\dur, ~f4/~icd6, \vol, vol4]);
651                                         ~l5a1 = Synth(s1, [\dur, ~f5,    \vol, vol5]);       ~l5b1 = Synth(s2, [\dur, ~f5,   \vol, vol5]);
652                                         ~l5c1 = Synth(s3, [\dur, ~f5/~icd3,  \vol, vol5]);   ~l5d1 = Synth(s4, [\dur, ~f5/~icd3, \vol, vol5]);
653                                         ~l5e1 = Synth(s5, [\dur, ~f5/~icd6,  \vol, vol5]);   ~l5f1 = Synth(s6, [\dur, ~f5/~icd6, \vol, vol5]);
654                                         ~l6a1 = Synth(s1, [\dur, ~f6,    \vol, vol6]);       ~l6b1 = Synth(s2, [\dur, ~f6,   \vol, vol6]);
655                                         ~l6c1 = Synth(s3, [\dur, ~f6/~icd3,  \vol, vol6]);   ~l6d1 = Synth(s4, [\dur, ~f6/~icd3, \vol, vol6]);
656                                         ~l6e1 = Synth(s5, [\dur, ~f6/~icd6,  \vol, vol6]);   ~l6f1 = Synth(s6, [\dur, ~f6/~icd6, \vol, vol6]);
657                                         ~l7a1 = Synth(s1, [\dur, ~f7,    \vol, vol7]);       ~l7b1 = Synth(s2, [\dur, ~f7,   \vol, vol7]);
658                                         ~l7c1 = Synth(s3, [\dur, ~f7/~icd3,  \vol, vol7]);   ~l7d1 = Synth(s4, [\dur, ~f7/~icd3, \vol, vol7]);
659                                         ~l7e1 = Synth(s5, [\dur, ~f7/~icd6,  \vol, vol7]);   ~l7f1 = Synth(s6, [\dur, ~f7/~icd6, \vol, vol7]);
660                                         ~l8a1 = Synth(s1, [\dur, ~f8,    \vol, vol8]);  ~l8b1 = Synth(s2, [\dur, ~f8,   \vol, vol8]);
661                                         ~l8c1 = Synth(s3, [\dur, ~f8/~icd3,  \vol, vol8]);   ~l8d1 = Synth(s4, [\dur, ~f8/~icd3, \vol, vol8]);
662                                         ~l8e1 = Synth(s5, [\dur, ~f8/~icd6,  \vol, vol8]);   ~l8f1 = Synth(s6, [\dur, ~f8/~icd6, \vol, vol8]);
663
664                                 });
665                         );
666                         AppClock.sched(0.161803398875,{
667                                 ([~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;
668                         });
669                 };
670
671                 if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (CompositeView(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (CompositeView(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
672                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (CompositeView(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (CompositeView(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
673                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (CompositeView(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (CompositeView(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
674                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (CompositeView(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (CompositeView(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
675                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (CompositeView(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (CompositeView(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
676                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (CompositeView(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (CompositeView(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
677                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (CompositeView(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (CompositeView(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
678                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (CompositeView(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (CompositeView(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
679
680                 b3.value = 1;
681         };
682
683         ~synthflow = {
684                 case
685                 {~l1a1.isRunning == true}{
686                         (1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6;
687                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
688                                 ~l1a1.set(\dur, ~f1,     \vol, vol1);  ~l1b1.set(\dur, ~f1,  \vol, vol1);
689                                 ~l1c1.set(\dur, ~f1/~icd3,       \vol, vol1);  ~l1d1.set(\dur, ~f1/~icd3,  \vol, vol1);
690                                 ~l1e1.set(\dur, ~f1/~icd6,       \vol, vol1);  ~l1f1.set(\dur, ~f1/~icd6,  \vol, vol1);
691                                 ~l2a1.set(\dur, ~f2,     \vol, vol2);          ~l2b1.set(\dur, ~f2,  \vol, vol2);
692                                 ~l2c1.set(\dur, ~f2/~icd3,       \vol, vol2);  ~l2d1.set(\dur, ~f2/~icd3,  \vol, vol2);
693                                 ~l2e1.set(\dur, ~f2/~icd6,       \vol, vol2);  ~l2f1.set(\dur, ~f2/~icd6,  \vol, vol2);
694                                 ~l3a1.set(\dur, ~f3,     \vol, vol3);          ~l3b1.set(\dur, ~f3,  \vol, vol3);
695                                 ~l3c1.set(\dur, ~f3/~icd3,       \vol, vol3);  ~l3d1.set(\dur, ~f3/~icd3,  \vol, vol3);
696                                 ~l3e1.set(\dur, ~f3/~icd6,       \vol, vol3);  ~l3f1.set(\dur, ~f3/~icd6,  \vol, vol3);
697                                 ~l4a1.set(\dur, ~f4,    \vol, vol4);           ~l4b1.set(\dur, ~f4,  \vol, vol4);
698                                 ~l4c1.set(\dur, ~f4/~icd3,       \vol, vol4);  ~l4d1.set(\dur, ~f4/~icd3,  \vol, vol4);
699                                 ~l4e1.set(\dur, ~f4/~icd6,       \vol, vol4);  ~l4f1.set(\dur, ~f4/~icd6,  \vol, vol4);
700                                 ~l5a1.set(\dur, ~f5,    \vol, vol5);           ~l5b1.set(\dur, ~f5,  \vol, vol5);
701                                 ~l5c1.set(\dur, ~f5/~icd3,       \vol, vol5);  ~l5d1.set(\dur, ~f5/~icd3,  \vol, vol5);
702                                 ~l5e1.set(\dur, ~f5/~icd6,       \vol, vol5);  ~l5f1.set(\dur, ~f5/~icd6,  \vol, vol5);
703                                 ~l6a1.set(\dur, ~f6,    \vol, vol6);           ~l6b1.set(\dur, ~f6,  \vol, vol6);
704                                 ~l6c1.set(\dur, ~f6/~icd3,       \vol, vol6);  ~l6d1.set(\dur, ~f6/~icd3,  \vol, vol6);
705                                 ~l6e1.set(\dur, ~f6/~icd6,       \vol, vol6);  ~l6f1.set(\dur, ~f6/~icd6,  \vol, vol6);
706                                 ~l7a1.set(\dur, ~f7,    \vol, vol7);           ~l7b1.set(\dur, ~f7,  \vol, vol7);
707                                 ~l7c1.set(\dur, ~f7/~icd3,       \vol, vol7);  ~l7d1.set(\dur, ~f7/~icd3,  \vol, vol7);
708                                 ~l7e1.set(\dur, ~f7/~icd6,       \vol, vol7);  ~l7f1.set(\dur, ~f7/~icd6,  \vol, vol7);
709                                 ~l8a1.set(\dur, ~f8,    \vol, vol8);           ~l8b1.set(\dur, ~f8,  \vol, vol8);
710                                 ~l8c1.set(\dur, ~f8/~icd3,       \vol, vol8);  ~l8d1.set(\dur, ~f8/~icd3,  \vol, vol8);
711                                 ~l8e1.set(\dur, ~f8/~icd6,       \vol, vol8);  ~l8f1.set(\dur, ~f8/~icd6,  \vol, vol8);
712                         }););
713                 }
714                 {~l1a.isRunning == true} {
715                         (1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6;
716                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
717                                 ~l1a.set(\dur, ~f1,     \vol, vol1);  ~l1b.set(\dur, ~f1,  \vol, vol1);
718                                 ~l1c.set(\dur, ~f1/~icd3,       \vol, vol1);  ~l1d.set(\dur, ~f1/~icd3,  \vol, vol1);
719                                 ~l1e.set(\dur, ~f1/~icd6,       \vol, vol1);  ~l1f.set(\dur, ~f1/~icd6,  \vol, vol1);
720                                 ~l2a.set(\dur, ~f2,     \vol, vol2);          ~l2b.set(\dur, ~f2,  \vol, vol2);
721                                 ~l2c.set(\dur, ~f2/~icd3,       \vol, vol2);  ~l2d.set(\dur, ~f2/~icd3,  \vol, vol2);
722                                 ~l2e.set(\dur, ~f2/~icd6,       \vol, vol2);  ~l2f.set(\dur, ~f2/~icd6,  \vol, vol2);
723                                 ~l3a.set(\dur, ~f3,     \vol, vol3);          ~l3b.set(\dur, ~f3,  \vol, vol3);
724                                 ~l3c.set(\dur, ~f3/~icd3,       \vol, vol3);  ~l3d.set(\dur, ~f3/~icd3,  \vol, vol3);
725                                 ~l3e.set(\dur, ~f3/~icd6,       \vol, vol3);  ~l3f.set(\dur, ~f3/~icd6,  \vol, vol3);
726                                 ~l4a.set(\dur, ~f4,    \vol, vol4);           ~l4b.set(\dur, ~f4,  \vol, vol4);
727                                 ~l4c.set(\dur, ~f4/~icd3,       \vol, vol4);  ~l4d.set(\dur, ~f4/~icd3,  \vol, vol4);
728                                 ~l4e.set(\dur, ~f4/~icd6,       \vol, vol4);  ~l4f.set(\dur, ~f4/~icd6,  \vol, vol4);
729                                 ~l5a.set(\dur, ~f5,    \vol, vol5);           ~l5b.set(\dur, ~f5,  \vol, vol5);
730                                 ~l5c.set(\dur, ~f5/~icd3,       \vol, vol5);  ~l5d.set(\dur, ~f5/~icd3,  \vol, vol5);
731                                 ~l5e.set(\dur, ~f5/~icd6,       \vol, vol5);  ~l5f.set(\dur, ~f5/~icd6,  \vol, vol5);
732                                 ~l6a.set(\dur, ~f6,    \vol, vol6);           ~l6b.set(\dur, ~f6,  \vol, vol6);
733                                 ~l6c.set(\dur, ~f6/~icd3,       \vol, vol6);  ~l6d.set(\dur, ~f6/~icd3,  \vol, vol6);
734                                 ~l6e.set(\dur, ~f6/~icd6,       \vol, vol6);  ~l6f.set(\dur, ~f6/~icd6,  \vol, vol6);
735                                 ~l7a.set(\dur, ~f7,    \vol, vol7);           ~l7b.set(\dur, ~f7,  \vol, vol7);
736                                 ~l7c.set(\dur, ~f7/~icd3,       \vol, vol7);  ~l7d.set(\dur, ~f7/~icd3,  \vol, vol7);
737                                 ~l7e.set(\dur, ~f7/~icd6,       \vol, vol7);  ~l7f.set(\dur, ~f7/~icd6,  \vol, vol7);
738                                 ~l8a.set(\dur, ~f8,    \vol, vol8);           ~l8b.set(\dur, ~f8,  \vol, vol8);
739                                 ~l8c.set(\dur, ~f8/~icd3,       \vol, vol8);  ~l8d.set(\dur, ~f8/~icd3,  \vol, vol8);
740                                 ~l8e.set(\dur, ~f8/~icd6,       \vol, vol8);  ~l8f.set(\dur, ~f8/~icd6,  \vol, vol8);
741
742                         }););
743                 };
744
745                 if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (CompositeView(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (CompositeView(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
746                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (CompositeView(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (CompositeView(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
747                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (CompositeView(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (CompositeView(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
748                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (CompositeView(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (CompositeView(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
749                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (CompositeView(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (CompositeView(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
750                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (CompositeView(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (CompositeView(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
751                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (CompositeView(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (CompositeView(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
752                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (CompositeView(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (CompositeView(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
753
754         };
755
756         ~synthslide = {
757                 case
758                 {~l1a1.isRunning == true}{(//fprog
759                         ~slideroutine = Routine({1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6;
760                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
761                                 ~slidedo.do({~slidecount=~slidecount-1;
762                                         (
763                                                 [ ~f1=~f1+g,~f2=~f2+h,~f3=~f3+i,~f4=~f4+j,~f5=~f5+k,~f6=~f6+l,~f7=~f7+m,~f8=~f8+n ];
764                                                 ~l1a1.set(\dur, ~f1,     \vol, vol1);  ~l1b1.set(\dur, ~f1,  \vol, vol1);
765                                                 ~l1c1.set(\dur, ~f1/~icd3,       \vol, vol1);  ~l1d1.set(\dur, ~f1/~icd3,  \vol, vol1);
766                                                 ~l1e1.set(\dur, ~f1/~icd6,       \vol, vol1);  ~l1f1.set(\dur, ~f1/~icd6,  \vol, vol1);
767                                                 ~l2a1.set(\dur, ~f2,     \vol, vol2);          ~l2b1.set(\dur, ~f2,  \vol, vol2);
768                                                 ~l2c1.set(\dur, ~f2/~icd3,       \vol, vol2);  ~l2d1.set(\dur, ~f2/~icd3,  \vol, vol2);
769                                                 ~l2e1.set(\dur, ~f2/~icd6,       \vol, vol2);  ~l2f1.set(\dur, ~f2/~icd6,  \vol, vol2);
770                                                 ~l3a1.set(\dur, ~f3,     \vol, vol3);          ~l3b1.set(\dur, ~f3,  \vol, vol3);
771                                                 ~l3c1.set(\dur, ~f3/~icd3,       \vol, vol3);  ~l3d1.set(\dur, ~f3/~icd3,  \vol, vol3);
772                                                 ~l3e1.set(\dur, ~f3/~icd6,       \vol, vol3);  ~l3f1.set(\dur, ~f3/~icd6,  \vol, vol3);
773                                                 ~l4a1.set(\dur, ~f4,    \vol, vol4);           ~l4b1.set(\dur, ~f4,  \vol, vol4);
774                                                 ~l4c1.set(\dur, ~f4/~icd3,       \vol, vol4);  ~l4d1.set(\dur, ~f4/~icd3,  \vol, vol4);
775                                                 ~l4e1.set(\dur, ~f4/~icd6,       \vol, vol4);  ~l4f1.set(\dur, ~f4/~icd6,  \vol, vol4);
776                                                 ~l5a1.set(\dur, ~f5,    \vol, vol5);           ~l5b1.set(\dur, ~f5,  \vol, vol5);
777                                                 ~l5c1.set(\dur, ~f5/~icd3,       \vol, vol5);  ~l5d1.set(\dur, ~f5/~icd3,  \vol, vol5);
778                                                 ~l5e1.set(\dur, ~f5/~icd6,       \vol, vol5);  ~l5f1.set(\dur, ~f5/~icd6,  \vol, vol5);
779                                                 ~l6a1.set(\dur, ~f6,    \vol, vol6);           ~l6b1.set(\dur, ~f6,  \vol, vol6);
780                                                 ~l6c1.set(\dur, ~f6/~icd3,       \vol, vol6);  ~l6d1.set(\dur, ~f6/~icd3,  \vol, vol6);
781                                                 ~l6e1.set(\dur, ~f6/~icd6,       \vol, vol6);  ~l6f1.set(\dur, ~f6/~icd6,  \vol, vol6);
782                                                 ~l7a1.set(\dur, ~f7,    \vol, vol7);           ~l7b1.set(\dur, ~f7,  \vol, vol7);
783                                                 ~l7c1.set(\dur, ~f7/~icd3,       \vol, vol7);  ~l7d1.set(\dur, ~f7/~icd3,  \vol, vol7);
784                                                 ~l7e1.set(\dur, ~f7/~icd6,       \vol, vol7);  ~l7f1.set(\dur, ~f7/~icd6,  \vol, vol7);
785                                                 ~l8a1.set(\dur, ~f8,    \vol, vol8);           ~l8b1.set(\dur, ~f8,  \vol, vol8);
786                                                 ~l8c1.set(\dur, ~f8/~icd3,       \vol, vol8);  ~l8d1.set(\dur, ~f8/~icd3,  \vol, vol8);
787                                                 ~l8e1.set(\dur, ~f8/~icd6,       \vol, vol8);  ~l8f1.set(\dur, ~f8/~icd6,  \vol, vol8);
788
789                                         );
790
791                                         {if(~slidecount==0,{
792                                                 if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (CompositeView(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (CompositeView(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
793                                                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (CompositeView(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (CompositeView(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
794                                                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (CompositeView(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (CompositeView(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
795                                                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (CompositeView(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (CompositeView(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
796                                                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (CompositeView(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (CompositeView(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
797                                                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (CompositeView(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (CompositeView(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
798                                                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (CompositeView(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (CompositeView(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
799                                                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (CompositeView(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (CompositeView(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
800                                         });}.defer;
801
802                                         (~slidetime/~slidedo).wait;});});}).play;);}
803                 {~l1a.isRunning == true} {(//fprog
804                         ~slideroutine = Routine({1.do({var vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8,s1,s2,s3,s4,s5,s6;
805                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
806                                 ~slidedo.do({~slidecount=~slidecount-1;
807                                         (
808                                                 [ ~f1=~f1+g,~f2=~f2+h,~f3=~f3+i,~f4=~f4+j,~f5=~f5+k,~f6=~f6+l,~f7=~f7+m,~f8=~f8+n ];
809                                                 ~l1a.set(\dur, ~f1,     \vol, vol1);  ~l1b.set(\dur, ~f1,  \vol, vol1);
810                                                 ~l1c.set(\dur, ~f1/~icd3,       \vol, vol1);  ~l1d.set(\dur, ~f1/~icd3,  \vol, vol1);
811                                                 ~l1e.set(\dur, ~f1/~icd6,       \vol, vol1);  ~l1f.set(\dur, ~f1/~icd6,  \vol, vol1);
812                                                 ~l2a.set(\dur, ~f2,     \vol, vol2);          ~l2b.set(\dur, ~f2,  \vol, vol2);
813                                                 ~l2c.set(\dur, ~f2/~icd3,       \vol, vol2);  ~l2d.set(\dur, ~f2/~icd3,  \vol, vol2);
814                                                 ~l2e.set(\dur, ~f2/~icd6,       \vol, vol2);  ~l2f.set(\dur, ~f2/~icd6,  \vol, vol2);
815                                                 ~l3a.set(\dur, ~f3,     \vol, vol3);          ~l3b.set(\dur, ~f3,  \vol, vol3);
816                                                 ~l3c.set(\dur, ~f3/~icd3,       \vol, vol3);  ~l3d.set(\dur, ~f3/~icd3,  \vol, vol3);
817                                                 ~l3e.set(\dur, ~f3/~icd6,       \vol, vol3);  ~l3f.set(\dur, ~f3/~icd6,  \vol, vol3);
818                                                 ~l4a.set(\dur, ~f4,    \vol, vol4);           ~l4b.set(\dur, ~f4,  \vol, vol4);
819                                                 ~l4c.set(\dur, ~f4/~icd3,       \vol, vol4);  ~l4d.set(\dur, ~f4/~icd3,  \vol, vol4);
820                                                 ~l4e.set(\dur, ~f4/~icd6,       \vol, vol4);  ~l4f.set(\dur, ~f4/~icd6,  \vol, vol4);
821                                                 ~l5a.set(\dur, ~f5,    \vol, vol5);           ~l5b.set(\dur, ~f5,  \vol, vol5);
822                                                 ~l5c.set(\dur, ~f5/~icd3,       \vol, vol5);  ~l5d.set(\dur, ~f5/~icd3,  \vol, vol5);
823                                                 ~l5e.set(\dur, ~f5/~icd6,       \vol, vol5);  ~l5f.set(\dur, ~f5/~icd6,  \vol, vol5);
824                                                 ~l6a.set(\dur, ~f6,    \vol, vol6);           ~l6b.set(\dur, ~f6,  \vol, vol6);
825                                                 ~l6c.set(\dur, ~f6/~icd3,       \vol, vol6);  ~l6d.set(\dur, ~f6/~icd3,  \vol, vol6);
826                                                 ~l6e.set(\dur, ~f6/~icd6,       \vol, vol6);  ~l6f.set(\dur, ~f6/~icd6,  \vol, vol6);
827                                                 ~l7a.set(\dur, ~f7,    \vol, vol7);           ~l7b.set(\dur, ~f7,  \vol, vol7);
828                                                 ~l7c.set(\dur, ~f7/~icd3,       \vol, vol7);  ~l7d.set(\dur, ~f7/~icd3,  \vol, vol7);
829                                                 ~l7e.set(\dur, ~f7/~icd6,       \vol, vol7);  ~l7f.set(\dur, ~f7/~icd6,  \vol, vol7);
830                                                 ~l8a.set(\dur, ~f8,    \vol, vol8);           ~l8b.set(\dur, ~f8,  \vol, vol8);
831                                                 ~l8c.set(\dur, ~f8/~icd3,       \vol, vol8);  ~l8d.set(\dur, ~f8/~icd3,  \vol, vol8);
832                                                 ~l8e.set(\dur, ~f8/~icd6,       \vol, vol8);  ~l8f.set(\dur, ~f8/~icd6,  \vol, vol8);
833
834
835                                         );
836
837                                         {if(~slidecount==0,{if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (CompositeView(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (CompositeView(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
838                                                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (CompositeView(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (CompositeView(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
839                                                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (CompositeView(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (CompositeView(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
840                                                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (CompositeView(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (CompositeView(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
841                                                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (CompositeView(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (CompositeView(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
842                                                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (CompositeView(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (CompositeView(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
843                                                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (CompositeView(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (CompositeView(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
844                                                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (CompositeView(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (CompositeView(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
845                                         });}.defer;
846
847                                         (~slidetime/~slidedo).wait;});});}).play;);};
848         };
849
850         ~synthpause = {(
851                 case
852                 {~l1a1.isRunning == true}{
853                         (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;
854                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
855                                 #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
856                                 ~l1a1.set(\dur, f1,     \vol, vol1);          ~l1b1.set(\dur, f1,  \vol, vol1);
857                                 ~l1c1.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d1.set(\dur, f1/~icd3,  \vol, vol1);
858                                 ~l1e1.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f1.set(\dur, f1/~icd6,  \vol, vol1);
859                                 ~l2a1.set(\dur, f2,     \vol, vol2);          ~l2b1.set(\dur, f2,  \vol, vol2);
860                                 ~l2c1.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d1.set(\dur, f2/~icd3,  \vol, vol2);
861                                 ~l2e1.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f1.set(\dur, f2/~icd6,  \vol, vol2);
862                                 ~l3a1.set(\dur, f3,     \vol, vol3);          ~l3b1.set(\dur, f3,  \vol, vol3);
863                                 ~l3c1.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d1.set(\dur, f3/~icd3,  \vol, vol3);
864                                 ~l3e1.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f1.set(\dur, f3/~icd6,  \vol, vol3);
865                                 ~l4a1.set(\dur, f4,    \vol, vol4);           ~l4b1.set(\dur, f4,  \vol, vol4);
866                                 ~l4c1.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d1.set(\dur, f4/~icd3,  \vol, vol4);
867                                 ~l4e1.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f1.set(\dur, f4/~icd6,  \vol, vol4);
868                                 ~l5a1.set(\dur, f5,    \vol, vol5);           ~l5b1.set(\dur, f5,  \vol, vol5);
869                                 ~l5c1.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d1.set(\dur, f5/~icd3,  \vol, vol5);
870                                 ~l5e1.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f1.set(\dur, f5/~icd6,  \vol, vol5);
871                                 ~l6a1.set(\dur, f6,    \vol, vol6);           ~l6b1.set(\dur, f6,  \vol, vol6);
872                                 ~l6c1.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d1.set(\dur, f6/~icd3,  \vol, vol6);
873                                 ~l6e1.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f1.set(\dur, f6/~icd6,  \vol, vol6);
874                                 ~l7a1.set(\dur, f7,    \vol, vol7);           ~l7b1.set(\dur, f7,  \vol, vol7);
875                                 ~l7c1.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d1.set(\dur, f7/~icd3,  \vol, vol7);
876                                 ~l7e1.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f1.set(\dur, f7/~icd6,  \vol, vol7);
877                                 ~l8a1.set(\dur, f8,    \vol, vol8);           ~l8b1.set(\dur, f8,  \vol, vol8);
878                                 ~l8c1.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d1.set(\dur, f8/~icd3,  \vol, vol8);
879                                 ~l8e1.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f1.set(\dur, f8/~icd6,  \vol, vol8);
880                         }););
881                 }
882                 {~l1a.isRunning == true} {
883                         (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;
884                                 #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
885                                 #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
886                                 ~l1a.set(\dur, f1,     \vol, vol1);  ~l1b.set(\dur, f1,  \vol, vol1);
887                                 ~l1c.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d.set(\dur, f1/~icd3,  \vol, vol1);
888                                 ~l1e.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f.set(\dur, f1/~icd6,  \vol, vol1);
889                                 ~l2a.set(\dur, f2,     \vol, vol2);          ~l2b.set(\dur, f2,  \vol, vol2);
890                                 ~l2c.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d.set(\dur, f2/~icd3,  \vol, vol2);
891                                 ~l2e.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f.set(\dur, f2/~icd6,  \vol, vol2);
892                                 ~l3a.set(\dur, f3,     \vol, vol3);          ~l3b.set(\dur, f3,  \vol, vol3);
893                                 ~l3c.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d.set(\dur, f3/~icd3,  \vol, vol3);
894                                 ~l3e.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f.set(\dur, f3/~icd6,  \vol, vol3);
895                                 ~l4a.set(\dur, f4,    \vol, vol4);           ~l4b.set(\dur, f4,  \vol, vol4);
896                                 ~l4c.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d.set(\dur, f4/~icd3,  \vol, vol4);
897                                 ~l4e.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f.set(\dur, f4/~icd6,  \vol, vol4);
898                                 ~l5a.set(\dur, f5,    \vol, vol5);           ~l5b.set(\dur, f5,  \vol, vol5);
899                                 ~l5c.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d.set(\dur, f5/~icd3,  \vol, vol5);
900                                 ~l5e.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f.set(\dur, f5/~icd6,  \vol, vol5);
901                                 ~l6a.set(\dur, f6,    \vol, vol6);           ~l6b.set(\dur, f6,  \vol, vol6);
902                                 ~l6c.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d.set(\dur, f6/~icd3,  \vol, vol6);
903                                 ~l6e.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f.set(\dur, f6/~icd6,  \vol, vol6);
904                                 ~l7a.set(\dur, f7,    \vol, vol7);           ~l7b.set(\dur, f7,  \vol, vol7);
905                                 ~l7c.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d.set(\dur, f7/~icd3,  \vol, vol7);
906                                 ~l7e.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f.set(\dur, f7/~icd6,  \vol, vol7);
907                                 ~l8a.set(\dur, f8,    \vol, vol8);           ~l8b.set(\dur, f8,  \vol, vol8);
908                                 ~l8c.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d.set(\dur, f8/~icd3,  \vol, vol8);
909                                 ~l8e.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f.set(\dur, f8/~icd6,  \vol, vol8);
910
911                         }););
912                 };
913                 );
914         };
915
916         ~synthfree = {
917                 (
918                         case
919                         {~l1a1.isRunning == true}{
920                                 (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;
921                                         #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
922                                         #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
923                                         ~l1a1.set(\dur, f1,     \vol, vol1);  ~l1b1.set(\dur, f1,  \vol, vol1);
924                                         ~l1c1.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d1.set(\dur, f1/~icd3,  \vol, vol1);
925                                         ~l1e1.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f1.set(\dur, f1/~icd6,  \vol, vol1);
926                                         ~l2a1.set(\dur, f2,     \vol, vol2);          ~l2b1.set(\dur, f2,  \vol, vol2);
927                                         ~l2c1.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d1.set(\dur, f2/~icd3,  \vol, vol2);
928                                         ~l2e1.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f1.set(\dur, f2/~icd6,  \vol, vol2);
929                                         ~l3a1.set(\dur, f3,     \vol, vol3);          ~l3b1.set(\dur, f3,  \vol, vol3);
930                                         ~l3c1.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d1.set(\dur, f3/~icd3,  \vol, vol3);
931                                         ~l3e1.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f1.set(\dur, f3/~icd6,  \vol, vol3);
932                                         ~l4a1.set(\dur, f4,    \vol, vol4);           ~l4b1.set(\dur, f4,  \vol, vol4);
933                                         ~l4c1.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d1.set(\dur, f4/~icd3,  \vol, vol4);
934                                         ~l4e1.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f1.set(\dur, f4/~icd6,  \vol, vol4);
935                                         ~l5a1.set(\dur, f5,    \vol, vol5);           ~l5b1.set(\dur, f5,  \vol, vol5);
936                                         ~l5c1.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d1.set(\dur, f5/~icd3,  \vol, vol5);
937                                         ~l5e1.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f1.set(\dur, f5/~icd6,  \vol, vol5);
938                                         ~l6a1.set(\dur, f6,    \vol, vol6);           ~l6b1.set(\dur, f6,  \vol, vol6);
939                                         ~l6c1.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d1.set(\dur, f6/~icd3,  \vol, vol6);
940                                         ~l6e1.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f1.set(\dur, f6/~icd6,  \vol, vol6);
941                                         ~l7a1.set(\dur, f7,    \vol, vol7);           ~l7b1.set(\dur, f7,  \vol, vol7);
942                                         ~l7c1.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d1.set(\dur, f7/~icd3,  \vol, vol7);
943                                         ~l7e1.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f1.set(\dur, f7/~icd6,  \vol, vol7);
944                                         ~l8a1.set(\dur, f8,    \vol, vol8);           ~l8b1.set(\dur, f8,  \vol, vol8);
945                                         ~l8c1.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d1.set(\dur, f8/~icd3,  \vol, vol8);
946                                         ~l8e1.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f1.set(\dur, f8/~icd6,  \vol, vol8);
947                                 }););
948                                 AppClock.sched(0.161803398875,{
949                                         ([~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;
950                                 });
951                         }
952                         {~l1a.isRunning == true}{
953                                 (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;
954                                         #vol1,vol2,vol3,vol4,vol5,vol6,vol7,vol8 = [~vol1,~vol2,~vol3,~vol4,~vol5,~vol6,~vol7,~vol8];
955                                         #f1,f2,f3,f4,f5,f6,f7,f8 = [ 0,0,0,0,0,0,0,0 ];
956                                         ~l1a.set(\dur, f1,     \vol, vol1);  ~l1b.set(\dur, f1,  \vol, vol1);
957                                         ~l1c.set(\dur, f1/~icd3,       \vol, vol1);  ~l1d.set(\dur, f1/~icd3,  \vol, vol1);
958                                         ~l1e.set(\dur, f1/~icd6,       \vol, vol1);  ~l1f.set(\dur, f1/~icd6,  \vol, vol1);
959                                         ~l2a.set(\dur, f2,     \vol, vol2);          ~l2b.set(\dur, f2,  \vol, vol2);
960                                         ~l2c.set(\dur, f2/~icd3,       \vol, vol2);  ~l2d.set(\dur, f2/~icd3,  \vol, vol2);
961                                         ~l2e.set(\dur, f2/~icd6,       \vol, vol2);  ~l2f.set(\dur, f2/~icd6,  \vol, vol2);
962                                         ~l3a.set(\dur, f3,     \vol, vol3);          ~l3b.set(\dur, f3,  \vol, vol3);
963                                         ~l3c.set(\dur, f3/~icd3,       \vol, vol3);  ~l3d.set(\dur, f3/~icd3,  \vol, vol3);
964                                         ~l3e.set(\dur, f3/~icd6,       \vol, vol3);  ~l3f.set(\dur, f3/~icd6,  \vol, vol3);
965                                         ~l4a.set(\dur, f4,    \vol, vol4);           ~l4b.set(\dur, f4,  \vol, vol4);
966                                         ~l4c.set(\dur, f4/~icd3,       \vol, vol4);  ~l4d.set(\dur, f4/~icd3,  \vol, vol4);
967                                         ~l4e.set(\dur, f4/~icd6,       \vol, vol4);  ~l4f.set(\dur, f4/~icd6,  \vol, vol4);
968                                         ~l5a.set(\dur, f5,    \vol, vol5);           ~l5b.set(\dur, f5,  \vol, vol5);
969                                         ~l5c.set(\dur, f5/~icd3,       \vol, vol5);  ~l5d.set(\dur, f5/~icd3,  \vol, vol5);
970                                         ~l5e.set(\dur, f5/~icd6,       \vol, vol5);  ~l5f.set(\dur, f5/~icd6,  \vol, vol5);
971                                         ~l6a.set(\dur, f6,    \vol, vol6);           ~l6b.set(\dur, f6,  \vol, vol6);
972                                         ~l6c.set(\dur, f6/~icd3,       \vol, vol6);  ~l6d.set(\dur, f6/~icd3,  \vol, vol6);
973                                         ~l6e.set(\dur, f6/~icd6,       \vol, vol6);  ~l6f.set(\dur, f6/~icd6,  \vol, vol6);
974                                         ~l7a.set(\dur, f7,    \vol, vol7);           ~l7b.set(\dur, f7,  \vol, vol7);
975                                         ~l7c.set(\dur, f7/~icd3,       \vol, vol7);  ~l7d.set(\dur, f7/~icd3,  \vol, vol7);
976                                         ~l7e.set(\dur, f7/~icd6,       \vol, vol7);  ~l7f.set(\dur, f7/~icd6,  \vol, vol7);
977                                         ~l8a.set(\dur, f8,    \vol, vol8);           ~l8b.set(\dur, f8,  \vol, vol8);
978                                         ~l8c.set(\dur, f8/~icd3,       \vol, vol8);  ~l8d.set(\dur, f8/~icd3,  \vol, vol8);
979                                         ~l8e.set(\dur, f8/~icd6,       \vol, vol8);  ~l8f.set(\dur, f8/~icd6,  \vol, vol8);
980                                 }););
981                                 AppClock.sched(0.161803398875,{
982                                         ([~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;
983                                 });
984                         };
985                 );
986         };
987
988
989         //timer values
990
991         case
992         {~slot1 == nil}{""}
993         {~slot2 == nil}{""}
994         {~slot3 == nil}{""}
995         {~slot4 == nil}{""}
996         {~slot5 == nil}{""}
997         {~slot6 == nil}{""}
998         {~slot7 == nil}{""}
999         {~slot8 == nil}{""};
1000
1001         ~timevals = {(~tst = TextView(w, Rect(~tspl,~tspt, ~tspw, ~tsph)).background_(Color.black);
1002                 (~tst.string =
1003                         "o1:_"++~time1o.value.asString++"_f1:_"++~time1f.value.asString++"_s1:_"++~time1s.value.asString++"\n" ++
1004                         "o2:_"++~time2o.value.asString++"_f2:_"++~time2f.value.asString++"_s2:_"++~time2s.value.asString++"\n" ++
1005                         "o3:_"++~time3o.value.asString++"_f3:_"++~time3f.value.asString++"_s3:_"++~time3s.value.asString++"\n" ++
1006                         "o4:_"++~time4o.value.asString++"_f4:_"++~time4f.value.asString++"_s4:_"++~time4s.value.asString++"\n" ++
1007                         "o5:_"++~time5o.value.asString++"_f5:_"++~time5f.value.asString++"_s5:_"++~time5s.value.asString++"\n" ++
1008                         "o6:_"++~time6o.value.asString++"_f6:_"++~time6f.value.asString++"_s6:_"++~time6s.value.asString++"\n" ++
1009                         "o7:_"++~time7o.value.asString++"_f7:_"++~time7f.value.asString++"_s7:_"++~time7s.value.asString++"\n" ++
1010                         "o8:_"++~time8o.value.asString++"_f8:_"++~time8f.value.asString++"_s8:_"++~time8s.value.asString++"\n" ++"\n" ++
1011                         if(~slot8 != ~slot, {
1012                                 (~slot1 = ~slot2).asString++"\n" ++
1013                                 (~slot2 = ~slot3).asString++"\n" ++
1014                                 (~slot3 = ~slot4).asString++"\n" ++
1015                                 (~slot4 = ~slot5).asString++"\n" ++
1016                                 (~slot5 = ~slot6).asString++"\n" ++
1017                                 (~slot6 = ~slot7).asString++"\n" ++
1018                                 (~slot7 = ~slot8).asString++"\n" ++
1019                                 (~slot8 = ~slot).asString;
1020                                 },{
1021                                         (~slot1).asString++"\n" ++
1022                                         (~slot2).asString++"\n" ++
1023                                         (~slot3).asString++"\n" ++
1024                                         (~slot4).asString++"\n" ++
1025                                         (~slot5).asString++"\n" ++
1026                                         (~slot6).asString++"\n" ++
1027                                         (~slot7).asString++"\n" ++
1028                                         (~slot8).asString;
1029                         });
1030
1031                 );
1032                 ~tst.stringColor = Color.white;
1033         )};
1034
1035
1036         //monitoring number of synths function
1037
1038         ~numsynthsfunc = {
1039                 if((~numsynths != nil) or: (~numsynths.isPlaying == true), {~numsynths.stop;});
1040                 ~numsynths = Routine({inf.do({if((s.numSynths > 49) and: (3.wait; s.numSynths > 49) and: (6.wait; s.numSynths > 49), {
1041
1042                         AppClock.sched(0, {
1043                                 if(~numsynthmessage != nil, {~numsynthmessage.close;});
1044                                 ~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;
1045                                 ~numsynthmessagestring = StaticText(~numsynthmessage, Rect(0,0,340+46,340+46/1.6180339887499)).background_(Color.black);
1046                                 ~numsynthmessagestring.align = \topLeft;
1047                                 ~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.";
1048                                 ~numsynthmessagestring.stringColor = Color.white;
1049                                 ~numsynthmessagebutton1 = Button.new(~numsynthmessage,Rect(320+46-100,340/1.6180339887499-30,46,46/1.6180339887499)).states_([["ok",Color.white,Color.black]]).action_({AppClock.sched(0, {~numsynthmessage.close; ~numsynths.play; ~midifunc.value;});});
1050                                 ~numsynthmessagebutton2 = Button.new(~numsynthmessage,Rect(120-46,340/1.6180339887499-30,46,46/1.6180339887499)).states_([["cancel",Color.white,Color.black]]).action_({AppClock.sched(0, {~numsynths.stop; ~numsynthmessage.close;});});
1051                                 ~numsynthmessage.front;
1052                         });
1053                 }); 1.wait;});}).play;
1054         };
1055
1056         ~numsynthsfunc.value;
1057
1058
1059         //mouse down action
1060
1061         view.mouseDownAction = {
1062                 |v, x, y, mod, butNum|
1063                 point = [x,y];
1064                 if(butNum == 0, { v.refresh;
1065
1066                         //generate dots on mouse down action
1067
1068                         ~tgrid = 30;
1069                         ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
1070
1071                         case
1072                         {y<~tgrid} {nil}
1073                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z1.close;~z1 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1074                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z2.close;~z2 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1075                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z3.close;~z3 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1076                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z4.close;~z4 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1077                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z5.close;~z5 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1078                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z6.close;~z6 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1079                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {~z7.close;~z7 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1080                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {~z8.close;~z8 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1081                         {y>~tgrid and: y<~bgrid} {nil}
1082                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z1.close;~z1 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1083                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z2.close;~z2 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1084                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z3.close;~z3 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1085                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z4.close;~z4 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1086                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z5.close;~z5 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1087                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z6.close;~z6 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1088                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z7.close;~z7 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1089                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z8.close;~z8 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1090                 }, {});
1091
1092                 ~tgrid = 30;
1093                 ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
1094
1095                 //set synth values on mouse down action
1096
1097                 case
1098                 {~l1a.isRunning == true}{
1099                         case
1100                         {y<~tgrid} {nil}
1101                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1102                                 ~l1a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1103                                 ~l1b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f1=q.value; ~undof1=~f1;
1104                                 ~l1c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1105                                 ~l1d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1106                                 ~l1e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1107                                 ~l1f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1108                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1109                                 ~l2a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1110                                 ~l2b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f2=q.value; ~undof2=~f2;
1111                                 ~l2c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1112                                 ~l2d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1113                                 ~l2e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1114                                 ~l2f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1115                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1116                                 ~l3a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1117                                 ~l3b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f3=q.value; ~undof3=~f3;
1118                                 ~l3c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1119                                 ~l3d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1120                                 ~l3e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1121                                 ~l3f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1122                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1123                                 ~l4a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1124                                 ~l4b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f4=q.value; ~undof4=~f4;
1125                                 ~l4c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1126                                 ~l4d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1127                                 ~l4e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1128                                 ~l4f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1129                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1130                                 ~l5a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1131                                 ~l5b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f5=q.value; ~undof5=~f5;
1132                                 ~l5c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1133                                 ~l5d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1134                                 ~l5e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1135                                 ~l5f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1136                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1137                                 ~l6a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1138                                 ~l6b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f6=q.value; ~undof6=~f6;
1139                                 ~l6c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1140                                 ~l6d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1141                                 ~l6e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1142                                 ~l6f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1143                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1144                                 ~l7a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1145                                 ~l7b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f7=q.value; ~undof7=~f7;
1146                                 ~l7c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1147                                 ~l7d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1148                                 ~l7e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1149                                 ~l7f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1150                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1151                                 ~l8a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1152                                 ~l8b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f8=q.value; ~undof8=~f8;
1153                                 ~l8c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1154                                 ~l8d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1155                                 ~l8e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1156                                 ~l8f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1157                         {y>~tgrid and: y<~bgrid} {nil}
1158                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1159                                 ~l1a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1160                                 ~l1b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f1=q.value; ~undof1=~f1;
1161                                 ~l1c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1162                                 ~l1d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1163                                 ~l1e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1164                                 ~l1f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1165                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1166                                 ~l2a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1167                                 ~l2b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f2=q.value; ~undof2=~f2;
1168                                 ~l2c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1169                                 ~l2d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1170                                 ~l2e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1171                                 ~l2f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1172                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1173                                 ~l3a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1174                                 ~l3b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f3=q.value; ~undof3=~f3;
1175                                 ~l3c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1176                                 ~l3d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1177                                 ~l3e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1178                                 ~l3f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1179                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1180                                 ~l4a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1181                                 ~l4b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f4=q.value; ~undof4=~f4;
1182                                 ~l4c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1183                                 ~l4d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1184                                 ~l4e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1185                                 ~l4f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1186                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1187                                 ~l5a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1188                                 ~l5b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f5=q.value; ~undof5=~f5;
1189                                 ~l5c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1190                                 ~l5d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1191                                 ~l5e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1192                                 ~l5f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1193                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1194                                 ~l6a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1195                                 ~l6b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f6=q.value; ~undof6=~f6;
1196                                 ~l6c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1197                                 ~l6d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1198                                 ~l6e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1199                                 ~l6f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1200                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1201                                 ~l7a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1202                                 ~l7b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f7=q.value; ~undof7=~f7;
1203                                 ~l7c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1204                                 ~l7d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1205                                 ~l7e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1206                                 ~l7f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1207                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1208                                 ~l8a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1209                                 ~l8b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f8=q.value; ~undof8=~f8;
1210                                 ~l8c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1211                                 ~l8d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1212                                 ~l8e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1213                                 ~l8f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);};
1214                 }
1215                 {~l1a1.isRunning == true}{
1216                         case
1217                         {y<~tgrid} {nil}
1218                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1219                                 ~l1a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1220                                 ~l1b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f1=q.value; ~undof1=~f1;
1221                                 ~l1c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1222                                 ~l1d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1223                                 ~l1e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1224                                 ~l1f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1225                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1226                                 ~l2a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1227                                 ~l2b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f2=q.value; ~undof2=~f2;
1228                                 ~l2c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1229                                 ~l2d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1230                                 ~l2e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1231                                 ~l2f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1232                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1233                                 ~l3a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1234                                 ~l3b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f3=q.value; ~undof3=~f3;
1235                                 ~l3c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1236                                 ~l3d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1237                                 ~l3e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1238                                 ~l3f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1239                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1240                                 ~l4a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1241                                 ~l4b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f4=q.value; ~undof4=~f4;
1242                                 ~l4c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1243                                 ~l4d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1244                                 ~l4e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1245                                 ~l4f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1246                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1247                                 ~l5a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1248                                 ~l5b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f5=q.value; ~undof5=~f5;
1249                                 ~l5c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1250                                 ~l5d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1251                                 ~l5e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1252                                 ~l5f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1253                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1254                                 ~l6a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1255                                 ~l6b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f6=q.value; ~undof6=~f6;
1256                                 ~l6c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1257                                 ~l6d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1258                                 ~l6e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1259                                 ~l6f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1260                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1261                                 ~l7a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1262                                 ~l7b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f7=q.value; ~undof7=~f7;
1263                                 ~l7c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1264                                 ~l7d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1265                                 ~l7e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1266                                 ~l7f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1267                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1268                                 ~l8a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1269                                 ~l8b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f8=q.value; ~undof8=~f8;
1270                                 ~l8c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1271                                 ~l8d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1272                                 ~l8e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1273                                 ~l8f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1274                         {y>~tgrid and: y<~bgrid} {nil}
1275                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1276                                 ~l1a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1277                                 ~l1b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f1=q.value; ~undof1=~f1;
1278                                 ~l1c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1279                                 ~l1d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1280                                 ~l1e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1281                                 ~l1f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1282                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1283                                 ~l2a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1284                                 ~l2b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f2=q.value; ~undof2=~f2;
1285                                 ~l2c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1286                                 ~l2d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1287                                 ~l2e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1288                                 ~l2f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1289                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1290                                 ~l3a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1291                                 ~l3b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f3=q.value; ~undof3=~f3;
1292                                 ~l3c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1293                                 ~l3d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1294                                 ~l3e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1295                                 ~l3f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1296                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1297                                 ~l4a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1298                                 ~l4b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f4=q.value; ~undof4=~f4;
1299                                 ~l4c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1300                                 ~l4d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1301                                 ~l4e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1302                                 ~l4f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1303                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1304                                 ~l5a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1305                                 ~l5b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f5=q.value; ~undof5=~f5;
1306                                 ~l5c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1307                                 ~l5d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1308                                 ~l5e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1309                                 ~l5f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1310                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1311                                 ~l6a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1312                                 ~l6b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f6=q.value; ~undof6=~f6;
1313                                 ~l6c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1314                                 ~l6d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1315                                 ~l6e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1316                                 ~l6f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1317                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1318                                 ~l7a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1319                                 ~l7b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f7=q.value; ~undof7=~f7;
1320                                 ~l7c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1321                                 ~l7d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1322                                 ~l7e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1323                                 ~l7f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1324                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1325                                 ~l8a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1326                                 ~l8b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f8=q.value; ~undof8=~f8;
1327                                 ~l8c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1328                                 ~l8d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1329                                 ~l8e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1330                                 ~l8f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);};
1331                 };
1332         };
1333
1334
1335         //mouse move action
1336
1337         view.mouseMoveAction = {
1338                 |v, x, y|
1339
1340                 ~nh = 2;
1341                 ~nw = ~nh*1.6180339887499;
1342
1343                 //generate dots on mouse move action
1344
1345                 ~tgrid = 30;
1346                 ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
1347
1348                 case
1349                 {y<~tgrid} {nil}
1350                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z1.close;~z25.close;~z1 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1351                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z2.close;~z26.close;~z2 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1352                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z3.close;~z27.close;~z3 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1353                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z4.close;~z28.close;~z4 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1354                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z5.close;~z29.close;~z5 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1355                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)}  {~z6.close;~z30.close;~z6 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1356                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {~z7.close;~z31.close;~z7 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1357                 {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {~z8.close;~z32.close;~z8 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1358                 {y>~tgrid and: y<~bgrid} {nil}
1359                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z1.close;~z25.close;~z1 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1360                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z2.close;~z26.close;~z2 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1361                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z3.close;~z27.close;~z3 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1362                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z4.close;~z28.close;~z4 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1363                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z5.close;~z29.close;~z5 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1364                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z6.close;~z30.close;~z6 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1365                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z7.close;~z31.close;~z7 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)}
1366                 {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {~z8.close;~z32.close;~z8 = (CompositeView(w, Rect(x, y, ~nw, 2)).background = Color.white;)};
1367                 w.refresh;
1368
1369                 ~tgrid = 30;
1370                 ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
1371
1372                 //set synth values on mouse move action
1373
1374                 case
1375                 {~l1a.isRunning == true}{
1376                         case
1377                         {y<~tgrid} {nil}
1378                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1379                                 ~l1a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1380                                 ~l1b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f1=q.value; ~undof1=~f1;
1381                                 ~l1c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1382                                 ~l1d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1383                                 ~l1e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1384                                 ~l1f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1385                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1386                                 ~l2a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1387                                 ~l2b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f2=q.value; ~undof2=~f2;
1388                                 ~l2c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1389                                 ~l2d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1390                                 ~l2e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1391                                 ~l2f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1392                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1393                                 ~l3a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1394                                 ~l3b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f3=q.value; ~undof3=~f3;
1395                                 ~l3c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1396                                 ~l3d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1397                                 ~l3e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1398                                 ~l3f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1399                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1400                                 ~l4a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1401                                 ~l4b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f4=q.value; ~undof4=~f4;
1402                                 ~l4c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1403                                 ~l4d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1404                                 ~l4e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1405                                 ~l4f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1406                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1407                                 ~l5a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1408                                 ~l5b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f5=q.value; ~undof5=~f5;
1409                                 ~l5c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1410                                 ~l5d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1411                                 ~l5e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1412                                 ~l5f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1413                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1414                                 ~l6a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1415                                 ~l6b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f6=q.value; ~undof6=~f6;
1416                                 ~l6c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1417                                 ~l6d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1418                                 ~l6e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1419                                 ~l6f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1420                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1421                                 ~l7a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1422                                 ~l7b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f7=q.value; ~undof7=~f7;
1423                                 ~l7c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1424                                 ~l7d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1425                                 ~l7e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1426                                 ~l7f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1427                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1428                                 ~l8a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1429                                 ~l8b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f8=q.value; ~undof8=~f8;
1430                                 ~l8c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1431                                 ~l8d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1432                                 ~l8e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1433                                 ~l8f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1434                         {y>~tgrid and: y<~bgrid} {nil}
1435                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1436                                 ~l1a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1437                                 ~l1b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f1=q.value; ~undof1=~f1;
1438                                 ~l1c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1439                                 ~l1d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1440                                 ~l1e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1441                                 ~l1f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1442                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1443                                 ~l2a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1444                                 ~l2b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f2=q.value; ~undof2=~f2;
1445                                 ~l2c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1446                                 ~l2d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1447                                 ~l2e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1448                                 ~l2f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1449                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1450                                 ~l3a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1451                                 ~l3b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f3=q.value; ~undof3=~f3;
1452                                 ~l3c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1453                                 ~l3d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1454                                 ~l3e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1455                                 ~l3f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1456                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1457                                 ~l4a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1458                                 ~l4b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f4=q.value; ~undof4=~f4;
1459                                 ~l4c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1460                                 ~l4d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1461                                 ~l4e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1462                                 ~l4f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1463                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1464                                 ~l5a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1465                                 ~l5b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f5=q.value; ~undof5=~f5;
1466                                 ~l5c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1467                                 ~l5d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1468                                 ~l5e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1469                                 ~l5f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1470                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1471                                 ~l6a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1472                                 ~l6b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f6=q.value; ~undof6=~f6;
1473                                 ~l6c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1474                                 ~l6d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1475                                 ~l6e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1476                                 ~l6f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1477                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1478                                 ~l7a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1479                                 ~l7b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f7=q.value; ~undof7=~f7;
1480                                 ~l7c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1481                                 ~l7d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1482                                 ~l7e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1483                                 ~l7f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1484                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1485                                 ~l8a.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1486                                 ~l8b.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f8=q.value; ~undof8=~f8;
1487                                 ~l8c.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1488                                 ~l8d.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1489                                 ~l8e.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1490                                 ~l8f.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);};
1491                 }
1492                 {~l1a1.isRunning == true}{
1493                         case
1494                         {y<~tgrid} {nil}
1495                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1496                                 ~l1a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1497                                 ~l1b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f1=q.value; ~undof1=~f1;
1498                                 ~l1c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1499                                 ~l1d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1500                                 ~l1e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1501                                 ~l1f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1502                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1503                                 ~l2a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1504                                 ~l2b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f2=q.value; ~undof2=~f2;
1505                                 ~l2c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1506                                 ~l2d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1507                                 ~l2e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1508                                 ~l2f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1509                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1510                                 ~l3a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1511                                 ~l3b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f3=q.value; ~undof3=~f3;
1512                                 ~l3c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1513                                 ~l3d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1514                                 ~l3e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1515                                 ~l3f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1516                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1517                                 ~l4a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1518                                 ~l4b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f4=q.value; ~undof4=~f4;
1519                                 ~l4c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1520                                 ~l4d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1521                                 ~l4e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1522                                 ~l4f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1523                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1524                                 ~l5a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1525                                 ~l5b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f5=q.value; ~undof5=~f5;
1526                                 ~l5c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1527                                 ~l5d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1528                                 ~l5e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1529                                 ~l5f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1530                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1531                                 ~l6a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1532                                 ~l6b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f6=q.value; ~undof6=~f6;
1533                                 ~l6c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1534                                 ~l6d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1535                                 ~l6e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1536                                 ~l6f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1537                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1538                                 ~l7a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1539                                 ~l7b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f7=q.value; ~undof7=~f7;
1540                                 ~l7c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1541                                 ~l7d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1542                                 ~l7e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1543                                 ~l7f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1544                         {y>=(~tgrid) and: y<=(~tgrid=~tgrid+10)} {
1545                                 ~l8a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)));
1546                                 ~l8b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value); ~f8=q.value; ~undof8=~f8;
1547                                 ~l8c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd3);
1548                                 ~l8d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd3);
1549                                 ~l8e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1))/~icd6);
1550                                 ~l8f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin1,~outmax1)).value/~icd6);}
1551                         {y>~tgrid and: y<~bgrid} {nil}
1552                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1553                                 ~l1a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1554                                 ~l1b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f1=q.value; ~undof1=~f1;
1555                                 ~l1c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1556                                 ~l1d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1557                                 ~l1e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1558                                 ~l1f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1559                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1560                                 ~l2a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1561                                 ~l2b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f2=q.value; ~undof2=~f2;
1562                                 ~l2c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1563                                 ~l2d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1564                                 ~l2e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1565                                 ~l2f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1566                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1567                                 ~l3a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1568                                 ~l3b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f3=q.value; ~undof3=~f3;
1569                                 ~l3c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1570                                 ~l3d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1571                                 ~l3e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1572                                 ~l3f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1573                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1574                                 ~l4a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1575                                 ~l4b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f4=q.value; ~undof4=~f4;
1576                                 ~l4c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1577                                 ~l4d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1578                                 ~l4e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1579                                 ~l4f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1580                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1581                                 ~l5a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1582                                 ~l5b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f5=q.value; ~undof5=~f5;
1583                                 ~l5c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1584                                 ~l5d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1585                                 ~l5e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1586                                 ~l5f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1587                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1588                                 ~l6a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1589                                 ~l6b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f6=q.value; ~undof6=~f6;
1590                                 ~l6c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1591                                 ~l6d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1592                                 ~l6e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1593                                 ~l6f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1594                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1595                                 ~l7a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1596                                 ~l7b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f7=q.value; ~undof7=~f7;
1597                                 ~l7c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1598                                 ~l7d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1599                                 ~l7e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1600                                 ~l7f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);}
1601                         {y>=(~bgrid) and: y<=(~bgrid=~bgrid+10)} {
1602                                 ~l8a1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)));
1603                                 ~l8b1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value); ~f8=q.value; ~undof8=~f8;
1604                                 ~l8c1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd3);
1605                                 ~l8d1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd3);
1606                                 ~l8e1.set(\dur, ((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2))/~icd6);
1607                                 ~l8f1.set(\dur, q=((x/(Window.screenBounds.width)).linexp(0,1,~outmin2,~outmax2)).value/~icd6);};
1608                 };
1609         };
1610
1611         ~tgrid = 30;
1612         ~bgrid = Window.screenBounds.height-(Window.screenBounds.height/1.6180339887499)+30;
1613         ~dc1 = ~tgrid-5; ~dc2 = ~bgrid-5; ~dca = 10;
1614
1615         ~bpl = Window.screenBounds.width-340;
1616         ~bpt = Window.screenBounds.height-88;
1617         ~bph = 40;
1618         ~bpw = 40/1.6180339887499;
1619
1620
1621         //copy button
1622
1623         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;
1624                 if(button.value == 1, {
1625
1626                         ~tsc = TextView(w, Rect(0,0, 1600*2, 354)).background_(Color.black);
1627                         (~tsc.string =
1628                                 "saved open/flow 1-8: "++"\n"++"\n"++
1629                                 "[~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"++
1630                                 "[~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"++
1631                                 "[~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"++
1632                                 "[~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"++
1633                                 "[~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"++
1634                                 "[~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"++
1635                                 "[~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"++
1636                                 "[~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"++
1637
1638                                 "saved slide 1-8: "++"\n"++"\n"++
1639
1640                                 "#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"++
1641                                 "#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"++
1642                                 "#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"++
1643                                 "#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"++
1644                                 "#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"++
1645                                 "#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"++
1646                                 "#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"++
1647                                 "#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;"++"\n"++"\n"++
1648
1649                                 "current: "++"\n"++
1650                                 "[~f1="++~f1.asString++",~f2="++~f2.asString++",~f3="++~f3.asString++",~f4="++~f4.asString++",~f5="++~f5.asString++",~f6="++~f6.asString++",~f7="++~f7.asString++",~f8="++~f8.asString++"]"
1651                         );
1652                         ~tsc.stringColor = Color.white;
1653                         (str= [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8/*,~f9,~f10,~f11,~f12*/ ];("echo"+str+"| xclip -selection clipboard").unixCmd;);
1654                         [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8/*,~f9,~f10,~f11,~f12*/ ].postln;},
1655                         {~tsc.close;});
1656         });
1657
1658
1659         //stop timer button
1660
1661         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;
1662                 if(~timer.isPlaying == true, {
1663                         if(~tst.value == nil, {~timer.stop; ~systemclock.stop; ~systemclock.clear;},{~tst.close;
1664                                 ~timevals.value;
1665                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear;});
1666                 });
1667         });
1668
1669
1670         //timer button
1671
1672         ~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, {
1673                 if(~tst != nil, {~tst.close});
1674                 ~timevals.value;
1675                 ~timer.stop; ~systemclock.stop; ~systemclock.clear;},{if(~tst.value == nil, {~timer.stop; ~systemclock.stop; ~systemclock.clear;},{~timer.stop; ~systemclock.stop; ~systemclock.clear; ~tst.close;})})});
1676
1677
1678         //start/stop synth button
1679
1680         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_({
1681                 arg synthbutton; if(synthbutton.value == 1, {
1682                         ~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);
1683                         ~synthopen.value;
1684                         ~numsynths.stop; ~numsynthsfunc.value;
1685                         ~midifunc.value;
1686                         },
1687                         {~synthfree.value; b4.value = 0;})
1688         });
1689
1690
1691         //pause/unpause button
1692
1693         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_({
1694                 arg synthbutton; if(synthbutton.value == 1, {~synthpause.value; ~timer.stop;},
1695                         {~synthflow.value; if(~time == 0, {~timer.stop;}, {~timer = Routine({inf.do({~time = ~time+0.01; ~time.postln; 0.01.wait;});}); SystemClock.play(~timer);})})
1696         });
1697
1698
1699         //generate values for number of KW(King Wen) sequences in a timewave half-cycle (or amplitude x2) pop-up menu
1700
1701         x=0;
1702         ~menu2values = Array.fill(24, {(x=x+1).asString++" kws"});
1703
1704
1705         //number of KW(King Wen) sequences in a timewave half-cycle (or amplitude x2) upon starting value
1706
1707         case
1708         {~gsinenum == nil}{~menu2start = ~menu2values.at(~synthdefnum-1)}
1709         {~gsinenum == 1}{~menu2start = ~menu2values.at(0)}
1710         {~gsinenum == 2}{~menu2start = ~menu2values.at(1)}
1711         {~gsinenum == 3}{~menu2start = ~menu2values.at(2)}
1712         {~gsinenum == 4}{~menu2start = ~menu2values.at(3)}
1713         {~gsinenum == 5}{~menu2start = ~menu2values.at(4)}
1714         {~gsinenum == 6}{~menu2start = ~menu2values.at(5)}
1715         {~gsinenum == 7}{~menu2start = ~menu2values.at(6)}
1716         {~gsinenum == 8}{~menu2start = ~menu2values.at(7)}
1717         {~gsinenum == 9}{~menu2start = ~menu2values.at(8)}
1718         {~gsinenum == 10}{~menu2start = ~menu2values.at(9)}
1719         {~gsinenum == 11}{~menu2start = ~menu2values.at(10)}
1720         {~gsinenum == 12}{~menu2start = ~menu2values.at(11)}
1721         {~gsinenum == 13}{~menu2start = ~menu2values.at(12)}
1722         {~gsinenum == 14}{~menu2start = ~menu2values.at(13)}
1723         {~gsinenum == 15}{~menu2start = ~menu2values.at(14)}
1724         {~gsinenum == 16}{~menu2start = ~menu2values.at(15)}
1725         {~gsinenum == 17}{~menu2start = ~menu2values.at(16)}
1726         {~gsinenum == 18}{~menu2start = ~menu2values.at(17)}
1727         {~gsinenum == 19}{~menu2start = ~menu2values.at(18)}
1728         {~gsinenum == 20}{~menu2start = ~menu2values.at(19)}
1729         {~gsinenum == 21}{~menu2start = ~menu2values.at(20)}
1730         {~gsinenum == 22}{~menu2start = ~menu2values.at(21)}
1731         {~gsinenum == 23}{~menu2start = ~menu2values.at(22)}
1732         {~gsinenum == 24}{~menu2start = ~menu2values.at(23)};
1733         if(~menu2synthdefstart.value == nil, {~menu2synthdefstart = ~synthdefnum}, {~menu2synthdefstart = ~gsinenum});
1734
1735
1736         //number of KW(King Wen) sequences in a timewave half-cycle (or amplitude x2) pop-up menu
1737
1738         menu2=PopUpMenu(w,Rect(20+60*2+16,Window.screenBounds.height-88+(30/1.6180339887499*0),86,60/1.6180339887499)).items_(~mvalue = (-1); [~menu2start.asString]++Array.fill(24, {~menu2values.at(~mvalue = ~mvalue+1);});).background_(Color.black).stringColor_(Color.white).action_({arg button;
1739
1740                 if(~st != nil, {~st.close});
1741                 ~st = StaticText(w, Rect(20+60*2+16+231,Window.screenBounds.height-88+(30/1.6180339887499*0), 80, 60)).background_(Color.black);
1742                 ~st.stringColor = Color.white;
1743                 ~st.string = "# of kws in halfcycle selected";
1744                 AppClock.sched(~gm,{~st.close;});
1745         });
1746
1747
1748         //pop-menu for timewave base (lowest) frequency
1749
1750         ~bfreqstart = ~basefreq;
1751         ~bfreq = PopUpMenu(w, Rect(20+60*2+16+86,Window.screenBounds.height-88+(30/1.6180339887499*0),140,60/1.6180339887499)).items_(~bfreqv = (-1); [~basefreq.asString++" hz"]++Array.fill(140, {~freqmap.at(~bfreqv=~bfreqv+1).asString})).background_(Color.black).stringColor_(Color.white).action_({arg button;
1752
1753                 if(~st != nil, {~st.close});
1754                 ~st = StaticText(w, Rect(20+60*2+16+231,Window.screenBounds.height-88+(30/1.6180339887499*0), 80, 40)).background_(Color.black);
1755                 ~st.stringColor = Color.white;
1756                 ~st.string = "basefreq selected";
1757                 AppClock.sched(~gm,{~st.close;});
1758         });
1759
1760
1761         //synthdef pop-up menu
1762
1763         ~gsinemenu = PopUpMenu(w, Rect(20+60*2+16,Window.screenBounds.height-52+(30/1.6180339887499*0),86,60/1.6180339887499)).items_(["psine1","psine2","psine3","hsine1","hsine2","hsine3","psineuf1","psineuf2","psineuf3","hsineuf1","hsineuf2","hsineuf3"]).background_(Color.black).stringColor_(Color.white).action_({arg button;
1764
1765                 if(~gsinemenu.value == 0,  {~kws_setting = 1; ~ratio_setting = "psine1"; ~low_pass_filter_on = 1; ~gs = 0;});
1766                 if(~gsinemenu.value == 1,  {~kws_setting = 2; ~ratio_setting = "psine2"; ~low_pass_filter_on = 1; ~gs = 1;});
1767                 if(~gsinemenu.value == 2,  {~kws_setting = 3; ~ratio_setting = "psine3"; ~low_pass_filter_on = 1; ~gs = 2;});
1768                 if(~gsinemenu.value == 3,  {~kws_setting = 1; ~ratio_setting = "hsine1"; ~low_pass_filter_on = 1; ~gs = 3;});
1769                 if(~gsinemenu.value == 4,  {~kws_setting = 2; ~ratio_setting = "hsine2"; ~low_pass_filter_on = 1; ~gs = 4;});
1770                 if(~gsinemenu.value == 5,  {~kws_setting = 3; ~ratio_setting = "hsine3"; ~low_pass_filter_on = 1; ~gs = 5;});
1771                 if(~gsinemenu.value == 6,  {~kws_setting = 1; ~ratio_setting = "psine1"; ~low_pass_filter_on = 0; ~gs = 6;});
1772                 if(~gsinemenu.value == 7,  {~kws_setting = 2; ~ratio_setting = "psine2"; ~low_pass_filter_on = 0; ~gs = 7;});
1773                 if(~gsinemenu.value == 8,  {~kws_setting = 3; ~ratio_setting = "psine3"; ~low_pass_filter_on = 0; ~gs = 8;});
1774                 if(~gsinemenu.value == 9,  {~kws_setting = 1; ~ratio_setting = "hsine1"; ~low_pass_filter_on = 0; ~gs = 9;});
1775                 if(~gsinemenu.value == 10, {~kws_setting = 2; ~ratio_setting = "hsine2"; ~low_pass_filter_on = 0; ~gs = 10;});
1776                 if(~gsinemenu.value == 11, {~kws_setting = 3; ~ratio_setting = "hsine3"; ~low_pass_filter_on = 0; ~gs = 11;});
1777
1778                 if(~st != nil, {~st.close});
1779                 ~st = StaticText(w, Rect(20+60*2+16+231,Window.screenBounds.height-88+(30/1.6180339887499*0), 80, 60)).background_(Color.black);
1780                 ~st.stringColor = Color.white;
1781                 ~st.string = "synthdef setting selected";
1782                 AppClock.sched(~gm,{~st.close;});
1783         });
1784
1785         if(~gs == nil, {~gs = 0;});
1786
1787         case
1788         {~gs == 0}{~gsinemenu.value = 0;}
1789         {~gs == 1}{~gsinemenu.value = 1;}
1790         {~gs == 2}{~gsinemenu.value = 2;}
1791         {~gs == 3}{~gsinemenu.value = 3;}
1792         {~gs == 4}{~gsinemenu.value = 4;}
1793         {~gs == 5}{~gsinemenu.value = 5;}
1794         {~gs == 0}{~gsinemenu.value = 6;}
1795         {~gs == 1}{~gsinemenu.value = 7;}
1796         {~gs == 2}{~gsinemenu.value = 8;}
1797         {~gs == 3}{~gsinemenu.value = 9;}
1798         {~gs == 4}{~gsinemenu.value = 10;}
1799         {~gs == 5}{~gsinemenu.value = 11;};
1800
1801
1802         //set low-pass filter frequency limit
1803
1804         if(~low_pass_filter_set_value == nil, {~low_pass_filter_set_value = ~low_pass_filter_freq_limit});
1805         if(~low_pass_filter_set_value != ~low_pass_filter_freq_limit, {~low_pass_filter_set_value = ~low_pass_filter_freq_limit});
1806
1807         ~low_pass_filter_textfield = TextField(w, Rect(20+60*2+16+86,Window.screenBounds.height-52+(30/1.6180339887499*0),80,60/1.6180339887499));
1808         ~low_pass_filter_textfield.string = ~low_pass_filter_set_value.asString;
1809         ~low_pass_filter_textfield.background_(Color.black);
1810         ~low_pass_filter_textfield.stringColor_(Color.white);
1811         ~low_pass_filter_textfield.action = {arg value; ~low_pass_filter_set_value = value;
1812
1813                 ~low_pass_filter_set_value = ~low_pass_filter_set_value.value;
1814
1815                 ~low_pass_filter_set_value = ~low_pass_filter_set_value.separate;
1816
1817                 ~low_pass_filter_set_value = ~low_pass_filter_set_value.reject{arg item;
1818                         (item != "1") and:
1819                         (item != "2") and:
1820                         (item != "3") and:
1821                         (item != "4") and:
1822                         (item != "5") and:
1823                         (item != "6") and:
1824                         (item != "7") and:
1825                         (item != "8") and:
1826                         (item != "9") and:
1827                         (item != "0") and:
1828                         (item != ".")
1829                 };
1830
1831                 ~low_pass_filter_set_value = ~low_pass_filter_set_value.join.asString.asFloat;
1832
1833                 ~low_pass_filter_textfield.string = ~low_pass_filter_set_value.asString;
1834
1835                 if(~low_pass_filter_set_value != 0, {
1836                         if(~st != nil, {~st.close});
1837                         ~st = StaticText(w, Rect(20+60*2+16+231,Window.screenBounds.height-88+(30/1.6180339887499*0), 80, 80)).background_(Color.black);
1838                         ~st.stringColor = Color.white;
1839                         ~st.string = "low-pass filter freq limit selected";
1840                         AppClock.sched(~gm,{~st.close;});
1841                 }, {~low_pass_filter_set_value = ~low_pass_filter_freq_limit; ~low_pass_filter_textfield.string = ~low_pass_filter_set_value.asString;});
1842         };
1843
1844
1845         //set button for number of KW sequences in a timewave half-cycle (or amplitude x2), basefreq, and gsine(evaluate synthdefs)
1846
1847         set1=Button(w,Rect(20+60*2+16+166, Window.screenBounds.height-52+(16/1.6180339887499*0),60,60/1.6180339887499)).states_([["set",Color.white,Color.black]]).mouseDownAction_({
1848
1849                 if(~st != nil, {~st.close});
1850                 ~st = StaticText(w, Rect(20+60*2+16+231,Window.screenBounds.height-40, 62, 20)).background_(Color.black);
1851                 ~st.stringColor = Color.white;
1852                 ~st.string = "loading...";
1853                 AppClock.sched(0.2,{
1854                         ~st.close;
1855                 });
1856
1857                 AppClock.sched(0,{
1858
1859                         if(~bfreq.value > 0, {~basefreq = ~freqmap.at(~bfreq.value - 1)}, {~basefreq = ~bfreqstart});
1860
1861                         (#a,b,c,d,e,f = [ ~basefreq,~basefreq,~basefreq,~basefreq,~basefreq,~basefreq  ]; ~a = a; ~b = b; ~c =c; ~d = d; ~e = e;~f=f;);
1862
1863                         ~low_pass_filter_freq_limit = ~low_pass_filter_set_value;
1864
1865
1866                         //set n1-n9 values
1867
1868                         case
1869                         {~ratio_setting == "psine1";}{~n_value1 = ~gm;    ~n_value2 = ~gm2;   ~n_value6 = ~gm6;}
1870                         {~ratio_setting == "psine2";}{~n_value1 = ~ngm1;  ~n_value2 = ~ngm2;  ~n_value6 = ~ngm6;}
1871                         {~ratio_setting == "psine3";}{~n_value1 = ~nngm1; ~n_value2 = ~nngm2; ~n_value6 = ~nngm6;}
1872                         {~ratio_setting == "hsine1";}{~n_value1 = ~h1;    ~n_value2 = ~h2;    ~n_value6 = ~h6;}
1873                         {~ratio_setting == "hsine2";}{~n_value1 = ~nh1;   ~n_value2 = ~nh2;   ~n_value6 = ~nh6;}
1874                         {~ratio_setting == "hsine3";}{~n_value1 = ~nnh1;  ~n_value2 = ~nnh2;  ~n_value6 = ~nnh6;};
1875
1876
1877                         //evaluate synthdefs(gsine)
1878
1879                         case
1880                         {menu2.value == 0}{~gsinenum = ~menu2synthdefstart; ~gsine.value;}
1881                         {menu2.value == 1}{~gsinenum = 1; ~gsine.value;}
1882                         {menu2.value == 2}{~gsinenum = 2; ~gsine.value;}
1883                         {menu2.value == 3}{~gsinenum = 3; ~gsine.value;}
1884                         {menu2.value == 4}{~gsinenum = 4; ~gsine.value;}
1885                         {menu2.value == 5}{~gsinenum = 5; ~gsine.value;}
1886                         {menu2.value == 6}{~gsinenum = 6; ~gsine.value;}
1887                         {menu2.value == 7}{~gsinenum = 7; ~gsine.value;}
1888                         {menu2.value == 8}{~gsinenum = 8; ~gsine.value;}
1889                         {menu2.value == 9}{~gsinenum = 9; ~gsine.value;}
1890                         {menu2.value == 10}{~gsinenum = 10; ~gsine.value;}
1891                         {menu2.value == 11}{~gsinenum = 11; ~gsine.value;}
1892                         {menu2.value == 12}{~gsinenum = 12; ~gsine.value;}
1893                         {menu2.value == 13}{~gsinenum = 13; ~gsine.value;}
1894                         {menu2.value == 14}{~gsinenum = 14; ~gsine.value;}
1895                         {menu2.value == 15}{~gsinenum = 15; ~gsine.value;}
1896                         {menu2.value == 16}{~gsinenum = 16; ~gsine.value;}
1897                         {menu2.value == 17}{~gsinenum = 17; ~gsine.value;}
1898                         {menu2.value == 18}{~gsinenum = 18; ~gsine.value;}
1899                         {menu2.value == 19}{~gsinenum = 19; ~gsine.value;}
1900                         {menu2.value == 20}{~gsinenum = 20; ~gsine.value;}
1901                         {menu2.value == 21}{~gsinenum = 21; ~gsine.value;}
1902                         {menu2.value == 22}{~gsinenum = 22; ~gsine.value;}
1903                         {menu2.value == 23}{~gsinenum = 23; ~gsine.value;}
1904                         {menu2.value == 24}{~gsinenum = 24; ~gsine.value;};
1905                 });
1906
1907         })
1908         .action_({
1909         });
1910
1911
1912         //open/flow/slide buttons coordinate values
1913
1914         ~bph = 26;
1915         ~bpw = 26/1.6180339887499;
1916         ~bpl = Window.screenBounds.width-(~bph*8)-20;
1917         ~bpt = Window.screenBounds.height-88;
1918
1919         ~bp01l = ~bpl;
1920         ~bp02l = ~bpl+(~bph*1);
1921         ~bp03l = ~bpl+(~bph*2);
1922         ~bp04l = ~bpl+(~bph*3);
1923         ~bp05l = ~bpl+(~bph*4);
1924         ~bp06l = ~bpl+(~bph*5);
1925         ~bp07l = ~bpl+(~bph*6);
1926         ~bp08l = ~bpl+(~bph*7);
1927         ~bpf1l = ~bpl;
1928         ~bpf2l = ~bpl+(~bph*1);
1929         ~bpf3l = ~bpl+(~bph*2);
1930         ~bpf4l = ~bpl+(~bph*3);
1931         ~bpf5l = ~bpl+(~bph*4);
1932         ~bpf6l = ~bpl+(~bph*5);
1933         ~bpf7l = ~bpl+(~bph*6);
1934         ~bpf8l = ~bpl+(~bph*7);
1935
1936         ~bp01t = ~bpt;
1937         ~bp02t = ~bpt;
1938         ~bp03t = ~bpt;
1939         ~bp04t = ~bpt;
1940         ~bp05t = ~bpt;
1941         ~bp06t = ~bpt;
1942         ~bp07t = ~bpt;
1943         ~bp08t = ~bpt;
1944         ~bpf1t = ~bpt+~bpw;
1945         ~bpf2t = ~bpt+~bpw;
1946         ~bpf3t = ~bpt+~bpw;
1947         ~bpf4t = ~bpt+~bpw;
1948         ~bpf5t = ~bpt+~bpw;
1949         ~bpf6t = ~bpt+~bpw;
1950         ~bpf7t = ~bpt+~bpw;
1951         ~bpf8t = ~bpt+~bpw;
1952
1953         ~bp01h = ~bph;
1954         ~bp02h = ~bph;
1955         ~bp03h = ~bph;
1956         ~bp04h = ~bph;
1957         ~bp05h = ~bph;
1958         ~bp06h = ~bph;
1959         ~bp07h = ~bph;
1960         ~bp08h = ~bph;
1961         ~bpf1h = ~bph;
1962         ~bpf2h = ~bph;
1963         ~bpf3h = ~bph;
1964         ~bpf4h = ~bph;
1965         ~bpf5h = ~bph;
1966         ~bpf6h = ~bph;
1967         ~bpf7h = ~bph;
1968         ~bpf8h = ~bph;
1969
1970         ~bp01w = ~bpw;
1971         ~bp02w = ~bpw;
1972         ~bp03w = ~bpw;
1973         ~bp04w = ~bpw;
1974         ~bp05w = ~bpw;
1975         ~bp06w = ~bpw;
1976         ~bp07w = ~bpw;
1977         ~bp08w = ~bpw;
1978         ~bpf1w = ~bpw;
1979         ~bpf2w = ~bpw;
1980         ~bpf3w = ~bpw;
1981         ~bpf4w = ~bpw;
1982         ~bpf5w = ~bpw;
1983         ~bpf6w = ~bpw;
1984         ~bpf7w = ~bpw;
1985         ~bpf8w = ~bpw;
1986
1987         ~tspw=280+210;
1988         ~tsph=280+210/~gm;
1989         ~tspl=Window.screenBounds.width-~tspw;
1990         ~tspt=~bpt-310;
1991
1992
1993         //synthopen 1-8 buttons
1994
1995         ~bplaceo1 = Button.new(w,Rect(~bp01l,~bp01t,~bp01h,~bp01w)).states_([["o1",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
1996
1997                 [~f1=fp1,~f2=fp2,~f3=fp3,~f4=fp4,~f5=fp5,~f6=fp6,~f7=fp7,~f8=fp8];
1998
1999                 ~synthopen.value;
2000                 ~currentsynth = "o1"; ~synthmonitorfunc.value;
2001
2002                 if(~ts.value == 1,
2003                         {if(~tst == nil, {nil}, {~tst.close;});
2004                                 ~timevals.value;
2005                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time1o = 0;
2006                                 ~timer = Routine({inf.do({
2007                                         ~time1o =
2008                                         ~time1o+0.01; ~slot = "o1_"+~time1o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2009                         {nil});
2010         });
2011
2012         ~bplaceo2 = Button.new(w,Rect(~bp02l,~bp02t,~bp02h,~bp02w)).states_([["o2",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2013
2014                 [~f1=fp1b,~f2=fp2b,~f3=fp3b,~f4=fp4b,~f5=fp5b,~f6=fp6b,~f7=fp7b,~f8=fp8b];
2015
2016                 ~synthopen.value;
2017                 ~currentsynth = "o2"; ~synthmonitorfunc.value;
2018
2019                 if(~ts.value == 1,
2020                         {if(~tst == nil, {nil}, {~tst.close;});
2021                                 ~timevals.value;
2022                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time2o = 0;
2023                                 ~timer = Routine({inf.do({
2024                                         ~time2o =
2025                                         ~time2o+0.01; ~slot = "o2_"+~time2o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2026                         {nil});
2027         });
2028         ~bplaceo3 = Button.new(w,Rect(~bp03l,~bp03t,~bp03h,~bp03w)).states_([["o3",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2029
2030                 [~f1=fp1c,~f2=fp2c,~f3=fp3c,~f4=fp4c,~f5=fp5c,~f6=fp6c,~f7=fp7c,~f8=fp8c];
2031
2032                 ~synthopen.value;
2033                 ~currentsynth = "o3"; ~synthmonitorfunc.value;
2034
2035                 if(~ts.value == 1,
2036                         {if(~tst == nil, {nil}, {~tst.close;});
2037                                 ~timevals.value;
2038                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time3o = 0;
2039                                 ~timer = Routine({inf.do({
2040                                         ~time3o =
2041                                         ~time3o+0.01; ~slot = "o3_"+~time3o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2042                         {nil});
2043         });
2044         ~bplaceo4 = Button.new(w,Rect(~bp04l,~bp04t,~bp04h,~bp04w)).states_([["o4",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2045
2046                 [~f1=fp1d,~f2=fp2d,~f3=fp3d,~f4=fp4d,~f5=fp5d,~f6=fp6d,~f7=fp7d,~f8=fp8d];
2047
2048                 ~synthopen.value;
2049                 ~currentsynth = "o4"; ~synthmonitorfunc.value;
2050
2051                 if(~ts.value == 1,
2052                         {if(~tst == nil, {nil}, {~tst.close;});
2053                                 ~timevals.value;
2054                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time4o = 0;
2055                                 ~timer = Routine({inf.do({
2056                                         ~time4o =
2057                                         ~time4o+0.01; ~slot = "o4_"+~time4o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2058                         {nil});
2059
2060         });
2061
2062         ~bplaceo5 = Button.new(w,Rect(~bp05l,~bp05t,~bp05h,~bp05w)).states_([["o5",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2063
2064                 [~f1=fp1e,~f2=fp2e,~f3=fp3e,~f4=fp4e,~f5=fp5e,~f6=fp6e,~f7=fp7e,~f8=fp8e];
2065
2066                 ~synthopen.value;
2067                 ~currentsynth = "o5"; ~synthmonitorfunc.value;
2068
2069                 if(~ts.value == 1,
2070                         {if(~tst == nil, {nil}, {~tst.close;});
2071                                 ~timevals.value;
2072                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time5o = 0;
2073                                 ~timer = Routine({inf.do({
2074                                         ~time5o =
2075                                         ~time5o+0.01; ~slot = "o5_"+~time5o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2076                         {nil});
2077
2078         });
2079         ~bplaceo6 = Button.new(w,Rect(~bp06l,~bp06t,~bp06h,~bp06w)).states_([["o6",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2080
2081                 [~f1=fp1f,~f2=fp2f,~f3=fp3f,~f4=fp4f,~f5=fp5f,~f6=fp6f,~f7=fp7f,~f8=fp8f];
2082
2083                 ~synthopen.value;
2084                 ~currentsynth = "o6"; ~synthmonitorfunc.value;
2085
2086                 if(~ts.value == 1,
2087                         {if(~tst == nil, {nil}, {~tst.close;});
2088                                 ~timevals.value;
2089                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time6o = 0;
2090                                 ~timer = Routine({inf.do({
2091                                         ~time6o =
2092                                         ~time6o+0.01; ~slot = "o6_"+~time6o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2093                         {nil});
2094         });
2095         ~bplaceo7 = Button.new(w,Rect(~bp07l,~bp07t,~bp07h,~bp07w)).states_([["o7",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2096
2097                 [~f1=fp1g,~f2=fp2g,~f3=fp3g,~f4=fp4g,~f5=fp5g,~f6=fp6g,~f7=fp7g,~f8=fp8g];
2098
2099                 ~synthopen.value;
2100                 ~currentsynth = "o7"; ~synthmonitorfunc.value;
2101
2102                 if(~ts.value == 1,
2103                         {if(~tst == nil, {nil}, {~tst.close;});
2104                                 ~timevals.value;
2105                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time7o = 0;
2106                                 ~timer = Routine({inf.do({
2107                                         ~time7o =
2108                                         ~time7o+0.01; ~slot = "o7_"+~time7o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2109                         {nil});
2110         });
2111         ~bplaceo8 = Button.new(w,Rect(~bp08l,~bp08t,~bp08h,~bp08w)).states_([["o8",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2112
2113                 [~f1=fp1h,~f2=fp2h,~f3=fp3h,~f4=fp4h,~f5=fp5h,~f6=fp6h,~f7=fp7h,~f8=fp8h];
2114
2115                 ~synthopen.value;
2116                 ~currentsynth = "o8"; ~synthmonitorfunc.value;
2117
2118                 if(~ts.value == 1,
2119                         {if(~tst == nil, {nil}, {~tst.close;});
2120                                 ~timevals.value;
2121                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time8o = 0;
2122                                 ~timer = Routine({inf.do({
2123                                         ~time8o =
2124                                         ~time8o+0.01; ~slot = "o8_"+~time8o.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2125                         {nil});
2126         });
2127
2128
2129         //synthflow 1-8 buttons
2130
2131         ~bplacef1 = Button.new(w,Rect(~bpf1l,~bpf1t,~bpf1h,~bpf1w)).states_([["f1",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2132
2133                 [~f1=fp1,~f2=fp2,~f3=fp3,~f4=fp4,~f5=fp5,~f6=fp6,~f7=fp7,~f8=fp8];
2134
2135                 ~synthflow.value;
2136                 ~currentsynth = "f1"; ~synthmonitorfunc.value;
2137
2138                 if(~ts.value == 1,
2139                         {if(~tst == nil, {nil}, {~tst.close;});
2140                                 ~timevals.value;
2141                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time1f = 0;
2142                                 ~timer = Routine({inf.do({
2143                                         ~time1f =
2144                                         ~time1f+0.01; ~slot = "f1_"+~time1f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2145                         {nil});
2146         });
2147         ~bplacef2 = Button.new(w,Rect(~bpf2l,~bpf2t,~bpf2h,~bpf2w)).states_([["f2",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2148
2149                 [~f1=fp1b,~f2=fp2b,~f3=fp3b,~f4=fp4b,~f5=fp5b,~f6=fp6b,~f7=fp7b,~f8=fp8b];
2150
2151                 ~synthflow.value;
2152                 ~currentsynth = "f2"; ~synthmonitorfunc.value;
2153
2154                 if(~ts.value == 1,
2155                         {if(~tst == nil, {nil}, {~tst.close;});
2156                                 ~timevals.value;
2157                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time2f = 0;
2158                                 ~timer = Routine({inf.do({
2159                                         ~time2f =
2160                                         ~time2f+0.01; ~slot = "f2_"+~time2f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2161                         {nil});
2162         });
2163
2164         ~bplacef3 = Button.new(w,Rect(~bpf3l,~bpf3t,~bpf3h,~bpf3w)).states_([["f3",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2165
2166                 [~f1=fp1c,~f2=fp2c,~f3=fp3c,~f4=fp4c,~f5=fp5c,~f6=fp6c,~f7=fp7c,~f8=fp8c];
2167
2168                 ~synthflow.value;
2169                 ~currentsynth = "f3"; ~synthmonitorfunc.value;
2170
2171                 if(~ts.value == 1,
2172                         {if(~tst == nil, {nil}, {~tst.close;});
2173                                 ~timevals.value;
2174                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time3f = 0;
2175                                 ~timer = Routine({inf.do({
2176                                         ~time3f =
2177                                         ~time3f+0.01; ~slot = "f3_"+~time3f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2178                         {nil});
2179         });
2180         ~bplacef4 = Button.new(w,Rect(~bpf4l,~bpf4t,~bpf4h,~bpf4w)).states_([["f4",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2181
2182                 [~f1=fp1d,~f2=fp2d,~f3=fp3d,~f4=fp4d,~f5=fp5d,~f6=fp6d,~f7=fp7d,~f8=fp8d];
2183
2184                 ~synthflow.value;
2185                 ~currentsynth = "f4"; ~synthmonitorfunc.value;
2186
2187                 if(~ts.value == 1,
2188                         {if(~tst == nil, {nil}, {~tst.close;});
2189                                 ~timevals.value;
2190                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time4f = 0;
2191                                 ~timer = Routine({inf.do({
2192                                         ~time4f =
2193                                         ~time4f+0.01; ~slot = "f4_"+~time4f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2194                         {nil});
2195         });
2196
2197         ~bplacef5 = Button.new(w,Rect(~bpf5l,~bpf5t,~bpf5h,~bpf5w)).states_([["f5",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2198
2199                 [~f1=fp1e,~f2=fp2e,~f3=fp3e,~f4=fp4e,~f5=fp5e,~f6=fp6e,~f7=fp7e,~f8=fp8e];
2200
2201                 ~synthflow.value;
2202                 ~currentsynth = "f5"; ~synthmonitorfunc.value;
2203
2204                 if(~ts.value == 1,
2205                         {if(~tst == nil, {nil}, {~tst.close;});
2206                                 ~timevals.value;
2207                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time5f = 0;
2208                                 ~timer = Routine({inf.do({
2209                                         ~time5f =
2210                                         ~time5f+0.01; ~slot = "f5_"+~time5f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2211                         {nil});
2212         });
2213
2214         ~bplacef6 = Button.new(w,Rect(~bpf6l,~bpf6t,~bpf6h,~bpf6w)).states_([["f6",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2215
2216                 [~f1=fp1f,~f2=fp2f,~f3=fp3f,~f4=fp4f,~f5=fp5f,~f6=fp6f,~f7=fp7f,~f8=fp8f];
2217
2218                 ~synthflow.value;
2219                 ~currentsynth = "f6"; ~synthmonitorfunc.value;
2220
2221                 if(~ts.value == 1,
2222                         {if(~tst == nil, {nil}, {~tst.close;});
2223                                 ~timevals.value;
2224                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time6f = 0;
2225                                 ~timer = Routine({inf.do({
2226                                         ~time6f =
2227                                         ~time6f+0.01; ~slot = "f6_"+~time6f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2228                         {nil});
2229         });
2230
2231
2232         ~bplacef7 = Button.new(w,Rect(~bpf7l,~bpf7t,~bpf7h,~bpf7w)).states_([["f7",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2233
2234                 [~f1=fp1g,~f2=fp2g,~f3=fp3g,~f4=fp4g,~f5=fp5g,~f6=fp6g,~f7=fp7g,~f8=fp8g];
2235
2236                 ~synthflow.value;
2237                 ~currentsynth = "f7"; ~synthmonitorfunc.value;
2238
2239                 if(~ts.value == 1,
2240                         {if(~tst == nil, {nil}, {~tst.close;});
2241                                 ~timevals.value;
2242                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time7f = 0;
2243                                 ~timer = Routine({inf.do({
2244                                         ~time7f =
2245                                         ~time7f+0.01; ~slot = "f7_"+~time7f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2246                         {nil});
2247         });
2248         ~bplacef8 = Button.new(w,Rect(~bpf8l,~bpf8t,~bpf8h,~bpf8w)).states_([["f8",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2249
2250                 [~f1=fp1h,~f2=fp2h,~f3=fp3h,~f4=fp4h,~f5=fp5h,~f6=fp6h,~f7=fp7h,~f8=fp8h];
2251
2252                 ~synthflow.value;
2253                 ~currentsynth = "f8"; ~synthmonitorfunc.value;
2254
2255                 if(~ts.value == 1,
2256                         {if(~tst == nil, {nil}, {~tst.close;});
2257                                 ~timevals.value;
2258                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time8f = 0;
2259                                 ~timer = Routine({inf.do({
2260                                         ~time8f =
2261                                         ~time8f+0.01; ~slot = "f8_"+~time8f.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2262                         {nil});
2263         });
2264
2265
2266         //synthslide 1-8 buttons
2267
2268         ~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;
2269
2270                 if(~slidetime1 == nil, {~slidetime1 = 4}); if(~slidedo1 == nil, {~slidedo1 = 2000;}); ~slidecount = ~slidedo1;
2271                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2272                         [ fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8 ])*(-1)/~slidedo1);
2273
2274                 ~slidetime =~slidetime1; ~slidedo = ~slidedo1;
2275
2276                 ~slideroutine.stop;
2277
2278                 ~synthslide.value;
2279                 ~currentsynth = "s1"; ~synthmonitorfunc.value;
2280
2281                 if(~ts.value == 1,
2282                         {if(~tst == nil, {nil}, {~tst.close;});
2283                                 ~timevals.value;
2284                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time1s = 0;
2285                                 ~timer = Routine({inf.do({
2286                                         ~time1s =
2287                                         ~time1s+0.01; ~slot = "s1_"+~time1s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2288                         {nil});
2289
2290         });
2291         ~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;
2292
2293                 if(~slidetime2 == nil, {~slidetime2 = 4}); if(~slidedo2 == nil, {~slidedo2 = 2000;}); ~slidecount = ~slidedo2;
2294                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2295                         [ fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b ])*(-1)/~slidedo2);
2296
2297                 ~slidetime = ~slidetime2; ~slidedo = ~slidedo2;
2298
2299                 ~slideroutine.stop;
2300
2301                 ~synthslide.value;
2302                 ~currentsynth = "s2"; ~synthmonitorfunc.value;
2303
2304                 if(~ts.value == 1,
2305                         {if(~tst == nil, {nil}, {~tst.close;});
2306                                 ~timevals.value;
2307                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time2s = 0;
2308                                 ~timer = Routine({inf.do({
2309                                         ~time2s =
2310                                         ~time2s+0.01; ~slot = "s2_"+~time2s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2311                         {nil});
2312
2313         });
2314         ~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;
2315
2316                 if(~slidetime3 == nil, {~slidetime3 = 4}); if(~slidedo3 == nil, {~slidedo3 = 2000;}); ~slidecount = ~slidedo3;
2317                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2318                         [ fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c ])*(-1)/~slidedo3);
2319
2320                 ~slidetime = ~slidetime3; ~slidedo = ~slidedo3;
2321
2322                 ~slideroutine.stop;
2323
2324                 ~synthslide.value;
2325                 ~currentsynth = "s3"; ~synthmonitorfunc.value;
2326
2327                 if(~ts.value == 1,
2328                         {if(~tst == nil, {nil}, {~tst.close;});
2329                                 ~timevals.value;
2330                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time3s = 0;
2331                                 ~timer = Routine({inf.do({
2332                                         ~time3s =
2333                                         ~time3s+0.01; ~slot = "s3_"+~time3s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2334                         {nil});
2335
2336         });
2337         ~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;
2338
2339                 if(~slidetime4 == nil, {~slidetime4 = 4}); if(~slidedo4 == nil, {~slidedo4 = 2000;}); ~slidecount = ~slidedo4;
2340                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2341                         [ fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d ])*(-1)/~slidedo4);
2342
2343                 ~slidetime = ~slidetime4; ~slidedo = ~slidedo4;
2344
2345                 ~slideroutine.stop;
2346
2347                 ~synthslide.value;
2348                 ~currentsynth = "s4"; ~synthmonitorfunc.value;
2349
2350                 if(~ts.value == 1,
2351                         {if(~tst == nil, {nil}, {~tst.close;});
2352                                 ~timevals.value;
2353                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time4s = 0;
2354                                 ~timer = Routine({inf.do({
2355                                         ~time4s =
2356                                         ~time4s+0.01; ~slot = "s4_"+~time4s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2357                         {nil});
2358         });
2359         ~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;
2360
2361                 if(~slidetime5 == nil, {~slidetime5 = 4}); if(~slidedo5 == nil, {~slidedo5 = 2000;}); ~slidecount = ~slidedo5;
2362                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2363                         [ fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e ])*(-1)/~slidedo5);
2364
2365                 ~slidetime = ~slidetime5; ~slidedo = ~slidedo5;
2366
2367                 ~slideroutine.stop;
2368
2369                 ~synthslide.value;
2370                 ~currentsynth = "s5"; ~synthmonitorfunc.value;
2371
2372                 if(~ts.value == 1,
2373                         {if(~tst == nil, {nil}, {~tst.close;});
2374                                 ~timevals.value;
2375                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time5s = 0;
2376                                 ~timer = Routine({inf.do({
2377                                         ~time5s =
2378                                         ~time5s+0.01; ~slot = "s5_"+~time5s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2379                         {nil});
2380
2381         });
2382         ~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;
2383
2384                 if(~slidetime6 == nil, {~slidetime6 = 4}); if(~slidedo6 == nil, {~slidedo6 = 2000;}); ~slidecount = ~slidedo6;
2385                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2386                         [ fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f ])*(-1)/~slidedo6);
2387
2388                 ~slidetime = ~slidetime6; ~slidedo = ~slidedo6;
2389                 ~slideroutine.stop;
2390
2391                 ~synthslide.value;
2392                 ~currentsynth = "s6"; ~synthmonitorfunc.value;
2393
2394                 if(~ts.value == 1,
2395                         {if(~tst == nil, {nil}, {~tst.close;});
2396                                 ~timevals.value;
2397                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time6s = 0;
2398                                 ~timer = Routine({inf.do({
2399                                         ~time6s =
2400                                         ~time6s+0.01; ~slot = "s6_"+~time6s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2401                         {nil});
2402
2403         });
2404         ~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;
2405
2406                 if(~slidetime7 == nil, {~slidetime7 = 4}); if(~slidedo7 == nil, {~slidedo7 = 2000;}); ~slidecount = ~slidedo7;
2407                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2408                         [ fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g ])*(-1)/~slidedo7);
2409
2410                 ~slidetime = ~slidetime7; ~slidedo = ~slidedo7;
2411                 ~slideroutine.stop;
2412
2413                 ~synthslide.value;
2414                 ~currentsynth = "s7"; ~synthmonitorfunc.value;
2415
2416                 if(~ts.value == 1,
2417                         {if(~tst == nil, {nil}, {~tst.close;});
2418                                 ~timevals.value;
2419                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time7s = 0;
2420                                 ~timer = Routine({inf.do({
2421                                         ~time7s =
2422                                         ~time7s+0.01; ~slot = "s7_"+~time7s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2423                         {nil});
2424
2425         });
2426         ~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;
2427
2428                 if(~slidetime8 == nil, {~slidetime8 = 4}); if(~slidedo8 == nil, {~slidedo8 = 2000;}); ~slidecount = ~slidedo8;
2429                 #g,h,i,j,k,l,m,n,o,p,q,r = (([ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8 ]-
2430                         [ fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h])*(-1)/~slidedo8);
2431
2432                 ~slidetime = ~slidetime8; ~slidedo = ~slidedo8;
2433
2434                 ~slideroutine.stop;
2435
2436                 ~synthslide.value;
2437                 ~currentsynth = "s8"; ~synthmonitorfunc.value;
2438
2439                 if(~ts.value == 1,
2440                         {if(~tst == nil, {nil}, {~tst.close;});
2441                                 ~timevals.value;
2442                                 ~timer.stop; ~systemclock.stop; ~systemclock.clear; ~time8s = 0;
2443                                 ~timer = Routine({inf.do({
2444                                         ~time8s =
2445                                         ~time8s+0.01; ~slot = "s8_"+~time8s.asString; 0.01.wait;});}); ~systemclock = SystemClock.play(~timer);},
2446                         {nil});
2447         });
2448
2449
2450         //if slidetime/slidedo is nil
2451
2452         if(~slidetimeall == nil, {~slidetimeall = 1});
2453         if(~slidetime1 == nil, {~slidetime1 = 1});
2454         if(~slidetime2 == nil, {~slidetime2 = 1});
2455         if(~slidetime3 == nil, {~slidetime3 = 1});
2456         if(~slidetime4 == nil, {~slidetime4 = 1});
2457         if(~slidetime5 == nil, {~slidetime5 = 1});
2458         if(~slidetime6 == nil, {~slidetime6 = 1});
2459         if(~slidetime7 == nil, {~slidetime7 = 1});
2460         if(~slidetime8 == nil, {~slidetime8 = 1});
2461
2462         if(~slidedoall == nil, {~slidedoall = 432});
2463         if(~slidedo1 == nil, {~slidedo1 = 432});
2464         if(~slidedo2 == nil, {~slidedo2 = 432});
2465         if(~slidedo3 == nil, {~slidedo3 = 432});
2466         if(~slidedo4 == nil, {~slidedo4 = 432});
2467         if(~slidedo5 == nil, {~slidedo5 = 432});
2468         if(~slidedo6 == nil, {~slidedo6 = 432});
2469         if(~slidedo7 == nil, {~slidedo7 = 432});
2470         if(~slidedo8 == nil, {~slidedo8 = 432});
2471
2472
2473         //set slide values button
2474
2475         ~slidevals = Button.new(w,Rect(Window.screenBounds.width-20-20-20,~bpt+69+5,20,20/1.6180339887499)).states_([["s",Color.white,Color.black],["s",Color.white,Color.black]]).action_({arg button; button.value.postln}).action_({arg button;
2476
2477                 if(button.value == 1, {
2478                         ({
2479                                 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;
2480                                 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;
2481                                 ~slideview = View(w, Rect(Window.screenBounds.width-(340+46),Window.screenBounds.height-(340+46/1.6180339887499)-110,340+46,340+46/1.6180339887499)).front;
2482
2483                                 tall = StaticText(~slideview, Rect(lefttime , top=top, width, height)).background_(Color.black).string_("all time").stringColor_(Color.white);
2484                                 t1 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s1 time").stringColor_(Color.white);
2485                                 t2 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s2 time").stringColor_(Color.white);
2486                                 t3 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s3 time").stringColor_(Color.white);
2487                                 t4 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s4 time").stringColor_(Color.white);
2488                                 t5 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s5 time").stringColor_(Color.white);
2489                                 t6 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s6 time").stringColor_(Color.white);
2490                                 t7 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s7 time").stringColor_(Color.white);
2491                                 t8 = StaticText(~slideview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("s8 time").stringColor_(Color.white);
2492
2493                                 top = 0;
2494
2495                                 stall=NumberBox(~slideview, Rect(lefttimebox , top=top, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetimeall);
2496                                 st1=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime1);
2497                                 st2=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime2);
2498                                 st3=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime3);
2499                                 st4=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime4);
2500                                 st5=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime5);
2501                                 st6=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime6);
2502                                 st7=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime7);
2503                                 st8=NumberBox(~slideview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidetime8);
2504
2505                                 top = 0;
2506
2507                                 iall = StaticText(~slideview, Rect(leftdo , top=top, width, height)).background_(Color.black).string_("all incr").stringColor_(Color.white);
2508                                 i1 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s1 incr").stringColor_(Color.white);
2509                                 i2 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s2 incr").stringColor_(Color.white);
2510                                 i3 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s3 incr").stringColor_(Color.white);
2511                                 i4 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s4 incr").stringColor_(Color.white);
2512                                 i5 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s5 incr").stringColor_(Color.white);
2513                                 i6 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s6 incr").stringColor_(Color.white);
2514                                 i7 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s7 incr").stringColor_(Color.white);
2515                                 i8 = StaticText(~slideview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("s8 incr").stringColor_(Color.white);
2516
2517                                 top = 0;
2518
2519                                 siall=NumberBox(~slideview, Rect(leftdobox , top=top, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedoall);
2520                                 si1=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo1);
2521                                 si2=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo2);
2522                                 si3=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo3);
2523                                 si4=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo4);
2524                                 si5=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo5);
2525                                 si6=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo6);
2526                                 si7=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo7);
2527                                 si8=NumberBox(~slideview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~slidedo8);
2528
2529                                 stall.action_({arg val;
2530                                         ~slidetimeall = val.value;
2531                                         ~slidetime1 = val.value;
2532                                         ~slidetime2 = val.value;
2533                                         ~slidetime3 = val.value;
2534                                         ~slidetime4 = val.value;
2535                                         ~slidetime5 = val.value;
2536                                         ~slidetime6 = val.value;
2537                                         ~slidetime7 = val.value;
2538                                         ~slidetime8 = val.value;
2539                                         ~slideview.close; ~slidevals.valueAction_(1);
2540                                 });
2541                                 st1.action_({arg val; ~slidetime1 = val.value;});
2542                                 st2.action_({arg val; ~slidetime2 = val.value;});
2543                                 st3.action_({arg val; ~slidetime3 = val.value;});
2544                                 st4.action_({arg val; ~slidetime4 = val.value;});
2545                                 st5.action_({arg val; ~slidetime5 = val.value;});
2546                                 st6.action_({arg val; ~slidetime6 = val.value;});
2547                                 st7.action_({arg val; ~slidetime7 = val.value;});
2548                                 st8.action_({arg val; ~slidetime8 = val.value;});
2549
2550                                 siall.action_({arg val;
2551                                         ~slidedoall = val.value;
2552                                         ~slidedo1 = val.value;
2553                                         ~slidedo2 = val.value;
2554                                         ~slidedo3 = val.value;
2555                                         ~slidedo4 = val.value;
2556                                         ~slidedo5 = val.value;
2557                                         ~slidedo6 = val.value;
2558                                         ~slidedo7 = val.value;
2559                                         ~slidedo8 = val.value;
2560                                         ~slideview.close; ~slidevals.valueAction_(1);
2561                                 });
2562                                 si1.action_({arg val; ~slidedo1 = val.value;});
2563                                 si2.action_({arg val; ~slidedo2 = val.value;});
2564                                 si3.action_({arg val; ~slidedo3 = val.value;});
2565                                 si4.action_({arg val; ~slidedo4 = val.value;});
2566                                 si5.action_({arg val; ~slidedo5 = val.value;});
2567                                 si6.action_({arg val; ~slidedo6 = val.value;});
2568                                 si7.action_({arg val; ~slidedo7 = val.value;});
2569                                 si8.action_({arg val; ~slidedo8 = val.value;});
2570
2571                                 ~slideview.background_(Color.black);
2572
2573                                 ~closeslidebutton = Button.new(~slideview,Rect(220, top+40, 40, 40/~gm)).states_([["close",Color.white,Color.black]]).action_({arg button;
2574
2575                                         ~slideview.close; ~slidevals.value = 0;
2576                                 });
2577
2578                         }.value);
2579
2580                         ~slideview.front;
2581                 }, {~slideview.close});
2582         });
2583
2584
2585         //mute/unmute 1-8 buttons
2586
2587         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;
2588                 case
2589                 {~l1a1.isRunning == true}{
2590                         if(button.value == 0, {
2591                                 (~vol1 = ~vol;
2592                                         1.do({
2593                                                 ~l1a1.set(\vol, ~vol1);  ~l1b1.set(\vol, ~vol1);
2594                                                 ~l1c1.set(\vol, ~vol1);  ~l1d1.set(\vol, ~vol1);
2595                                                 ~l1e1.set(\vol, ~vol1);  ~l1f1.set(\vol, ~vol1);
2596
2597                                 }););
2598                                 }, {(~vol1 = 0;
2599                                         1.do({
2600                                                 ~l1a1.set(\vol, ~vol1);  ~l1b1.set(\vol, ~vol1);
2601                                                 ~l1c1.set(\vol, ~vol1);  ~l1d1.set(\vol, ~vol1);
2602                                                 ~l1e1.set(\vol, ~vol1);  ~l1f1.set(\vol, ~vol1);
2603
2604                                         }););
2605                         });
2606                 }
2607                 {~l1a.isRunning == true}{
2608                         if(button.value == 0, {
2609                                 (~vol1 = ~vol;
2610                                         1.do({
2611                                                 ~l1a.set(\vol, ~vol1);  ~l1b.set(\vol, ~vol1);
2612                                                 ~l1c.set(\vol, ~vol1);  ~l1d.set(\vol, ~vol1);
2613                                                 ~l1e.set(\vol, ~vol1);  ~l1f.set(\vol, ~vol1);
2614
2615                                 }););
2616                                 }, {(~vol1 = 0;
2617                                         1.do({
2618                                                 ~l1a.set(\vol, ~vol1);  ~l1b.set(\vol, ~vol1);
2619                                                 ~l1c.set(\vol, ~vol1);  ~l1d.set(\vol, ~vol1);
2620                                                 ~l1e.set(\vol, ~vol1);  ~l1f.set(\vol, ~vol1);
2621
2622                                         }););
2623                         });
2624                 };
2625         });
2626
2627         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;
2628                 case
2629                 {~l1a1.isRunning == true}{
2630                         if(button.value == 0, {
2631                                 (~vol2 = ~vol;
2632                                         1.do({
2633                                                 ~l2a1.set(\vol, ~vol2);  ~l2b1.set(\vol, ~vol2);
2634                                                 ~l2c1.set(\vol, ~vol2);  ~l2d1.set(\vol, ~vol2);
2635                                                 ~l2e1.set(\vol, ~vol2);  ~l2f1.set(\vol, ~vol2);
2636
2637                                 }););
2638                                 }, {(~vol2 = 0;
2639                                         1.do({
2640                                                 ~l2a1.set(\vol, ~vol2);  ~l2b1.set(\vol, ~vol2);
2641                                                 ~l2c1.set(\vol, ~vol2);  ~l2d1.set(\vol, ~vol2);
2642                                                 ~l2e1.set(\vol, ~vol2);  ~l2f1.set(\vol, ~vol2);
2643
2644                                         }););
2645                         });
2646                 }
2647                 {~l1a.isRunning == true}{
2648                         if(button.value == 0, {
2649                                 (~vol2 = ~vol;
2650                                         1.do({
2651                                                 ~l2a.set(\vol, ~vol2);  ~l2b.set(\vol, ~vol2);
2652                                                 ~l2c.set(\vol, ~vol2);  ~l2d.set(\vol, ~vol2);
2653                                                 ~l2e.set(\vol, ~vol2);  ~l2f.set(\vol, ~vol2);
2654
2655                                 }););
2656                                 }, {(~vol2 = 0;
2657                                         1.do({
2658                                                 ~l2a.set(\vol, ~vol2);  ~l2b.set(\vol, ~vol2);
2659                                                 ~l2c.set(\vol, ~vol2);  ~l2d.set(\vol, ~vol2);
2660                                                 ~l2e.set(\vol, ~vol2);  ~l2f.set(\vol, ~vol2);
2661
2662                                         }););
2663                         });
2664                 };
2665         });
2666         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;
2667                 case
2668                 {~l1a1.isRunning == true}{
2669                         if(button.value == 0, {
2670                                 (~vol3 = ~vol;
2671                                         1.do({
2672                                                 ~l3a1.set(\vol, ~vol3);  ~l3b1.set(\vol, ~vol3);
2673                                                 ~l3c1.set(\vol, ~vol3);  ~l3d1.set(\vol, ~vol3);
2674                                                 ~l3e1.set(\vol, ~vol3);  ~l3f1.set(\vol, ~vol3);
2675
2676                                 }););
2677                                 }, {(~vol3 = 0;
2678                                         1.do({
2679                                                 ~l3a1.set(\vol, ~vol3);  ~l3b1.set(\vol, ~vol3);
2680                                                 ~l3c1.set(\vol, ~vol3);  ~l3d1.set(\vol, ~vol3);
2681                                                 ~l3e1.set(\vol, ~vol3);  ~l3f1.set(\vol, ~vol3);
2682
2683                                         }););
2684                         });
2685                 }
2686                 {~l1a.isRunning == true}{
2687                         if(button.value == 0, {
2688                                 (~vol3 = ~vol;
2689                                         1.do({
2690                                                 ~l3a.set(\vol, ~vol3);  ~l3b.set(\vol, ~vol3);
2691                                                 ~l3c.set(\vol, ~vol3);  ~l3d.set(\vol, ~vol3);
2692                                                 ~l3e.set(\vol, ~vol3);  ~l3f.set(\vol, ~vol3);
2693
2694                                 }););
2695                                 }, {(~vol3 = 0;
2696                                         1.do({
2697                                                 ~l3a.set(\vol, ~vol3);  ~l3b.set(\vol, ~vol3);
2698                                                 ~l3c.set(\vol, ~vol3);  ~l3d.set(\vol, ~vol3);
2699                                                 ~l3e.set(\vol, ~vol3);  ~l3f.set(\vol, ~vol3);
2700
2701                                         }););
2702                         });
2703                 };
2704         });
2705         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;
2706                 case
2707                 {~l1a1.isRunning == true}{
2708                         if(button.value == 0, {
2709                                 (~vol4 = ~vol;
2710                                         1.do({
2711                                                 ~l4a1.set(\vol, ~vol4);  ~l4b1.set(\vol, ~vol4);
2712                                                 ~l4c1.set(\vol, ~vol4);  ~l4d1.set(\vol, ~vol4);
2713                                                 ~l4e1.set(\vol, ~vol4);  ~l4f1.set(\vol, ~vol4);
2714
2715                                 }););
2716                                 }, {(~vol4 = 0;
2717                                         1.do({
2718                                                 ~l4a1.set(\vol, ~vol4);  ~l4b1.set(\vol, ~vol4);
2719                                                 ~l4c1.set(\vol, ~vol4);  ~l4d1.set(\vol, ~vol4);
2720                                                 ~l4e1.set(\vol, ~vol4);  ~l4f1.set(\vol, ~vol4);
2721
2722                                         }););
2723                         });
2724                 }
2725                 {~l1a.isRunning == true}{
2726                         if(button.value == 0, {
2727                                 (~vol4 = ~vol;
2728                                         1.do({
2729                                                 ~l4a.set(\vol, ~vol4);  ~l4b.set(\vol, ~vol4);
2730                                                 ~l4c.set(\vol, ~vol4);  ~l4d.set(\vol, ~vol4);
2731                                                 ~l4e.set(\vol, ~vol4);  ~l4f.set(\vol, ~vol4);
2732
2733                                 }););
2734                                 }, {(~vol4 = 0;
2735                                         1.do({
2736                                                 ~l4a.set(\vol, ~vol4);  ~l4b.set(\vol, ~vol4);
2737                                                 ~l4c.set(\vol, ~vol4);  ~l4d.set(\vol, ~vol4);
2738                                                 ~l4e.set(\vol, ~vol4);  ~l4f.set(\vol, ~vol4);
2739
2740                                         }););
2741                         });
2742                 };
2743         });
2744         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;
2745                 case
2746                 {~l1a1.isRunning == true}{
2747                         if(button.value == 0, {
2748                                 (~vol5 = ~vol;
2749                                         1.do({
2750                                                 ~l5a1.set(\vol, ~vol5);  ~l5b1.set(\vol, ~vol5);
2751                                                 ~l5c1.set(\vol, ~vol5);  ~l5d1.set(\vol, ~vol5);
2752                                                 ~l5e1.set(\vol, ~vol5);  ~l5f1.set(\vol, ~vol5);
2753
2754                                 }););
2755                                 }, {(~vol5 = 0;
2756                                         1.do({
2757                                                 ~l5a1.set(\vol, ~vol5);  ~l5b1.set(\vol, ~vol5);
2758                                                 ~l5c1.set(\vol, ~vol5);  ~l5d1.set(\vol, ~vol5);
2759                                                 ~l5e1.set(\vol, ~vol5);  ~l5f1.set(\vol, ~vol5);
2760
2761                                         }););
2762                         });
2763                 }
2764                 {~l1a.isRunning == true}{
2765                         if(button.value == 0, {
2766                                 (~vol5 = ~vol;
2767                                         1.do({
2768                                                 ~l5a.set(\vol, ~vol5);  ~l5b.set(\vol, ~vol5);
2769                                                 ~l5c.set(\vol, ~vol5);  ~l5d.set(\vol, ~vol5);
2770                                                 ~l5e.set(\vol, ~vol5);  ~l5f.set(\vol, ~vol5);
2771
2772                                 }););
2773                                 }, {(~vol5 = 0;
2774                                         1.do({
2775                                                 ~l5a.set(\vol, ~vol5);  ~l5b.set(\vol, ~vol5);
2776                                                 ~l5c.set(\vol, ~vol5);  ~l5d.set(\vol, ~vol5);
2777                                                 ~l5e.set(\vol, ~vol5);  ~l5f.set(\vol, ~vol5);
2778
2779                                         }););
2780                         });
2781                 };
2782         });
2783         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;
2784                 case
2785                 {~l1a1.isRunning == true}{
2786                         if(button.value == 0, {
2787                                 (~vol6 = ~vol;
2788                                         1.do({
2789                                                 ~l6a1.set(\vol, ~vol6);  ~l6b1.set(\vol, ~vol6);
2790                                                 ~l6c1.set(\vol, ~vol6);  ~l6d1.set(\vol, ~vol6);
2791                                                 ~l6e1.set(\vol, ~vol6);  ~l6f1.set(\vol, ~vol6);
2792
2793                                 }););
2794                                 }, {(~vol6 = 0;
2795                                         1.do({
2796                                                 ~l6a1.set(\vol, ~vol6);  ~l6b1.set(\vol, ~vol6);
2797                                                 ~l6c1.set(\vol, ~vol6);  ~l6d1.set(\vol, ~vol6);
2798                                                 ~l6e1.set(\vol, ~vol6);  ~l6f1.set(\vol, ~vol6);
2799
2800                                         }););
2801                         });
2802                 }
2803                 {~l1a.isRunning == true}{
2804                         if(button.value == 0, {
2805                                 (~vol6 = ~vol;
2806                                         1.do({
2807                                                 ~l6a.set(\vol, ~vol6);  ~l6b.set(\vol, ~vol6);
2808                                                 ~l6c.set(\vol, ~vol6);  ~l6d.set(\vol, ~vol6);
2809                                                 ~l6e.set(\vol, ~vol6);  ~l6f.set(\vol, ~vol6);
2810
2811                                 }););
2812                                 }, {(~vol6 = 0;
2813                                         1.do({
2814                                                 ~l6a.set(\vol, ~vol6);  ~l6b.set(\vol, ~vol6);
2815                                                 ~l6c.set(\vol, ~vol6);  ~l6d.set(\vol, ~vol6);
2816                                                 ~l6e.set(\vol, ~vol6);  ~l6f.set(\vol, ~vol6);
2817
2818                                         }););
2819                         });
2820                 };
2821
2822         });
2823         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;
2824                 case
2825                 {~l1a1.isRunning == true}{
2826                         if(button.value == 0, {
2827                                 (~vol7 = ~vol;
2828                                         1.do({
2829                                                 ~l7a1.set(\vol, ~vol7);  ~l7b1.set(\vol, ~vol7);
2830                                                 ~l7c1.set(\vol, ~vol7);  ~l7d1.set(\vol, ~vol7);
2831                                                 ~l7e1.set(\vol, ~vol7);  ~l7f1.set(\vol, ~vol7);
2832
2833                                 }););
2834                                 }, {(~vol7 = 0;
2835                                         1.do({
2836                                                 ~l7a1.set(\vol, ~vol7);  ~l7b1.set(\vol, ~vol7);
2837                                                 ~l7c1.set(\vol, ~vol7);  ~l7d1.set(\vol, ~vol7);
2838                                                 ~l7e1.set(\vol, ~vol7);  ~l7f1.set(\vol, ~vol7);
2839
2840                                         }););
2841                         });
2842                 }
2843                 {~l1a.isRunning == true}{
2844                         if(button.value == 0, {
2845                                 (~vol7 = ~vol;
2846                                         1.do({
2847                                                 ~l7a.set(\vol, ~vol7);  ~l7b.set(\vol, ~vol7);
2848                                                 ~l7c.set(\vol, ~vol7);  ~l7d.set(\vol, ~vol7);
2849                                                 ~l7e.set(\vol, ~vol7);  ~l7f.set(\vol, ~vol7);
2850
2851                                 }););
2852                                 }, {(~vol7 = 0;
2853                                         1.do({
2854                                                 ~l7a.set(\vol, ~vol7);  ~l7b.set(\vol, ~vol7);
2855                                                 ~l7c.set(\vol, ~vol7);  ~l7d.set(\vol, ~vol7);
2856                                                 ~l7e.set(\vol, ~vol7);  ~l7f.set(\vol, ~vol7);
2857
2858                                         }););
2859                         });
2860                 };
2861         });
2862         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;
2863                 case
2864                 {~l1a1.isRunning == true}{
2865                         if(button.value == 0, {
2866                                 (~vol8 = ~vol;
2867                                         1.do({
2868                                                 ~l8a1.set(\vol, ~vol8);  ~l8b1.set(\vol, ~vol8);
2869                                                 ~l8c1.set(\vol, ~vol8);  ~l8d1.set(\vol, ~vol8);
2870                                                 ~l8e1.set(\vol, ~vol8);  ~l8f1.set(\vol, ~vol8);
2871
2872                                 }););
2873                                 }, {(~vol8 = 0;
2874                                         1.do({
2875                                                 ~l8a1.set(\vol, ~vol8);  ~l8b1.set(\vol, ~vol8);
2876                                                 ~l8c1.set(\vol, ~vol8);  ~l8d1.set(\vol, ~vol8);
2877                                                 ~l8e1.set(\vol, ~vol8);  ~l8f1.set(\vol, ~vol8);
2878
2879                                         }););
2880                         });
2881                 }
2882                 {~l1a.isRunning == true}{
2883                         if(button.value == 0, {
2884                                 (~vol8 = ~vol;
2885                                         1.do({
2886                                                 ~l8a.set(\vol, ~vol8);  ~l8b.set(\vol, ~vol8);
2887                                                 ~l8c.set(\vol, ~vol8);  ~l8d.set(\vol, ~vol8);
2888                                                 ~l8e.set(\vol, ~vol8);  ~l8f.set(\vol, ~vol8);
2889
2890                                 }););
2891                                 }, {(~vol8 = 0;
2892                                         1.do({
2893                                                 ~l8a.set(\vol, ~vol8);  ~l8b.set(\vol, ~vol8);
2894                                                 ~l8c.set(\vol, ~vol8);  ~l8d.set(\vol, ~vol8);
2895                                                 ~l8e.set(\vol, ~vol8);  ~l8f.set(\vol, ~vol8);
2896
2897                                         }););
2898                         });
2899                 };
2900         });
2901
2902
2903         //mute/unmute all button
2904
2905         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;
2906
2907                 if(button.value == 0, {
2908                         mute1.value = 0;
2909                         mute2.value = 0;
2910                         mute3.value = 0;
2911                         mute4.value = 0;
2912                         mute5.value = 0;
2913                         mute6.value = 0;
2914                         mute7.value = 0;
2915                         mute8.value = 0;
2916
2917                         ~vol1 = ~vol;
2918                         ~vol2 = ~vol;
2919                         ~vol3 = ~vol;
2920                         ~vol4 = ~vol;
2921                         ~vol5 = ~vol;
2922                         ~vol6 = ~vol;
2923                         ~vol7 = ~vol;
2924                         ~vol8 = ~vol;
2925
2926                         },
2927                         {
2928                                 mute1.value = 1;
2929                                 mute2.value = 1;
2930                                 mute3.value = 1;
2931                                 mute4.value = 1;
2932                                 mute5.value = 1;
2933                                 mute6.value = 1;
2934                                 mute7.value = 1;
2935                                 mute8.value = 1;
2936
2937                                 ~vol1 = 0;
2938                                 ~vol2 = 0;
2939                                 ~vol3 = 0;
2940                                 ~vol4 = 0;
2941                                 ~vol5 = 0;
2942                                 ~vol6 = 0;
2943                                 ~vol7 = 0;
2944                                 ~vol8 = 0;
2945
2946                 });
2947                 ~synthflow.value;
2948         });
2949
2950
2951         //midi Korg NanoKontrol function
2952
2953         ~midifunc = {
2954                 ~snb = 0;
2955                 /*~etemp = EqualTemperament(12, calibratefreq: 432, calibratenote: 69);*/
2956
2957
2958                 //midi set frequency
2959
2960                 MIDIFunc.cc({if(~snb == 0, {~snb = 1},{~snb = 0});}, ccNum: 60);
2961                 MIDIdef.cc('l1', { |val|
2962                         case
2963                         {~l1a.isRunning == true}{
2964                                 ~l1a.set(\dur, ~f1 = \dur.asSpec.map(val / 127));
2965                                 ~l1b.set(\dur,      \dur.asSpec.map(val / 127));
2966                                 ~l1c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
2967                                 ~l1d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
2968                                 ~l1e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
2969                                 ~l1f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
2970                         }{~l1a1.isRunning == true}{
2971                                 ~l1a1.set(\dur, ~f1 = \dur.asSpec.map(val / 127));
2972                                 ~l1b1.set(\dur,      \dur.asSpec.map(val / 127));
2973                                 ~l1c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
2974                                 ~l1d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
2975                                 ~l1e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
2976                                 ~l1f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
2977                         };
2978                         ~tunefreq1 = ~f1; ~f1 = ~f1+~f1t;
2979                         {if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (CompositeView(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (CompositeView(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
2980                         }.defer;
2981                 }, ccNum: [0]);
2982                 MIDIdef.cc('l2', { |val|
2983                         case
2984                         {~l1a.isRunning == true}{
2985                                 ~l2a.set(\dur, ~f2 = \dur.asSpec.map(val / 127));
2986                                 ~l2b.set(\dur,      \dur.asSpec.map(val / 127));
2987                                 ~l2c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
2988                                 ~l2d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
2989                                 ~l2e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
2990                                 ~l2f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
2991                         }{~l1a1.isRunning == true}{
2992                                 ~l2a1.set(\dur, ~f2 = \dur.asSpec.map(val / 127));
2993                                 ~l2b1.set(\dur,      \dur.asSpec.map(val / 127));
2994                                 ~l2c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
2995                                 ~l2d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
2996                                 ~l2e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
2997                                 ~l2f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
2998                         };
2999                         ~tunefreq2 = ~f2; ~f2 = ~f2+~f2t;
3000                         {if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (CompositeView(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (CompositeView(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
3001                         }.defer;
3002                 }, ccNum: [1]);
3003                 MIDIdef.cc('l3', { |val|
3004                         case
3005                         {~l1a.isRunning == true}{
3006                                 ~l3a.set(\dur, ~f3 = \dur.asSpec.map(val / 127));
3007                                 ~l3b.set(\dur,      \dur.asSpec.map(val / 127));
3008                                 ~l3c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3009                                 ~l3d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3010                                 ~l3e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3011                                 ~l3f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3012                         }{~l1a1.isRunning == true}{
3013                                 ~l3a1.set(\dur, ~f3 = \dur.asSpec.map(val / 127));
3014                                 ~l3b1.set(\dur,      \dur.asSpec.map(val / 127));
3015                                 ~l3c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3016                                 ~l3d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3017                                 ~l3e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3018                                 ~l3f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3019                         };
3020                         ~tunefreq3 = ~f3; ~f3 = ~f3+~f3t;
3021                         {if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (CompositeView(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (CompositeView(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
3022                         }.defer;
3023                 }, ccNum: 2);
3024                 MIDIdef.cc('l4', { |val|
3025                         case
3026                         {~l1a.isRunning == true}{
3027                                 ~l4a.set(\dur, ~f4 = \dur.asSpec.map(val / 127));
3028                                 ~l4b.set(\dur,      \dur.asSpec.map(val / 127));
3029                                 ~l4c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3030                                 ~l4d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3031                                 ~l4e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3032                                 ~l4f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3033                         }{~l1a1.isRunning == true}{
3034                                 ~l4a1.set(\dur, ~f4 = \dur.asSpec.map(val / 127));
3035                                 ~l4b1.set(\dur,      \dur.asSpec.map(val / 127));
3036                                 ~l4c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3037                                 ~l4d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3038                                 ~l4e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3039                                 ~l4f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3040                         };
3041                         ~tunefreq4 = ~f4; ~f4 = ~f4+~f4t;
3042                         {if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (CompositeView(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (CompositeView(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
3043                         }.defer;
3044                 }, ccNum: 3);
3045                 MIDIdef.cc('l5', { |val|
3046                         case
3047                         {~l1a.isRunning == true}{
3048                                 ~l5a.set(\dur, ~f5 = \dur.asSpec.map(val / 127));
3049                                 ~l5b.set(\dur,      \dur.asSpec.map(val / 127));
3050                                 ~l5c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3051                                 ~l5d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3052                                 ~l5e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3053                                 ~l5f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3054                         }{~l1a1.isRunning == true}{
3055                                 ~l5a1.set(\dur, ~f5 = \dur.asSpec.map(val / 127));
3056                                 ~l5b1.set(\dur,      \dur.asSpec.map(val / 127));
3057                                 ~l5c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3058                                 ~l5d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3059                                 ~l5e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3060                                 ~l5f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3061                         };
3062                         ~tunefreq5 = ~f5; ~f5 = ~f5+~f5t;
3063                         {if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (CompositeView(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (CompositeView(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
3064                         }.defer;
3065                 }, ccNum: 4);
3066                 MIDIdef.cc('l6', { |val|
3067                         case
3068                         {~l1a.isRunning == true}{
3069                                 ~l6a.set(\dur, ~f6 = \dur.asSpec.map(val / 127));
3070                                 ~l6b.set(\dur,      \dur.asSpec.map(val / 127));
3071                                 ~l6c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3072                                 ~l6d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3073                                 ~l6e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3074                                 ~l6f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3075                         }{~l1a1.isRunning == true}{
3076                                 ~l6a1.set(\dur, ~f6 = \dur.asSpec.map(val / 127));
3077                                 ~l6b1.set(\dur,      \dur.asSpec.map(val / 127));
3078                                 ~l6c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3079                                 ~l6d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3080                                 ~l6e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3081                                 ~l6f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3082                         };
3083                         ~tunefreq6 = ~f6; ~f6 = ~f6+~f6t;
3084                         {if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (CompositeView(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (CompositeView(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
3085                         }.defer;
3086                 }, ccNum: 5);
3087                 MIDIdef.cc('l7', { |val|
3088                         case
3089                         {~l1a.isRunning == true}{
3090                                 ~l7a.set(\dur, ~f7 = \dur.asSpec.map(val / 127));
3091                                 ~l7b.set(\dur,      \dur.asSpec.map(val / 127));
3092                                 ~l7c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3093                                 ~l7d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3094                                 ~l7e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3095                                 ~l7f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3096                         }{~l1a1.isRunning == true}{
3097                                 ~l7a1.set(\dur, ~f7 = \dur.asSpec.map(val / 127));
3098                                 ~l7b1.set(\dur,      \dur.asSpec.map(val / 127));
3099                                 ~l7c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3100                                 ~l7d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3101                                 ~l7e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3102                                 ~l7f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3103                         };
3104                         ~tunefreq7 = ~f7; ~f7 = ~f7+~f7t;
3105                         {if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (CompositeView(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (CompositeView(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
3106                         }.defer;
3107                 }, ccNum: 6);
3108                 MIDIdef.cc('l8', { |val|
3109                         case
3110                         {~l1a.isRunning == true}{
3111                                 ~l8a.set(\dur, ~f8 = \dur.asSpec.map(val / 127));
3112                                 ~l8b.set(\dur,      \dur.asSpec.map(val / 127));
3113                                 ~l8c.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3114                                 ~l8d.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3115                                 ~l8e.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3116                                 ~l8f.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3117                         }{~l1a1.isRunning == true}{
3118                                 ~l8a1.set(\dur, ~f8 = \dur.asSpec.map(val / 127));
3119                                 ~l8b1.set(\dur,      \dur.asSpec.map(val / 127));
3120                                 ~l8c1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3121                                 ~l8d1.set(\dur,      \dur.asSpec.map(val / 127)/~icd3);
3122                                 ~l8e1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3123                                 ~l8f1.set(\dur,      \dur.asSpec.map(val / 127)/~icd6);
3124                         };
3125                         ~tunefreq8 = ~f8; ~f8 = ~f8+~f8t;
3126                         {if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (CompositeView(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (CompositeView(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
3127                         }.defer;
3128                 }, ccNum: 7);
3129
3130
3131                 //if midi tuning frequency values are nil
3132
3133                 if(~f1t == nil, {~f1t = 0});
3134                 if(~f2t == nil, {~f2t = 0});
3135                 if(~f3t == nil, {~f3t = 0});
3136                 if(~f4t == nil, {~f4t = 0});
3137                 if(~f5t == nil, {~f5t = 0});
3138                 if(~f6t == nil, {~f6t = 0});
3139                 if(~f7t == nil, {~f7t = 0});
3140                 if(~f8t == nil, {~f8t = 0});
3141
3142
3143                 //midi set tuning frequency
3144
3145                 MIDIFunc.cc({|val|
3146                         ~f1 = ~f1-~f1t;
3147                         Spec.add(\tune, ([0, ~tunefreq1*~stepratio-~tunefreq1, \lin]));
3148                         case
3149                         {~l1a.isRunning == true}{
3150                                 ~l1a.set(\tune, ~f1t = \tune.asSpec.map(val / 127));
3151                                 ~l1b.set(\tune,      \tune.asSpec.map(val / 127));
3152                                 ~l1c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3153                                 ~l1d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3154                                 ~l1e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3155                                 ~l1f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3156                         }{~l1a1.isRunning == true}{
3157                                 ~l1a1.set(\tune, ~f1t = \tune.asSpec.map(val / 127));
3158                                 ~l1b1.set(\tune,      \tune.asSpec.map(val / 127));
3159                                 ~l1c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3160                                 ~l1d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3161                                 ~l1e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3162                                 ~l1f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3163                         };
3164                         ~f1 = ~f1+~f1t;
3165                         {if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (CompositeView(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (CompositeView(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
3166                         }.defer;
3167                 }, ccNum: 16);
3168                 MIDIFunc.cc({|val|
3169                         ~f2 = ~f2-~f2t;
3170                         Spec.add(\tune, ([0, ~tunefreq2*~stepratio-~tunefreq2, \lin]));
3171                         case
3172                         {~l1a.isRunning == true}{
3173                                 ~l2a.set(\tune, ~f2t = \tune.asSpec.map(val / 127));
3174                                 ~l2b.set(\tune,      \tune.asSpec.map(val / 127));
3175                                 ~l2c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3176                                 ~l2d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3177                                 ~l2e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3178                                 ~l2f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3179                         }{~l1a1.isRunning == true}{
3180                                 ~l2a1.set(\tune, ~f2t = \tune.asSpec.map(val / 127));
3181                                 ~l2b1.set(\tune,      \tune.asSpec.map(val / 127));
3182                                 ~l2c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3183                                 ~l2d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3184                                 ~l2e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3185                                 ~l2f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3186                         };
3187                         ~f2 = ~f2+~f2t;
3188                         {if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (CompositeView(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (CompositeView(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
3189                         }.defer;
3190                 }, ccNum: 17);
3191                 MIDIFunc.cc({|val|
3192                         ~f3 = ~f3-~f3t;
3193                         Spec.add(\tune, ([0, ~tunefreq3*~stepratio-~tunefreq3, \lin]));
3194                         case
3195                         {~l1a.isRunning == true}{
3196                                 ~l3a.set(\tune, ~f3t = \tune.asSpec.map(val / 127));
3197                                 ~l3b.set(\tune,      \tune.asSpec.map(val / 127));
3198                                 ~l3c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3199                                 ~l3d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3200                                 ~l3e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3201                                 ~l3f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3202                         }{~l1a1.isRunning == true}{
3203                                 ~l3a1.set(\tune, ~f3t = \tune.asSpec.map(val / 127));
3204                                 ~l3b1.set(\tune,      \tune.asSpec.map(val / 127));
3205                                 ~l3c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3206                                 ~l3d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3207                                 ~l3e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3208                                 ~l3f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3209                         };
3210                         ~f3 = ~f3+~f3t;
3211                         {if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (CompositeView(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (CompositeView(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
3212                         }.defer;
3213                 }, ccNum: 18);
3214                 MIDIFunc.cc({|val|
3215                         ~f4 = ~f4-~f4t;
3216                         Spec.add(\tune, ([0, ~tunefreq4*~stepratio-~tunefreq4, \lin]));
3217                         case
3218                         {~l1a.isRunning == true}{
3219                                 ~l4a.set(\tune, ~f4t = \tune.asSpec.map(val / 127));
3220                                 ~l4b.set(\tune,      \tune.asSpec.map(val / 127));
3221                                 ~l4c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3222                                 ~l4d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3223                                 ~l4e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3224                                 ~l4f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3225                         }{~l1a1.isRunning == true}{
3226                                 ~l4a1.set(\tune, ~f4t = \tune.asSpec.map(val / 127));
3227                                 ~l4b1.set(\tune,      \tune.asSpec.map(val / 127));
3228                                 ~l4c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3229                                 ~l4d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3230                                 ~l4e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3231                                 ~l4f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3232                         };
3233                         ~f4 = ~f4+~f4t;
3234                         {if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (CompositeView(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (CompositeView(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
3235                         }.defer;
3236                 }, ccNum: 19);
3237                 MIDIFunc.cc({|val|
3238                         ~f5 = ~f5-~f5t;
3239                         Spec.add(\tune, ([0, ~tunefreq5*~stepratio-~tunefreq5, \lin]));
3240                         case
3241                         {~l1a.isRunning == true}{
3242                                 ~l5a.set(\tune, ~f5t = \tune.asSpec.map(val / 127));
3243                                 ~l5b.set(\tune,      \tune.asSpec.map(val / 127));
3244                                 ~l5c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3245                                 ~l5d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3246                                 ~l5e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3247                                 ~l5f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3248                         }{~l1a1.isRunning == true}{
3249                                 ~l5a1.set(\tune, ~f5t = \tune.asSpec.map(val / 127));
3250                                 ~l5b1.set(\tune,      \tune.asSpec.map(val / 127));
3251                                 ~l5c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3252                                 ~l5d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3253                                 ~l5e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3254                                 ~l5f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3255                         };
3256                         ~f5 = ~f5+~f5t;
3257                         {if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (CompositeView(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (CompositeView(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
3258                         }.defer;
3259                 }, ccNum: 20);
3260                 MIDIFunc.cc({|val|
3261                         ~f6 = ~f6-~f6t;
3262                         Spec.add(\tune, ([0, ~tunefreq6*~stepratio-~tunefreq6, \lin]));
3263                         case
3264                         {~l1a.isRunning == true}{
3265                                 ~l6a.set(\tune, ~f6t = \tune.asSpec.map(val / 127));
3266                                 ~l6b.set(\tune,      \tune.asSpec.map(val / 127));
3267                                 ~l6c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3268                                 ~l6d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3269                                 ~l6e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3270                                 ~l6f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3271                         }{~l1a1.isRunning == true}{
3272                                 ~l6a1.set(\tune, ~f6t = \tune.asSpec.map(val / 127));
3273                                 ~l6b1.set(\tune,      \tune.asSpec.map(val / 127));
3274                                 ~l6c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3275                                 ~l6d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3276                                 ~l6e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3277                                 ~l6f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3278                         };
3279                         ~f6 = ~f6+~f6t;
3280                         {if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (CompositeView(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (CompositeView(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
3281                         }.defer;
3282                 }, ccNum: 21);
3283                 MIDIFunc.cc({|val|
3284                         ~f7 = ~f7-~f7t;
3285                         Spec.add(\tune, ([0, ~tunefreq7*~stepratio-~tunefreq7, \lin]));
3286                         case
3287                         {~l1a.isRunning == true}{
3288                                 ~l7a.set(\tune, ~f7t = \tune.asSpec.map(val / 127));
3289                                 ~l7b.set(\tune,      \tune.asSpec.map(val / 127));
3290                                 ~l7c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3291                                 ~l7d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3292                                 ~l7e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3293                                 ~l7f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3294                         }{~l1a1.isRunning == true}{
3295                                 ~l7a1.set(\tune, ~f7t = \tune.asSpec.map(val / 127));
3296                                 ~l7b1.set(\tune,      \tune.asSpec.map(val / 127));
3297                                 ~l7c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3298                                 ~l7d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3299                                 ~l7e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3300                                 ~l7f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3301                         };
3302                         ~f7 = ~f7+~f7t;
3303                         {if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (CompositeView(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (CompositeView(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
3304                         }.defer;
3305                 }, ccNum: 22);
3306                 MIDIFunc.cc({|val|
3307                         ~f8 = ~f8-~f8t;
3308                         Spec.add(\tune, ([0, ~tunefreq8*~stepratio-~tunefreq8, \lin]));
3309                         case
3310                         {~l1a.isRunning == true}{
3311                                 ~l8a.set(\tune, ~f8t = \tune.asSpec.map(val / 127));
3312                                 ~l8b.set(\tune,      \tune.asSpec.map(val / 127));
3313                                 ~l8c.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3314                                 ~l8d.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3315                                 ~l8e.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3316                                 ~l8f.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3317                         }{~l1a1.isRunning == true}{
3318                                 ~l8a1.set(\tune, ~f7t = \tune.asSpec.map(val / 127));
3319                                 ~l8b1.set(\tune,      \tune.asSpec.map(val / 127));
3320                                 ~l8c1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3321                                 ~l8d1.set(\tune,      \tune.asSpec.map(val / 127)/~icd3);
3322                                 ~l8e1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3323                                 ~l8f1.set(\tune,      \tune.asSpec.map(val / 127)/~icd6);
3324                         };
3325                         ~f8 = ~f8+~f8t;
3326                         {if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (CompositeView(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (CompositeView(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~nw, 2)).background = Color.white;);});
3327                         }.defer;
3328                 }, ccNum: 23);
3329
3330
3331                 //Korg NanoKontrol button assignments
3332
3333
3334                 //start/stop synth and pause/unpause synth buttons
3335
3336                 MIDIFunc.cc({|val| {case{b3.value == 0}{b3.valueAction = 1};}.defer;}, ccNum: 41);
3337                 MIDIFunc.cc({|val| {case{b3.value == 1}{b3.valueAction = 0};}.defer;}, ccNum: 42);
3338                 MIDIFunc.cc({|val| {case{b4.value == 0}{b4.valueAction = 1};}.defer;}, ccNum: 43);
3339                 MIDIFunc.cc({|val| {case{b4.value == 1}{b4.valueAction = 0};}.defer;}, ccNum: 44);
3340
3341
3342                 //open/flow/slide buttons (inactive)
3343
3344                 /*MIDIFunc.cc({|val| {~bplaceo1.valueAction=0}.defer;}, ccNum: 32);
3345                 MIDIFunc.cc({|val| {~bplaceo2.valueAction=0}.defer;}, ccNum: 33);
3346                 MIDIFunc.cc({|val| {~bplaceo3.valueAction=0}.defer;}, ccNum: 34);
3347                 MIDIFunc.cc({|val| {~bplaceo4.valueAction=0}.defer;}, ccNum: 35);
3348                 MIDIFunc.cc({|val| {~bplaceo5.valueAction=0}.defer;}, ccNum: 36);
3349                 MIDIFunc.cc({|val| {~bplaceo6.valueAction=0}.defer;}, ccNum: 37);
3350                 MIDIFunc.cc({|val| {~bplaceo7.valueAction=0}.defer;}, ccNum: 38);
3351                 MIDIFunc.cc({|val| {~bplaceo8.valueAction=0}.defer;}, ccNum: 39);
3352                 MIDIFunc.cc({|val| {~bplacef1.valueAction=0}.defer;}, ccNum: 48);
3353                 MIDIFunc.cc({|val| {~bplacef2.valueAction=0}.defer;}, ccNum: 49);
3354                 MIDIFunc.cc({|val| {~bplacef3.valueAction=0}.defer;}, ccNum: 50);
3355                 MIDIFunc.cc({|val| {~bplacef4.valueAction=0}.defer;}, ccNum: 51);
3356                 MIDIFunc.cc({|val| {~bplacef5.valueAction=0}.defer;}, ccNum: 52);
3357                 MIDIFunc.cc({|val| {~bplacef6.valueAction=0}.defer;}, ccNum: 53);
3358                 MIDIFunc.cc({|val| {~bplacef7.valueAction=0}.defer;}, ccNum: 54);
3359                 MIDIFunc.cc({|val| {~bplacef8.valueAction=0}.defer;}, ccNum: 55);
3360                 MIDIFunc.cc({|val| {~bplaces1.valueAction=0}.defer;}, ccNum: 64);
3361                 MIDIFunc.cc({|val| {~bplaces2.valueAction=0}.defer;}, ccNum: 65);
3362                 MIDIFunc.cc({|val| {~bplaces3.valueAction=0}.defer;}, ccNum: 66);
3363                 MIDIFunc.cc({|val| {~bplaces4.valueAction=0}.defer;}, ccNum: 67);
3364                 MIDIFunc.cc({|val| {~bplaces5.valueAction=0}.defer;}, ccNum: 68);
3365                 MIDIFunc.cc({|val| {~bplaces6.valueAction=0}.defer;}, ccNum: 69);
3366                 MIDIFunc.cc({|val| {~bplaces7.valueAction=0}.defer;}, ccNum: 70);
3367                 MIDIFunc.cc({|val| {~bplaces8.valueAction=0}.defer;}, ccNum: 71);
3368                 */
3369
3370
3371                 //mute/unmute buttons
3372
3373                 MIDIFunc.cc({|val| {mute1.valueAction = 1;}.defer;}, ccNum: 48);
3374                 MIDIFunc.cc({|val| {mute2.valueAction = 1;}.defer;}, ccNum: 49);
3375                 MIDIFunc.cc({|val| {mute3.valueAction = 1;}.defer;}, ccNum: 50);
3376                 MIDIFunc.cc({|val| {mute4.valueAction = 1;}.defer;}, ccNum: 51);
3377                 MIDIFunc.cc({|val| {mute5.valueAction = 1;}.defer;}, ccNum: 52);
3378                 MIDIFunc.cc({|val| {mute6.valueAction = 1;}.defer;}, ccNum: 53);
3379                 MIDIFunc.cc({|val| {mute7.valueAction = 1;}.defer;}, ccNum: 54);
3380                 MIDIFunc.cc({|val| {mute8.valueAction = 1;}.defer;}, ccNum: 55);
3381                 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);
3382                 MIDIFunc.cc({|val| {mute1.valueAction = 0;}.defer;}, ccNum: 32);
3383                 MIDIFunc.cc({|val| {mute2.valueAction = 0;}.defer;}, ccNum: 33);
3384                 MIDIFunc.cc({|val| {mute3.valueAction = 0;}.defer;}, ccNum: 34);
3385                 MIDIFunc.cc({|val| {mute4.valueAction = 0;}.defer;}, ccNum: 35);
3386                 MIDIFunc.cc({|val| {mute5.valueAction = 0;}.defer;}, ccNum: 36);
3387                 MIDIFunc.cc({|val| {mute6.valueAction = 0;}.defer;}, ccNum: 37);
3388                 MIDIFunc.cc({|val| {mute7.valueAction = 0;}.defer;}, ccNum: 38);
3389                 MIDIFunc.cc({|val| {mute8.valueAction = 0;}.defer;}, ccNum: 39);
3390                 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);
3391
3392                 /*MIDIFunc.cc({ |val| ([~a2,~b2,~c2,~d2,~e2,~f2]).postln;}, ccNum: [0]);*/
3393                 /*MIDIFunc.cc({ |val|~l1.set(\tune, 0);}, ccNum: [32]);*/
3394                 /*MIDIFunc.cc({ |val| ([(~w),(~x),(~y),(~z),(~u),(~v),~r,~s]).postln;}, ccNum: [64]);*/
3395                 /*~basefreq= 432.cpsmidi-69;*/
3396                 /*Spec.add(\dur, ~etemp.cps([0, 127, \exp]));*/
3397
3398                 Spec.add(\dur, ([~freqmap.at(0), ~freqmap.at(127), \exp]));
3399                 /*Spec.add(\tune, ([0, 128, \lin]));*/
3400         };
3401
3402
3403         //evaluate midi function
3404
3405         ~midifunc.value;
3406
3407
3408         //keyboard number buttons to choose synth
3409
3410         keycodeb = Button.new(w,Rect(Window.screenBounds.width-20-16,~bpt+160,16,16/1.6180339887499)).states_([
3411                 ["1",Color.white,Color.black],
3412                 ["2",Color.white,Color.black],
3413                 ["3",Color.white,Color.black],
3414                 ["4",Color.white,Color.black],
3415                 ["5",Color.white,Color.black],
3416                 ["6",Color.white,Color.black],
3417                 ["7",Color.white,Color.black],
3418                 ["8",Color.white,Color.black]]).action_({arg button;
3419
3420                 case
3421                 {button.value == 0}{
3422                         ~z25.background = Color.green; ~z1.background = Color.green;
3423                         ~z26.background = Color.white; ~z2.background = Color.white;
3424                         ~z27.background = Color.white; ~z3.background = Color.white;
3425                         ~z28.background = Color.white; ~z4.background = Color.white;
3426                         ~z29.background = Color.white; ~z5.background = Color.white;
3427                         ~z30.background = Color.white; ~z6.background = Color.white;
3428                         ~z31.background = Color.white; ~z7.background = Color.white;
3429                         ~z32.background = Color.white; ~z8.background = Color.white;
3430                 }
3431                 {button.value == 1}{
3432                         ~z25.background = Color.white; ~z1.background = Color.white;
3433                         ~z26.background = Color.green; ~z2.background = Color.green;
3434                         ~z27.background = Color.white; ~z3.background = Color.white;
3435                         ~z28.background = Color.white; ~z4.background = Color.white;
3436                         ~z29.background = Color.white; ~z5.background = Color.white;
3437                         ~z30.background = Color.white; ~z6.background = Color.white;
3438                         ~z31.background = Color.white; ~z7.background = Color.white;
3439                         ~z32.background = Color.white; ~z8.background = Color.white;
3440                 }
3441                 {button.value == 2}{
3442                         ~z25.background = Color.white; ~z1.background = Color.white;
3443                         ~z26.background = Color.white; ~z2.background = Color.white;
3444                         ~z27.background = Color.green; ~z3.background = Color.green;
3445                         ~z28.background = Color.white; ~z4.background = Color.white;
3446                         ~z29.background = Color.white; ~z5.background = Color.white;
3447                         ~z30.background = Color.white; ~z6.background = Color.white;
3448                         ~z31.background = Color.white; ~z7.background = Color.white;
3449                         ~z32.background = Color.white; ~z8.background = Color.white;
3450                 }
3451                 {button.value == 3}{
3452                         ~z25.background = Color.white; ~z1.background = Color.white;
3453                         ~z26.background = Color.white; ~z2.background = Color.white;
3454                         ~z27.background = Color.white; ~z3.background = Color.white;
3455                         ~z28.background = Color.green; ~z4.background = Color.green;
3456                         ~z29.background = Color.white; ~z5.background = Color.white;
3457                         ~z30.background = Color.white; ~z6.background = Color.white;
3458                         ~z31.background = Color.white; ~z7.background = Color.white;
3459                         ~z32.background = Color.white; ~z8.background = Color.white;
3460                 }
3461                 {button.value == 4}{
3462                         ~z25.background = Color.white; ~z1.background = Color.white;
3463                         ~z26.background = Color.white; ~z2.background = Color.white;
3464                         ~z27.background = Color.white; ~z3.background = Color.white;
3465                         ~z28.background = Color.white; ~z4.background = Color.white;
3466                         ~z29.background = Color.green; ~z5.background = Color.green;
3467                         ~z30.background = Color.white; ~z6.background = Color.white;
3468                         ~z31.background = Color.white; ~z7.background = Color.white;
3469                         ~z32.background = Color.white; ~z8.background = Color.white;
3470                 }
3471                 {button.value == 5}{
3472                         ~z25.background = Color.white; ~z1.background = Color.white;
3473                         ~z26.background = Color.white; ~z2.background = Color.white;
3474                         ~z27.background = Color.white; ~z3.background = Color.white;
3475                         ~z28.background = Color.white; ~z4.background = Color.white;
3476                         ~z29.background = Color.white; ~z5.background = Color.white;
3477                         ~z30.background = Color.green; ~z6.background = Color.green;
3478                         ~z31.background = Color.white; ~z7.background = Color.white;
3479                         ~z32.background = Color.white; ~z8.background = Color.white;
3480                 }
3481                 {button.value == 6}{
3482                         ~z25.background = Color.white; ~z1.background = Color.white;
3483                         ~z26.background = Color.white; ~z2.background = Color.white;
3484                         ~z27.background = Color.white; ~z3.background = Color.white;
3485                         ~z28.background = Color.white; ~z4.background = Color.white;
3486                         ~z29.background = Color.white; ~z5.background = Color.white;
3487                         ~z30.background = Color.white; ~z6.background = Color.white;
3488                         ~z31.background = Color.green; ~z7.background = Color.green;
3489                         ~z32.background = Color.white; ~z8.background = Color.white;
3490                 }
3491                 {button.value == 7}{
3492                         ~z25.background = Color.white; ~z1.background = Color.white;
3493                         ~z26.background = Color.white; ~z2.background = Color.white;
3494                         ~z27.background = Color.white; ~z3.background = Color.white;
3495                         ~z28.background = Color.white; ~z4.background = Color.white;
3496                         ~z29.background = Color.white; ~z5.background = Color.white;
3497                         ~z30.background = Color.white; ~z6.background = Color.white;
3498                         ~z31.background = Color.white; ~z7.background = Color.white;
3499                         ~z32.background = Color.green; ~z8.background = Color.green;
3500                 }
3501
3502         });
3503
3504
3505         //misc. keyboard buttons
3506
3507         w.view.keyDownAction = { arg view, char, modifiers, unicode, keycode;
3508                 [char, modifiers, unicode, keycode];
3509
3510                 //copy
3511                 if(unicode == ~c_unicode, {
3512                         case
3513                         {b.value == 0}{b.valueAction = 1}
3514                         {b.value == 1}{b.valueAction = 0};
3515                 });
3516
3517                 //start/stop synth
3518                 if(unicode == ~s_unicode, {
3519                         case
3520                         {b3.value == 0}{b3.valueAction = 1}
3521                         {b3.value == 1}{b3.valueAction = 0};
3522                 });
3523
3524                 //pause/unpause synth
3525                 if(unicode == ~spacebar_unicode, {
3526                         case
3527                         {b4.value == 0}{b4.valueAction = 1}
3528                         {b4.value == 1}{b4.valueAction = 0};
3529                 });
3530
3531                 //timer function
3532                 if(unicode == ~t_unicode, {
3533                         case
3534                         {~ts.value == 0}{~ts.valueAction = 1}
3535                         {~ts.value == 1}{~ts.valueAction = 0};
3536                 });
3537
3538                 //routine function
3539                 if(unicode == ~r_unicode, {
3540                         case
3541                         {~rviewbutton.value == 0}{~rviewbutton.valueAction = 1}
3542                         {~rviewbutton.value == 1}{~rviewbutton.valueAction = 0};
3543                 });
3544
3545                 //mute/unmute all synths
3546                 if(unicode == ~m_unicode, {
3547                         case
3548                         {muteall.value == 0}{muteall.valueAction = 1}
3549                         {muteall.value == 1}{muteall.valueAction = 0};
3550                 });
3551
3552                 //minimize GUI window
3553                 if(unicode == ~escape_unicode, {w.minimize;});
3554
3555
3556                 //keyboard number actions
3557
3558                 case
3559                 {unicode == ~one_unicode}{keycodeb.valueAction_(0)}
3560                 {unicode == ~two_unicode}{keycodeb.valueAction_(1)}
3561                 {unicode == ~three_unicode}{keycodeb.valueAction_(2)}
3562                 {unicode == ~four_unicode}{keycodeb.valueAction_(3)}
3563                 {unicode == ~five_unicode}{keycodeb.valueAction_(4)}
3564                 {unicode == ~six_unicode}{keycodeb.valueAction_(5)}
3565                 {unicode == ~seven_unicode}{keycodeb.valueAction_(6)}
3566                 {unicode == ~eight_unicode}{keycodeb.valueAction_(7)}
3567
3568
3569                 //keyboard up/down arrow actions
3570
3571                 {(keycode == ~uparrow_keycode) or: (unicode == ~i_unicode)}{keycodeb.valueAction_(keycodeb.value-1)}
3572                 {(keycode == ~downarrow_keycode) or: (unicode == ~k_unicode)}{keycodeb.valueAction_(keycodeb.value+1)};
3573
3574
3575                 //set synth frequency using left/right arrow keys or j/l keys
3576
3577                 if((~f1 >= ~freqmap.at(127)), {~freqmap.at(127)},
3578                         {if((keycodeb.value == 0) and: ((keycode == ~rightarrow_keycode) or: (unicode == ~l_unicode)), {
3579                                 ~freqmapval1 = ~f1.cpsmidi.round;
3580                                 case
3581                                 {~l1a.isRunning == true}{
3582                                         ~l1a.set(\dur, ~f1 = ~freqmap.at(~freqmapval1 = ~freqmapval1.value+1));
3583                                         ~l1b.set(\dur, ~f1);
3584                                         ~l1c.set(\dur, ~f1/~icd3);
3585                                         ~l1d.set(\dur, ~f1/~icd3);
3586                                         ~l1e.set(\dur, ~f1/~icd6);
3587                                         ~l1f.set(\dur, ~f1/~icd6);
3588                                 }
3589                                 {~l1a1.isRunning == true}{
3590                                         ~l1a1.set(\dur, ~f1 = ~freqmap.at(~freqmapval1 = ~freqmapval1.value+1));
3591                                         ~l1b1.set(\dur, ~f1);
3592                                         ~l1c1.set(\dur, ~f1/~icd3);
3593                                         ~l1d1.set(\dur, ~f1/~icd3);
3594                                         ~l1e1.set(\dur, ~f1/~icd6);
3595                                         ~l1f1.set(\dur, ~f1/~icd6);
3596                                 };
3597                                 if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (CompositeView(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (CompositeView(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
3598                                 ~z25.background = Color.green; ~z1.background = Color.green;
3599                                 ~z26.background = Color.white; ~z2.background = Color.white;
3600                                 ~z27.background = Color.white; ~z3.background = Color.white;
3601                                 ~z28.background = Color.white; ~z4.background = Color.white;
3602                                 ~z29.background = Color.white; ~z5.background = Color.white;
3603                                 ~z30.background = Color.white; ~z6.background = Color.white;
3604                                 ~z31.background = Color.white; ~z7.background = Color.white;
3605                                 ~z32.background = Color.white; ~z8.background = Color.white;
3606                 });});
3607                 if((~f1 <= ~freqmap.at(0)), {~freqmap.at(0)},
3608                         {if((keycodeb.value == 0) and: ((keycode == ~leftarrow_keycode) or: (unicode == ~j_unicode)), {
3609                                 ~freqmapval1 = ~f1.cpsmidi.round;
3610                                 case
3611                                 {~l1a.isRunning == true}{
3612                                         ~l1a.set(\dur, ~f1 = ~freqmap.at(~freqmapval1 = ~freqmapval1.value-1));
3613                                         ~l1b.set(\dur, ~f1);
3614                                         ~l1c.set(\dur, ~f1/~icd3);
3615                                         ~l1d.set(\dur, ~f1/~icd3);
3616                                         ~l1e.set(\dur, ~f1/~icd6);
3617                                         ~l1f.set(\dur, ~f1/~icd6);
3618                                 }
3619                                 {~l1a1.isRunning == true}{
3620                                         ~l1a1.set(\dur, ~f1 = ~freqmap.at(~freqmapval1 = ~freqmapval1.value-1));
3621                                         ~l1b1.set(\dur, ~f1);
3622                                         ~l1c1.set(\dur, ~f1/~icd3);
3623                                         ~l1d1.set(\dur, ~f1/~icd3);
3624                                         ~l1e1.set(\dur, ~f1/~icd6);
3625                                         ~l1f1.set(\dur, ~f1/~icd6);
3626                                 };
3627                                 if((~f1 > ~outmaxa) or: (~f1 < ~outmina), {~z25.close;~z1.close;~z25 = (CompositeView(w, Rect((~f1.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+10, ~nw, 2)).background = Color.white;);}, {~z1.close;~z25.close;~z1 = (CompositeView(w, Rect((~f1.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+10, ~nw, 2)).background = Color.white;);});
3628
3629                                 ~z25.background = Color.green; ~z1.background = Color.green;
3630                                 ~z26.background = Color.white; ~z2.background = Color.white;
3631                                 ~z27.background = Color.white; ~z3.background = Color.white;
3632                                 ~z28.background = Color.white; ~z4.background = Color.white;
3633                                 ~z29.background = Color.white; ~z5.background = Color.white;
3634                                 ~z30.background = Color.white; ~z6.background = Color.white;
3635                                 ~z31.background = Color.white; ~z7.background = Color.white;
3636                                 ~z32.background = Color.white; ~z8.background = Color.white;
3637                 });});
3638
3639                 if((~f2 >= ~freqmap.at(127)), {~freqmap.at(127)},
3640                         {if((keycodeb.value == 1) and: ((keycode == ~rightarrow_keycode) or: (unicode == ~l_unicode)), {
3641                                 ~freqmapval2 = ~f2.cpsmidi.round;
3642                                 case
3643                                 {~l1a.isRunning == true}{
3644                                         ~l2a.set(\dur, ~f2 = ~freqmap.at(~freqmapval2 = ~freqmapval2.value+1));
3645                                         ~l2b.set(\dur, ~f2);
3646                                         ~l2c.set(\dur, ~f2/~icd3);
3647                                         ~l2d.set(\dur, ~f2/~icd3);
3648                                         ~l2e.set(\dur, ~f2/~icd6);
3649                                         ~l2f.set(\dur, ~f2/~icd6);
3650                                 }
3651                                 {~l1a1.isRunning == true}{
3652                                         ~l2a1.set(\dur, ~f2 = ~freqmap.at(~freqmapval2 = ~freqmapval2.value+1));
3653                                         ~l2b1.set(\dur, ~f2);
3654                                         ~l2c1.set(\dur, ~f2/~icd3);
3655                                         ~l2d1.set(\dur, ~f2/~icd3);
3656                                         ~l2e1.set(\dur, ~f2/~icd6);
3657                                         ~l2f1.set(\dur, ~f2/~icd6);
3658                                 };
3659                                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (CompositeView(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (CompositeView(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
3660                                 ~z25.background = Color.white; ~z1.background = Color.white;
3661                                 ~z26.background = Color.green; ~z2.background = Color.green;
3662                                 ~z27.background = Color.white; ~z3.background = Color.white;
3663                                 ~z28.background = Color.white; ~z4.background = Color.white;
3664                                 ~z29.background = Color.white; ~z5.background = Color.white;
3665                                 ~z30.background = Color.white; ~z6.background = Color.white;
3666                                 ~z31.background = Color.white; ~z7.background = Color.white;
3667                                 ~z32.background = Color.white; ~z8.background = Color.white;
3668                 });});
3669                 if((~f2 <= ~freqmap.at(0)), {~freqmap.at(0)},
3670                         {if((keycodeb.value == 1) and: ((keycode == ~leftarrow_keycode) or: (unicode == ~j_unicode)), {
3671                                 ~freqmapval2 = ~f2.cpsmidi.round;
3672                                 case
3673                                 {~l1a.isRunning == true}{
3674                                         ~l2a.set(\dur, ~f2 = ~freqmap.at(~freqmapval2 = ~freqmapval2.value-1));
3675                                         ~l2b.set(\dur, ~f2);
3676                                         ~l2c.set(\dur, ~f2/~icd3);
3677                                         ~l2d.set(\dur, ~f2/~icd3);
3678                                         ~l2e.set(\dur, ~f2/~icd6);
3679                                         ~l2f.set(\dur, ~f2/~icd6);
3680                                 }
3681                                 {~l1a1.isRunning == true}{
3682                                         ~l2a1.set(\dur, ~f2 = ~freqmap.at(~freqmapval2 = ~freqmapval2.value-1));
3683                                         ~l2b1.set(\dur, ~f2);
3684                                         ~l2c1.set(\dur, ~f2/~icd3);
3685                                         ~l2d1.set(\dur, ~f2/~icd3);
3686                                         ~l2e1.set(\dur, ~f2/~icd6);
3687                                         ~l2f1.set(\dur, ~f2/~icd6);
3688                                 };
3689                                 if((~f2 > ~outmaxa) or: (~f2 < ~outmina), {~z26.close;~z2.close;~z26 = (CompositeView(w, Rect((~f2.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+20, ~nw, 2)).background = Color.white;);}, {~z2.close;~z26.close;~z2 = (CompositeView(w, Rect((~f2.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+20, ~nw, 2)).background = Color.white;);});
3690
3691                                 ~z25.background = Color.white; ~z1.background = Color.white;
3692                                 ~z26.background = Color.green; ~z2.background = Color.green;
3693                                 ~z27.background = Color.white; ~z3.background = Color.white;
3694                                 ~z28.background = Color.white; ~z4.background = Color.white;
3695                                 ~z29.background = Color.white; ~z5.background = Color.white;
3696                                 ~z30.background = Color.white; ~z6.background = Color.white;
3697                                 ~z31.background = Color.white; ~z7.background = Color.white;
3698                                 ~z32.background = Color.white; ~z8.background = Color.white;
3699                 });});
3700
3701                 if((~f3 >= ~freqmap.at(127)), {~freqmap.at(127)},
3702                         {if((keycodeb.value == 2) and: ((keycode == ~rightarrow_keycode) or: (unicode == ~l_unicode)), {
3703                                 ~freqmapval3 = ~f3.cpsmidi.round;
3704                                 case
3705                                 {~l1a.isRunning == true}{
3706                                         ~l3a.set(\dur, ~f3 = ~freqmap.at(~freqmapval3 = ~freqmapval3.value+1));
3707                                         ~l3b.set(\dur, ~f3);
3708                                         ~l3c.set(\dur, ~f3/~icd3);
3709                                         ~l3d.set(\dur, ~f3/~icd3);
3710                                         ~l3e.set(\dur, ~f3/~icd6);
3711                                         ~l3f.set(\dur, ~f3/~icd6);
3712                                 }
3713                                 {~l1a1.isRunning == true}{
3714                                         ~l3a1.set(\dur, ~f3 = ~freqmap.at(~freqmapval3 = ~freqmapval3.value+1));
3715                                         ~l3b1.set(\dur, ~f3);
3716                                         ~l3c1.set(\dur, ~f3/~icd3);
3717                                         ~l3d1.set(\dur, ~f3/~icd3);
3718                                         ~l3e1.set(\dur, ~f3/~icd6);
3719                                         ~l3f1.set(\dur, ~f3/~icd6);
3720                                 };
3721                                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (CompositeView(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (CompositeView(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
3722                                 ~z25.background = Color.white; ~z1.background = Color.white;
3723                                 ~z26.background = Color.white; ~z2.background = Color.white;
3724                                 ~z27.background = Color.green; ~z3.background = Color.green;
3725                                 ~z28.background = Color.white; ~z4.background = Color.white;
3726                                 ~z29.background = Color.white; ~z5.background = Color.white;
3727                                 ~z30.background = Color.white; ~z6.background = Color.white;
3728                                 ~z31.background = Color.white; ~z7.background = Color.white;
3729                                 ~z32.background = Color.white; ~z8.background = Color.white;
3730                 });});
3731                 if((~f3 <= ~freqmap.at(0)), {~freqmap.at(0)},
3732                         {if((keycodeb.value == 2) and: ((keycode == ~leftarrow_keycode) or: (unicode == ~j_unicode)), {
3733                                 ~freqmapval3 = ~f3.cpsmidi.round;
3734                                 case
3735                                 {~l1a.isRunning == true}{
3736                                         ~l3a.set(\dur, ~f3 = ~freqmap.at(~freqmapval3 = ~freqmapval3.value-1));
3737                                         ~l3b.set(\dur, ~f3);
3738                                         ~l3c.set(\dur, ~f3/~icd3);
3739                                         ~l3d.set(\dur, ~f3/~icd3);
3740                                         ~l3e.set(\dur, ~f3/~icd6);
3741                                         ~l3f.set(\dur, ~f3/~icd6);
3742                                 }
3743                                 {~l1a1.isRunning == true}{
3744                                         ~l3a1.set(\dur, ~f3 = ~freqmap.at(~freqmapval3 = ~freqmapval3.value-1));
3745                                         ~l3b1.set(\dur, ~f3);
3746                                         ~l3c1.set(\dur, ~f3/~icd3);
3747                                         ~l3d1.set(\dur, ~f3/~icd3);
3748                                         ~l3e1.set(\dur, ~f3/~icd6);
3749                                         ~l3f1.set(\dur, ~f3/~icd6);
3750                                 };
3751                                 if((~f3 > ~outmaxa) or: (~f3 < ~outmina), {~z27.close;~z3.close;~z27 = (CompositeView(w, Rect((~f3.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+30, ~nw, 2)).background = Color.white;);}, {~z3.close;~z27.close;~z3 = (CompositeView(w, Rect((~f3.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+30, ~nw, 2)).background = Color.white;);});
3752
3753                                 ~z25.background = Color.white; ~z1.background = Color.white;
3754                                 ~z26.background = Color.white; ~z2.background = Color.white;
3755                                 ~z27.background = Color.green; ~z3.background = Color.green;
3756                                 ~z28.background = Color.white; ~z4.background = Color.white;
3757                                 ~z29.background = Color.white; ~z5.background = Color.white;
3758                                 ~z30.background = Color.white; ~z6.background = Color.white;
3759                                 ~z31.background = Color.white; ~z7.background = Color.white;
3760                                 ~z32.background = Color.white; ~z8.background = Color.white;
3761                 });});
3762
3763                 if((~f4 >= ~freqmap.at(127)), {~freqmap.at(127)},
3764                         {if((keycodeb.value == 3) and: ((keycode == ~rightarrow_keycode) or: (unicode == ~l_unicode)), {
3765                                 ~freqmapval4 = ~f4.cpsmidi.round;
3766                                 case
3767                                 {~l1a.isRunning == true}{
3768                                         ~l4a.set(\dur, ~f4 = ~freqmap.at(~freqmapval4 = ~freqmapval4.value+1));
3769                                         ~l4b.set(\dur, ~f4);
3770                                         ~l4c.set(\dur, ~f4/~icd3);
3771                                         ~l4d.set(\dur, ~f4/~icd3);
3772                                         ~l4e.set(\dur, ~f4/~icd6);
3773                                         ~l4f.set(\dur, ~f4/~icd6);
3774                                 }
3775                                 {~l1a1.isRunning == true}{
3776                                         ~l4a1.set(\dur, ~f4 = ~freqmap.at(~freqmapval4 = ~freqmapval4.value+1));
3777                                         ~l4b1.set(\dur, ~f4);
3778                                         ~l4c1.set(\dur, ~f4/~icd3);
3779                                         ~l4d1.set(\dur, ~f4/~icd3);
3780                                         ~l4e1.set(\dur, ~f4/~icd6);
3781                                         ~l4f1.set(\dur, ~f4/~icd6);
3782                                 };
3783                                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (CompositeView(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (CompositeView(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
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.green; ~z4.background = Color.green;
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.white; ~z8.background = Color.white;
3792                 });});
3793                 if((~f4 <= ~freqmap.at(0)), {~freqmap.at(0)},
3794                         {if((keycodeb.value == 3) and: ((keycode == ~leftarrow_keycode) or: (unicode == ~j_unicode)), {
3795                                 ~freqmapval4 = ~f4.cpsmidi.round;
3796                                 case
3797                                 {~l1a.isRunning == true}{
3798                                         ~l4a.set(\dur, ~f4 = ~freqmap.at(~freqmapval4 = ~freqmapval4.value-1));
3799                                         ~l4b.set(\dur, ~f4);
3800                                         ~l4c.set(\dur, ~f4/~icd3);
3801                                         ~l4d.set(\dur, ~f4/~icd3);
3802                                         ~l4e.set(\dur, ~f4/~icd6);
3803                                         ~l4f.set(\dur, ~f4/~icd6);
3804                                 }
3805                                 {~l1a1.isRunning == true}{
3806                                         ~l4a1.set(\dur, ~f4 = ~freqmap.at(~freqmapval4 = ~freqmapval4.value-1));
3807                                         ~l4b1.set(\dur, ~f4);
3808                                         ~l4c1.set(\dur, ~f4/~icd3);
3809                                         ~l4d1.set(\dur, ~f4/~icd3);
3810                                         ~l4e1.set(\dur, ~f4/~icd6);
3811                                         ~l4f1.set(\dur, ~f4/~icd6);
3812                                 };
3813                                 if((~f4 > ~outmaxa) or: (~f4 < ~outmina), {~z28.close;~z4.close;~z28 = (CompositeView(w, Rect((~f4.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+40, ~nw, 2)).background = Color.white;);}, {~z4.close;~z28.close;~z4 = (CompositeView(w, Rect((~f4.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+40, ~nw, 2)).background = Color.white;);});
3814
3815                                 ~z25.background = Color.white; ~z1.background = Color.white;
3816                                 ~z26.background = Color.white; ~z2.background = Color.white;
3817                                 ~z27.background = Color.white; ~z3.background = Color.white;
3818                                 ~z28.background = Color.green; ~z4.background = Color.green;
3819                                 ~z29.background = Color.white; ~z5.background = Color.white;
3820                                 ~z30.background = Color.white; ~z6.background = Color.white;
3821                                 ~z31.background = Color.white; ~z7.background = Color.white;
3822                                 ~z32.background = Color.white; ~z8.background = Color.white;
3823                 });});
3824
3825                 if((~f5 >= ~freqmap.at(127)), {~freqmap.at(127)},
3826                         {if((keycodeb.value == 4) and: ((keycode == ~rightarrow_keycode) or: (unicode == ~l_unicode)), {
3827                                 ~freqmapval5 = ~f5.cpsmidi.round;
3828                                 case
3829                                 {~l1a.isRunning == true}{
3830                                         ~l5a.set(\dur, ~f5 = ~freqmap.at(~freqmapval5 = ~freqmapval5.value+1));
3831                                         ~l5b.set(\dur, ~f5);
3832                                         ~l5c.set(\dur, ~f5/~icd3);
3833                                         ~l5d.set(\dur, ~f5/~icd3);
3834                                         ~l5e.set(\dur, ~f5/~icd6);
3835                                         ~l5f.set(\dur, ~f5/~icd6);
3836                                 }
3837                                 {~l1a1.isRunning == true}{
3838                                         ~l5a1.set(\dur, ~f5 = ~freqmap.at(~freqmapval5 = ~freqmapval5.value+1));
3839                                         ~l5b1.set(\dur, ~f5);
3840                                         ~l5c1.set(\dur, ~f5/~icd3);
3841                                         ~l5d1.set(\dur, ~f5/~icd3);
3842                                         ~l5e1.set(\dur, ~f5/~icd6);
3843                                         ~l5f1.set(\dur, ~f5/~icd6);
3844                                 };
3845                                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (CompositeView(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (CompositeView(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
3846                                 ~z25.background = Color.white; ~z1.background = Color.white;
3847                                 ~z26.background = Color.white; ~z2.background = Color.white;
3848                                 ~z27.background = Color.white; ~z3.background = Color.white;
3849                                 ~z28.background = Color.white; ~z4.background = Color.white;
3850                                 ~z29.background = Color.green; ~z5.background = Color.green;
3851                                 ~z30.background = Color.white; ~z6.background = Color.white;
3852                                 ~z31.background = Color.white; ~z7.background = Color.white;
3853                                 ~z32.background = Color.white; ~z8.background = Color.white;
3854                 });});
3855                 if((~f5 <= ~freqmap.at(0)), {~freqmap.at(0)},
3856                         {if((keycodeb.value == 4) and: ((keycode == ~leftarrow_keycode) or: (unicode == ~j_unicode)), {
3857                                 ~freqmapval5 = ~f5.cpsmidi.round;
3858                                 case
3859                                 {~l1a.isRunning == true}{
3860                                         ~l5a.set(\dur, ~f5 = ~freqmap.at(~freqmapval5 = ~freqmapval5.value-1));
3861                                         ~l5b.set(\dur, ~f5);
3862                                         ~l5c.set(\dur, ~f5/~icd3);
3863                                         ~l5d.set(\dur, ~f5/~icd3);
3864                                         ~l5e.set(\dur, ~f5/~icd6);
3865                                         ~l5f.set(\dur, ~f5/~icd6);
3866                                 }
3867                                 {~l1a1.isRunning == true}{
3868                                         ~l5a1.set(\dur, ~f5 = ~freqmap.at(~freqmapval5 = ~freqmapval5.value-1));
3869                                         ~l5b1.set(\dur, ~f5);
3870                                         ~l5c1.set(\dur, ~f5/~icd3);
3871                                         ~l5d1.set(\dur, ~f5/~icd3);
3872                                         ~l5e1.set(\dur, ~f5/~icd6);
3873                                         ~l5f1.set(\dur, ~f5/~icd6);
3874                                 };
3875                                 if((~f5 > ~outmaxa) or: (~f5 < ~outmina), {~z29.close;~z5.close;~z29 = (CompositeView(w, Rect((~f5.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+50, ~nw, 2)).background = Color.white;);}, {~z5.close;~z29.close;~z5 = (CompositeView(w, Rect((~f5.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+50, ~nw, 2)).background = Color.white;);});
3876
3877                                 ~z25.background = Color.white; ~z1.background = Color.white;
3878                                 ~z26.background = Color.white; ~z2.background = Color.white;
3879                                 ~z27.background = Color.white; ~z3.background = Color.white;
3880                                 ~z28.background = Color.white; ~z4.background = Color.white;
3881                                 ~z29.background = Color.green; ~z5.background = Color.green;
3882                                 ~z30.background = Color.white; ~z6.background = Color.white;
3883                                 ~z31.background = Color.white; ~z7.background = Color.white;
3884                                 ~z32.background = Color.white; ~z8.background = Color.white;
3885                 });});
3886
3887                 if((~f6 >= ~freqmap.at(127)), {~freqmap.at(127)},
3888                         {if((keycodeb.value == 5) and: ((keycode == ~rightarrow_keycode) or: (unicode == ~l_unicode)), {
3889                                 ~freqmapval6 = ~f6.cpsmidi.round;
3890                                 case
3891                                 {~l1a.isRunning == true}{
3892                                         ~l6a.set(\dur, ~f6 = ~freqmap.at(~freqmapval6 = ~freqmapval6.value+1));
3893                                         ~l6b.set(\dur, ~f6);
3894                                         ~l6c.set(\dur, ~f6/~icd3);
3895                                         ~l6d.set(\dur, ~f6/~icd3);
3896                                         ~l6e.set(\dur, ~f6/~icd6);
3897                                         ~l6f.set(\dur, ~f6/~icd6);
3898                                 }
3899                                 {~l1a1.isRunning == true}{
3900                                         ~l6a1.set(\dur, ~f6 = ~freqmap.at(~freqmapval6 = ~freqmapval6.value+1));
3901                                         ~l6b1.set(\dur, ~f6);
3902                                         ~l6c1.set(\dur, ~f6/~icd3);
3903                                         ~l6d1.set(\dur, ~f6/~icd3);
3904                                         ~l6e1.set(\dur, ~f6/~icd6);
3905                                         ~l6f1.set(\dur, ~f6/~icd6);
3906                                 };
3907                                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (CompositeView(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (CompositeView(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
3908                                 ~z25.background = Color.white; ~z1.background = Color.white;
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.green; ~z6.background = Color.green;
3914                                 ~z31.background = Color.white; ~z7.background = Color.white;
3915                                 ~z32.background = Color.white; ~z8.background = Color.white;
3916                 });});
3917                 if((~f6 <= ~freqmap.at(0)), {~freqmap.at(0)},
3918                         {if((keycodeb.value == 5) and: ((keycode == ~leftarrow_keycode) or: (unicode == ~j_unicode)), {
3919                                 ~freqmapval6 = ~f6.cpsmidi.round;
3920                                 case
3921                                 {~l1a.isRunning == true}{
3922                                         ~l6a.set(\dur, ~f6 = ~freqmap.at(~freqmapval6 = ~freqmapval6.value-1));
3923                                         ~l6b.set(\dur, ~f6);
3924                                         ~l6c.set(\dur, ~f6/~icd3);
3925                                         ~l6d.set(\dur, ~f6/~icd3);
3926                                         ~l6e.set(\dur, ~f6/~icd6);
3927                                         ~l6f.set(\dur, ~f6/~icd6);
3928                                 }
3929                                 {~l1a1.isRunning == true}{
3930                                         ~l6a1.set(\dur, ~f6 = ~freqmap.at(~freqmapval6 = ~freqmapval6.value-1));
3931                                         ~l6b1.set(\dur, ~f6);
3932                                         ~l6c1.set(\dur, ~f6/~icd3);
3933                                         ~l6d1.set(\dur, ~f6/~icd3);
3934                                         ~l6e1.set(\dur, ~f6/~icd6);
3935                                         ~l6f1.set(\dur, ~f6/~icd6);
3936                                 };
3937                                 if((~f6 > ~outmaxa) or: (~f6 < ~outmina), {~z30.close;~z6.close;~z30 = (CompositeView(w, Rect((~f6.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+60, ~nw, 2)).background = Color.white;);}, {~z6.close;~z30.close;~z6 = (CompositeView(w, Rect((~f6.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+60, ~nw, 2)).background = Color.white;);});
3938
3939                                 ~z25.background = Color.white; ~z1.background = Color.white;
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.green; ~z6.background = Color.green;
3945                                 ~z31.background = Color.white; ~z7.background = Color.white;
3946                                 ~z32.background = Color.white; ~z8.background = Color.white;
3947                 });});
3948
3949                 if((~f7 >= ~freqmap.at(127)), {~freqmap.at(127)},
3950                         {if((keycodeb.value == 6) and: ((keycode == ~rightarrow_keycode) or: (unicode == ~l_unicode)), {
3951                                 ~freqmapval7 = ~f7.cpsmidi.round;
3952                                 case
3953                                 {~l1a.isRunning == true}{
3954                                         ~l7a.set(\dur, ~f7 = ~freqmap.at(~freqmapval7 = ~freqmapval7.value+1));
3955                                         ~l7b.set(\dur, ~f7);
3956                                         ~l7c.set(\dur, ~f7/~icd3);
3957                                         ~l7d.set(\dur, ~f7/~icd3);
3958                                         ~l7e.set(\dur, ~f7/~icd6);
3959                                         ~l7f.set(\dur, ~f7/~icd6);
3960                                 }
3961                                 {~l1a1.isRunning == true}{
3962                                         ~l7a1.set(\dur, ~f7 = ~freqmap.at(~freqmapval7 = ~freqmapval7.value+1));
3963                                         ~l7b1.set(\dur, ~f7);
3964                                         ~l7c1.set(\dur, ~f7/~icd3);
3965                                         ~l7d1.set(\dur, ~f7/~icd3);
3966                                         ~l7e1.set(\dur, ~f7/~icd6);
3967                                         ~l7f1.set(\dur, ~f7/~icd6);
3968                                 };
3969                                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (CompositeView(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (CompositeView(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
3970                                 ~z25.background = Color.white; ~z1.background = Color.white;
3971                                 ~z26.background = Color.white; ~z2.background = Color.white;
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.green; ~z7.background = Color.green;
3977                                 ~z32.background = Color.white; ~z8.background = Color.white;
3978                 });});
3979                 if((~f7 <= ~freqmap.at(0)), {~freqmap.at(0)},
3980                         {if((keycodeb.value == 6) and: ((keycode == ~leftarrow_keycode) or: (unicode == ~j_unicode)), {
3981                                 ~freqmapval7 = ~f7.cpsmidi.round;
3982                                 case
3983                                 {~l1a.isRunning == true}{
3984                                         ~l7a.set(\dur, ~f7 = ~freqmap.at(~freqmapval7 = ~freqmapval7.value-1));
3985                                         ~l7b.set(\dur, ~f7);
3986                                         ~l7c.set(\dur, ~f7/~icd3);
3987                                         ~l7d.set(\dur, ~f7/~icd3);
3988                                         ~l7e.set(\dur, ~f7/~icd6);
3989                                         ~l7f.set(\dur, ~f7/~icd6);
3990                                 }
3991                                 {~l1a1.isRunning == true}{
3992                                         ~l7a1.set(\dur, ~f7 = ~freqmap.at(~freqmapval7 = ~freqmapval7.value-1));
3993                                         ~l7b1.set(\dur, ~f7);
3994                                         ~l7c1.set(\dur, ~f7/~icd3);
3995                                         ~l7d1.set(\dur, ~f7/~icd3);
3996                                         ~l7e1.set(\dur, ~f7/~icd6);
3997                                         ~l7f1.set(\dur, ~f7/~icd6);
3998                                 };
3999                                 if((~f7 > ~outmaxa) or: (~f7 < ~outmina), {~z31.close;~z7.close;~z31 = (CompositeView(w, Rect((~f7.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+70, ~nw, 2)).background = Color.white;);}, {~z7.close;~z31.close;~z7 = (CompositeView(w, Rect((~f7.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+70, ~nw, 2)).background = Color.white;);});
4000
4001                                 ~z25.background = Color.white; ~z1.background = Color.white;
4002                                 ~z26.background = Color.white; ~z2.background = Color.white;
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.green; ~z7.background = Color.green;
4008                                 ~z32.background = Color.white; ~z8.background = Color.white;
4009                 });});
4010
4011                 if((~f8 >= ~freqmap.at(127)), {~freqmap.at(127)},
4012                         {if((keycodeb.value == 7) and: ((keycode == ~rightarrow_keycode) or: (unicode == ~l_unicode)), {
4013                                 ~freqmapval8 = ~f8.cpsmidi.round;
4014                                 case
4015                                 {~l1a.isRunning == true}{
4016                                         ~l8a.set(\dur, ~f8 = ~freqmap.at(~freqmapval8 = ~freqmapval8.value+1));
4017                                         ~l8b.set(\dur, ~f8);
4018                                         ~l8c.set(\dur, ~f8/~icd3);
4019                                         ~l8d.set(\dur, ~f8/~icd3);
4020                                         ~l8e.set(\dur, ~f8/~icd6);
4021                                         ~l8f.set(\dur, ~f8/~icd6);
4022                                 }
4023                                 {~l1a1.isRunning == true}{
4024                                         ~l8a1.set(\dur, ~f8 = ~freqmap.at(~freqmapval8 = ~freqmapval8.value+1));
4025                                         ~l8b1.set(\dur, ~f8);
4026                                         ~l8c1.set(\dur, ~f8/~icd3);
4027                                         ~l8d1.set(\dur, ~f8/~icd3);
4028                                         ~l8e1.set(\dur, ~f8/~icd6);
4029                                         ~l8f1.set(\dur, ~f8/~icd6);
4030                                 };
4031                                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (CompositeView(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (CompositeView(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~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.white; ~z3.background = Color.white;
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.green; ~z8.background = Color.green;
4040                 });});
4041                 if((~f8 <= ~freqmap.at(0)), {~freqmap.at(0)},
4042                         {if((keycodeb.value == 7) and: ((keycode == ~leftarrow_keycode) or: (unicode == ~j_unicode)), {
4043                                 ~freqmapval8 = ~f8.cpsmidi.round;
4044                                 case
4045                                 {~l1a.isRunning == true}{
4046                                         ~l8a.set(\dur, ~f8 = ~freqmap.at(~freqmapval8 = ~freqmapval8.value-1));
4047                                         ~l8b.set(\dur, ~f8);
4048                                         ~l8c.set(\dur, ~f8/~icd3);
4049                                         ~l8d.set(\dur, ~f8/~icd3);
4050                                         ~l8e.set(\dur, ~f8/~icd6);
4051                                         ~l8f.set(\dur, ~f8/~icd6);
4052                                 }
4053                                 {~l1a1.isRunning == true}{
4054                                         ~l8a1.set(\dur, ~f8 = ~freqmap.at(~freqmapval8 = ~freqmapval8.value-1));
4055                                         ~l8b1.set(\dur, ~f8);
4056                                         ~l8c1.set(\dur, ~f8/~icd3);
4057                                         ~l8d1.set(\dur, ~f8/~icd3);
4058                                         ~l8e1.set(\dur, ~f8/~icd6);
4059                                         ~l8f1.set(\dur, ~f8/~icd6);
4060                                 };
4061                                 if((~f8 > ~outmaxa) or: (~f8 < ~outmina), {~z32.close;~z8.close;~z32 = (CompositeView(w, Rect((~f8.explin(~outminb,~outmaxb,0,Window.screenBounds.width)), ~dc1+80, ~nw, 2)).background = Color.white;);}, {~z8.close;~z32.close;~z8 = (CompositeView(w, Rect((~f8.explin(~outmina,~outmaxa,0,Window.screenBounds.width)), ~dc2+80, ~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.white; ~z3.background = Color.white;
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.green; ~z8.background = Color.green;
4071                 });});
4072
4073
4074         };
4075
4076
4077         //if routine function values are nil
4078
4079         if(~rslot1a == nil, {~rslot1a = ~bplaceo1;}); if(~rslot1b == nil, {~rslot1b = ~bplacef1;});
4080         if(~rslot2 == nil, {~rslot2 = ~bplacef2;});
4081         if(~rslot3 == nil, {~rslot3 = ~bplacef3;});
4082         if(~rslot4 == nil, {~rslot4 = ~bplacef4;});
4083         if(~rslot5 == nil, {~rslot5 = ~bplacef5;});
4084         if(~rslot6 == nil, {~rslot6 = ~bplacef6;});
4085         if(~rslot7 == nil, {~rslot7 = ~bplacef7;});
4086         if(~rslot8 == nil, {~rslot8 = ~bplacef8;});
4087         if(~rtimeall == nil, {~rtimeall = 8;});
4088         if(~rtime1 == nil, {~rtime1 = 8;});
4089         if(~rtime2 == nil, {~rtime2 = 8;});
4090         if(~rtime3 == nil, {~rtime3 = 8;});
4091         if(~rtime4 == nil, {~rtime4 = 8;});
4092         if(~rtime5 == nil, {~rtime5 = 8;});
4093         if(~rtime6 == nil, {~rtime6 = 8;});
4094         if(~rtime7 == nil, {~rtime7 = 8;});
4095         if(~rtime8 == nil, {~rtime8 = 8;});
4096         if(~rdoall == nil, {~rdoall = 1;});
4097         if(~rdo1a == nil, {~rdo1a = "o1";}); if(~rdo1b == nil, {~rdo1b = "f1";});
4098         if(~rdo2 == nil, {~rdo2 = "f2";});
4099         if(~rdo3 == nil, {~rdo3 = "f3";});
4100         if(~rdo4 == nil, {~rdo4 = "f4";});
4101         if(~rdo5 == nil, {~rdo5 = "f5";});
4102         if(~rdo6 == nil, {~rdo6 = "f6";});
4103         if(~rdo7 == nil, {~rdo7 = "f7";});
4104         if(~rdo8 == nil, {~rdo8 = "f8";});
4105
4106
4107         //misc. routine button functions (see below)
4108
4109         ~si1aset = {
4110                 if(~si1a.value == "o1", {~rslot1a = ~bplaceo1; ~rdo1a = ~si1a.value;});
4111                 if(~si1a.value == "f1", {~rslot1a = ~bplacef1; ~rdo1a = ~si1a.value;});
4112                 if(~si1a.value == "s1", {~rslot1a = ~bplaces1; ~rdo1a = ~si1a.value;});
4113                 if(~si1a.value == "o2", {~rslot1a = ~bplaceo2; ~rdo1a = ~si1a.value;});
4114                 if(~si1a.value == "f2", {~rslot1a = ~bplacef2; ~rdo1a = ~si1a.value;});
4115                 if(~si1a.value == "s2", {~rslot1a = ~bplaces2; ~rdo1a = ~si1a.value;});
4116                 if(~si1a.value == "o3", {~rslot1a = ~bplaceo3; ~rdo1a = ~si1a.value;});
4117                 if(~si1a.value == "f3", {~rslot1a = ~bplacef3; ~rdo1a = ~si1a.value;});
4118                 if(~si1a.value == "s3", {~rslot1a = ~bplaces3; ~rdo1a = ~si1a.value;});
4119                 if(~si1a.value == "o4", {~rslot1a = ~bplaceo4; ~rdo1a = ~si1a.value;});
4120                 if(~si1a.value == "f4", {~rslot1a = ~bplacef4; ~rdo1a = ~si1a.value;});
4121                 if(~si1a.value == "s4", {~rslot1a = ~bplaces4; ~rdo1a = ~si1a.value;});
4122                 if(~si1a.value == "o5", {~rslot1a = ~bplaceo5; ~rdo1a = ~si1a.value;});
4123                 if(~si1a.value == "f5", {~rslot1a = ~bplacef5; ~rdo1a = ~si1a.value;});
4124                 if(~si1a.value == "s5", {~rslot1a = ~bplaces5; ~rdo1a = ~si1a.value;});
4125                 if(~si1a.value == "o6", {~rslot1a = ~bplaceo6; ~rdo1a = ~si1a.value;});
4126                 if(~si1a.value == "f6", {~rslot1a = ~bplacef6; ~rdo1a = ~si1a.value;});
4127                 if(~si1a.value == "s6", {~rslot1a = ~bplaces6; ~rdo1a = ~si1a.value;});
4128                 if(~si1a.value == "o7", {~rslot1a = ~bplaceo7; ~rdo1a = ~si1a.value;});
4129                 if(~si1a.value == "f7", {~rslot1a = ~bplacef7; ~rdo1a = ~si1a.value;});
4130                 if(~si1a.value == "s7", {~rslot1a = ~bplaces7; ~rdo1a = ~si1a.value;});
4131                 if(~si1a.value == "o8", {~rslot1a = ~bplaceo8; ~rdo1a = ~si1a.value;});
4132                 if(~si1a.value == "f8", {~rslot1a = ~bplacef8; ~rdo1a = ~si1a.value;});
4133                 if(~si1a.value == "s8", {~rslot1a = ~bplaces8; ~rdo1a = ~si1a.value;});
4134         };
4135         ~si1bset = {
4136                 if(~si1b.value == "o1", {~rslot1b = ~bplaceo1; ~rdo1b = ~si1b.value;});
4137                 if(~si1b.value == "f1", {~rslot1b = ~bplacef1; ~rdo1b = ~si1b.value;});
4138                 if(~si1b.value == "s1", {~rslot1b = ~bplaces1; ~rdo1b = ~si1b.value;});
4139                 if(~si1b.value == "o2", {~rslot1b = ~bplaceo2; ~rdo1b = ~si1b.value;});
4140                 if(~si1b.value == "f2", {~rslot1b = ~bplacef2; ~rdo1b = ~si1b.value;});
4141                 if(~si1b.value == "s2", {~rslot1b = ~bplaces2; ~rdo1b = ~si1b.value;});
4142                 if(~si1b.value == "o3", {~rslot1b = ~bplaceo3; ~rdo1b = ~si1b.value;});
4143                 if(~si1b.value == "f3", {~rslot1b = ~bplacef3; ~rdo1b = ~si1b.value;});
4144                 if(~si1b.value == "s3", {~rslot1b = ~bplaces3; ~rdo1b = ~si1b.value;});
4145                 if(~si1b.value == "o4", {~rslot1b = ~bplaceo4; ~rdo1b = ~si1b.value;});
4146                 if(~si1b.value == "f4", {~rslot1b = ~bplacef4; ~rdo1b = ~si1b.value;});
4147                 if(~si1b.value == "s4", {~rslot1b = ~bplaces4; ~rdo1b = ~si1b.value;});
4148                 if(~si1b.value == "o5", {~rslot1b = ~bplaceo5; ~rdo1b = ~si1b.value;});
4149                 if(~si1b.value == "f5", {~rslot1b = ~bplacef5; ~rdo1b = ~si1b.value;});
4150                 if(~si1b.value == "s5", {~rslot1b = ~bplaces5; ~rdo1b = ~si1b.value;});
4151                 if(~si1b.value == "o6", {~rslot1b = ~bplaceo6; ~rdo1b = ~si1b.value;});
4152                 if(~si1b.value == "f6", {~rslot1b = ~bplacef6; ~rdo1b = ~si1b.value;});
4153                 if(~si1b.value == "s6", {~rslot1b = ~bplaces6; ~rdo1b = ~si1b.value;});
4154                 if(~si1b.value == "o7", {~rslot1b = ~bplaceo7; ~rdo1b = ~si1b.value;});
4155                 if(~si1b.value == "f7", {~rslot1b = ~bplacef7; ~rdo1b = ~si1b.value;});
4156                 if(~si1b.value == "s7", {~rslot1b = ~bplaces7; ~rdo1b = ~si1b.value;});
4157                 if(~si1b.value == "o8", {~rslot1b = ~bplaceo8; ~rdo1b = ~si1b.value;});
4158                 if(~si1b.value == "f8", {~rslot1b = ~bplacef8; ~rdo1b = ~si1b.value;});
4159                 if(~si1b.value == "s8", {~rslot1b = ~bplaces8; ~rdo1b = ~si1b.value;});
4160         };
4161         ~si2set = {
4162                 if(~si2.value == "o1", {~rslot2 = ~bplaceo1; ~rdo2 = ~si2.value;});
4163                 if(~si2.value == "f1", {~rslot2 = ~bplacef1; ~rdo2 = ~si2.value;});
4164                 if(~si2.value == "s1", {~rslot2 = ~bplaces1; ~rdo2 = ~si2.value;});
4165                 if(~si2.value == "o2", {~rslot2 = ~bplaceo2; ~rdo2 = ~si2.value;});
4166                 if(~si2.value == "f2", {~rslot2 = ~bplacef2; ~rdo2 = ~si2.value;});
4167                 if(~si2.value == "s2", {~rslot2 = ~bplaces2; ~rdo2 = ~si2.value;});
4168                 if(~si2.value == "o3", {~rslot2 = ~bplaceo3; ~rdo2 = ~si2.value;});
4169                 if(~si2.value == "f3", {~rslot2 = ~bplacef3; ~rdo2 = ~si2.value;});
4170                 if(~si2.value == "s3", {~rslot2 = ~bplaces3; ~rdo2 = ~si2.value;});
4171                 if(~si2.value == "o4", {~rslot2 = ~bplaceo4; ~rdo2 = ~si2.value;});
4172                 if(~si2.value == "f4", {~rslot2 = ~bplacef4; ~rdo2 = ~si2.value;});
4173                 if(~si2.value == "s4", {~rslot2 = ~bplaces4; ~rdo2 = ~si2.value;});
4174                 if(~si2.value == "o5", {~rslot2 = ~bplaceo5; ~rdo2 = ~si2.value;});
4175                 if(~si2.value == "f5", {~rslot2 = ~bplacef5; ~rdo2 = ~si2.value;});
4176                 if(~si2.value == "s5", {~rslot2 = ~bplaces5; ~rdo2 = ~si2.value;});
4177                 if(~si2.value == "o6", {~rslot2 = ~bplaceo6; ~rdo2 = ~si2.value;});
4178                 if(~si2.value == "f6", {~rslot2 = ~bplacef6; ~rdo2 = ~si2.value;});
4179                 if(~si2.value == "s6", {~rslot2 = ~bplaces6; ~rdo2 = ~si2.value;});
4180                 if(~si2.value == "o7", {~rslot2 = ~bplaceo7; ~rdo2 = ~si2.value;});
4181                 if(~si2.value == "f7", {~rslot2 = ~bplacef7; ~rdo2 = ~si2.value;});
4182                 if(~si2.value == "s7", {~rslot2 = ~bplaces7; ~rdo2 = ~si2.value;});
4183                 if(~si2.value == "o8", {~rslot2 = ~bplaceo8; ~rdo2 = ~si2.value;});
4184                 if(~si2.value == "f8", {~rslot2 = ~bplacef8; ~rdo2 = ~si2.value;});
4185                 if(~si2.value == "s8", {~rslot2 = ~bplaces8; ~rdo2 = ~si2.value;});
4186         };
4187         ~si3set = {
4188                 if(~si3.value == "o1", {~rslot3 = ~bplaceo1; ~rdo3 = ~si3.value;});
4189                 if(~si3.value == "f1", {~rslot3 = ~bplacef1; ~rdo3 = ~si3.value;});
4190                 if(~si3.value == "s1", {~rslot3 = ~bplaces1; ~rdo3 = ~si3.value;});
4191                 if(~si3.value == "o2", {~rslot3 = ~bplaceo2; ~rdo3 = ~si3.value;});
4192                 if(~si3.value == "f2", {~rslot3 = ~bplacef2; ~rdo3 = ~si3.value;});
4193                 if(~si3.value == "s2", {~rslot3 = ~bplaces2; ~rdo3 = ~si3.value;});
4194                 if(~si3.value == "o3", {~rslot3 = ~bplaceo3; ~rdo3 = ~si3.value;});
4195                 if(~si3.value == "f3", {~rslot3 = ~bplacef3; ~rdo3 = ~si3.value;});
4196                 if(~si3.value == "s3", {~rslot3 = ~bplaces3; ~rdo3 = ~si3.value;});
4197                 if(~si3.value == "o4", {~rslot3 = ~bplaceo4; ~rdo3 = ~si3.value;});
4198                 if(~si3.value == "f4", {~rslot3 = ~bplacef4; ~rdo3 = ~si3.value;});
4199                 if(~si3.value == "s4", {~rslot3 = ~bplaces4; ~rdo3 = ~si3.value;});
4200                 if(~si3.value == "o5", {~rslot3 = ~bplaceo5; ~rdo3 = ~si3.value;});
4201                 if(~si3.value == "f5", {~rslot3 = ~bplacef5; ~rdo3 = ~si3.value;});
4202                 if(~si3.value == "s5", {~rslot3 = ~bplaces5; ~rdo3 = ~si3.value;});
4203                 if(~si3.value == "o6", {~rslot3 = ~bplaceo6; ~rdo3 = ~si3.value;});
4204                 if(~si3.value == "f6", {~rslot3 = ~bplacef6; ~rdo3 = ~si3.value;});
4205                 if(~si3.value == "s6", {~rslot3 = ~bplaces6; ~rdo3 = ~si3.value;});
4206                 if(~si3.value == "o7", {~rslot3 = ~bplaceo7; ~rdo3 = ~si3.value;});
4207                 if(~si3.value == "f7", {~rslot3 = ~bplacef7; ~rdo3 = ~si3.value;});
4208                 if(~si3.value == "s7", {~rslot3 = ~bplaces7; ~rdo3 = ~si3.value;});
4209                 if(~si3.value == "o8", {~rslot3 = ~bplaceo8; ~rdo3 = ~si3.value;});
4210                 if(~si3.value == "f8", {~rslot3 = ~bplacef8; ~rdo3 = ~si3.value;});
4211                 if(~si3.value == "s8", {~rslot3 = ~bplaces8; ~rdo3 = ~si3.value;});
4212         };
4213         ~si4set = {
4214                 if(~si4.value == "o1", {~rslot4 = ~bplaceo1; ~rdo4 = ~si4.value;});
4215                 if(~si4.value == "f1", {~rslot4 = ~bplacef1; ~rdo4 = ~si4.value;});
4216                 if(~si4.value == "s1", {~rslot4 = ~bplaces1; ~rdo4 = ~si4.value;});
4217                 if(~si4.value == "o2", {~rslot4 = ~bplaceo2; ~rdo4 = ~si4.value;});
4218                 if(~si4.value == "f2", {~rslot4 = ~bplacef2; ~rdo4 = ~si4.value;});
4219                 if(~si4.value == "s2", {~rslot4 = ~bplaces2; ~rdo4 = ~si4.value;});
4220                 if(~si4.value == "o3", {~rslot4 = ~bplaceo3; ~rdo4 = ~si4.value;});
4221                 if(~si4.value == "f3", {~rslot4 = ~bplacef3; ~rdo4 = ~si4.value;});
4222                 if(~si4.value == "s3", {~rslot4 = ~bplaces3; ~rdo4 = ~si4.value;});
4223                 if(~si4.value == "o4", {~rslot4 = ~bplaceo4; ~rdo4 = ~si4.value;});
4224                 if(~si4.value == "f4", {~rslot4 = ~bplacef4; ~rdo4 = ~si4.value;});
4225                 if(~si4.value == "s4", {~rslot4 = ~bplaces4; ~rdo4 = ~si4.value;});
4226                 if(~si4.value == "o5", {~rslot4 = ~bplaceo5; ~rdo4 = ~si4.value;});
4227                 if(~si4.value == "f5", {~rslot4 = ~bplacef5; ~rdo4 = ~si4.value;});
4228                 if(~si4.value == "s5", {~rslot4 = ~bplaces5; ~rdo4 = ~si4.value;});
4229                 if(~si4.value == "o6", {~rslot4 = ~bplaceo6; ~rdo4 = ~si4.value;});
4230                 if(~si4.value == "f6", {~rslot4 = ~bplacef6; ~rdo4 = ~si4.value;});
4231                 if(~si4.value == "s6", {~rslot4 = ~bplaces6; ~rdo4 = ~si4.value;});
4232                 if(~si4.value == "o7", {~rslot4 = ~bplaceo7; ~rdo4 = ~si4.value;});
4233                 if(~si4.value == "f7", {~rslot4 = ~bplacef7; ~rdo4 = ~si4.value;});
4234                 if(~si4.value == "s7", {~rslot4 = ~bplaces7; ~rdo4 = ~si4.value;});
4235                 if(~si4.value == "o8", {~rslot4 = ~bplaceo8; ~rdo4 = ~si4.value;});
4236                 if(~si4.value == "f8", {~rslot4 = ~bplacef8; ~rdo4 = ~si4.value;});
4237                 if(~si4.value == "s8", {~rslot4 = ~bplaces8; ~rdo4 = ~si4.value;});
4238         };
4239         ~si5set = {
4240                 if(~si5.value == "o1", {~rslot5 = ~bplaceo1; ~rdo5 = ~si5.value;});
4241                 if(~si5.value == "f1", {~rslot5 = ~bplacef1; ~rdo5 = ~si5.value;});
4242                 if(~si5.value == "s1", {~rslot5 = ~bplaces1; ~rdo5 = ~si5.value;});
4243                 if(~si5.value == "o2", {~rslot5 = ~bplaceo2; ~rdo5 = ~si5.value;});
4244                 if(~si5.value == "f2", {~rslot5 = ~bplacef2; ~rdo5 = ~si5.value;});
4245                 if(~si5.value == "s2", {~rslot5 = ~bplaces2; ~rdo5 = ~si5.value;});
4246                 if(~si5.value == "o3", {~rslot5 = ~bplaceo3; ~rdo5 = ~si5.value;});
4247                 if(~si5.value == "f3", {~rslot5 = ~bplacef3; ~rdo5 = ~si5.value;});
4248                 if(~si5.value == "s3", {~rslot5 = ~bplaces3; ~rdo5 = ~si5.value;});
4249                 if(~si5.value == "o4", {~rslot5 = ~bplaceo4; ~rdo5 = ~si5.value;});
4250                 if(~si5.value == "f4", {~rslot5 = ~bplacef4; ~rdo5 = ~si5.value;});
4251                 if(~si5.value == "s4", {~rslot5 = ~bplaces4; ~rdo5 = ~si5.value;});
4252                 if(~si5.value == "o5", {~rslot5 = ~bplaceo5; ~rdo5 = ~si5.value;});
4253                 if(~si5.value == "f5", {~rslot5 = ~bplacef5; ~rdo5 = ~si5.value;});
4254                 if(~si5.value == "s5", {~rslot5 = ~bplaces5; ~rdo5 = ~si5.value;});
4255                 if(~si5.value == "o6", {~rslot5 = ~bplaceo6; ~rdo5 = ~si5.value;});
4256                 if(~si5.value == "f6", {~rslot5 = ~bplacef6; ~rdo5 = ~si5.value;});
4257                 if(~si5.value == "s6", {~rslot5 = ~bplaces6; ~rdo5 = ~si5.value;});
4258                 if(~si5.value == "o7", {~rslot5 = ~bplaceo7; ~rdo5 = ~si5.value;});
4259                 if(~si5.value == "f7", {~rslot5 = ~bplacef7; ~rdo5 = ~si5.value;});
4260                 if(~si5.value == "s7", {~rslot5 = ~bplaces7; ~rdo5 = ~si5.value;});
4261                 if(~si5.value == "o8", {~rslot5 = ~bplaceo8; ~rdo5 = ~si5.value;});
4262                 if(~si5.value == "f8", {~rslot5 = ~bplacef8; ~rdo5 = ~si5.value;});
4263                 if(~si5.value == "s8", {~rslot5 = ~bplaces8; ~rdo5 = ~si5.value;});
4264         };
4265         ~si6set = {
4266                 if(~si6.value == "o1", {~rslot6 = ~bplaceo1; ~rdo6 = ~si6.value;});
4267                 if(~si6.value == "f1", {~rslot6 = ~bplacef1; ~rdo6 = ~si6.value;});
4268                 if(~si6.value == "s1", {~rslot6 = ~bplaces1; ~rdo6 = ~si6.value;});
4269                 if(~si6.value == "o2", {~rslot6 = ~bplaceo2; ~rdo6 = ~si6.value;});
4270                 if(~si6.value == "f2", {~rslot6 = ~bplacef2; ~rdo6 = ~si6.value;});
4271                 if(~si6.value == "s2", {~rslot6 = ~bplaces2; ~rdo6 = ~si6.value;});
4272                 if(~si6.value == "o3", {~rslot6 = ~bplaceo3; ~rdo6 = ~si6.value;});
4273                 if(~si6.value == "f3", {~rslot6 = ~bplacef3; ~rdo6 = ~si6.value;});
4274                 if(~si6.value == "s3", {~rslot6 = ~bplaces3; ~rdo6 = ~si6.value;});
4275                 if(~si6.value == "o4", {~rslot6 = ~bplaceo4; ~rdo6 = ~si6.value;});
4276                 if(~si6.value == "f4", {~rslot6 = ~bplacef4; ~rdo6 = ~si6.value;});
4277                 if(~si6.value == "s4", {~rslot6 = ~bplaces4; ~rdo6 = ~si6.value;});
4278                 if(~si6.value == "o5", {~rslot6 = ~bplaceo5; ~rdo6 = ~si6.value;});
4279                 if(~si6.value == "f5", {~rslot6 = ~bplacef5; ~rdo6 = ~si6.value;});
4280                 if(~si6.value == "s5", {~rslot6 = ~bplaces5; ~rdo6 = ~si6.value;});
4281                 if(~si6.value == "o6", {~rslot6 = ~bplaceo6; ~rdo6 = ~si6.value;});
4282                 if(~si6.value == "f6", {~rslot6 = ~bplacef6; ~rdo6 = ~si6.value;});
4283                 if(~si6.value == "s6", {~rslot6 = ~bplaces6; ~rdo6 = ~si6.value;});
4284                 if(~si6.value == "o7", {~rslot6 = ~bplaceo7; ~rdo6 = ~si6.value;});
4285                 if(~si6.value == "f7", {~rslot6 = ~bplacef7; ~rdo6 = ~si6.value;});
4286                 if(~si6.value == "s7", {~rslot6 = ~bplaces7; ~rdo6 = ~si6.value;});
4287                 if(~si6.value == "o8", {~rslot6 = ~bplaceo8; ~rdo6 = ~si6.value;});
4288                 if(~si6.value == "f8", {~rslot6 = ~bplacef8; ~rdo6 = ~si6.value;});
4289                 if(~si6.value == "s8", {~rslot6 = ~bplaces8; ~rdo6 = ~si6.value;});
4290         };
4291         ~si7set = {
4292                 if(~si7.value == "o1", {~rslot7 = ~bplaceo1; ~rdo7 = ~si7.value;});
4293                 if(~si7.value == "f1", {~rslot7 = ~bplacef1; ~rdo7 = ~si7.value;});
4294                 if(~si7.value == "s1", {~rslot7 = ~bplaces1; ~rdo7 = ~si7.value;});
4295                 if(~si7.value == "o2", {~rslot7 = ~bplaceo2; ~rdo7 = ~si7.value;});
4296                 if(~si7.value == "f2", {~rslot7 = ~bplacef2; ~rdo7 = ~si7.value;});
4297                 if(~si7.value == "s2", {~rslot7 = ~bplaces2; ~rdo7 = ~si7.value;});
4298                 if(~si7.value == "o3", {~rslot7 = ~bplaceo3; ~rdo7 = ~si7.value;});
4299                 if(~si7.value == "f3", {~rslot7 = ~bplacef3; ~rdo7 = ~si7.value;});
4300                 if(~si7.value == "s3", {~rslot7 = ~bplaces3; ~rdo7 = ~si7.value;});
4301                 if(~si7.value == "o4", {~rslot7 = ~bplaceo4; ~rdo7 = ~si7.value;});
4302                 if(~si7.value == "f4", {~rslot7 = ~bplacef4; ~rdo7 = ~si7.value;});
4303                 if(~si7.value == "s4", {~rslot7 = ~bplaces4; ~rdo7 = ~si7.value;});
4304                 if(~si7.value == "o5", {~rslot7 = ~bplaceo5; ~rdo7 = ~si7.value;});
4305                 if(~si7.value == "f5", {~rslot7 = ~bplacef5; ~rdo7 = ~si7.value;});
4306                 if(~si7.value == "s5", {~rslot7 = ~bplaces5; ~rdo7 = ~si7.value;});
4307                 if(~si7.value == "o6", {~rslot7 = ~bplaceo6; ~rdo7 = ~si7.value;});
4308                 if(~si7.value == "f6", {~rslot7 = ~bplacef6; ~rdo7 = ~si7.value;});
4309                 if(~si7.value == "s6", {~rslot7 = ~bplaces6; ~rdo7 = ~si7.value;});
4310                 if(~si7.value == "o7", {~rslot7 = ~bplaceo7; ~rdo7 = ~si7.value;});
4311                 if(~si7.value == "f7", {~rslot7 = ~bplacef7; ~rdo7 = ~si7.value;});
4312                 if(~si7.value == "s7", {~rslot7 = ~bplaces7; ~rdo7 = ~si7.value;});
4313                 if(~si7.value == "o8", {~rslot7 = ~bplaceo8; ~rdo7 = ~si7.value;});
4314                 if(~si7.value == "f8", {~rslot7 = ~bplacef8; ~rdo7 = ~si7.value;});
4315                 if(~si7.value == "s8", {~rslot7 = ~bplaces8; ~rdo7 = ~si7.value;});
4316         };
4317         ~si8set = {
4318                 if(~si8.value == "o1", {~rslot8 = ~bplaceo1; ~rdo8 = ~si8.value;});
4319                 if(~si8.value == "f1", {~rslot8 = ~bplacef1; ~rdo8 = ~si8.value;});
4320                 if(~si8.value == "s1", {~rslot8 = ~bplaces1; ~rdo8 = ~si8.value;});
4321                 if(~si8.value == "o2", {~rslot8 = ~bplaceo2; ~rdo8 = ~si8.value;});
4322                 if(~si8.value == "f2", {~rslot8 = ~bplacef2; ~rdo8 = ~si8.value;});
4323                 if(~si8.value == "s2", {~rslot8 = ~bplaces2; ~rdo8 = ~si8.value;});
4324                 if(~si8.value == "o3", {~rslot8 = ~bplaceo3; ~rdo8 = ~si8.value;});
4325                 if(~si8.value == "f3", {~rslot8 = ~bplacef3; ~rdo8 = ~si8.value;});
4326                 if(~si8.value == "s3", {~rslot8 = ~bplaces3; ~rdo8 = ~si8.value;});
4327                 if(~si8.value == "o4", {~rslot8 = ~bplaceo4; ~rdo8 = ~si8.value;});
4328                 if(~si8.value == "f4", {~rslot8 = ~bplacef4; ~rdo8 = ~si8.value;});
4329                 if(~si8.value == "s4", {~rslot8 = ~bplaces4; ~rdo8 = ~si8.value;});
4330                 if(~si8.value == "o5", {~rslot8 = ~bplaceo5; ~rdo8 = ~si8.value;});
4331                 if(~si8.value == "f5", {~rslot8 = ~bplacef5; ~rdo8 = ~si8.value;});
4332                 if(~si8.value == "s5", {~rslot8 = ~bplaces5; ~rdo8 = ~si8.value;});
4333                 if(~si8.value == "o6", {~rslot8 = ~bplaceo6; ~rdo8 = ~si8.value;});
4334                 if(~si8.value == "f6", {~rslot8 = ~bplacef6; ~rdo8 = ~si8.value;});
4335                 if(~si8.value == "s6", {~rslot8 = ~bplaces6; ~rdo8 = ~si8.value;});
4336                 if(~si8.value == "o7", {~rslot8 = ~bplaceo7; ~rdo8 = ~si8.value;});
4337                 if(~si8.value == "f7", {~rslot8 = ~bplacef7; ~rdo8 = ~si8.value;});
4338                 if(~si8.value == "s7", {~rslot8 = ~bplaces7; ~rdo8 = ~si8.value;});
4339                 if(~si8.value == "o8", {~rslot8 = ~bplaceo8; ~rdo8 = ~si8.value;});
4340                 if(~si8.value == "f8", {~rslot8 = ~bplacef8; ~rdo8 = ~si8.value;});
4341                 if(~si8.value == "s8", {~rslot8 = ~bplaces8; ~rdo8 = ~si8.value;});
4342         };
4343
4344
4345         //routine function button
4346
4347         ~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;
4348
4349                 if(button.value == 1, {
4350                         ({
4351                                 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;
4352                                 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;
4353                                 ~rview = View(w, Rect(Window.screenBounds.width-(340+46),Window.screenBounds.height-(340+46/1.6180339887499)-110,340+46,340+46/1.6180339887499)).front;
4354                                 /*w.view.decorator=FlowLayout(w.view.bounds);
4355                                 w.view.decorator.gap=2@2;*/
4356
4357                                 top = 0;
4358
4359                                 i1 = StaticText(~rview, Rect(leftdo , top=top, width, height)).background_(Color.black).string_("rslot1").stringColor_(Color.white);
4360                                 i2 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot2").stringColor_(Color.white);
4361                                 i3 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot3").stringColor_(Color.white);
4362                                 i4 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot4").stringColor_(Color.white);
4363                                 i5 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot5").stringColor_(Color.white);
4364                                 i6 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot6").stringColor_(Color.white);
4365                                 i7 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot7").stringColor_(Color.white);
4366                                 i8 = StaticText(~rview, Rect(leftdo , top=top+height, width, height)).background_(Color.black).string_("rslot8").stringColor_(Color.white);
4367
4368                                 top = 0;
4369
4370                                 ~si1a=TextField(~rview, Rect(leftdobox , top=top, widthbox/2, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo1a);
4371                                 ~si1b=TextField(~rview, Rect(leftdobox+(widthbox/2) , top=top, widthbox/2, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo1b);
4372                                 ~si2=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo2);
4373                                 ~si3=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo3);
4374                                 ~si4=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo4);
4375                                 ~si5=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo5);
4376                                 ~si6=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo6);
4377                                 ~si7=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo7);
4378                                 ~si8=TextField(~rview, Rect(leftdobox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).stringColor_(Color.white).value_(~rdo8);
4379
4380                                 top = 0;
4381
4382                                 t1 = StaticText(~rview, Rect(lefttime , top=top, width, height)).background_(Color.black).string_("rtime1").stringColor_(Color.white);
4383                                 t2 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime2").stringColor_(Color.white);
4384                                 t3 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime3").stringColor_(Color.white);
4385                                 t4 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime4").stringColor_(Color.white);
4386                                 t5 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime5").stringColor_(Color.white);
4387                                 t6 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime6").stringColor_(Color.white);
4388                                 t7 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime7").stringColor_(Color.white);
4389                                 t8 = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("rtime8").stringColor_(Color.white);
4390                                 tall = StaticText(~rview, Rect(lefttime , top=top+height, width, height)).background_(Color.black).string_("all time").stringColor_(Color.white);
4391
4392
4393                                 top = 0;
4394
4395                                 st1=NumberBox(~rview, Rect(lefttimebox , top=top, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime1);
4396                                 st2=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime2);
4397                                 st3=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime3);
4398                                 st4=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime4);
4399                                 st5=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime5);
4400                                 st6=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime6);
4401                                 st7=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime7);
4402                                 st8=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtime8);
4403                                 stall=NumberBox(~rview, Rect(lefttimebox , top=top+heightbox, widthbox, heightbox)).background_(Color.black).normalColor_(Color.white;).value_(~rtimeall);
4404
4405
4406                                 ~si1a.action_({~si1aset.value});
4407                                 ~si1b.action_({~si1bset.value});
4408                                 ~si2.action_({~si2set.value});
4409                                 ~si3.action_({~si3set.value});
4410                                 ~si4.action_({~si4set.value});
4411                                 ~si5.action_({~si5set.value});
4412                                 ~si6.action_({~si6set.value});
4413                                 ~si7.action_({~si7set.value});
4414                                 ~si8.action_({~si8set.value});
4415
4416                                 stall.action_({arg val;
4417                                         ~rtimeall = val.value;
4418                                         ~rtime1 = val.value;
4419                                         ~rtime2 = val.value;
4420                                         ~rtime3 = val.value;
4421                                         ~rtime4 = val.value;
4422                                         ~rtime5 = val.value;
4423                                         ~rtime6 = val.value;
4424                                         ~rtime7 = val.value;
4425                                         ~rtime8 = val.value;
4426                                         ~rview.close; ~rviewbutton.valueAction_(1);
4427                                 });
4428                                 st1.action_({arg val; ~rtime1 = val.value;});
4429                                 st2.action_({arg val; ~rtime2 = val.value;});
4430                                 st3.action_({arg val; ~rtime3 = val.value;});
4431                                 st4.action_({arg val; ~rtime4 = val.value;});
4432                                 st5.action_({arg val; ~rtime5 = val.value;});
4433                                 st6.action_({arg val; ~rtime6 = val.value;});
4434                                 st7.action_({arg val; ~rtime7 = val.value;});
4435                                 st8.action_({arg val; ~rtime8 = val.value;});
4436
4437                                 ~rview.background_(Color.black);
4438
4439                                 ~metronomeincr = 1;
4440
4441                                 ~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;
4442
4443                                         if(button.value == 1, {
4444
4445                                                 ~metronome = Task({
4446                                                         inf.do({
4447                                                                 AppClock.sched(0, {~metronomebutton.value = 1;});
4448                                                                 ~metronomeincr.wait;
4449                                                                 AppClock.sched(0, {~metronomebutton.value = 0;});
4450                                                                 ~metronomeincr.wait;
4451                                                         });
4452                                                 });
4453
4454                                                 ~loop = Task({
4455                                                         1.do({
4456                                                                 {~rslot1a.valueAction_(0)}.defer;
4457                                                                 ~rtime1.wait;
4458                                                                 {~rslot2.valueAction_(0)}.defer;
4459                                                                 ~rtime2.wait;
4460                                                                 {~rslot3.valueAction_(0)}.defer;
4461                                                                 ~rtime3.wait;
4462                                                                 {~rslot4.valueAction_(0)}.defer;
4463                                                                 ~rtime4.wait;
4464                                                                 {~rslot5.valueAction_(0)}.defer;
4465                                                                 ~rtime5.wait;
4466                                                                 {~rslot6.valueAction_(0)}.defer;
4467                                                                 ~rtime6.wait;
4468                                                                 {~rslot7.valueAction_(0)}.defer;
4469                                                                 ~rtime7.wait;
4470                                                                 {~rslot8.valueAction_(0)}.defer;
4471                                                                 ~rtime8.wait;
4472                                                         });
4473                                                         inf.do({
4474                                                                 {~rslot1b.valueAction_(0)}.defer;
4475                                                                 ~rtime1.wait;
4476                                                                 {~rslot2.valueAction_(0)}.defer;
4477                                                                 ~rtime2.wait;
4478                                                                 {~rslot3.valueAction_(0)}.defer;
4479                                                                 ~rtime3.wait;
4480                                                                 {~rslot4.valueAction_(0)}.defer;
4481                                                                 ~rtime4.wait;
4482                                                                 {~rslot5.valueAction_(0)}.defer;
4483                                                                 ~rtime5.wait;
4484                                                                 {~rslot6.valueAction_(0)}.defer;
4485                                                                 ~rtime6.wait;
4486                                                                 {~rslot7.valueAction_(0)}.defer;
4487                                                                 ~rtime7.wait;
4488                                                                 {~rslot8.valueAction_(0)}.defer;
4489                                                                 ~rtime8.wait;
4490                                                         });
4491                                                 }); SystemClock(~metronome.start); SystemClock(~loop.start); ~numsynths.stop;}, {
4492
4493                                                         SystemClock(~metronome.stop); SystemClock(~loop.stop); SystemClock(~loop.reset); ~synthfree.value; ~pauseroutinebutton.value = 0; ~numsynths.stop; ~numsynthsfunc.value;});
4494                                 });
4495
4496                                 ~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;
4497
4498                                         if(button.value == 1, {SystemClock(~loop.pause); ~synthpause.value;}, {SystemClock(~loop.resume); ~synthflow.value;});
4499                                 });
4500
4501                                 ~closeroutinebutton = Button.new(~rview,Rect(220, top+40, 40, 40/~gm)).states_([["close",Color.white,Color.black]]).action_({arg button;
4502
4503                                         ~rview.close; ~rviewbutton.value = 0;
4504                                 });
4505
4506                                 ~metronomebutton = Button.new(~rview,Rect(120, top+40, 40, 40/~gm)).states_([["",Color.white,Color.red],["",Color.white,Color.blue]]).action_({arg button;});
4507
4508                         }.value);
4509
4510                         if(~loop.isPlaying == true, {~routinebutton.value = 1;});
4511                         ~rview.front;
4512                 }, {~rview.close});
4513         });
4514
4515
4516         //synth identifier function
4517
4518         ~synthmonitor = StaticText(w, Rect(Window.screenBounds.width-14,~bpt+49,18,18/1.6180339887499)).background_(Color.black).stringColor_(Color.white);
4519         ~synthmonitor.string = if(~currentsynth == nil, {"nil".asString});
4520
4521         ~synthmonitorfunc = {
4522                 ~synthmonitor.close;
4523                 ~synthmonitor = StaticText(w, Rect(Window.screenBounds.width-14,~bpt+49,18,18/1.6180339887499)).background_(Color.black).stringColor_(Color.white);
4524                 ~synthmonitor.string = ~currentsynth.asString;
4525                 ~synthmonitor.font = Font(size: 10);
4526         };
4527
4528         ~synthmonitorfunc.value;
4529
4530
4531         //cpu, # of ugens, and # of synths display
4532
4533         ~cpumonitor = StaticText(w, Rect(Window.screenBounds.width-500,~bpt-200,500,90/1.6180339887499)).background_(Color.black).stringColor_(Color.white);
4534         ~cpumonitor.close;
4535
4536         ~cpumonitorfunc =  {
4537                 ~cpumonitor.close;
4538                 ~cpumonitor = StaticText(w, Rect(20,~bpt-100,500,120/1.6180339887499)).background_(Color.black).stringColor_(Color.white);
4539                 ~cpumonitor.string = "cpu: "+s.avgCPU.asString+"%"++"\n" ++"ugens: "+s.numUGens.asString++"\n" ++"synths: "+s.numSynths.asString;
4540                 ~cpumonitor.font = Font(size: 14);
4541         };
4542
4543         ~cpumonitorroutine = Routine({
4544                 inf.do({
4545                         AppClock.sched(0, {
4546                                 ~cpumonitorfunc.value;
4547                         });
4548                         1.wait;
4549                 });
4550         });
4551
4552         ~cpumonitorbutton = Button.new(w,Rect(~bpl+((16*8)),~bpt+69+5-(16/1.6180339887499),16,16/1.6180339887499)).states_([["cm",Color.white,Color.black],["cm",Color.white,Color.black]]).action_({arg button;
4553
4554                 if(button.value == 1, {
4555                         ~cpumonitorroutine.reset;
4556                         ~cpumonitorroutine.play;
4557                 }, {~cpumonitorroutine.stop; ~cpumonitor.close;});
4558
4559         });
4560
4561
4562         //information button
4563
4564         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;
4565
4566                 if(button.value == 1, {
4567                         ~hb = TextView(w, Rect(0,0, Window.screenBounds.width, Window.screenBounds.height-200)).background_(Color.black);
4568                         (~hb.string =
4569                                 "(scroll down to see more)"++"\n"++"\n"++"\n"++
4570                                 "ctrl/cmd-period: stop synth/free server"++"\n"++"\n"++"\n"++
4571                                 "GUI Buttons"++"\n"++"\n"++"\n"++
4572                                 "synth0/synth1: start/stop synth set"++"\n"++"\n"++
4573                                 "pause0/pause1: pause/unpause synth set"++"\n"++"\n"++
4574                                 "tsynth0/tsynth1: tsynth0 to allow timed synth set, then click on any o or f button to time a progression. click on the st button in the bottom right to stop the timer. tsynth1 to dis-allow timed synth set"++"\n"++"\n"++
4575                                 "copy: copy frequency/note info"++"\n"++"\n"++
4576                                 "kws: change number of kw(King Wen) sequences in a timewave half-cycle (or amplitude x2). press set to load"++"\n"++"\n"++
4577                                 "top-level hz frequency: set the base frequency. press set to load"++"\n"++"\n"++
4578                                 "psine1-psine3 (based on phi, with low-pass filter), hsine1-hsine3 (based on 19.47, with low-pass filter), psineuf1-psineuf3 (based on phi, without low-pass filter), hsineuf1-hsineuf3 (based on 19.47, without low-pass filter) - set synthdef type. press set to load"++"\n"++"\n"++
4579                                 "lower-level hz frequency: change the low-pass filter frequency limit. default is 2206.9995468963. press set to load"++"\n"++"\n"++
4580                                 "s1-s8: set/save note positions"++"\n"++"\n"++
4581                                 "g1-g8: groups of saved note positions"++"\n"++"\n"++
4582                                 "uc-u8: undo changes to set note positions. press set to load"++"\n"++"\n"++
4583                                 "rc, /rc: start recording/stop recording"++"\n"++"\n"++
4584                                 "prc: pause recording"++"\n"++"\n"++
4585                                 "o1-o8: play set/saved note positions by opening a new synth set"++"\n"++"\n"++
4586                                 "f1-f8: flow transition to set/saved note positions"++"\n"++"\n"++
4587                                 "s1-s8: slide transition to set/saved note positions"++"\n"++"\n"++
4588                                 "m/u: mute/unmute all"++"\n"++"\n"++
4589                                 "1-8: mute or unmute individual synth"++"\n"++"\n"++
4590                                 "cm: cpu percentage/number of ugens/number of synths display"++"\n"++"\n"++
4591                                 "rw: random western scale"++"\n"++"\n"++
4592                                 "re: random eastern scale"++"\n"++"\n"++
4593                                 "r: routine/loop function - rslot for synth set, rtime for time between transitions"++"\n"++"\n"++
4594                                 "st: stop synth timer/show timer results"++"\n"++"\n"++
4595                                 "s: set slide time/increment"++"\n"++"\n"++
4596                                 "i: help"++"\n"++"\n"++
4597                                 "m: minimize window"++"\n"++"\n"++
4598                                 "c: close window"++"\n"++"\n"++"\n"++
4599                                 "Keyboard Functions (functionality will vary with device)"++"\n"++"\n"++"\n"++
4600                                 "s: start/stop synth set"++"\n"++"\n"++
4601                                 "space bar: pause/unpause synth set"++"\n"++"\n"++
4602                                 "ctrl-period/cmd-period: stop synth/free server"++"\n"++"\n"++
4603                                 "left/right arrow(or J and L): move down/up note"++"\n"++"\n"++
4604                                 "up/down arrow(or I and K): change synth for left/right arrow note function"++"\n"++"\n"++
4605                                 "#1-8 on keyboard: choose synth for left/right arrow note function"++"\n"++"\n"++
4606                                 "r: routine/loop function - rslot for synth set, rtime for time between transitions"++"\n"++"\n"++
4607                                 "m: mute/unmute all"++"\n"++"\n"++
4608                                 "c: copy function"++"\n"++"\n"++
4609                                 "t: timed synth function"++"\n"++"\n"++
4610                                 "esc: minimize window"
4611                                 ;
4612                         );
4613                         ~hb.stringColor = Color.white;
4614                         },
4615                         {~hb.close;});
4616         });
4617
4618
4619         //random notes button 1
4620
4621         ~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;
4622
4623                 if((~l1a.isRunning == true) or: (~l1a1.isRunning == true), {
4624                         8.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut(~freqmap.at(rrand(36, 91));)});
4625                         ~synthflow.value;
4626                 });
4627         });
4628
4629
4630         //random notes button 2
4631
4632         ~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;
4633
4634                 if((~l1a.isRunning == true) or: (~l1a1.isRunning == true), {
4635                         8.do(x = 0; {("f"++(x=x+1)).asSymbol.envirPut((~freqmap.at(127)/8).rand;)});
4636                         ~synthflow.value;
4637                 });
4638         });
4639
4640
4641         //setgroup buttons, sg1-sg8
4642
4643         ~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;
4644
4645                 if(button.value == 1, {
4646                         #fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12=[~sg1a1,~sg1a2,~sg1a3,~sg1a4,~sg1a5,~sg1a6,~sg1a7,~sg1a8,~sg1a9,~sg1a10,~sg1a11,~sg1a12];
4647                         #fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b=[~sg1b1,~sg1b2,~sg1b3,~sg1b4,~sg1b5,~sg1b6,~sg1b7,~sg1b8,~sg1b9,~sg1b10,~sg1b11,~sg1b12];
4648                         #fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c=[~sg1c1,~sg1c2,~sg1c3,~sg1c4,~sg1c5,~sg1c6,~sg1c7,~sg1c8,~sg1c9,~sg1c10,~sg1c11,~sg1c12];
4649                         #fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d=[~sg1d1,~sg1d2,~sg1d3,~sg1d4,~sg1d5,~sg1d6,~sg1d7,~sg1d8,~sg1d9,~sg1d10,~sg1d11,~sg1d12];
4650                         #fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e=[~sg1e1,~sg1e2,~sg1e3,~sg1e4,~sg1e5,~sg1e6,~sg1e7,~sg1e8,~sg1e9,~sg1e10,~sg1e11,~sg1e12];
4651                         #fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f=[~sg1f1,~sg1f2,~sg1f3,~sg1f4,~sg1f5,~sg1f6,~sg1f7,~sg1f8,~sg1f9,~sg1f10,~sg1f11,~sg1f12];
4652                         #fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g=[~sg1g1,~sg1g2,~sg1g3,~sg1g4,~sg1g5,~sg1g6,~sg1g7,~sg1g8,~sg1g9,~sg1g10,~sg1g11,~sg1g12];
4653                         #fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h=[~sg1h1,~sg1h2,~sg1h3,~sg1h4,~sg1h5,~sg1h6,~sg1h7,~sg1h8,~sg1h9,~sg1h10,~sg1h11,~sg1h12];
4654
4655                         ~setgroup2.value = 0;
4656                         ~setgroup3.value = 0;
4657                         ~setgroup4.value = 0;
4658                         ~setgroup5.value = 0;
4659                         ~setgroup6.value = 0;
4660                         ~setgroup7.value = 0;
4661                         ~setgroup8.value = 0;
4662
4663                         ~setgroupval = 1;
4664                 });
4665         });
4666         ~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;
4667
4668                 if(button.value == 1, {
4669                         #fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12=[~sg2a1,~sg2a2,~sg2a3,~sg2a4,~sg2a5,~sg2a6,~sg2a7,~sg2a8,~sg2a9,~sg2a10,~sg2a11,~sg2a12];
4670                         #fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b=[~sg2b1,~sg2b2,~sg2b3,~sg2b4,~sg2b5,~sg2b6,~sg2b7,~sg2b8,~sg2b9,~sg2b10,~sg2b11,~sg2b12];
4671                         #fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c=[~sg2c1,~sg2c2,~sg2c3,~sg2c4,~sg2c5,~sg2c6,~sg2c7,~sg2c8,~sg2c9,~sg2c10,~sg2c11,~sg2c12];
4672                         #fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d=[~sg2d1,~sg2d2,~sg2d3,~sg2d4,~sg2d5,~sg2d6,~sg2d7,~sg2d8,~sg2d9,~sg2d10,~sg2d11,~sg2d12];
4673                         #fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e=[~sg2e1,~sg2e2,~sg2e3,~sg2e4,~sg2e5,~sg2e6,~sg2e7,~sg2e8,~sg2e9,~sg2e10,~sg2e11,~sg2e12];
4674                         #fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f=[~sg2f1,~sg2f2,~sg2f3,~sg2f4,~sg2f5,~sg2f6,~sg2f7,~sg2f8,~sg2f9,~sg2f10,~sg2f11,~sg2f12];
4675                         #fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g=[~sg2g1,~sg2g2,~sg2g3,~sg2g4,~sg2g5,~sg2g6,~sg2g7,~sg2g8,~sg2g9,~sg2g10,~sg2g11,~sg2g12];
4676                         #fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h=[~sg2h1,~sg2h2,~sg2h3,~sg2h4,~sg2h5,~sg2h6,~sg2h7,~sg2h8,~sg2h9,~sg2h10,~sg2h11,~sg2h12];
4677
4678                         ~setgroup1.value = 0;
4679                         ~setgroup3.value = 0;
4680                         ~setgroup4.value = 0;
4681                         ~setgroup5.value = 0;
4682                         ~setgroup6.value = 0;
4683                         ~setgroup7.value = 0;
4684                         ~setgroup8.value = 0;
4685
4686                         ~setgroupval = 2;
4687                 });
4688         });
4689         ~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;
4690
4691                 if(button.value == 1, {
4692                         #fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12=[~sg3a1,~sg3a2,~sg3a3,~sg3a4,~sg3a5,~sg3a6,~sg3a7,~sg3a8,~sg3a9,~sg3a10,~sg3a11,~sg3a12];
4693                         #fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b=[~sg3b1,~sg3b2,~sg3b3,~sg3b4,~sg3b5,~sg3b6,~sg3b7,~sg3b8,~sg3b9,~sg3b10,~sg3b11,~sg3b12];
4694                         #fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c=[~sg3c1,~sg3c2,~sg3c3,~sg3c4,~sg3c5,~sg3c6,~sg3c7,~sg3c8,~sg3c9,~sg3c10,~sg3c11,~sg3c12];
4695                         #fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d=[~sg3d1,~sg3d2,~sg3d3,~sg3d4,~sg3d5,~sg3d6,~sg3d7,~sg3d8,~sg3d9,~sg3d10,~sg3d11,~sg3d12];
4696                         #fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e=[~sg3e1,~sg3e2,~sg3e3,~sg3e4,~sg3e5,~sg3e6,~sg3e7,~sg3e8,~sg3e9,~sg3e10,~sg3e11,~sg3e12];
4697                         #fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f=[~sg3f1,~sg3f2,~sg3f3,~sg3f4,~sg3f5,~sg3f6,~sg3f7,~sg3f8,~sg3f9,~sg3f10,~sg3f11,~sg3f12];
4698                         #fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g=[~sg3g1,~sg3g2,~sg3g3,~sg3g4,~sg3g5,~sg3g6,~sg3g7,~sg3g8,~sg3g9,~sg3g10,~sg3g11,~sg3g12];
4699                         #fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h=[~sg3h1,~sg3h2,~sg3h3,~sg3h4,~sg3h5,~sg3h6,~sg3h7,~sg3h8,~sg3h9,~sg3h10,~sg3h11,~sg3h12];
4700
4701                         ~setgroup1.value = 0;
4702                         ~setgroup2.value = 0;
4703                         ~setgroup4.value = 0;
4704                         ~setgroup5.value = 0;
4705                         ~setgroup6.value = 0;
4706                         ~setgroup7.value = 0;
4707                         ~setgroup8.value = 0;
4708
4709                         ~setgroupval = 3;
4710                 });
4711         });
4712         ~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;
4713
4714                 if(button.value == 1, {
4715                         #fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12=[~sg4a1,~sg4a2,~sg4a3,~sg4a4,~sg4a5,~sg4a6,~sg4a7,~sg4a8,~sg4a9,~sg4a10,~sg4a11,~sg4a12];
4716                         #fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b=[~sg4b1,~sg4b2,~sg4b3,~sg4b4,~sg4b5,~sg4b6,~sg4b7,~sg4b8,~sg4b9,~sg4b10,~sg4b11,~sg4b12];
4717                         #fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c=[~sg4c1,~sg4c2,~sg4c3,~sg4c4,~sg4c5,~sg4c6,~sg4c7,~sg4c8,~sg4c9,~sg4c10,~sg4c11,~sg4c12];
4718                         #fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d=[~sg4d1,~sg4d2,~sg4d3,~sg4d4,~sg4d5,~sg4d6,~sg4d7,~sg4d8,~sg4d9,~sg4d10,~sg4d11,~sg4d12];
4719                         #fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e=[~sg4e1,~sg4e2,~sg4e3,~sg4e4,~sg4e5,~sg4e6,~sg4e7,~sg4e8,~sg4e9,~sg4e10,~sg4e11,~sg4e12];
4720                         #fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f=[~sg4f1,~sg4f2,~sg4f3,~sg4f4,~sg4f5,~sg4f6,~sg4f7,~sg4f8,~sg4f9,~sg4f10,~sg4f11,~sg4f12];
4721                         #fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g=[~sg4g1,~sg4g2,~sg4g3,~sg4g4,~sg4g5,~sg4g6,~sg4g7,~sg4g8,~sg4g9,~sg4g10,~sg4g11,~sg4g12];
4722                         #fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h=[~sg4h1,~sg4h2,~sg4h3,~sg4h4,~sg4h5,~sg4h6,~sg4h7,~sg4h8,~sg4h9,~sg4h10,~sg4h11,~sg4h12];
4723
4724                         ~setgroup1.value = 0;
4725                         ~setgroup2.value = 0;
4726                         ~setgroup3.value = 0;
4727                         ~setgroup5.value = 0;
4728                         ~setgroup6.value = 0;
4729                         ~setgroup7.value = 0;
4730                         ~setgroup8.value = 0;
4731
4732                         ~setgroupval = 4;
4733                 });
4734         });
4735         ~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;
4736
4737                 if(button.value == 1, {
4738                         #fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12=[~sg5a1,~sg5a2,~sg5a3,~sg5a4,~sg5a5,~sg5a6,~sg5a7,~sg5a8,~sg5a9,~sg5a10,~sg5a11,~sg5a12];
4739                         #fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b=[~sg5b1,~sg5b2,~sg5b3,~sg5b4,~sg5b5,~sg5b6,~sg5b7,~sg5b8,~sg5b9,~sg5b10,~sg5b11,~sg5b12];
4740                         #fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c=[~sg5c1,~sg5c2,~sg5c3,~sg5c4,~sg5c5,~sg5c6,~sg5c7,~sg5c8,~sg5c9,~sg5c10,~sg5c11,~sg5c12];
4741                         #fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d=[~sg5d1,~sg5d2,~sg5d3,~sg5d4,~sg5d5,~sg5d6,~sg5d7,~sg5d8,~sg5d9,~sg5d10,~sg5d11,~sg5d12];
4742                         #fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e=[~sg5e1,~sg5e2,~sg5e3,~sg5e4,~sg5e5,~sg5e6,~sg5e7,~sg5e8,~sg5e9,~sg5e10,~sg5e11,~sg5e12];
4743                         #fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f=[~sg5f1,~sg5f2,~sg5f3,~sg5f4,~sg5f5,~sg5f6,~sg5f7,~sg5f8,~sg5f9,~sg5f10,~sg5f11,~sg5f12];
4744                         #fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g=[~sg5g1,~sg5g2,~sg5g3,~sg5g4,~sg5g5,~sg5g6,~sg5g7,~sg5g8,~sg5g9,~sg5g10,~sg5g11,~sg5g12];
4745                         #fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h=[~sg5h1,~sg5h2,~sg5h3,~sg5h4,~sg5h5,~sg5h6,~sg5h7,~sg5h8,~sg5h9,~sg5h10,~sg5h11,~sg5h12];
4746
4747                         ~setgroup1.value = 0;
4748                         ~setgroup2.value = 0;
4749                         ~setgroup3.value = 0;
4750                         ~setgroup4.value = 0;
4751                         ~setgroup6.value = 0;
4752                         ~setgroup7.value = 0;
4753                         ~setgroup8.value = 0;
4754
4755                         ~setgroupval = 5;
4756                 });
4757         });
4758         ~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;
4759
4760                 if(button.value == 1, {
4761                         #fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12=[~sg6a1,~sg6a2,~sg6a3,~sg6a4,~sg6a5,~sg6a6,~sg6a7,~sg6a8,~sg6a9,~sg6a10,~sg6a11,~sg6a12];
4762                         #fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b=[~sg6b1,~sg6b2,~sg6b3,~sg6b4,~sg6b5,~sg6b6,~sg6b7,~sg6b8,~sg6b9,~sg6b10,~sg6b11,~sg6b12];
4763                         #fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c=[~sg6c1,~sg6c2,~sg6c3,~sg6c4,~sg6c5,~sg6c6,~sg6c7,~sg6c8,~sg6c9,~sg6c10,~sg6c11,~sg6c12];
4764                         #fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d=[~sg6d1,~sg6d2,~sg6d3,~sg6d4,~sg6d5,~sg6d6,~sg6d7,~sg6d8,~sg6d9,~sg6d10,~sg6d11,~sg6d12];
4765                         #fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e=[~sg6e1,~sg6e2,~sg6e3,~sg6e4,~sg6e5,~sg6e6,~sg6e7,~sg6e8,~sg6e9,~sg6e10,~sg6e11,~sg6e12];
4766                         #fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f=[~sg6f1,~sg6f2,~sg6f3,~sg6f4,~sg6f5,~sg6f6,~sg6f7,~sg6f8,~sg6f9,~sg6f10,~sg6f11,~sg6f12];
4767                         #fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g=[~sg6g1,~sg6g2,~sg6g3,~sg6g4,~sg6g5,~sg6g6,~sg6g7,~sg6g8,~sg6g9,~sg6g10,~sg6g11,~sg6g12];
4768                         #fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h=[~sg6h1,~sg6h2,~sg6h3,~sg6h4,~sg6h5,~sg6h6,~sg6h7,~sg6h8,~sg6h9,~sg6h10,~sg6h11,~sg6h12];
4769
4770                         ~setgroup1.value = 0;
4771                         ~setgroup2.value = 0;
4772                         ~setgroup3.value = 0;
4773                         ~setgroup4.value = 0;
4774                         ~setgroup5.value = 0;
4775                         ~setgroup7.value = 0;
4776                         ~setgroup8.value = 0;
4777
4778                         ~setgroupval = 6;
4779                 });
4780         });
4781         ~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;
4782
4783                 if(button.value == 1, {
4784                         #fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12=[~sg7a1,~sg7a2,~sg7a3,~sg7a4,~sg7a5,~sg7a6,~sg7a7,~sg7a8,~sg7a9,~sg7a10,~sg7a11,~sg7a12];
4785                         #fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b=[~sg7b1,~sg7b2,~sg7b3,~sg7b4,~sg7b5,~sg7b6,~sg7b7,~sg7b8,~sg7b9,~sg7b10,~sg7b11,~sg7b12];
4786                         #fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c=[~sg7c1,~sg7c2,~sg7c3,~sg7c4,~sg7c5,~sg7c6,~sg7c7,~sg7c8,~sg7c9,~sg7c10,~sg7c11,~sg7c12];
4787                         #fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d=[~sg7d1,~sg7d2,~sg7d3,~sg7d4,~sg7d5,~sg7d6,~sg7d7,~sg7d8,~sg7d9,~sg7d10,~sg7d11,~sg7d12];
4788                         #fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e=[~sg7e1,~sg7e2,~sg7e3,~sg7e4,~sg7e5,~sg7e6,~sg7e7,~sg7e8,~sg7e9,~sg7e10,~sg7e11,~sg7e12];
4789                         #fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f=[~sg7f1,~sg7f2,~sg7f3,~sg7f4,~sg7f5,~sg7f6,~sg7f7,~sg7f8,~sg7f9,~sg7f10,~sg7f11,~sg7f12];
4790                         #fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g=[~sg7g1,~sg7g2,~sg7g3,~sg7g4,~sg7g5,~sg7g6,~sg7g7,~sg7g8,~sg7g9,~sg7g10,~sg7g11,~sg7g12];
4791                         #fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h=[~sg7h1,~sg7h2,~sg7h3,~sg7h4,~sg7h5,~sg7h6,~sg7h7,~sg7h8,~sg7h9,~sg7h10,~sg7h11,~sg7h12];
4792
4793                         ~setgroup1.value = 0;
4794                         ~setgroup2.value = 0;
4795                         ~setgroup3.value = 0;
4796                         ~setgroup4.value = 0;
4797                         ~setgroup5.value = 0;
4798                         ~setgroup6.value = 0;
4799                         ~setgroup8.value = 0;
4800
4801                         ~setgroupval = 7;
4802                 });
4803         });
4804         ~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;
4805
4806                 if(button.value == 1, {
4807                         #fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12=[~sg8a1,~sg8a2,~sg8a3,~sg8a4,~sg8a5,~sg8a6,~sg8a7,~sg8a8,~sg8a9,~sg8a10,~sg8a11,~sg8a12];
4808                         #fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b=[~sg8b1,~sg8b2,~sg8b3,~sg8b4,~sg8b5,~sg8b6,~sg8b7,~sg8b8,~sg8b9,~sg8b10,~sg8b11,~sg8b12];
4809                         #fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c=[~sg8c1,~sg8c2,~sg8c3,~sg8c4,~sg8c5,~sg8c6,~sg8c7,~sg8c8,~sg8c9,~sg8c10,~sg8c11,~sg8c12];
4810                         #fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d=[~sg8d1,~sg8d2,~sg8d3,~sg8d4,~sg8d5,~sg8d6,~sg8d7,~sg8d8,~sg8d9,~sg8d10,~sg8d11,~sg8d12];
4811                         #fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e=[~sg8e1,~sg8e2,~sg8e3,~sg8e4,~sg8e5,~sg8e6,~sg8e7,~sg8e8,~sg8e9,~sg8e10,~sg8e11,~sg8e12];
4812                         #fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f=[~sg8f1,~sg8f2,~sg8f3,~sg8f4,~sg8f5,~sg8f6,~sg8f7,~sg8f8,~sg8f9,~sg8f10,~sg8f11,~sg8f12];
4813                         #fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g=[~sg8g1,~sg8g2,~sg8g3,~sg8g4,~sg8g5,~sg8g6,~sg8g7,~sg8g8,~sg8g9,~sg8g10,~sg8g11,~sg8g12];
4814                         #fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h=[~sg8h1,~sg8h2,~sg8h3,~sg8h4,~sg8h5,~sg8h6,~sg8h7,~sg8h8,~sg8h9,~sg8h10,~sg8h11,~sg8h12];
4815
4816                         ~setgroup1.value = 0;
4817                         ~setgroup2.value = 0;
4818                         ~setgroup3.value = 0;
4819                         ~setgroup4.value = 0;
4820                         ~setgroup5.value = 0;
4821                         ~setgroup6.value = 0;
4822                         ~setgroup7.value = 0;
4823
4824                         ~setgroupval = 8;
4825                 });
4826         });
4827
4828
4829         //if setgroup values are nil
4830
4831         if(~setgroupval == nil, {~setgroup1.value = 1;});
4832         if(~setgroupval == 1, {~setgroup1.value = 1;});
4833         if(~setgroupval == 2, {~setgroup2.value = 1;});
4834         if(~setgroupval == 3, {~setgroup3.value = 1;});
4835         if(~setgroupval == 4, {~setgroup4.value = 1;});
4836         if(~setgroupval == 5, {~setgroup5.value = 1;});
4837         if(~setgroupval == 6, {~setgroup6.value = 1;});
4838         if(~setgroupval == 7, {~setgroup7.value = 1;});
4839         if(~setgroupval == 8, {~setgroup8.value = 1;});
4840
4841
4842         //save chord notes buttons, s1-s8
4843
4844         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, {~r1=fp1;~r2=fp2;~r3=fp3;~r4=fp4;~r5=fp5;~r6=fp6;~r7=fp7;~r8=fp8;~r9=fp9;~r10=fp10;~r11=fp11;~r12=fp12; #fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12/*,fp13,fp14,fp15,fp16,fp17,fp18,fp19,fp20,fp21,fp22,fp23,fp24*/ = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ]; "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;
4845
4846                 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))});});
4847                 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))});});
4848                 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))});});
4849                 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))});});
4850                 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))});});
4851                 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))});});
4852                 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))});});
4853                 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))});});
4854
4855                 n1.states_([["s1",Color.green,Color.black]]);
4856                 n2.states_([["s2",Color.white,Color.black]]);
4857                 n3.states_([["s3",Color.white,Color.black]]);
4858                 n4.states_([["s4",Color.white,Color.black]]);
4859                 n5.states_([["s5",Color.white,Color.black]]);
4860                 n6.states_([["s6",Color.white,Color.black]]);
4861                 n7.states_([["s7",Color.white,Color.black]]);
4862                 n8.states_([["s8",Color.white,Color.black]]);
4863         });});
4864
4865         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, {~r1b=fp1b;~r2b=fp2b;~r3b=fp3b;~r4b=fp4b;~r5b=fp5b;~r6b=fp6b;~r7b=fp7b;~r8b=fp8b;~r9b=fp9b;~r10b=fp10b;~r11b=fp11b;~r12b=fp12b; #fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b/*,fp13b,fp14b,fp15b,fp16b,fp17b,fp18b,fp19b,fp20b,fp21b,fp22b,fp23b,fp24b*/ = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ]; "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;
4866
4867                 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))});});
4868                 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))});});
4869                 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))});});
4870                 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))});});
4871                 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))});});
4872                 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))});});
4873                 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))});});
4874                 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))});});
4875
4876                 n1.states_([["s1",Color.white,Color.black]]);
4877                 n2.states_([["s2",Color.green,Color.black]]);
4878                 n3.states_([["s3",Color.white,Color.black]]);
4879                 n4.states_([["s4",Color.white,Color.black]]);
4880                 n5.states_([["s5",Color.white,Color.black]]);
4881                 n6.states_([["s6",Color.white,Color.black]]);
4882                 n7.states_([["s7",Color.white,Color.black]]);
4883                 n8.states_([["s8",Color.white,Color.black]]);
4884         });});
4885         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, {~r1c=fp1c;~r2c=fp2c;~r3c=fp3c;~r4c=fp4c;~r5c=fp5c;~r6c=fp6c;~r7c=fp7c;~r8c=fp8c;~r9c=fp9c;~r10c=fp10c;~r11c=fp11c;~r12c=fp12c; #fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c/*,fp13c,fp14c,fp15c,fp16c,fp17c,fp18c,fp19c,fp20c,fp21c,fp22c,fp23c,fp24c*/ = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ]; "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;
4886
4887                 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))});});
4888                 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))});});
4889                 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))});});
4890                 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))});});
4891                 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))});});
4892                 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))});});
4893                 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))});});
4894                 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))});});
4895
4896                 n1.states_([["s1",Color.white,Color.black]]);
4897                 n2.states_([["s2",Color.white,Color.black]]);
4898                 n3.states_([["s3",Color.green,Color.black]]);
4899                 n4.states_([["s4",Color.white,Color.black]]);
4900                 n5.states_([["s5",Color.white,Color.black]]);
4901                 n6.states_([["s6",Color.white,Color.black]]);
4902                 n7.states_([["s7",Color.white,Color.black]]);
4903                 n8.states_([["s8",Color.white,Color.black]]);
4904         });});
4905         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, {~r1d=fp1d;~r2d=fp2d;~r3d=fp3d;~r4d=fp4d;~r5d=fp5d;~r6d=fp6d;~r7d=fp7d;~r8d=fp8d;~r9d=fp9d;~r10d=fp10d;~r11d=fp11d;~r12d=fp12d; #fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d/*,fp13d,fp14d,fp15d,fp16d,fp17d,fp18d,fp19d,fp20d,fp21d,fp22d,fp23d,fp24d*/ = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ]; "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;
4906
4907                 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))});});
4908                 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))});});
4909                 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))});});
4910                 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))});});
4911                 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))});});
4912                 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))});});
4913                 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))});});
4914                 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))});});
4915
4916                 n1.states_([["s1",Color.white,Color.black]]);
4917                 n2.states_([["s2",Color.white,Color.black]]);
4918                 n3.states_([["s3",Color.white,Color.black]]);
4919                 n4.states_([["s4",Color.green,Color.black]]);
4920                 n5.states_([["s5",Color.white,Color.black]]);
4921                 n6.states_([["s6",Color.white,Color.black]]);
4922                 n7.states_([["s7",Color.white,Color.black]]);
4923                 n8.states_([["s8",Color.white,Color.black]]);
4924         });});
4925         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, {~r1e=fp1e;~r2e=fp2e;~r3e=fp3e;~r4e=fp4e;~r5e=fp5e;~r6e=fp6e;~r7e=fp7e;~r8e=fp8e;~r9e=fp9e;~r10e=fp10e;~r11e=fp11e;~r12e=fp12e; #fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e/*,fp13e,fp14e,fp15e,fp16e,fp17e,fp18e,fp19e,fp20e,fp21e,fp22e,fp23e,fp24e*/ = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ]; "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;
4926
4927                 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))});});
4928                 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))});});
4929                 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))});});
4930                 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))});});
4931                 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))});});
4932                 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))});});
4933                 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))});});
4934                 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))});});
4935
4936                 n1.states_([["s1",Color.white,Color.black]]);
4937                 n2.states_([["s2",Color.white,Color.black]]);
4938                 n3.states_([["s3",Color.white,Color.black]]);
4939                 n4.states_([["s4",Color.white,Color.black]]);
4940                 n5.states_([["s5",Color.green,Color.black]]);
4941                 n6.states_([["s6",Color.white,Color.black]]);
4942                 n7.states_([["s7",Color.white,Color.black]]);
4943                 n8.states_([["s8",Color.white,Color.black]]);
4944         });});
4945         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, {~r1f=fp1f;~r2f=fp2f;~r3f=fp3f;~r4f=fp4f;~r5f=fp5f;~r6f=fp6f;~r7f=fp7f;~r8f=fp8f;~r9f=fp9f;~r10f=fp10f;~r11f=fp11f;~r12f=fp12f; #fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f/*,fp13f,fp14f,fp15f,fp16f,fp17f,fp18f,fp19f,fp20f,fp21f,fp22f,fp23f,fp24f*/ = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ]; "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;
4946
4947                 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))});});
4948                 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))});});
4949                 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))});});
4950                 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))});});
4951                 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))});});
4952                 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))});});
4953                 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))});});
4954                 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))});});
4955
4956                 n1.states_([["s1",Color.white,Color.black]]);
4957                 n2.states_([["s2",Color.white,Color.black]]);
4958                 n3.states_([["s3",Color.white,Color.black]]);
4959                 n4.states_([["s4",Color.white,Color.black]]);
4960                 n5.states_([["s5",Color.white,Color.black]]);
4961                 n6.states_([["s6",Color.green,Color.black]]);
4962                 n7.states_([["s7",Color.white,Color.black]]);
4963                 n8.states_([["s8",Color.white,Color.black]]);
4964         });});
4965         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, {~r1g=fp1g;~r2g=fp2g;~r3g=fp3g;~r4g=fp4g;~r5g=fp5g;~r6g=fp6g;~r7g=fp7g;~r8g=fp8g;~r9g=fp9g;~r10g=fp10g;~r11g=fp11g;~r12g=fp12g; #fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g/*,fp13g,fp14g,fp15g,fp16g,fp17g,fp18g,fp19g,fp20g,fp21g,fp22g,fp23g,fp24g*/ = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ]; "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;
4966
4967                 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))});});
4968                 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))});});
4969                 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))});});
4970                 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))});});
4971                 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))});});
4972                 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))});});
4973                 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))});});
4974                 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))});});
4975
4976                 n1.states_([["s1",Color.white,Color.black]]);
4977                 n2.states_([["s2",Color.white,Color.black]]);
4978                 n3.states_([["s3",Color.white,Color.black]]);
4979                 n4.states_([["s4",Color.white,Color.black]]);
4980                 n5.states_([["s5",Color.white,Color.black]]);
4981                 n6.states_([["s6",Color.white,Color.black]]);
4982                 n7.states_([["s7",Color.green,Color.black]]);
4983                 n8.states_([["s8",Color.white,Color.black]]);
4984         });});
4985         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, {~r1h=fp1h;~r2h=fp2h;~r3h=fp3h;~r4h=fp4h;~r5h=fp5h;~r6h=fp6h;~r7h=fp7h;~r8h=fp8h;~r9h=fp9h;~r10h=fp10h;~r11h=fp11h;~r12h=fp12h; #fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h/*,fp13h,fp14h,fp15h,fp16h,fp17h,fp18h,fp19h,fp20h,fp21h,fp22h,fp23h,fp24h*/ = [ ~f1,~f2,~f3,~f4,~f5,~f6,~f7,~f8,~f9,~f10,~f11,~f12 ]; "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;
4986
4987                 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))});});
4988                 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))});});
4989                 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))});});
4990                 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))});});
4991                 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))});});
4992                 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))});});
4993                 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))});});
4994                 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))});});
4995
4996                 n1.states_([["s1",Color.white,Color.black]]);
4997                 n2.states_([["s2",Color.white,Color.black]]);
4998                 n3.states_([["s3",Color.white,Color.black]]);
4999                 n4.states_([["s4",Color.white,Color.black]]);
5000                 n5.states_([["s5",Color.white,Color.black]]);
5001                 n6.states_([["s6",Color.white,Color.black]]);
5002                 n7.states_([["s7",Color.white,Color.black]]);
5003                 n8.states_([["s8",Color.green,Color.black]]);
5004         });});
5005
5006
5007         //undo saved chord pop-up menu
5008
5009         ~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;});
5010
5011
5012         //set button for undo pop-up menu
5013
5014         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;
5015                 case
5016                 {~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;}
5017                 {~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, {#fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12 = [~u1,~u2,~u3,~u4,~u5,~u6,~u7,~u8,~u9,~u10,~u11,~u12]},{#fp1,fp2,fp3,fp4,fp5,fp6,fp7,fp8,fp9,fp10,fp11,fp12 = [~r1,~r2,~r3,~r4,~r5,~r6,~r7,~r8,~r9,~r10,~r11,~r12]});~undo.value = 0;}
5018                 {~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], {#fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b = [~u1b,~u2b,~u3b,~u4b,~u5b,~u6b,~u7b,~u8b,~u9b,~u10b,~u11b,~u12b]},{#fp1b,fp2b,fp3b,fp4b,fp5b,fp6b,fp7b,fp8b,fp9b,fp10b,fp11b,fp12b = [~r1b,~r2b,~r3b,~r4b,~r5b,~r6b,~r7b,~r8b,~r9b,~r10b,~r11b,~r12b]});~undo.value = 0;}
5019                 {~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], {#fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c = [~u1c,~u2c,~u3c,~u4c,~u5c,~u6c,~u7c,~u8c,~u9c,~u10c,~u11c,~u12c]},{#fp1c,fp2c,fp3c,fp4c,fp5c,fp6c,fp7c,fp8c,fp9c,fp10c,fp11c,fp12c = [~r1c,~r2c,~r3c,~r4c,~r5c,~r6c,~r7c,~r8c,~r9c,~r10c,~r11c,~r12c]});~undo.value = 0;}
5020                 {~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], {#fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d = [~u1d,~u2d,~u3d,~u4d,~u5d,~u6d,~u7d,~u8d,~u9d,~u10d,~u11d,~u12d]},{#fp1d,fp2d,fp3d,fp4d,fp5d,fp6d,fp7d,fp8d,fp9d,fp10d,fp11d,fp12d = [~r1d,~r2d,~r3d,~r4d,~r5d,~r6d,~r7d,~r8d,~r9d,~r10d,~r11d,~r12d]});~undo.value = 0;}
5021                 {~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], {#fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e = [~u1e,~u2e,~u3e,~u4e,~u5e,~u6e,~u7e,~u8e,~u9e,~u10e,~u11e,~u12e]},{#fp1e,fp2e,fp3e,fp4e,fp5e,fp6e,fp7e,fp8e,fp9e,fp10e,fp11e,fp12e = [~r1e,~r2e,~r3e,~r4e,~r5e,~r6e,~r7e,~r8e,~r9e,~r10e,~r11e,~r12e]});~undo.value = 0;}
5022                 {~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], {#fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f = [~u1f,~u2f,~u3f,~u4f,~u5f,~u6f,~u7f,~u8f,~u9f,~u10f,~u11f,~u12f]},{#fp1f,fp2f,fp3f,fp4f,fp5f,fp6f,fp7f,fp8f,fp9f,fp10f,fp11f,fp12f = [~r1f,~r2f,~r3f,~r4f,~r5f,~r6f,~r7f,~r8f,~r9f,~r10f,~r11f,~r12f]});~undo.value = 0;}
5023                 {~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], {#fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g = [~u1g,~u2g,~u3g,~u4g,~u5g,~u6g,~u7g,~u8g,~u9g,~u10g,~u11g,~u12g]},{#fp1g,fp2g,fp3g,fp4g,fp5g,fp6g,fp7g,fp8g,fp9g,fp10g,fp11g,fp12g = [~r1g,~r2g,~r3g,~r4g,~r5g,~r6g,~r7g,~r8g,~r9g,~r10g,~r11g,~r12g]});~undo.value = 0;}
5024                 {~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], {#fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h = [~u1h,~u2h,~u3h,~u4h,~u5h,~u6h,~u7h,~u8h,~u9h,~u10h,~u11h,~u12h]},{#fp1h,fp2h,fp3h,fp4h,fp5h,fp6h,fp7h,fp8h,fp9h,fp10h,fp11h,fp12h = [~r1h,~r2h,~r3h,~r4h,~r5h,~r6h,~r7h,~r8h,~r9h,~r10h,~r11h,~r12h]});~undo.value = 0;};
5025         });
5026
5027
5028         //record/stop record button
5029
5030         ~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;
5031
5032                 if(button.value == 1, {~numsynths.stop; s.record; if(button.value == 0, {button.value = 1});},
5033                         {s.stopRecording; ~startrecord.value = 0; ~pauserecord.value = 0; ~numsynths.stop; ~numsynths.play;});
5034         });
5035
5036
5037         //pause record button
5038
5039         ~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});});
5040
5041
5042         //minimize GUI window button
5043
5044         ~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;});
5045
5046
5047         //close GUI window button
5048
5049         ~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;
5050
5051                 if(~closemessage != nil, {~closemessage.close}, {nil});
5052                 ~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;
5053                 ~closemessagestring = StaticText(~closemessage, Rect(0,0,340+46,340+46/1.6180339887499)).background_(Color.black);
5054                 ~closemessagestring.align = \center;
5055                 ~closemessagestring.string ="Close Timewave Synth?";
5056                 ~closemessagestring.stringColor = Color.white;
5057                 ~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, {w.close; Task({1.do({if(~l1a.isRunning == true or: ~l1a1.isRunning == true, {~synthfree.value;}, {nil}); 1.wait; s.freeAll;});}).play;});});
5058                 ~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;});});
5059                 ~closemessage.front;
5060
5061         });
5062
5063
5064         w.front; w.fullScreen;
5065
5066         //Developed by Ken Brant (ken_brant@ymail.com)
5067
5068 }.value);
5069 );
5070 );
5071
5072
5073 //Interpreted King Wen Sequences
5074
5075 /*
5076
5077 (#a,b,c,d,e,f = /*[ 128.43436842029,128.43436842029,128.43436842029,128.43436842029,128.43436842029,128.43436842029  ]*/
5078 [ ~basefreq,~basefreq,~basefreq,~basefreq,~basefreq,~basefreq  ];
5079 ~a = a; ~b = b; ~c =c; ~d = d; ~e = e;~f=f;);
5080
5081 ~fth = 1.4142135623729;
5082 ~bi  = ~fth; (~bi  = "binary interval" - intverval of key change to hexgram's opposite in King Wen sequence)
5083
5084
5085 (First Setting)
5086
5087 /*1*/   #a,b,c,d,e,f=[ ~a,~b,~c,~d,~e,~f  ],
5088 /*2*/   [ a = a/~bi, b = b/~bi, c = c/~bi, d = d/~bi, e = e/~bi, f = f/~bi ],
5089 /*3*/   [ a = a,     b = b*~bi, c = c,     d = d,     e = e,     f = f*~bi ],
5090 /*4*/   [ a = a*~bi, b = b/~bi, c = c,     d = d,     e = e*~bi, f = f/~bi ],
5091 /*5*/   [ a = a/~bi, b = b*~bi, c = c,     d = d*~bi, e = e,     f = f*~bi ],
5092 /*6*/   [ a = a*~bi, b = b,     c = c*~bi, d = d/~bi, e = e,     f = f/~bi ],
5093 /*7*/   [ a = a/~bi, b = b/~bi, c = c/~bi, d = d,     e = e,     f = f     ],
5094 /*8*/   [ a = a,     b = b*~bi, c = c,     d = d,     e = e/~bi, f = f     ],
5095 /*9*/   [ a = a*~bi, b = b,     c = c,     d = d*~bi, e = e*~bi, f = f*~bi ],
5096 /*10*/  [ a = a,     b = b,     c = c*~bi, d = d/~bi, e = e,     f = f     ],
5097 /*11*/  [ a = a/~bi, b = b/~bi, c = c/~bi, d = d*~bi, e = e,     f = f     ],
5098 /*12*/  [ a = a*~bi, b = b*~bi, c = c*~bi, d = d/~bi, e = e/~bi, f = f/~bi ],
5099 /*13*/  [ a = a,     b = b,     c = c,     d = d*~bi, e = e,     f = f*~bi ],
5100 /*14*/  [ a = a,     b = b/~bi, c = c,     d = d,     e = e*~bi, f = f     ],
5101 /*15*/  [ a = a/~bi, b = b,     c = c/~bi, d = d,     e = e/~bi, f = f/~bi ],
5102 /*16*/  [ a = a,     b = b,     c = c*~bi, d = d/~bi, e = e,     f = f     ],
5103 /*17*/  [ a = a,     b = b*~bi, c = c,     d = d,     e = e,     f = f*~bi ],
5104 /*18*/  [ a = a*~bi, b = b/~bi, c = c/~bi, d = d*~bi, e = e*~bi, f = f/~bi ],
5105 /*19*/  [ a = a/~bi, b = b,     c = c,     d = d/~bi, e = e,     f = f*~bi ],
5106 /*20*/  [ a = a*~bi, b = b*~bi, c = c,     d = d,     e = e/~bi, f = f/~bi ],
5107 /*21*/  [ a = a,     b = b/~bi, c = c*~bi, d = d,     e = e,     f = f*~bi ],
5108 /*22*/  [ a = a,     b = b,     c = c/~bi, d = d*~bi, e = e,     f = f     ],
5109 /*23*/  [ a = a,     b = b,     c = c,     d = d/~bi, e = e,     f = f/~bi ],
5110 /*24*/  [ a = a/~bi, b = b,     c = c,     d = d,     e = e,     f = f*~bi ],
5111 /*25*/  [ a = a*~bi, b = b*~bi, c = c*~bi, d = d,     e = e,     f = f     ],
5112 /*26*/  [ a = a,     b = b/~bi, c = c/~bi, d = d*~bi, e = e*~bi, f = f     ],
5113 /*27*/  [ a = a,     b = b,     c = c,     d = d/~bi, e = e/~bi, f = f     ],
5114 /*28*/  [ a = a/~bi, b = b*~bi, c = c*~bi, d = d*~bi, e = e*~bi, f = f/~bi ],
5115 /*29*/  [ a = a,     b = b,     c = c/~bi, d = d/~bi, e = e,     f = f     ],
5116 /*30*/  [ a = a*~bi, b = b/~bi, c = c*~bi, d = d*~bi, e = e/~bi, f = f*~bi ],
5117 /*31*/  [ a = a/~bi, b = b*~bi, c = c,     d = d,     e = e,     f = f/~bi ],
5118 /*32*/  [ a = a,     b = b/~bi, c = c,     d = d,     e = e*~bi, f = f     ],
5119 /*33*/  [ a = a*~bi, b = b*~bi, c = c,     d = d,     e = e/~bi, f = f     ],
5120 /*34*/  [ a = a/~bi, b = b/~bi, c = c,     d = d,     e = e*~bi, f = f*~bi ],
5121 /*35*/  [ a = a*~bi, b = b,     c = c,     d = d/~bi, e = e/~bi, f = f/~bi ],
5122 /*36*/  [ a = a/~bi, b = b,     c = c/~bi, d = d*~bi, e = e,     f = f*~bi ],
5123 /*37*/  [ a = a*~bi, b = b*~bi, c = c,     d = d,     e = e,     f = f     ],
5124 /*38*/  [ a = a,     b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f     ],
5125 /*39*/  [ a = a/~bi, b = b*~bi, c = c/~bi, d = d*~bi, e = e/~bi, f = f/~bi ],
5126 /*40*/  [ a = a,     b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f     ],
5127 /*41*/  [ a = a*~bi, b = b,     c = c/~bi, d = d,     e = e,     f = f*~bi ],
5128 /*42*/  [ a = a,     b = b*~bi, c = c,     d = d,     e = e/~bi, f = f     ],
5129 /*43*/  [ a = a/~bi, b = b,     c = c*~bi, d = d*~bi, e = e*~bi, f = f     ],
5130 /*44*/  [ a = a*~bi, b = b,     c = c,     d = d,     e = e,     f = f/~bi ],
5131 /*45*/  [ a = a/~bi, b = b,     c = c,     d = d/~bi, e = e/~bi, f = f     ],
5132 /*46*/  [ a = a,     b = b/~bi, c = c/~bi, d = d*~bi, e = e*~bi, f = f     ],
5133 /*47*/  [ a = a,     b = b*~bi, c = c*~bi, d = d/~bi, e = e,     f = f     ],
5134 /*48*/  [ a = a,     b = b,     c = c/~bi, d = d*~bi, e = e,     f = f     ],
5135 /*49*/  [ a = a,     b = b,     c = c*~bi, d = d,     e = e/~bi, f = f*~bi ],
5136 /*50*/  [ a = a*~bi, b = b/~bi, c = c,     d = d,     e = e*~bi, f = f/~bi ],
5137 /*51*/  [ a = a/~bi, b = b,     c = c,     d = d/~bi, e = e/~bi, f = f*~bi ],
5138 /*52*/  [ a = a*~bi, b = b,     c = c/~bi, d = d*~bi, e = e,     f = f/~bi ],
5139 /*53*/  [ a = a,     b = b*~bi, c = c,     d = d,     e = e,     f = f     ],
5140 /*54*/  [ a = a/~bi, b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f*~bi ],
5141 /*55*/  [ a = a,     b = b,     c = c,     d = d*~bi, e = e/~bi, f = f     ],
5142 /*56*/  [ a = a*~bi, b = b,     c = c,     d = d,     e = e,     f = f/~bi ],
5143 /*57*/  [ a = a,     b = b*~bi, c = c/~bi, d = d,     e = e*~bi, f = f     ],
5144 /*58*/  [ a = a/~bi, b = b,     c = c*~bi, d = d/~bi, e = e,     f = f*~bi ],
5145 /*59*/  [ a = a*~bi, b = b,     c = c/~bi, d = d,     e = e,     f = f/~bi ],
5146 /*60*/  [ a = a/~bi, b = b,     c = c,     d = d,     e = e,     f = f*~bi ],
5147 /*61*/  [ a = a*~bi, b = b,     c = c,     d = d,     e = e,     f = f     ],
5148 /*62*/  [ a = a/~bi, b = b/~bi, c = c*~bi, d = d*~bi, e = e/~bi, f = f/~bi ],
5149 /*63*/  [ a = a,     b = b*~bi, c = c/~bi, d = d,     e = e,     f = f*~bi ],
5150 /*64*/  [ a = a*~bi, b = b/~bi, c = c*~bi, d = d/~bi, e = e*~bi, f = f/~bi ]
5151
5152 /*1*/   [ a = a*~n1, b = b*~n1*~bi, c = c*~n1, d = d*~n1*~bi, e = e*~n1, f = f*~n1*~bi ],...
5153
5154
5155 (Second Setting)
5156
5157 /*1*/   #a,b,c,d,e,f=[ ~a,~b,~c,~d,~e,~f  ],
5158 /*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 ],
5159 /*3*/   [ a = a,         b = b*~bi,     c = c,         d = d,         e = e,         f = f*~bi     ],
5160 /*4*/   [ a = a*~bi,     b = b/~bi,     c = c,         d = d,         e = e*~bi,     f = f/~bi     ],
5161 /*5*/   [ a = a/~bi,     b = b*~bi,     c = c,         d = d*~bi,     e = e,         f = f*~bi     ],
5162 /*6*/   [ a = a*~bi,     b = b,         c = c*~bi,     d = d/~bi,     e = e,         f = f/~bi     ],
5163 /*7*/   [ a = a/~bi,     b = b/~bi,     c = c/~bi,     d = d,         e = e,         f = f         ],
5164 /*8*/   [ a = a,         b = b*~bi,     c = c,         d = d,         e = e/~bi,     f = f         ],
5165 /*9*/   [ a = a*~bi,     b = b,         c = c,         d = d*~bi,     e = e*~bi,     f = f*~bi     ],
5166 /*10*/  [ a = a,         b = b,         c = c*~bi,     d = d/~bi,     e = e,         f = f         ],
5167 /*11*/  [ a = a/~bi,     b = b/~bi,     c = c/~bi,     d = d*~bi,     e = e,         f = f         ],
5168 /*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 ],
5169 /*13*/  [ a = a,         b = b,         c = c,         d = d*~bi,     e = e,         f = f*~bi     ],
5170 /*14*/  [ a = a,         b = b/~bi,     c = c,         d = d,         e = e*~bi,     f = f         ],
5171 /*15*/  [ a = a/~bi,     b = b,         c = c/~bi,     d = d,         e = e/~bi,     f = f/~bi     ],
5172 /*16*/  [ a = a,         b = b,         c = c*~bi,     d = d/~bi,     e = e,         f = f         ],
5173 /*17*/  [ a = a,         b = b*~bi,     c = c,         d = d,         e = e,         f = f*~bi     ],
5174 /*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 ],
5175 /*19*/  [ a = a/~bi,     b = b,         c = c,         d = d/~bi,     e = e,         f = f*~bi     ],
5176 /*20*/  [ a = a*~bi,     b = b*~bi,     c = c,         d = d,         e = e/~bi,     f = f/~bi     ],
5177 /*21*/  [ a = a,         b = b/~bi,     c = c*~bi,     d = d,         e = e,         f = f*~bi     ],
5178 /*22*/  [ a = a,         b = b,         c = c/~bi,     d = d*~bi,     e = e,         f = f         ],
5179 /*23*/  [ a = a,         b = b,         c = c,         d = d/~bi,     e = e,         f = f/~bi     ],
5180 /*24*/  [ a = a/~bi,     b = b,         c = c,         d = d,         e = e,         f = f*~bi     ],
5181 /*25*/  [ a = a*~bi,     b = b*~bi,     c = c*~bi,     d = d,         e = e,         f = f         ],
5182 /*26*/  [ a = a,         b = b/~bi,     c = c/~bi,     d = d*~bi,     e = e*~bi,     f = f         ],
5183 /*27*/  [ a = a,         b = b,         c = c,         d = d/~bi,     e = e/~bi,     f = f         ],
5184 /*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 ],
5185 /*29*/  [ a = a,         b = b,         c = c/~bi,     d = d/~bi,     e = e,         f = f         ],
5186 /*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 ],
5187 /*31*/  [ a = a/~bi,     b = b*~bi,     c = c,         d = d,         e = e,         f = f/~bi     ],
5188 /*32*/  [ a = a,         b = b/~bi,     c = c,         d = d,         e = e*~bi,     f = f         ],
5189 /*33*/  [ a = a*~bi,     b = b*~bi,     c = c,         d = d,         e = e/~bi,     f = f         ],
5190 /*34*/  [ a = a/~bi,     b = b/~bi,     c = c,         d = d,         e = e*~bi,     f = f*~bi     ],
5191 /*35*/  [ a = a*~bi,     b = b,         c = c,         d = d/~bi,     e = e/~bi,     f = f/~bi     ],
5192 /*36*/  [ a = a/~bi,     b = b,         c = c/~bi,     d = d*~bi,     e = e,         f = f*~bi     ],
5193 /*37*/  [ a = a*~bi,     b = b*~bi,     c = c,         d = d,         e = e,         f = f         ],
5194 /*38*/  [ a = a,         b = b/~bi,     c = c*~bi,     d = d/~bi,     e = e*~bi,     f = f         ],
5195 /*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 ],
5196 /*40*/  [ a = a,         b = b/~bi,     c = c*~bi,     d = d/~bi,     e = e*~bi,     f = f         ],
5197 /*41*/  [ a = a*~bi,     b = b,         c = c/~bi,     d = d,         e = e,         f = f*~bi     ],
5198 /*42*/  [ a = a,         b = b*~bi,     c = c,         d = d,         e = e/~bi,     f = f         ],
5199 /*43*/  [ a = a/~bi,     b = b,         c = c*~bi,     d = d*~bi,     e = e*~bi,     f = f         ],
5200 /*44*/  [ a = a*~bi,     b = b,         c = c,         d = d,         e = e,         f = f/~bi     ],
5201 /*45*/  [ a = a/~bi,     b = b,         c = c,         d = d/~bi,     e = e/~bi,     f = f         ],
5202 /*46*/  [ a = a,         b = b/~bi,     c = c/~bi,     d = d*~bi,     e = e*~bi,     f = f         ],
5203 /*47*/  [ a = a,         b = b*~bi,     c = c*~bi,     d = d/~bi,     e = e,         f = f         ],
5204 /*48*/  [ a = a,         b = b,         c = c/~bi,     d = d*~bi,     e = e,         f = f         ],
5205 /*49*/  [ a = a,         b = b,         c = c*~bi,     d = d,         e = e/~bi,     f = f*~bi     ],
5206 /*50*/  [ a = a*~bi,     b = b/~bi,     c = c,         d = d,         e = e*~bi,     f = f/~bi     ],
5207 /*51*/  [ a = a/~bi,     b = b,         c = c,         d = d/~bi,     e = e/~bi,     f = f*~bi     ],
5208 /*52*/  [ a = a*~bi,     b = b,         c = c/~bi,     d = d*~bi,     e = e,         f = f/~bi     ],
5209 /*53*/  [ a = a,         b = b*~bi,     c = c,         d = d,         e = e,         f = f         ],
5210 /*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 ],
5211 /*55*/  [ a = a,         b = b,         c = c,         d = d*~bi,     e = e/~bi,     f = f         ],
5212 /*56*/  [ a = a*~bi,     b = b,         c = c,         d = d,         e = e,         f = f/~bi     ],
5213 /*57*/  [ a = a,         b = b*~bi,     c = c/~bi,     d = d,         e = e*~bi,     f = f         ],
5214 /*58*/  [ a = a/~bi,     b = b,         c = c*~bi,     d = d/~bi,     e = e,         f = f*~bi     ],
5215 /*59*/  [ a = a*~bi,     b = b,         c = c/~bi,     d = d,         e = e,         f = f/~bi     ],
5216 /*60*/  [ a = a/~bi,     b = b,         c = c,         d = d,         e = e,         f = f*~bi     ],
5217 /*61*/  [ a = a*~bi,     b = b,         c = c,         d = d,         e = e,         f = f         ],
5218 /*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 ],
5219 /*63*/  [ a = a,         b = b*~bi,     c = c/~bi,     d = d,         e = e,         f = f*~bi     ],
5220 /*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 ]
5221
5222 /*1*/   [ a = a,         b = b*~bi,     c = c,         d = d*~bi,     e = e,         f = f*~bi     ],...
5223
5224
5225 (Third Setting)
5226
5227 /*1*/   #a,b,c,d,e,f=[ ~a,~b,~c,~d,~e,~f  ],
5228 /*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 ],
5229 /*3*/   [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5230 /*4*/   [ a = a*~n1*~bi, b = b*~n1/~bi, c = c*~n1,     d = d*~n1,     e = e*~n1*~bi, f = f*~n1/~bi ],
5231 /*5*/   [ a = a*~n1/~bi, b = b*~n1*~bi, c = c*~n1,     d = d*~n1*~bi, e = e*~n1,     f = f*~n1*~bi ],
5232 /*6*/   [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1/~bi ],
5233 /*7*/   [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1,     e = e*~n1,     f = f*~n1     ],
5234 /*8*/   [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1/~bi, f = f*~n1     ],
5235 /*9*/   [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1,     d = d*~n1*~bi, e = e*~n1*~bi, f = f*~n1*~bi ],
5236 /*10*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1     ],
5237 /*11*/  [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1,     f = f*~n1     ],
5238 /*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 ],
5239 /*13*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1,     d = d*~n1*~bi, e = e*~n1,     f = f*~n1*~bi ],
5240 /*14*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1,     d = d*~n1,     e = e*~n1*~bi, f = f*~n1     ],
5241 /*15*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1/~bi, d = d*~n1,     e = e*~n1/~bi, f = f*~n1/~bi ],
5242 /*16*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1     ],
5243 /*17*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5244 /*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 ],
5245 /*19*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1,     f = f*~n1*~bi ],
5246 /*20*/  [ a = a*~n1*~bi, b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1/~bi, f = f*~n1/~bi ],
5247 /*21*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1*~bi, d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5248 /*22*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1,     f = f*~n1     ],
5249 /*23*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1,     f = f*~n1/~bi ],
5250 /*24*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5251 /*25*/  [ a = a*~n1*~bi, b = b*~n1*~bi, c = c*~n1*~bi, d = d*~n1,     e = e*~n1,     f = f*~n1     ],
5252 /*26*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1*~bi, f = f*~n1     ],
5253 /*27*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1     ],
5254 /*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 ],
5255 /*29*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1/~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1     ],
5256 /*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 ],
5257 /*31*/  [ a = a*~n1/~bi, b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1/~bi ],
5258 /*32*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1,     d = d*~n1,     e = e*~n1*~bi, f = f*~n1     ],
5259 /*33*/  [ a = a*~n1*~bi, b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1/~bi, f = f*~n1     ],
5260 /*34*/  [ a = a*~n1/~bi, b = b*~n1/~bi, c = c*~n1,     d = d*~n1,     e = e*~n1*~bi, f = f*~n1*~bi ],
5261 /*35*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1/~bi ],
5262 /*36*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1,     f = f*~n1*~bi ],
5263 /*37*/  [ a = a*~n1*~bi, b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1     ],
5264 /*38*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1*~bi, f = f*~n1     ],
5265 /*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 ],
5266 /*40*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1*~bi, f = f*~n1     ],
5267 /*41*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1/~bi, d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5268 /*42*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1/~bi, f = f*~n1     ],
5269 /*43*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1*~bi, d = d*~n1*~bi, e = e*~n1*~bi, f = f*~n1     ],
5270 /*44*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1/~bi ],
5271 /*45*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1     ],
5272 /*46*/  [ a = a*~n1,     b = b*~n1/~bi, c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1*~bi, f = f*~n1     ],
5273 /*47*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1     ],
5274 /*48*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1,     f = f*~n1     ],
5275 /*49*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1*~bi, d = d*~n1,     e = e*~n1/~bi, f = f*~n1*~bi ],
5276 /*50*/  [ a = a*~n1*~bi, b = b*~n1/~bi, c = c*~n1,     d = d*~n1,     e = e*~n1*~bi, f = f*~n1/~bi ],
5277 /*51*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1,     d = d*~n1/~bi, e = e*~n1/~bi, f = f*~n1*~bi ],
5278 /*52*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1/~bi, d = d*~n1*~bi, e = e*~n1,     f = f*~n1/~bi ],
5279 /*53*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1     ],
5280 /*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 ],
5281 /*55*/  [ a = a*~n1,     b = b*~n1,     c = c*~n1,     d = d*~n1*~bi, e = e*~n1/~bi, f = f*~n1     ],
5282 /*56*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1/~bi ],
5283 /*57*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1/~bi, d = d*~n1,     e = e*~n1*~bi, f = f*~n1     ],
5284 /*58*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1*~bi, d = d*~n1/~bi, e = e*~n1,     f = f*~n1*~bi ],
5285 /*59*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1/~bi, d = d*~n1,     e = e*~n1,     f = f*~n1/~bi ],
5286 /*60*/  [ a = a*~n1/~bi, b = b*~n1,     c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5287 /*61*/  [ a = a*~n1*~bi, b = b*~n1,     c = c*~n1,     d = d*~n1,     e = e*~n1,     f = f*~n1     ],
5288 /*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 ],
5289 /*63*/  [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1/~bi, d = d*~n1,     e = e*~n1,     f = f*~n1*~bi ],
5290 /*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 ]
5291
5292 /*1*/   [ a = a*~n1,     b = b*~n1*~bi, c = c*~n1,     d = d*~n1*~bi, e = e*~n1,     f = f*~n1*~bi ],...
5293
5294 */