Page 1 of 1

Simple Guitar Echo

Posted: Sat Jul 11, 2009 11:14 am
by hkwijhe
Hi all,

Just wrote a simple guitar echo that does a pretty nice job.
Have fun,

Hans Kemper

Code: Select all

; Guitar Echo
; HK July 2009
; version 2.0
;
; mono in mono out
; pot0 = feedback amount (from no feedback = slap back to infinite feedback)
; pot1 = delay time (50 ms to 1 second with 32 kHz x-tal)
; pot2 = dry - wet mix
;
; only 20 thicks

;declare memory spaces:

mem	del	32767

;declare register equates:

equ	dout	reg0
equ	kfbk	reg1
equ        dry_in    reg2

;get feedback value from pot0:

wrax	kfbk,0
rdax	pot0,1
wrax	kfbk,0

;get address pointer from pot1:

rdax	pot1,1
and	%01111110_00000000_00000000	;don't make jumps too small
sof	61/64,3/64			;50 ms to 1 second
wrax	addr_ptr,0

;get output from delay:

rmpa	1
wrax	dout,0

;put input signals into delay, allowing for feedback:

rdax	dout,1
mulx	kfbk	
rdax	adcl,0.5
rdax	adcr,0.5
wrax      dry_in, 1
wra	del,0

; mix dry and wet using pot2

rdax	dout,1
rdax	dry_in,-1
mulx	pot2
rdax	dry_in,1

;form mono output:

wrax	dacl,1
wrax	dacr,0


Posted: Sat Jul 11, 2009 2:36 pm
by frank
Will have to give this a try when I'm in the office!

Posted: Mon Dec 20, 2010 8:45 am
by differo
Bump! Frank have you had chance to try this? I could try this too if it works!

Posted: Mon Dec 20, 2010 11:17 am
by frank
Yup, sounds nice.

Posted: Mon Dec 20, 2010 12:36 pm
by differo
Great! Just downloaded it, and build it to one eprom - works like a charm! My first build of something that isn't in the rom - feels good :)

Re: Simple Guitar Echo

Posted: Thu Mar 14, 2013 8:22 am
by Mcfly
Hi, regarding this echo code I'm getting a bit of noise (HF noise, hiss) when feedback is set to max. Even with nothing connected to the ADC inputs, noise becomes more noticeable as time passes. Is there any way to filter or avoid this noise?

Thanks.
hkwijhe wrote:Hi all,

Just wrote a simple guitar echo that does a pretty nice job.
Have fun,

Hans Kemper

Code: Select all

; Guitar Echo
; HK July 2009
; version 2.0
;
; mono in mono out
; pot0 = feedback amount (from no feedback = slap back to infinite feedback)
; pot1 = delay time (50 ms to 1 second with 32 kHz x-tal)
; pot2 = dry - wet mix
;
; only 20 thicks

;declare memory spaces:

mem	del	32767

;declare register equates:

equ	dout	reg0
equ	kfbk	reg1
equ        dry_in    reg2

;get feedback value from pot0:

wrax	kfbk,0
rdax	pot0,1
wrax	kfbk,0

;get address pointer from pot1:

rdax	pot1,1
and	%01111110_00000000_00000000	;don't make jumps too small
sof	61/64,3/64			;50 ms to 1 second
wrax	addr_ptr,0

;get output from delay:

rmpa	1
wrax	dout,0

;put input signals into delay, allowing for feedback:

rdax	dout,1
mulx	kfbk	
rdax	adcl,0.5
rdax	adcr,0.5
wrax      dry_in, 1
wra	del,0

; mix dry and wet using pot2

rdax	dout,1
rdax	dry_in,-1
mulx	pot2
rdax	dry_in,1

;form mono output:

wrax	dacl,1
wrax	dacr,0


Posted: Thu Mar 14, 2013 9:35 am
by frank
The way the code is written you have basically infinite feedback when the feedback pot is set at max. So everything will add up, including noise. If you look at the lines:

Code: Select all

;get feedback value from pot0:

wrax   kfbk,0
rdax   pot0,1
wrax   kfbk,0 
he just used the raw pot value as the feedback coefficient, you can try lowering the coefficient like:

Code: Select all

;get feedback value from pot0:

wrax   kfbk,0
rdax   pot0,0.9
wrax   kfbk,0 
which will limit the feedback coefficient to 0.9