Manual

!local swapBins = swapBins
!for i=0,(maxBin-1)/2,1 do
!!swapBins( i, maxBin-i )
!end
!local shift = state.param1
!state.param1 = shift - (maxBin-1)*3/4
!scriptedShift( state )
!state.param1 = shift
end
local function scriptedBrickWallLPF( state )
!local maxBin = state.maxBin
!local cutoff = state.param2 * maxBin
!local setBin = setBin
!for i=cutoff,maxBin,1 do
!!setBin( i, 0, 0 )
!end
end
local function scriptedBrickWallHPF( state )
!local maxBin = state.maxBin
!local cutoff = state.param2 * maxBin
!local setBin = setBin
!for i=0,cutoff,1 do
!!setBin( i, 0, 0 )
!end
end
local function scriptedBPF( state )
!local maxBin = state.maxBin
!local cutoff = state.param2 * maxBin
!local depth = state.param3 ^ 2
!if depth <= 0 then return end
!local multiplyBin = multiplyBin
!for i=0,cutoff,1 do
!!local factor = 1 - ( cutoff - i ) * depth
!!if factor < 0 then factor = 0 end
!!multiplyBin( i, factor )
!!-- equivalently
!!-- local re, im = getBin( i )
!!-- setBin( i, re * factor, im * factor )
!end
!for i=cutoff,maxBin,1 do
!!local factor = 1 - ( i - cutoff ) * depth
!!if factor < 0 then factor = 0 end
!!multiplyBin( i, factor )
!!-- equivalently
!!-- local re, im = getBin( i )
!!-- setBin( i, re * factor, im * factor )
!end
end
local function scriptedGate( state )
!local maxBin = state.maxBin
!local threshold = state.param2
!local magnitude = 0
!local getBinMagnitudeSqr = getBinMagnitudeSqr
!local zeroBin = zeroBin
!threshold = threshold * (maxBin-1) / 32