Change assigned Midi CC on a pot triggered by incoming Rx Midi Message

Hi all,

Is it possible to change the assigned midi cc message on a pot based on an incoming Rx midi message. I have 2 PO16 modules. I just want to change the midi assignments on specific pots via an external device. I have been able to figure out how to change pages based on an incoming midi message. I have minimal programing knowledge, however I did see where you can change led values from an incoming midi message.

Thanks in advance

Some possible way I can think is using lookup and global variables, here a example with three knobs changing its cc number depending of two incoming CCs (100 and 101, you can change that of course to your needs)

-- On System Setup
ccPot1 = 30
ccPot2 = 60
ccPot3 = 90

These are the default pot output CC numbers on page initialization.

On MIDI RX

Step 1


Step 2


Step 3 (add a code block and copy the code below).

if i <= 1 then

local potCCs = {
  pot1 = {30, 31}, 
  pot2 = {60, 61}, 
  pot3 = {90, 91}
}

  function getPotCC(name, i)
    potCCs[name] and potCCs[name][i + 1] or nil
  end

  ccPot1 = getPotCC("pot1", i)
  ccPot2 = getPotCC("pot2", i)
  ccPot3 = getPotCC("pot3", i)
end

Now to switch between pot control changes:
On Pot 1

On Pot 2

On Pot 3

So, when a CC with number 100 is received, pot 1 CC number will be 30, if 101 is received instead, pot 1 CC number will be 31, and so on.

Hope it helps, however keep in mind this will reach almost the code character limit (on MIDI RX) . Maybe somebody have a more simple solution?

Cheers.