File tree 3 files changed +15
-7
lines changed
3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ function checksum(t)
4
4
do
5
5
cs = cs + t [i ]
6
6
end
7
- return 0x80 - (cs % 0x80 )
7
+ cs = cs % 0x80
8
+ return (0x80 - cs ) % 0x80
8
9
end
9
10
10
11
-- read effects MSB
@@ -49,9 +50,15 @@ function effectsAllParams(t)
49
50
t [# t + 1 ] = effectsLSB ()
50
51
end
51
52
52
- function effectsParams ()
53
- t = { 0x0 , 0x0 }
54
- effectsAllParams (t )
53
+ function effectsParams (v )
54
+ t = { 0x0 }
55
+ if v < 5 then
56
+ t [# t + 1 ] = 0x1
57
+ t [# t + 1 ] = effectsLSB ()
58
+ else
59
+ t [# t + 1 ] = 0x0
60
+ t [# t + 1 ] = effectsMSB ()
61
+ end
55
62
return t
56
63
end
57
64
351
358
-- notif of changed values
352
359
function onReceiveNotify (key , value )
353
360
if key == " EFF" then
354
- sendOneParam (effectsParams ())
361
+ sendOneParam (effectsParams (value ))
355
362
elseif key == " DF" then
356
363
sendOneParam (dfParams (value ))
357
364
elseif key == " COMP" then
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ function checksum(t)
6
6
do
7
7
cs = cs + t [i ]
8
8
end
9
- return 0x80 - (cs % 0x80 )
9
+ cs = cs % 0x80
10
+ return (0x80 - cs ) % 0x80
10
11
end
11
12
12
13
function wait40ms ()
@@ -31,7 +32,7 @@ function onValueChanged(x)
31
32
if x == " x" and self .values .x == 0 then
32
33
local gbn = 0
33
34
if self .parent .children .group .values .text == " B" then
34
- gbn = 64
35
+ gbn = 64
35
36
end
36
37
gbn = gbn + (tonumber (self .parent .children .bank .values .text ) - 1 ) * 8 + (tonumber (self .parent .children .number .values .text ) - 1 )
37
38
self .parent .children .label4 .values .text = tostring (gbn )
You can’t perform that action at this time.
0 commit comments