Skip to content

Commit c7715d7

Browse files
committed
Fix Vu Meters
1 parent bd42356 commit c7715d7

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
.vscode
66
**/.DS_Store
7+
output
78

89
### Python ###
910
# Byte-compiled / optimized / DLL files

touchmcu/midi.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,14 @@ def midi_fader(note, ch, send=True, receive=True):
196196

197197
return result
198198

199-
def midi_vu(ch):
199+
def midi_vu():
200200

201201
vu = MidiMessage()
202202
vu.send = False
203203
vu.receive = True
204204
vu.triggers["x"] = Condition.ANY
205205
vu.type = MidiMessageType.CHANNEL_PRESSURE
206-
vu.channel = ch
206+
vu.channel = 0
207207
vu.data1 = 0
208208
vu.data2 = 0
209209
vu.values.append({

touchmcu/scripts/vu.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ function onReceiveMIDI(message, connections)
1313
-- some byte manipulation here,
1414
-- - the 4 msb are the track number
1515
-- - the 4 lsb are the value
16-
local rtrack = math.floor(data1 / 2^4)
16+
local rtrack = math.floor(data1 / 16)
1717

1818
-- Not me, skip
1919
if rtrack ~= track then
2020
return
2121
end
2222

23-
local value = data1 - (rtrack * 2^4)
23+
local value = data1 - (rtrack * 16)
2424

2525
for i = 1, 11, 1 do
2626
local led = findLed(i)

touchmcu/track.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def create_vu(parent, trackid):
7777
root["frame"].resize(14, 12*14)
7878

7979

80-
root.messages.extend(midi_vu(trackid))
80+
root.messages.extend(midi_vu())
8181

8282

8383
# This is a lua header that declare on which track the vu meter is

0 commit comments

Comments
 (0)