Page 1 of 1

Adding the original back in with the affected signal

Posted: Sat Mar 06, 2010 5:35 pm
by B.C.
Hey guys,

So I have some algorithms I like, but I can't seem to add the original signal back in with the effected. I assume that this could be done by storing the original signal in a register and then reading it out and adding it with the affected. However, in trying this I get the clipping light to continually activate and no sound to be heard. Any suggestions will be great. O and just so you guys know I am new to the chip but have assembly experience.

~Brandon

Posted: Sat Mar 06, 2010 8:45 pm
by livingston
You should post your code, so we can see what you're doing exactly. But you don't need to save the original to a register, you can just read it again at the end, like:

rdax adcr,1 ;read input
;do some stuff, generate effected signal
mulx pot0 ;volume for effect
wrax effect,0 ;create effect register, clear accum
rdax adcr,.5 ;read clean again
mulx pot ;clean volume
rdax effect,.5 ;read in effect

wrax dacr,0 ;write to output

Posted: Sun Mar 07, 2010 3:13 am
by B.C.
Ok, very cool.

I would post the code but I already deleted it. I'll give this a shot and we can go from there.

Thank you for your help!

Posted: Sun Mar 07, 2010 2:24 pm
by livingston
No problem. :D I've only been at this for a couple of months, so after asking a ton of questions here, I'm happy to be able to answer one or two.

Posted: Sun Mar 07, 2010 2:46 pm
by B.C.
Ok, so I tried to incorporate the dry volume, but now all I get is unaffected signal. Here is some code:
equ effect reg14 ; Setting up register
;Processing
rda del1+2630, .5 ;sum outputs as taps from reverb ring
rda del2+1943, .7
rda del3+3200, 1
rda del4+4016, 1.5
wrax dacl, 0.0
;

Note, the increasing coeff. are for reverse reverb
;Clean blend
mulx POT2
wrax effect, 0
rdax adcl, .5
rdax effect, .5
wrax dacl, 0.0

Posted: Sun Mar 07, 2010 4:13 pm
by livingston
B.C. wrote:Ok, so I tried to incorporate the dry volume, but now all I get is unaffected signal. Here is some code:
equ effect reg14 ; Setting up register
;Processing
rda del1+2630, .5 ;sum outputs as taps from reverb ring
rda del2+1943, .7
rda del3+3200, 1
rda del4+4016, 1.5
wrax dacl, 0.0
;

Note, the increasing coeff. are for reverse reverb
;Clean blend
mulx POT2
wrax effect, 0
rdax adcl, .5
rdax effect, .5
wrax dacl, 0.0
Here's your problem in red. This line writes the effect to the left output (WRAX DACL) and the "0.0" part of that line clears the effected signal from the accumulator. You don't want to do either of those things. You need the effected signal to be in the accumulator before you write it to the "effect" register in order to use that code I posted, and also you don't really want to write to the same output twice (I actually don't know what effect this has, but there's no reason to do it and it could potentially screw things up).

Also, you removed the clean volume control, so if you take out the red line from above, it should work, but you won't have control over the clean volume. To do a mix control, which pans from 100% reverb to 100% clean, you do this:

Code: Select all

equ     effect    reg14 ; Setting up register
;Processing
rda     del1+2630,     .5     ;sum outputs as taps from reverb ring
rda     del2+1943,     .7
rda     del3+3200,     1
rda     del4+4016,     1.5
wrax   effect,     0

;Clean blend

RDAX  	effect,-1  	;read 'A' signal, with opposite sign
RDAX 	adcl,1 	;read 'B' signal, add to the A signal
MULX 	pot0 	;multiply by the xfade coefficient (pot derived)
RDAX 	effect,1 	;add back the A signal with correct sign
wrax         dacl,0

Posted: Sun Mar 07, 2010 6:19 pm
by B.C.
Makes sense! Thank you for all your help! Like I said, I have assembly language experience (Atmel AVR Micro) but this is a tad different. :)

Posted: Mon Mar 08, 2010 1:02 am
by livingston
Maybe sometime you can help me with AVRs...

Posted: Mon Mar 08, 2010 2:55 pm
by B.C.
More than happy to :)

Posted: Mon Mar 08, 2010 3:52 pm
by B.C.
Hey Livingston,
Just got done testing my algorithm and it is perfect. Thank you for all your help!

~Brandon

Posted: Mon Mar 08, 2010 8:51 pm
by livingston
Cool, glad I could help. I'll just take 5% of your profits as a consultant's fee. :wink: