I'm trying to implement the following code but am having a problem, seemingly with the amount of midi_send() parts, or maybe I'm doing something weird... I'm new to Lua and just using the action blocks and converting those to code to see what they do...
This seems to work:
self:element_index(),
self:button_value(),
(module_position_y() * 4 + page_current()) % 16,
(32 + module_position_x() * 16 + self:element_index()) % 128
self:button_mode(0)
for i = 1, 6 do
midi_send(i - 1, 176, 49, 127)
midi_send(i - 1, 176, 7, 108)
end
midi_send(6, 176, 49, 0)
midi_send(6, 176, 7, 108)```
However, when I try to add the following code to the end of this it doesn't work suddenly and no MIDI messages are sent at all:
```midi_send(7, 176, 49, 0)
midi_send(7, 176, 7, 108)```
Why is that?