-
Notifications
You must be signed in to change notification settings - Fork 0
/
allen-heath-qu-mixer-plugin.qplug
787 lines (738 loc) · 40.3 KB
/
allen-heath-qu-mixer-plugin.qplug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
-- Basic Framework Plugin
-- by QSC
-- October 2020
-- Information block for the plugin
PluginInfo = {
Name = "Allen & Heath~Qu Mixer",
Version = "1.0.1",
BuildVersion = "1.0.0.171",
Id = "5b589c6d-5137-492a-a163-2bbfd2f949d4",
Author = "Johnny Zhu",
Description = "It is an one-way communication plugin of controlling a Allen&Heath QU mixer."
}
-- Define the color of the plugin object in the design
function GetColor(props)
return { 0, 50, 200 }
end
-- The name that will initially display when dragged into a design
function GetPrettyName(props)
return "Allen&Heath~QU Mixer, version " .. PluginInfo.Version
end
-- Optional function used if plugin has multiple pages
PageNames = { "Setup", "Control" } --List the pages within the plugin
function GetPages(props)
local pages = {}
for ix,name in ipairs(PageNames) do
table.insert(pages, {name = PageNames[ix]})
end
return pages
end
-- Optional function to define model if plugin supports more than one model
function GetModel(props)
local model = {}
if props.Model ~= nil and props.Model.Value ~= "" then
table.insert(model, { props.Model.Value } )
else
table.insert(model, { "Base Model" } )
end
return model
end
-- Define User configurable Properties of the plugin
function GetProperties()
local props = {}
table.insert(props, {
Name = "Debug Print",
Type = "enum",
Choices = {"None", "Tx/Rx", "Tx", "Rx", "Function Calls", "All"},
Value = "None"
})
table.insert(props, {
Name = "Model",
Type = "enum",
--Choices = {"Qu-16", "Qu-24", "Qu-32", "Qu-SB", "Qu-Pac"}, Value = "Qu-32"
Choices = {"Qu-32", "Other"}, Value = "Qu-32"
})
return props
end
-- Optional function to define pins on the plugin that are not connected to a Control
function GetPins(props)
local pins = {}
--[[ table.insert(pins,{
Name = "Audio Output",
Direction = "output",
}) ]]
return pins
end
-- Optional function to update available properties when properties are altered by the user
function RectifyProperties(props)
if props.plugin_show_debug.Value == false then
props["Debug Print"].IsHidden = true
end
return props
end
-- Optional function to define components used within the plugin
function GetComponents(props)
local components = {}
table.insert(components,{
Name = "main_mixer",
Type = "mixer",
Properties =
{
["n_inputs"] = 8,
["n_outputs"] = 1,
}
})
return components
end
-- Optional function to define wiring of components used within the plugin
function GetWiring(props)
local wiring = {}
-- table.insert( wiring, { "Audio Output", "main_mixer Output 1" } )
return wiring
end
-- Defines the Controls used within the plugin
function GetControls(props)
local ctrls = {}
table.insert(ctrls, {
Name = "SceneButton",
ControlType = "Button",
ButtonType = "Momentary",
Count = 100,
--UserPin = true,
--PinStyle = "Input",
Icon = "<NONE>"
})
table.insert(ctrls, {
Name = "SceneKnob",
ControlType = "Knob",
ControlUnit = "Integer",
Count = 1,
Min = 1,
Max = 100,
UserPin = true,
PinStyle = "Both"
})
table.insert(ctrls, {
Name = "InputMute",
ControlType = "Button",
ButtonType = "Toggle",
Count = 35,
--UserPin = true,
--PinStyle = "Both",
Icon = "<NONE>"
})
table.insert(ctrls, {
Name = "InputFader",
ControlType = "Knob",
ButtonType = "Fader",
Count = 35,
Min = 0,
Max = 127,
--UserPin = true,
--PinStyle = "Both",
})
table.insert(ctrls, {
Name = "OutputMute",
ControlType = "Button",
ButtonType = "Toggle",
Count = 14,
--UserPin = true,
--PinStyle = "Both",
Icon = "<NONE>"
})
table.insert(ctrls, {
Name = "OutputFader",
ControlType = "Knob",
ButtonType = "Fader",
Count = 35,
Min = 0,
Max = 127,
--UserPin = true,
--PinStyle = "Both",
})
--**Controls on Page "Setup"
table.insert(ctrls, {
Name = "IP Address",
ControlType = "Text",
Count = 1,
DefaultValue = "127.0.0.1"
})
table.insert(ctrls, {
Name = "Port",
ControlType = "Knob",
ControlUnit = "Integer",
Count = 1,
Min = 1,
Max = 65535,
DefaultValue = 51325
})
table.insert(ctrls, {
Name = "Status",
ControlType = "Indicator",
IndicatorType = "Status",
Count = 1,
UserPin = true,
PinStyle = "Output"
})
table.insert(ctrls, {
Name = "MIDI Channel",
ControlType = "Knob",
ControlUnit = "Integer",
Count = 1,
Min = 1,
Max = 16,
DefaultValue = 1
})
return ctrls
end
--Layout of controls and graphics for the plugin UI to display
function GetControlLayout(props)
local layout = {}
local graphics = {}
local CurrentPage = PageNames[props["page_index"].Value]
--*** Page "Control" *********************************************************************************************
if CurrentPage == "Control" then
table.insert(graphics,{
Type = "GroupBox",
Text = "Control",
TextSize = 15,
Fill = {118,178,219},
CornerRadius = 8,
StrokeWidth = 1,
Position = {0,0},
Size = {1280,720}
})
table.insert(graphics,{
Type = "Header",
Text = "Scene Recall",
TextSize = 12,
Fill = {50,50,50},
StrokeWidth = 1,
Position = {10,30},
Size = {1260,15}
})
table.insert(graphics,{
Type = "Text",
Text = "Button",
TextSize = 12,
Position = {10,55},
Size = {50,24},
FontSize = 11,
HTextAlign = "Right"
})
table.insert(graphics,{
Type = "Text",
Text = "Combo Box",
Position = {10,154},
Size = {50,24},
TextSize = 12,
HTextAlign = "Right"
})
--Scene Buttons
--[[ for sceneIdx = 1, 25 do
layout["SceneButton "..sceneIdx] = {
PrettyName = "Buttons~Recall Scene ",
Style = "Button",
Position = {75 + 48*(sceneIdx-1), 80},
TextSize = 12,
Size = {48,24},
Color = {255,255,255},
Legend = tostring(sceneIdx)
}
end
]]
for scn = 0, 99 do
local row = 1 + math.floor(scn / 25)
local col = 1 + (scn % 25)
layout["SceneButton " .. scn+1] = {
PrettyName = "Recall Scene " .. string.format("%d", scn+1),
Style = "Button",
Color = {255,255,255},
Legend = "S "..(scn+1),
Position = {65 + (48 * (col - 1)),
55 + (24 * (row - 1))},
Size = {48, 24}
}
end
--Scene Knob
layout["SceneKnob"] = {
PrettyName = "Recall Scene ",
Style = "ComboBox",
Position = {65, 154},
Size = {60,24},
Color = {110,198,241},
TextSize = 12,
}
--Connection Status Led Indicator
layout["Status"] = {
Style = "Led",
PrettyName = "Status",
Position = {2, 2},
Size = {16, 16},
Margin = 2,
TextSize = 12,
}
table.insert(graphics,{
Type = "Header",
Text = "Inputs",
TextSize = 12,
Fill = {50,50,50},
StrokeWidth = 1,
Position = {10,210},
Size = {1260,15}
})
table.insert(graphics,{
Type = "Header",
Text = "Outputs",
TextSize = 12,
Fill = {50,50,50},
StrokeWidth = 1,
Position = {10,480},
Size = {1260,15}
})
--Input Labels
for channelIdx = 1, 32 do
table.insert(graphics,{
Type = "Text",
Text = tostring(channelIdx),
TextSize = 12,
Position = {10 + 36*(channelIdx-1), 234},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
end
for channelIdx = 1, 3 do
table.insert(graphics,{
Type = "Text",
Text = "ST"..tostring(channelIdx),
TextSize = 12,
Position = {1162 + 36*(channelIdx-1), 234},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
end
--Output Labels
for channelIdx = 1, 4 do
table.insert(graphics,{
Type = "Text",
Text = tostring(channelIdx),
TextSize = 12,
Position = {10 + 36*(channelIdx-1), 504},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
end
table.insert(graphics,{
Type = "Text",
Text = "5-6",
TextSize = 12,
Position = {154, 504},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
table.insert(graphics,{
Type = "Text",
Text = "7-8",
TextSize = 12,
Position = {190, 504},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
table.insert(graphics,{
Type = "Text",
Text = "9-10",
TextSize = 12,
Position = {226, 504},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
table.insert(graphics,{
Type = "Text",
Text = "LR",
TextSize = 12,
Position = {262, 504},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
table.insert(graphics,{
Type = "Text",
Text = "Grp 1-2",
TextSize = 12,
Position = {298, 504},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
table.insert(graphics,{
Type = "Text",
Text = "Grp 3-4",
TextSize = 12,
Position = {334, 504},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
table.insert(graphics,{
Type = "Text",
Text = "Grp 5-6",
TextSize = 12,
Position = {370, 504},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
table.insert(graphics,{
Type = "Text",
Text = "Grp 7-8",
TextSize = 12,
Position = {406, 504},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
table.insert(graphics,{
Type = "Text",
Text = "MTX 1-2",
TextSize = 12,
Position = {442, 504},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
table.insert(graphics,{
Type = "Text",
Text = "MTX 3-4",
TextSize = 12,
Position = {478, 504},
Size = {36,36},
FontSize = 11,
HTextAlign = "Middle"
})
-- InputMute Buttons
for channelIdx = 1, 35 do
layout["InputMute "..channelIdx] = {
PrettyName = "Buttons~Input Mute ",
Style = "Button",
Position = {10 + 36*(channelIdx-1), 270},
TextSize = 12,
Size = {36,16},
Color = {255,0,0},
--Legend = tostring(sceneIdx)
}
end
-- InputMute Faders
for channelIdx = 1, 35 do
layout["InputFader "..channelIdx] = {
PrettyName = "Fader~Input Fader ",
Style = "Fader",
Position = {10 + 36*(channelIdx-1), 297},
TextSize = 12,
Size = {36,128},
}
end
-- OutputMute Buttons
for channelIdx = 1, 14 do
layout["OutputMute "..channelIdx] = {
PrettyName = "Buttons~Output Mute ",
Style = "Button",
Position = {10 + 36*(channelIdx-1), 540},
TextSize = 12,
Size = {36,16},
Color = {255,0,0},
}
end
-- OutputMute Faders
for channelIdx = 1, 14 do
layout["OutputFader "..channelIdx] = {
PrettyName = "Fader~Output Fader ",
Style = "Fader",
Position = {10 + 36*(channelIdx-1), 567},
TextSize = 12,
Size = {36,128},
}
end
--*** Page "Setup" *********************************************************************************************
elseif CurrentPage == "Setup" then
table.insert(graphics,{
Type = "GroupBox",
Text = "Setup",
TextSize = 15,
Fill = {118,178,219},
CornerRadius = 8,
StrokeWidth = 1,
Position = {0,0},
Size = {350,250}
})
--Show AH logo
local AHLogo = "iVBORw0KGgoAAAANSUhEUgAAAXcAAABQCAYAAADiHjXEAAAKQ2lDQ1BJQ0MgcHJvZmlsZQAAeNqdU3dYk/cWPt/3ZQ9WQtjwsZdsgQAiI6wIyBBZohCSAGGEEBJAxYWIClYUFRGcSFXEgtUKSJ2I4qAouGdBiohai1VcOO4f3Ke1fXrv7e371/u855zn/M55zw+AERImkeaiagA5UoU8Otgfj09IxMm9gAIVSOAEIBDmy8JnBcUAAPADeXh+dLA//AGvbwACAHDVLiQSx+H/g7pQJlcAIJEA4CIS5wsBkFIAyC5UyBQAyBgAsFOzZAoAlAAAbHl8QiIAqg0A7PRJPgUA2KmT3BcA2KIcqQgAjQEAmShHJAJAuwBgVYFSLALAwgCgrEAiLgTArgGAWbYyRwKAvQUAdo5YkA9AYACAmUIszAAgOAIAQx4TzQMgTAOgMNK/4KlfcIW4SAEAwMuVzZdL0jMUuJXQGnfy8ODiIeLCbLFCYRcpEGYJ5CKcl5sjE0jnA0zODAAAGvnRwf44P5Dn5uTh5mbnbO/0xaL+a/BvIj4h8d/+vIwCBAAQTs/v2l/l5dYDcMcBsHW/a6lbANpWAGjf+V0z2wmgWgrQevmLeTj8QB6eoVDIPB0cCgsL7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pG1GEOM5VkicptIZppKBa7QkyFn6ZHW+ssaM9H6kx9eTzN25vOvFbNqZZXyLZuV18l+z7ao5lMEpLrMOD5wbKA3OJ11qJm493sViF4fGvce7EjQHPmo2fNZM6l7j+oZVXHxesibxlJpDfD9hxaucWsHHmTGxzvmznNh2znhwy9j1Gz95YGq5sx9U2S/OKver2DS4BuYHAbEfIKziNOv4mkWGnfJULHE1bqqkjIL0zOrV9MIFh/q1a2+z9rErgxvumPFItK7M4i64PUiQ42YrE4p5n21z0XqT0YYyOaTZ9O9yaYVZvpziAYt6zXLGhR0XK4UHubyyH1RZcWc/Gome06BZ/JpVhtt4NYc4ZMIs/6MpPbu2ctM2mmD+lSLyIwKRPMvKq1X+ZPWRYvKieexf5eCtH1qhlSAekJjPUvPAVtwRCAQCUaUYsRSS/R8IBAKBqH7gYTsIBAKB4o5AIBAIFHcEAoFAoLgjEAgEAsUdgUAgECjuCAQCgeKOQCAQCBR3BAKBQKC4IxAIBALFHYFAIBAo7ggEAoHijlWAQCAQow//L8AAlYgvNqPPUr4AAAAASUVORK5CYII="
table.insert(graphics,{
Type="Image",
Image=AHLogo,
Position={205,220},
Size={141,30}
})
--Show Qu logo
local QuLogo = "iVBORw0KGgoAAAANSUhEUgAAAR0AAACmCAYAAADnEFt5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1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xjg0+i+IATKdxeMS0pelEN4Ci0QZGnVKhwebDQtxtDfAJrLmobzTLpNgp25dQ1ku52ShkRAtFAZ8+kTo6OsgFAKB7BQCYDgAApgMAmA4AAKYDAJgOAGA6AACYDgBgOgAAmA4AYDoAAJgOAGA6AIDpAABgOgCA6QAAYDoAgOkAABj/E2AANzNyOf+aUyMAAAAASUVORK5CYII="
table.insert(graphics,{
Type="Image",
Image=QuLogo,
Position={228,0},
Size={115,67}
})
table.insert(graphics,{
Type = "Header",
Text = "Setup",
TextSize = 12,
Fill = {50,50,50},
StrokeWidth = 1,
Position = {10,30},
Size = {205,15}
})
table.insert(graphics,{
Type = "Text",
Text = "IP Address",
TextSize = 12,
Position = {12,80},
Size = {72,24},
HTextAlign = "Right"
})
table.insert(graphics,{
Type = "Text",
Text = "Port: 51325 ",
TextSize = 12,
Position = {12,104},
Size = {72,24},
HTextAlign = "Right"
})
table.insert(graphics,{
Type = "Text",
Text = "Status",
TextSize = 12,
Position = {12,140},
Size = {72,24},
HTextAlign = "Right"
})
table.insert(graphics,{
Type = "Text",
Text = "MIDI Channel",
TextSize = 12,
Position = {12,176},
Size = {72,24},
HTextAlign = "Right"
})
layout["IP Address"] = {
PrettyName = "Mixer's IP Address",
Style = "TextField",
Position = {84, 80},
Size = {106,24},
Color = {255,255,255},
TextSize = 12,
}
--[[ layout["Port"] = {
PrettyName = "Fixed at 51325",
Style = "TextField",
Position = {84, 105},
Size = {106,24},
Color = {110,198,241},
TextSize = 12,
}
]]
layout["Status"] = {
PrettyName = "Status",
Style = "Status",
Position = {84, 138},
Size = {230,24}
--Color = {194,194,194},
--IsReadOnly = true
}
layout["MIDI Channel"] = {
PrettyName = "MIDI Channel (Setup on Mixer)",
Style = "ComboBox",
Position = {84, 176},
Size = {60,24},
Color = {110,198,241},
TextSize = 12,
}
end
return layout, graphics
end
--Start event based logic
if Controls then
--Johnny Zhu
--2021.08.30
--------------------------------------------------------------------
-- UI variables
--------------------------------------------------------------------
-- controls
--btn_enable = Controls["Enable"]
knob_midichannel = Controls["MIDI Channel"]
btn_scene = Controls["SceneButton"]
knob_scene = Controls["SceneKnob"]
-- btn_scene = Controls.SceneButton
-- knob_scene = Controls.SceneKnob
btn_inputmute = Controls["InputMute"]
fader_inputfader = Controls["InputFader"]
btn_outputmute = Controls["OutputMute"]
fader_outputfader = Controls["OutputFader"]
--Connection Status
stat_details = Controls["Status"]
--[[ Status.Value:
5-Initializing-blue
4-Missing -#C00000
3-Not Present-gray
2-Fault-red
1-Compromised-orange
0-OK-green
]]--
-- TCP/UCP connection
txt_address = Controls["IP Address"]
knb_port = Controls["Port"]
knb_port.Value = 51325
--------------------------------------------------------------------
-- Other variables and CONSTANTS
--------------------------------------------------------------------
--Global Variables
tx = ""
midiChannel = knob_midichannel.Value -1
--CONSTANTS
--STX = "\x02"
ETX = ""
--ETX = "\x0D\x0A"
-- commands to device
--------------------------------------------------------------------
-- Function Definition
--------------------------------------------------------------------
function DebugFormatHex(string,hex) -- Format strings containing non-printable characters so we can see what they are
local visual = ""
local format = hex~=nil and "\\x%02x" or "[%02X]" --hex==nil: format="[%02X]"; hex~=nil: format="\\x%02x"
for i=1,#string do
local byte = string:sub(i,i)
visual = visual..string.format(format,string.byte(byte))
end
return visual
end
--------------------------------------------------------------------
-- Socket Connection
--------------------------------------------------------------------
-- socket
sock = TcpSocket.New()
sock.ReadTimeout = 0
sock.WriteTimeout = 0
sock.ReconnectTimeout = 5
sock:Connect(txt_address.String, knb_port.Value)
-- send data
function send(data)
--print("sending: "..data)
tx = data
sock:Connect(txt_address.String, knb_port.Value)
end
-- report connection details to gui
function connStat(message, severity)
stat_details.Value = severity
stat_details.String = message
if severity == 2 then
Log.Error(string.format("%s:%s\t%s", txt_address.String, knb_port.String, message))
end
end
-- do when event is data
function parseResponse()
rx = sock:Read(sock.BufferLength)
if rx ~= nil then
print("received: "..DebugFormatHex(rx))
stat_details.String = "RX: "..DebugFormatHex(rx)
-- do something with data here
end
--sock:Disconnect()
--connStat("socket closed by client", 1)
end
sock.EventHandler = function(sock, evt, err)
if evt == TcpSocket.Events.Connected then -- Connected
connStat("TX: "..DebugFormatHex(tx), 0)
sock:Write(tx)
print("sending: "..DebugFormatHex(tx) )
elseif evt == TcpSocket.Events.Reconnect then -- Reconnecting
connStat("socket reconnecting...", 5)
elseif evt == TcpSocket.Events.Data then -- Data
connStat("data received from remote", 0)
parseResponse()
elseif evt == TcpSocket.Events.Closed then -- Closed by remote
connStat("socket closed by remote", 4)
elseif evt == TcpSocket.Events.Error then -- Error
connStat("socket closed due to error", 2)
elseif evt == TcpSocket.Events.Timeout then -- Timeout
connStat("socket closed due to timeout", 3)
end
end
--------------------------------------------------------------------
-- Event Handlers
--------------------------------------------------------------------
--btn_enable.EventHandler = function()
--send(enable)
--end
knob_midichannel.EventHandler = function()
midiChannel = knob_midichannel.Value -1
print("MIDI Channel = "..string.format("0x%02X", midiChannel) )
end
--[[
for i=1, #btn_scene do
btn_scene[i].EventHandler = function()
send(scene[i])
end
end
]]--
for i=1, #btn_scene do
btn_scene[i].EventHandler = function()
if btn_scene[i].Boolean == true then
tx = string.format("%c", 0xB0 + midiChannel).."\x00\x00"..string.format("%c", 0xB0 + midiChannel).."\x20\x00"..string.format("%c", 0xC0 + midiChannel)..string.format("%c", i-1)..ETX
send(tx)
end
end
end
knob_scene.EventHandler = function()
tx = string.format("%c", 0xB0 + midiChannel).."\x00\x00"..string.format("%c", 0xB0 + midiChannel).."\x20\x00"..string.format("%c", 0xC0 + midiChannel)..string.format("%c", knob_scene.Value -1)..ETX
send(tx)
end
--Mute on 9N, CH, 7F, 8N, CH, 00
--Mute off 9N, CH, 3F, 8N, CH, 00
for i=1, #btn_inputmute do
btn_inputmute[i].EventHandler = function()
if btn_inputmute[i].Boolean == true then --on
tx = string.format("%c", 0x90 + midiChannel)..string.format("%c", 0x1F + i).."\x7F"..string.format("%c", 0x80 + midiChannel)..string.format("%c", 0x1F + i).."\x00"..ETX
else
tx = string.format("%c", 0x90 + midiChannel)..string.format("%c", 0x1F + i).."\x3F"..string.format("%c", 0x80 + midiChannel)..string.format("%c", 0x1F + i).."\x00"..ETX
end
send(tx)
end
end
for i=1, #btn_outputmute do
btn_outputmute[i].EventHandler = function()
if btn_outputmute[i].Boolean == true then --on
tx = string.format("%c", 0x90 + midiChannel)..string.format("%c", 0x5F + i).."\x7F"..string.format("%c", 0x80 + midiChannel)..string.format("%c", 0x5F + i).."\x00"..ETX
else
tx = string.format("%c", 0x90 + midiChannel)..string.format("%c", 0x5F + i).."\x3F"..string.format("%c", 0x80 + midiChannel)..string.format("%c", 0x5F + i).."\x00"..ETX
end
send(tx)
end
end
--Fader BN, 63, CH, BN, 62, 17, BN, 06, VA BN, 26, 07
for i=1, #fader_inputfader do
fader_inputfader[i].EventHandler = function()
tx = string.format("%c", 0xB0 + midiChannel).."\x63"..string.format("%c", 0x1F + i)..string.format("%c", 0xB0 + midiChannel).."\x62\x17"..string.format("%c", 0xB0 + midiChannel).."\x06"..string.format("%c", fader_inputfader[i].Value)..string.format("%c", 0xB0 + midiChannel).."\x26\x07"..ETX
send(tx)
end
end
for i=1, #fader_outputfader do
fader_outputfader[i].EventHandler = function()
tx = string.format("%c", 0xB0 + midiChannel).."\x63"..string.format("%c", 0x5F + i)..string.format("%c", 0xB0 + midiChannel).."\x62\x17"..string.format("%c", 0xB0 + midiChannel).."\x06"..string.format("%c", fader_outputfader[i].Value)..string.format("%c", 0xB0 + midiChannel).."\x26\x07"..ETX
send(tx)
end
end
end