I found here a code of delay effect with 8 seconds delay. I think this processor is amazing that it can do something like that
But there is a little problem - sound quality is very bad. Frank, you helped me a few times, I think this time you also help. Here's code:
Code: Select all
equ input reg0
equ loop reg1
equ temp reg2
equ output reg4
mem delay 32767
; Get input, filter it to avoid aliasing (not shown)
rdax adcl, 1
rdax adcr, 1
; (filter here)
wrax input, 0
; IF loop counter variable is 0, THEN read an input sample and put it in the temp variable.
rdax loop, -1
skp neg, NotZro
ldax input
wrax temp, 0
NotZro:
; Put the temp variable in the head-end of the delay.
ldax temp
wra delay, 0
; Get a delayed sample out of the tail end of the delay, put it in the temp variable.
rda delay+32767, 1
wrax temp, 0
; Add 0.1 to the loop counter.
ldax loop
sof 1, 0.1
wrax loop, 1
; IF loop counter is > 0.8, THEN write the temp variable to the output, and reset loop variable to 0
sof 1, -0.8
skp neg, Done
ldax temp
wrax output, 0
wrax loop, 0
Done:
; Done, write output (you really need to filter it again here)
ldax output
wrax dacl, 1
wrax dacr, 0
BTW - I use 40kHz crystal for full 20kHz bandwidth, is that a problem ?