Code: Select all
rdax pot1,-1.0 ; ACC = POT1 * -1.0
sof 1,0.999; ACC = ACC + 0.999
Moderator: frank
Code: Select all
rdax pot1,-1.0 ; ACC = POT1 * -1.0
sof 1,0.999; ACC = ACC + 0.999
Code: Select all
skp run,endclr
wrax wf1,0
wrax wf2,0
endclr:
;sum inputs to mono:
rdax adcl,1
rdax adcr,1
wrax mono,0
;Now do wah, a 2 pole LPF, peaking.
;begin by getting control level into detector:
rdax mono,1 ;get input
absa ;absolute value
rdfx avg,0.3 ;average input level
wrax avg,0 ;write avg level, pass on
rdax lavg,0.001
sof -0.01,0
rdax lavg,1
wrax temp,0
rdax avg,1
maxx temp,1 ;filter a long average
wrax lavg,0
;now set up a means by which the sensitivity control can affect the filter frequency:
rdax lavg,1
sof 1,0.002 ;never let lavg go to zero
log 1,0
wrax temp,0
rdax avg,1
log 1,0
rdax temp,-1
mulx pot1
mulx pot1
exp 1,0
rdfx ffil,0.0005
wrax ffil,1
sof 0.7,0.02 ;limit frequency range
wrax wf,0
;get wfq value from pot2:
rdax pot1,1
mulx pot1
sof -0.2,0.25 ;make 0.3 to 0.05
wrax wq,0 ;write Q value (pos number)
;do filter:
rdax wf1,1
mulx wf
rdax wf2,1
wrax wf2,-1
rdax mono,1
wrax temp,0 ;save signal
rdax wf1,-1
mulx wq
rdax temp,1
mulx wf
rdax wf1,1
wrax wf1,0 ;finished with biquad filter.
;derive bypass signal from pot2:
rdax pot1,1
mulx pot1
rdax bypass,0.9 ;recursive gain
wrax bypass,0
;now combine outputs to make a wahout signal
rdax mono,-1
rdax wf2,1
mulx bypass
rdax mono,1
wrax wahout,0
wrax dacl,1
wrax dacr,0