Echo for guitar

Algorithm development and general DSP issues

Moderator: frank

Post Reply
ice-nine
Posts: 192
Joined: Thu May 24, 2012 9:03 am

Echo for guitar

Post by ice-nine »

I have been messing around with an echo for guitar by modifying the OEM echo. This is an echo with controls for Delay level, feedback and Delay time, the Delay time also adjusts a filter so that at longer delays the HF rolls off quicker to try and simulate how a tape would roll off the Freq as its speed slows down.

The pot for HF roll off could work better if it was scaled as it is a little too clean at short delays and a little to much roll off at longer delays.
Would using an SOF command be the way to work this out ?

Code: Select all

;OEM1_5 Echo modified to use delay time pot to also adjust feedback filter,
;            a shorter delay time will give less HF roll off while longer delay time
;            will roll of the HF quicker. Hopefully to help simulate the freq response 
;            that tape speed (delay time) has on the feedback path.

;pot0 = Repeat feedback
;pot1 = Delay time/repeat damping
;pot2 = Echo Level

;The echo program allows a mono input to produce a mono output,
;delayed and repeated.

;The rather long delay can be used for dramatic performance effects,
;but at shorter delay settings, karaoke-style reverb is obtained.

;The delay is variable from 50 to 700mS (Fs=46KHz) 
;and depends on crystal frequency

mem	delay	32767

equ	potfil1	reg0
equ	potfil2	reg1
equ	interp	reg2
equ	lpf	reg3
equ	temp	reg4
equ	dout1	reg5
equ	dout2	reg6
equ	fbk	reg7
equ	dry_in	reg8
equ	fildel1	reg9
equ	fildel2	reg10

;read inputs, add to feedback and write to delay:

rdax	fbk,1		;read feedback value
mulx	pot0		;scale by pot0 value for feedback control
rdax	adcl,0.5		;read and add inputs	
rdax	adcr,0.5
wrax	dry_in,1
wra	delay,0		;write result to delay

;prepare read pointer based on pot1 setting:

rdax	pot1,1		;read pot value
sof	0.95,0.04	;limit delay range
rdfx	potfil1,0.001	;filter pot value
wrax	potfil1,1		;write filter register, keep in ACC
rdfx	potfil2,0.001
wrax	potfil2,1
wrax	addr_ptr,0	;load address pointer with first read position
rmpa	1		;read memory from pointer position
wrax	dout1,0		;store first value, clear ACC

;now get second  value:

or	%00000000_00000001_00000000	
rdax	potfil2,1		;get pointer back and add
wrax	addr_ptr,0	;load pointer again
rmpa	1
wrax	dout2,0		;store second value, clear accumulator

;now get an interpolation value:

rdax	potfil2,1
and	%00000000_00000000_11111111
sof	-2,0
sof	-2,0
sof	-2,0
sof	-2,0
sof	-2,0
sof	-2,0
sof	-2,0
sof	-2,0
sof	-2,0
sof	-2,0
sof	-2,0
sof	-2,0
sof	-2,0
sof	-2,0		
sof	1.999,0		;shift 15 paces
wrax	interp,0		;save in register

;now crossfade between delay read values using interp value:

rdax	dout2,1
rdax	dout1,-1
mulx	interp		;crossfade with interp
rdax	dout1,1

;now take this as the output, filter and arrange feedback:

wrax	fildel1,1		;write result to filter delay (fildel), full scale
wrax	fildel2,1		;keep in ACC
wrax	temp,1		;store in temp
rdfx	lpf,0.1		;filter signal
wrlx	lpf,-1		;acc is filtered
rdax	temp,-1		;negative filter input value
mulx	pot1		;crossfade around filter with pot1
rdax	temp,1		;filter in again, in phase
wrax	fbk,0		;write to feedback register

;now mix dry and delay to output

;rdax	dry_in,1
rdax	fildel1,1
rdax	fildel2,0
mulx	pot2
rdax	dry_in,1

wrax	dacl,1		;write result to both outputs
wrax	dacr,0	
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

SOF may be the answer but it may be more complex. I would determine the min and max coefficients to generate the desired sounds then map them to POT position and derive the equation from there. Usually a combination of RDAX and SOF will work. Let's say you want POT0 to range from 0.3 to 0.8 linearly, but pots range from 0 to 1 (well, 0.999 but treat it as 1):

MAX - MIN = 0.8 - 0.3 = 0.5

So code is:
SOF 0,0 ; clear ACC
RDAX POT0, 0.5 ; results in ACC value from 0 to 0.5
SOF 1.0, 0.3; ACC now ranges 0.3 to 0.8

Or:
SOF 0,0 ; clear ACC
RDAX POT0, 1.0; results in ACC value from 0 to 0.999
SOF 0.5, 0.3; ACC now ranges 0.3 to 0.8
Frank Thomson
Experimental Noize
ice-nine
Posts: 192
Joined: Thu May 24, 2012 9:03 am

Post by ice-nine »

Thanks Frank, I will use that in the code, prob won't get much chance now till after the holidays but I will post back the results when I get the chance.
Post Reply