simple 2 effects delay on right, reverb on left

Algorithm development and general DSP issues

Moderator: frank

Post Reply
jovesdies
Posts: 33
Joined: Wed Feb 25, 2009 3:55 am

simple 2 effects delay on right, reverb on left

Post by jovesdies »

Hi,
I'm trying to mod the echo-reverb program found in 3k programs to obtain delay on right channel and reverb on left channel.
I'm at work now and I can't test it
Is there anyone who can tell me if is it ok ?

Thanks.

... oh, here's the program :

;ECHO+REVERB.

;Pot0 = delay 100-500ms.
;Pot1 = repeat
;Pot2 = reverb (fixed parameters)

mem del 22938

mem ap1 123
mem ap2 245
mem ap3 625
mem ap4 856

mem lap1a 974
mem lap1b 1437
mem d1 1523

mem lap2a 1356
mem lap2b 1168
mem d2 1445

;write-first registers:

equ apout reg0
equ dout reg1
equ ef reg2

;read-first registers:

equ lf1 reg20
equ lf2 reg21
equ efil reg22

;constants:

equ krt 0.7
equ kshlf -0.5

;clear read-first registers and establish smoothing lFOs:

skp run,endclr
wrax lf1,0
wrax lf2,0
wrax efil,0
wlds sin0,25,100
wlds sin1,30,100
endclr:

;prepare delay control:

rdax pot0,1
and %01111110_00000000_00000000
sof 0.6,0.1 ;100 to 700mS
wrax addr_ptr,0

;write inputs to delay and involve feedback:

rdax efil,1 ;filtered echo out
mulx pot1 ;repeat control
rdax adcl,1.0
rdax adcr,1.0
wra del,1
mulx pot2 ;reverb control

;fall-through, do reverb:

rda ap1#,0.5
wrap ap1,-0.5
rda ap2#,0.5
wrap ap2,-0.5
rda ap3#,0.5
wrap ap3,-0.5
rda ap4#,0.5
wrap ap4,-0.5
wrax apout,0

rda d2#,krt
rdax apout,1
rda lap1a#,0.5
wrap lap1a,-0.5
rda lap1b#,0.5
wrap lap1b,-0.5
rdfx lf1,0.5
wrlx lf1,kshlf
wra d1,1.5
wrax dacl,0

rdax dout,1
wrax dacr,0

;now get dout with address pointer:

rmpa 1
wrax dout,0

;develop filter coefficient, ef, from pot1:
;make such that ef=1 if pot is zero or max,
;but reduces to 0.5 at mid scale

rdax pot1,1
sof 1,-0.5 ;make go -.5 to +0.5
sof 1.2,0 ;make go -0.6 to +0.6
absa ;now +0.6, 0, +0.6
sof 1,0.4 ;now 1, 0.4, 1
wrax ef,0 ;write echo filter coefficient

;now filter dout into eout:

rdax dout,1
rdax efil,-1
mulx ef
rdax efil,1
wrax efil,0


;smooth reverb delays:

cho rda,sin0,sin|reg|compc,d1+100
cho rda,sin0,sin,d1+101
wra d1+200,0

cho rda,sin1,sin|reg|compc,d2+100
cho rda,sin1,sin,d2+101
wra d2+200,0
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

I can't try it at the moment but nothing is jumping out at me as wrong. It looks like you are adding L+R into the reverb (you may want to change the coefficient to 0.5 here) and outputting the reverb on left and delay on right.

I notice you read the output of the delay then save it to dout and this is mixed into efil which is added to the reverb so you will still have the delay/echo in the reverb.
Frank Thomson
Experimental Noize
jovesdies
Posts: 33
Joined: Wed Feb 25, 2009 3:55 am

Post by jovesdies »

OK.
I've erased the instruction rdax adcr,1.0 to read only left channel on the reverb side.
How can I obtain only reverb on loft out and delay on right out ?

Thanks.
jovesdies
Posts: 33
Joined: Wed Feb 25, 2009 3:55 am

Post by jovesdies »

Ok.
I've changed the preogram to control reverb time.
I still have a problem: the delay feedback control the reverb too.
How can I separate reverb and delay ?

Thanks.

;ECHO+REVERB.

;Pot0 = delay 100-500ms.
;Pot1 = repeat
;Pot2 = reverb time

mem del 22938

mem ap1 123
mem ap2 245
mem ap3 625
mem ap4 856

mem lap1a 974
mem lap1b 1437
mem d1 1523

mem lap2a 1356
mem lap2b 1168
mem d2 1445

;write-first registers:

equ apout reg0
equ dout reg1
equ ef reg2
rt equ reg4
krt equ reg5

;read-first registers:

equ lf1 reg20
equ lf2 reg21
equ efil reg22

;constants:


equ kshlf -0.5

;clear read-first registers and establish smoothing lFOs:

skp run,endclr
wrax lf1,0
wrax lf2,0
wrax efil,0
wlds sin0,25,100
wlds sin1,30,100
endclr:

;prepare delay control:

rdax pot0,1
and %01111110_00000000_00000000
sof 0.6,0.1 ;100 to 700mS
wrax addr_ptr,0

;write inputs to delay and involve feedback:

