Skip to content

Commit

Permalink
Fix Vu Meters
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoG60 committed May 21, 2022
1 parent bd42356 commit c7715d7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

.vscode
**/.DS_Store
output

### Python ###
# Byte-compiled / optimized / DLL files
Expand Down
4 changes: 2 additions & 2 deletions touchmcu/midi.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ def midi_fader(note, ch, send=True, receive=True):

return result

def midi_vu(ch):
def midi_vu():

vu = MidiMessage()
vu.send = False
vu.receive = True
vu.triggers["x"] = Condition.ANY
vu.type = MidiMessageType.CHANNEL_PRESSURE
vu.channel = ch
vu.channel = 0
vu.data1 = 0
vu.data2 = 0
vu.values.append({
Expand Down
4 changes: 2 additions & 2 deletions touchmcu/scripts/vu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ function onReceiveMIDI(message, connections)
-- some byte manipulation here,
-- - the 4 msb are the track number
-- - the 4 lsb are the value
local rtrack = math.floor(data1 / 2^4)
local rtrack = math.floor(data1 / 16)

-- Not me, skip
if rtrack ~= track then
return
end

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

for i = 1, 11, 1 do
local led = findLed(i)
Expand Down
2 changes: 1 addition & 1 deletion touchmcu/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def create_vu(parent, trackid):
root["frame"].resize(14, 12*14)


root.messages.extend(midi_vu(trackid))
root.messages.extend(midi_vu())


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

0 comments on commit c7715d7

Please sign in to comment.