Skip to content

Commit ac5a4c7

Browse files
Add files via upload
1 parent 6081cfd commit ac5a4c7

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

GP8-controler.tosc

23 Bytes
Binary file not shown.

main-midiaction.lua

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ function checksum(t)
44
do
55
cs = cs + t[i]
66
end
7-
return 0x80 - (cs % 0x80)
7+
cs = cs % 0x80
8+
return (0x80 - cs) % 0x80
89
end
910

1011
-- read effects MSB
@@ -49,9 +50,15 @@ function effectsAllParams(t)
4950
t[#t + 1] = effectsLSB()
5051
end
5152

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
5562
return t
5663
end
5764

@@ -351,7 +358,7 @@ end
351358
-- notif of changed values
352359
function onReceiveNotify(key, value)
353360
if key == "EFF" then
354-
sendOneParam(effectsParams())
361+
sendOneParam(effectsParams(value))
355362
elseif key == "DF" then
356363
sendOneParam(dfParams(value))
357364
elseif key == "COMP" then

midi-change-program.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ function checksum(t)
66
do
77
cs = cs + t[i]
88
end
9-
return 0x80 - (cs % 0x80)
9+
cs = cs % 0x80
10+
return (0x80 - cs) % 0x80
1011
end
1112

1213
function wait40ms()
@@ -31,7 +32,7 @@ function onValueChanged(x)
3132
if x == "x" and self.values.x == 0 then
3233
local gbn = 0
3334
if self.parent.children.group.values.text == "B" then
34-
gbn = 64
35+
gbn = 64
3536
end
3637
gbn = gbn + (tonumber(self.parent.children.bank.values.text) - 1) * 8 + (tonumber(self.parent.children.number.values.text) - 1)
3738
self.parent.children.label4.values.text = tostring(gbn)

0 commit comments

Comments
 (0)