rdax POT2,1.0
sof 0.7,0.2 ;rt ranges 0.2 to 0.9 pot 2 change reverb time
wrax krt,0

rdax efil,1 ;filtered echo out
mulx pot1 ;repeat control
rdax adcr,1.0

wra del,1


;fall-through, do reverb:

rda ap1#,0.5
wrap ap1,-0.5
rda ap2#,0.5
wrap ap2,-0.5
rda ap3#,0.5
wrap ap3,-0.5
rda ap4#,0.5
wrap ap4,-0.5
wrax apout,0

rda d2#,1.0
mulx krt
rdax apout,1
rda lap1a#,0.5
wrap lap1a,-0.5
rda lap1b#,0.5
wrap lap1b,-0.5
rdfx lf1,0.5
wrlx lf1,kshlf
wra d1,1.5
wrax dacl,0

rdax dout,1
wrax dacr,0

;now get dout with address pointer:

rmpa 1
wrax dout,0

;develop filter coefficient, ef, from pot1:
;make such that ef=1 if pot is zero or max,
;but reduces to 0.5 at mid scale

rdax pot1,1
sof 1,-0.5 ;make go -.5 to +0.5
sof 1.2,0 ;make go -0.6 to +0.6
absa ;now +0.6, 0, +0.6
sof 1,0.4 ;now 1, 0.4, 1
wrax ef,0 ;write echo filter coefficient

;now filter dout into eout:

rdax dout,1
rdax efil,-1
mulx ef
rdax efil,1
wrax efil,0


;smooth reverb delays:

cho rda,sin0,sin|reg|compc,d1+100
cho rda,sin0,sin,d1+101
wra d1+200,0

cho rda,sin1,sin|reg|compc,d2+100
cho rda,sin1,sin,d2+101
wra d2+200,0
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

I took a closer look at the code and with the way Keith originally wrote it I would suggest dropping this code and starting with a small reverb only program, get it working on only one channel then adding the delay program.

When doing 2 different programs in one box it is better to treat them completely independently, do one then the other. Trying to split a program like this that was designed to be a mixed effect is more work and will take more time and effort than starting with a small mono reverb program.
Frank Thomson
Experimental Noize
jovesdies
Posts: 33
Joined: Wed Feb 25, 2009 3:55 am

Post by jovesdies »

Here's another program. This time I am started with 2 different programs (a basic reverb and a delay) join together. The problem now is that delay feedback doesn't work .... mmh....

Here's the program :


;pot0 = feedback
;pot1 = Delay time
;pot2 = reverb time

mem delay 20000
ap1 mem 334
ap2 mem 556
ap3 mem 871

lap1a mem 808
lap1b mem 1934
d1 mem 2489

lap2a mem 1016
lap2b mem 1787
d2 mem 2287
;register equates:

apout equ reg1
lp1 equ reg2
lp2 equ reg3
rt equ reg4
krt equ reg5
equ pfil1 reg6
equ pfil2 reg7
equ nxtadd reg8
equ interp reg9
equ lpf reg10
equ temp reg11
equ dout1 reg12
equ dout2 reg13
equ fbk reg14

;declare constants:

kap equ 0.6 ;all pass coefficient

krf equ 0.9 ;reverb lpf freq
krs equ -0.6 ;reverb lpf shelf


;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 adcr,1 ;read and add inputs
wra delay,0 ;write result to delay


;set reverb time:

rdax POT2,1.0
sof 0.7,0.2 ;rt ranges 0.2 to 0.9
wrax krt,0

;prepare read pointer based on pot1 setting:

rdax pot1,1 ;read pot value
sof 0.93,0.07 ;limit delay range
rdfx pfil1,0.001 ;filter pot value
wrax pfil1,1 ;write filter register, keep in ACC
rdfx pfil2,0.001
wrax pfil2,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 pfil2,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 pfil2,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 dacr,1

skp run,REV
wrax lp1,0
wrax lp2,0
wlds sin0,12,100

REV:

rdax ADCL,1.0

;do reverb:

rda ap1#,kap
wrap ap1,-kap
rda ap2#,kap
wrap ap2,-kap
rda ap3#,kap
wrap ap3,-kap
wrax apout,0

rda d2#,1.0
mulx krt
rdax apout,1
rda lap1a#,kap
wrap lap1a,-kap
rda lap1b#,kap
wrap lap1b,-kap
rdfx lp1,krf
wrlx lp1,krs
wra d1,0

rda d1#,1.0
mulx krt
rdax apout,1
rda lap2a#,kap
wrap lap2a,-kap
rda lap2b#,kap
wrap lap2b,-kap
rdfx lp2,krf
wrlx lp2,krs
wra d2,1.99
rda d1,1.99

;output to right channel:
wrax DACL,1.0

;smooth reverb:

cho rda,sin0,sin|reg|compc,lap1b+100
cho rda,sin0,sin,lap1b+101
wra lap1b+200,0
cho rda,sin0,sin|reg|compc,lap2b+100
cho rda,sin0,sin,lap2b+101
wra lap2b+200,0
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

You have 'fbk' defined as reg 14 and you add it to the input of the delay but you never load fbk with anything. You should be loading fbk with the output of the delay.
Frank Thomson
Experimental Noize
Post Reply