Page 1 of 1

feedback loop

Posted: Fri Jun 19, 2015 12:11 pm
by tjm215
trying to make a feedback loop - connect the input to the output. It can be done with hardware I know but I would like to do it with code. any idea? looking to have one of the pots control the level of feedback.

thanks!

Posted: Fri Jun 19, 2015 2:22 pm
by frank
Just write the final output to a register as well as the DAC then in the code read the register where you want the feedback.

Posted: Sat Jun 20, 2015 12:57 pm
by tjm215
thats what im trying but when I have the knob controlling the feedback also controls the effect level when I try that

heres the relevant part of the code im working on

Code: Select all

ldax adcl
rdax fbk,1
wra delayl,0

cho rda,RMP0,REG|COMPC,delayl 
cho rda,RMP0,,delayl+1 
wra temp,0 
cho rda,RMP0,RPTR2|COMPC,delayl  
cho rda,RMP0,RPTR2,delayl+1 
cho sof,RMP0,NA|COMPC,0 
cho rda,RMP0,NA,temp 

wrax fbk,0
rdax fbk,1
mulx pot1

wrax dacl,0

Posted: Sat Jun 20, 2015 9:51 pm
by frank
Do you want the pot to control both? If not then do the mulx at the top where you read the feedback not at the bottom where you write it to a register. Basically:

.
.
rdax fbk,1
mulx pot1
wra delayl,0
.
.
.
wrax fbk, 1.0
wrax davl, 0

Posted: Mon Jun 22, 2015 6:50 am
by tjm215
ok Ive got this and im still having the same problem. no sound with pot1 turned all the way down

Code: Select all

lldax ADCL
rdax fbk,1
mulx pot1
wra delayl,0
cho rda,RMP0,REG|COMPC,delayl 
cho rda,RMP0,,delayl+1 
wra temp,0 
cho rda,RMP0,RPTR2|COMPC,delayl 
cho rda,RMP0,RPTR2,delayl+1 
cho sof,RMP0,NA|COMPC,0 
cho rda,RMP0,NA,temp 
wrax fbk,1 
wrax DACL,0 

Posted: Mon Jun 22, 2015 9:09 am
by frank
Look at the first three lines of your program and think about what is happening to the accumulator.

Posted: Mon Jun 22, 2015 9:40 am
by tjm215
aha! got it! thanks a million frank

Code: Select all

ldax adcl
rdax fbk,.6 
mulx pot1
rdax adcl,1
wra delayl,0 
cho rda,RMP0,REG|COMPC,delayl 
cho rda,RMP0,,delayl+1 
wra temp,0 
cho rda,RMP0,RPTR2|COMPC,delayl 
cho rda,RMP0,RPTR2,delayl+1 
cho sof,RMP0,NA|COMPC,0 
cho rda,RMP0,NA,temp 
wrax fbk,1 
wrax DACL,0

Posted: Mon Jun 22, 2015 12:04 pm
by frank
Close, and will sound almost right but remove the first 4 lines and replace with:

ldax fbk
mulx pot1
rdax adcl,1

Posted: Mon Jun 22, 2015 5:27 pm
by tjm215
Great thanks. I'm not sure I notice much of a difference but it saves me a line of code so I'll take it. Thanks a lot frank