Auto-engage for the Wah pedal

Hi all,

I’m currently migrating from Fractal to Gig Performer, and one feature I really missed was auto-engage wah.

So I built a simple GPScript solution:

  • Wah engages instantly when you move the pedal from heel

  • When you return to heel (~95–100%), it waits a bit (~750 ms)

  • Then it auto-bypasses

  • If you move the pedal again before the delay, it stays active

Feels very natural and avoids accidental cut-offs.

No extra footswitch needed — just expression pedal + script.

Var
    WAH_POS    : Widget
    WAH_BYPASS : Widget

    wahIsOn        : Boolean = false
    heelStartMs    : Double  = -1.0
    lastPos        : Double  = 1.0

    heelThreshold  : Double  = 0.95
    disengageDelay : Double  = 600.0


Initialization
    SetTimersRunning(true)

    lastPos = GetWidgetValue(WAH_POS)

    // Si está fuera del heel, encendido
    If lastPos < heelThreshold Then
        wahIsOn = true
        SetWidgetValue(WAH_BYPASS, 1.0)
    Else
        wahIsOn = false
        SetWidgetValue(WAH_BYPASS, 0.0)
    End
End


On WidgetValueChanged(newValue : Double) from WAH_POS

    lastPos = newValue

    // Sales del heel -> activar inmediatamente
    If newValue < heelThreshold Then
        heelStartMs = -1.0

        If not wahIsOn Then
            wahIsOn = true
            SetWidgetValue(WAH_BYPASS, 1.0)
        End
    Else
        // Entraste en heel -> empezar conteo
        If heelStartMs < 0.0 Then
            heelStartMs = TimeSinceStartup()
        End
    End

End


On TimerTick(milliseconds : Double)

    If wahIsOn Then
        // Si sigue en heel el tiempo suficiente -> bypass
        If lastPos >= heelThreshold Then
            If heelStartMs >= 0.0 Then
                If (milliseconds - heelStartMs) >= disengageDelay Then
                    wahIsOn = false
                    SetWidgetValue(WAH_BYPASS, 0.0)
                    heelStartMs = -1.0
                End
            End
        Else
            heelStartMs = -1.0
        End
    End

End


• WAH_POS → widget que recibe el pedal de expresión
• WAH_BYPASS → widget/button mapeado al bypass del wah

4 Likes

In fact it is a Auto engage for wah pedal!!

This is very nice — I wonder though why you didn’t use the ThresholdDetector object available in GP Script, you might not have needed to use the timer callback.

 ThresholdDetector_Detect : Return true if we crossed over

    Declaration: function ThresholdDetector_Detect (td : ThresholdDetector, newValue : double) Returns Boolean
    Category: Math
        Parameters
        td : ThresholdDetector
        newValue : double
    returns Boolean


ThresholdDetector_Setup : Define the conditions to detect an edge

    Declaration: function ThresholdDetector_Setup (td : ThresholdDetector, crossOver : double, initialValue : double, upDirection : boolean)
    Category: Math
        Parameters
        td : ThresholdDetector
        crossOver : double
        initialValue : double
        upDirection : boolean

Great point, thanks for mentioning it :+1:

I did consider using ThresholdDetector, and it would definitely be a cleaner way to handle the edge detection (heel → movement) part.

However, in this case I also needed a time-based condition (i.e. only bypass after staying in heel position for ~750 ms), so I ended up using a timer to manage that behavior.

That said, a hybrid approach could be even better:

  • use ThresholdDetector for reliable engage detection

  • keep a timer only for the delayed disengage

Might refactor it that way — appreciate the suggestion!