KORG nanoKONTROL 2 issues

There is perhaps a solution using this GIG script I made just for the fun :nerd_face::

var
  AxEdge             : MidiInDeviceAlias // Define AxEdge as a RigManager alias to the real controller
  state              : Integer=0;
  CC0_mem, CC32_mem  : ControlChangeMessage;
  PC_mem             : ProgramChangeMessage;
  time               : Double = TimeSinceStartup();  
  stateDelay         : Double = 10.0; //in ms
  //
  CC0_remap          : Integer = 1;  // CC0  will be remapped to this value 
  CC32_remap         : Integer = 33; // CC32 will be remapped to this value 

Initialization
  SetTimersRunning(true); // We could also stop the timers when not necessary at State 0
End
  
On ControlChangeEvent(m : ControlChangeMessage) Matching 0 from AxEdge

  Select
    state == 0 Do state = 1;
                  CC0_mem = m;
                  time = TimeSinceStartup();
    
    state == 1 Do InjectMidiEventViaRigManager(AxEdge, WithCCNumber(CC0_mem, CC0_remap));
                  CC0_mem = m;
                  time = time - stateDelay;
    
    true       Do InjectMidiEventViaRigManager(AxEdge, WithCCNumber(m, CC0_remap));
  End 
End

On ControlChangeEvent(m : ControlChangeMessage) Matching 32 from AxEdge
  Select
    state == 1 && (TimeSinceStartup() < (time + 2*stateDelay))
               Do  state = 2;
                   CC32_mem = m;
    
    state == 2 Do  state = 0;
                   InjectMidiEventViaRigManager(AxEdge, WithCCNumber(CC0_mem, CC0_remap));
                   InjectMidiEventViaRigManager(AxEdge, WithCCNumber(CC32_mem, CC32_remap));
                   InjectMidiEventViaRigManager(AxEdge, WithCCNumber(m, CC32_remap));
    
    true       Do InjectMidiEventViaRigManager(AxEdge, WithCCNumber(m, CC32_remap))
  End
End

On ProgramChangeEvent(m : ProgramChangeMessage) from AxEdge
  If state == 2
  Then
    state = 0;
    InjectMidiEventViaRigManager(AxEdge, CC0_mem);
    InjectMidiEventViaRigManager(AxEdge, CC32_mem);
    InjectMidiEventViaRigManager(AxEdge, PC_mem);
  End
  
  PC_mem = m;  
End

// Called by timer ticking
On TimerTick(ms : double)
  Select
    state == 1 && (TimeSinceStartup() > (time + 2*stateDelay)) 
               Do state = 0;
                  InjectMidiEventViaRigManager(AxEdge, WithCCNumber(CC0_mem, CC0_remap));
    
    state == 2 && (TimeSinceStartup() > (time + 3*stateDelay)) 
               Do state = 0;
                  InjectMidiEventViaRigManager(AxEdge, WithCCNumber(CC0_mem, CC0_remap));
                  InjectMidiEventViaRigManager(AxEdge, WithCCNumber(CC32_mem, CC32_remap));    
  End
End

It is supposed to convert all CCO and CC32 but not those part of a MSB+LSB+PC sequence. I couldn’t really test it because none of my controllers accept to send a CC0 or CC32. But, I have great hope that it should work. :nerd_face: