;@ map DLY500
;@ map CLA001

;@ ins a
;@ outs a
opcode DelayA, 0, kkkkkkkk
	kTime, kFB, kFilter, kDW, kOn, kRange, kIn, kOut xin
; TODO add filter
	ain zar kIn

	if kRange == 0 then
    kTime table kTime, giDLY500
  elseif kRange == 1 then
    kTime table kTime, giDLY_1s
  elseif kRange == 2 then
    kTime table kTime, giDLY_2s
  elseif kRange == 3 then
    kTime table kTime, giDLY2p7
	endif

	kFdbk table kFB, giCLA001
	kDW table kDW, giCLA001

	abuf delayr 2.7 ;max time
	atap deltapi kTime
	delayw ain+atap*kFdbk

	;no filter
	zaw atap*kDW+ain*(1-kDW), kOut
endop
