Simple Guitar Echo

Algorithm development and general DSP issues

Moderator: frank

Post Reply
hkwijhe
Posts: 7
Joined: Sun Jun 14, 2009 2:39 am

Simple Guitar Echo

Post 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

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

Post by frank »

Will have to give this a try when I'm in the office!
Frank Thomson
Experimental Noize
differo
Posts: 22
Joined: Fri Feb 26, 2010 8:01 pm

Post by differo »

Bump! Frank have you had chance to try this? I could try this too if it works!
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

Yup, sounds nice.
Frank Thomson
Experimental Noize
differo
Posts: 22
Joined: Fri Feb 26, 2010 8:01 pm

Post 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 :)
Mcfly
Posts: 46
Joined: Fri Mar 08, 2013 2:38 pm
Location: Argentina

Re: Simple Guitar Echo

Post 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

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

Post 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
Frank Thomson
Experimental Noize
Post Reply