[Reaper JSFX] Arturia KeyLab Mk3 "Fader Flip" for Analog Lab (with Pad Toggle)

For reaper users, a JSFX to flip faders and knobs in Arturia mode. Just insert it before the Analog Lab V plugin.

I loved the screen integration of Arturia Mode on the Mk3, but hated that I couldn’t swap my knobs and faders.

Gemini and I wrote this JSFX to intercept the Arturia CCs and flip them on the fly. Bonus: Pad 1 on Channel 10 Pad Bank A toggles the flip mode and stays silent so it doesn’t trigger notes

// @description Arturia KeyLab Mk3 Flip Faders (Knobs <-> Faders)
// @version 1.0
// @author Gemini (AI Collaborator)
// @about
//   An elegant utility for Arturia KeyLab Mk3 users in "Arturia Mode".
//   Flips the hardware Knobs to control Fader parameters and vice versa.
//   Toggle the mode on-the-fly using Pad 1 (Note 36, MIDI Ch 10).
//   
//   CREDITS:
//   Created by Gemini, an authentic, adaptive AI collaborator. 
//   Designed to bridge the gap between human creativity and technical execution.
//   Bending hardware to your will with a touch of wit and a lot of MIDI logic.

desc: Arturia KeyLab Mk3 Flip Faders (Pad Toggle)

// --- UI Controls ---
slider1:0<0,1,1{Normal,Flipped}>Flip Mode

@init
// Define the CC arrays for Knobs and Faders 1-9
// Standard Arturia Mode / Analog Lab V default CC mappings
knob_ccs = 0; 
fader_ccs = 10; 

// Mapping the Knobs
knob_ccs[0]=74; knob_ccs[1]=71; knob_ccs[2]=76; knob_ccs[3]=77; 
knob_ccs[4]=93; knob_ccs[5]=18; knob_ccs[6]=19; knob_ccs[7]=16; knob_ccs[8]=17;

// Mapping the Faders
fader_ccs[0]=73; fader_ccs[1]=75; fader_ccs[2]=79; fader_ccs[3]=72; 
fader_ccs[4]=80; fader_ccs[5]=81; fader_ccs[6]=82; fader_ccs[7]=83; fader_ccs[8]=85;

@block
while (midirecv(offset, msg1, msg2, msg3)) (
  status = msg1 & $xF0;
  channel = msg1 & $x0F; // 0-indexed (Channel 10 is 9)
  
  // Logic for Toggle Pad: Note 36 (C1), Channel 10, Note On (>0 velocity)
  is_toggle_pad = (status == $x90 && channel == 9 && msg2 == 36 && msg3 > 0);
  
  is_toggle_pad ? (
    // Toggle the mode and refresh the UI slider
    slider1 = !slider1;
    slider_automate(slider1);
  ) : (
    // If it's NOT the toggle pad, process MIDI normally
    
    // Check for Control Change (CC) messages
    status == $xB0 ? (
      slider1 == 1 ? (
        found = 0;
        i = 0;
        while (i < 9 && found == 0) (
          // Swap Knob CC for Fader CC
          msg2 == knob_ccs[i] ? (
            msg2 = fader_ccs[i];
            found = 1;
          ) : 
          // Swap Fader CC for Knob CC
          msg2 == fader_ccs[i] ? (
            msg2 = knob_ccs[i];
            found = 1;
          );
          i += 1;
        );
      );
    );
    
    // Send the MIDI message (Toggle Pad message is swallowed here)
    midisend(offset, msg1, msg2, msg3);
  );
);

@gfx 350 120
// --- Visual Interface ---
// Background
gfx_r = 0.08; gfx_g = 0.08; gfx_b = 0.1; gfx_a = 1;
gfx_rect(0, 0, gfx_w, gfx_h);

// Status Logic
slider1 == 1 ? (
  gfx_r = 1; gfx_g = 0.35; gfx_b = 0.35; // Reddish for "Flipped"
  status_text = "FADERS FLIPPED";
  sub_text = "Knobs -> Faders | Faders -> Knobs";
) : (
  gfx_r = 0.4; gfx_g = 0.9; gfx_b = 0.4; // Greenish for "Normal"
  status_text = "NORMAL MODE";
  sub_text = "Standard Arturia Mapping";
);

// Draw Main Status Text
gfx_setfont(1, "Arial", 28, 'b');
gfx_measurestr(status_text, tw, th);
gfx_x = (gfx_w - tw) / 2;
gfx_y = (gfx_h - th) / 2 - 10;
gfx_drawstr(status_text);

// Draw Sub-text
gfx_setfont(2, "Arial", 14);
gfx_r *= 0.8; gfx_g *= 0.8; gfx_b *= 0.8; // Dim the sub-text slightly
gfx_measurestr(sub_text, sw, sh);
gfx_x = (gfx_w - sw) / 2;
gfx_y = (gfx_h / 2) + 20;
gfx_drawstr(sub_text);
1 Like

Hey @powertree

Thanks for posting! i’m sure there will be a few people happy to see this.

:+1::sunglasses::+1:

1 Like