Stupid questions. For beginners.

Algorithm development and general DSP issues

Moderator: frank

frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

Odd, I've had this question a lot lately, basically multiply the pot by -1 and add 1:

Code: Select all


rdax pot1,-1.0 ; ACC = POT1 * -1.0
sof 1,0.999; ACC = ACC + 0.999 

Frank Thomson
Experimental Noize
Alex MAK
Posts: 89
Joined: Fri Nov 05, 2010 1:00 pm

Post by Alex MAK »

Thank you, Frank. This is exactly what I need!
Alex MAK
Posts: 89
Joined: Fri Nov 05, 2010 1:00 pm

Post by Alex MAK »

Hi, guys! Please tell me how to add this code to the sensitivity and decay.
sensitivity - pot0, decay - pot2.

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
Alex MAK
Posts: 89
Joined: Fri Nov 05, 2010 1:00 pm

Post by Alex MAK »

Hey, guys! I want to control the speed of response filter with POT0. I understand that I need to make this change in the envelope detector. I do not know what piece of the detector to change. I need your help or hint.
Post Reply