Auto-engage expression pedal for PC-based modellers: a solution!

Discussion in 'Digital & Modeling Gear' started by adamquek, Mar 18, 2019.

  1. adamquek

    adamquek Member

    Oct 29, 2004
    Hey folks,

    I've been throwing this idea around for weeks in my head and finally sat down and put in the elbow (brain?) grease to make it work.

    I've always loved the auto-engage function of the Bad Horsie wah, which is also available in the Axe FX. Since selling off the Axe-FX and moving over the Helix Native, I basically haven't used my expression pedal for anything as I don't like tap dancing to change scene/patch, then move over the the wah etc.

    I noticed that Reaper has a programmable FX plugin called JSFX, and it was capable of receiving/sending MIDI, so I wrote a short script to turn my expression pedal into an auto-engage pedal.

    Basically it functions like a noise gate, that sends a 127 value when the pedal is moving and a 0 value when the pedal is above a threshold for a specific duration in ms.

    I'm not a programmer so apologies if there are more elegant ways to get this done. For everyone else, feel free to make use the code, pretty please with what it does for 45 lines (although... it took many hours to get that far).

    desc:MIDI auto engage

    slider1:7<0,127,1>MIDI CC# in
    slider2:1000<500,2000,20>Gate (ms)
    slider4:4<0,127,1>MIDI CC# out


    cc_in = slider1;
    gate_ms = slider2;
    threshold = slider3;
    cc_out = slider4;

    auto_engage = 0;
    counter = 0;


    //time of last move
    while(midirecv(offset,msg1,msg2,msg3)) (
    counter = counter + 1;
    msg1==$xB0 && msg2==cc_in && msg3 < threshold ? (

    //time since last move
    time_since = min(time_precise() - last_move,gate_ms/1000);

    //open gate check
    time_since < gate_ms/1000 && auto_engage == 0 ? (
    auto_engage = 1;

    //close gate check
    time_since == gate_ms/1000 && auto_engage == 1 && msg3 > threshold ? (
    auto_engage = 0;

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice