Spin Semiconductor Forum Index Spin Semiconductor
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tone Control

 
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> Algorithm development
View previous topic :: View next topic  
Author Message
frotaitalos



Joined: 07 Feb 2018
Posts: 8
Location: Brazil

PostPosted: Thu Mar 29, 2018 7:49 am    Post subject: Tone Control Reply with quote

Hi everyone, this is my first post in the forum, I apologize for the lack of knowledge.

I want to create a tone control for various reverb algorithms that I have modified, my idea is to read the signal input, apply the frequency cut and direct the signal to the reverb. I made several attempts based on the FV-1 documentation, but I did not even get close to achieving this, could anyone help me, or could anyone already have this code created I could share here? I appreciate your help. The idea is that when the pot is at 1 the filter will let pass all the frequencies that the instrument generates, and when it is at 0 it will pass frequencies below 600Hz, basically it is a low pass filter with frequency controlled by the pot.

I have searched a lot here in the forum and found some topics regarding my doubt but none of them finalized the tone adjustment code, I am sending below the code that I have so far.
;
equ LPF reg0
equ tone reg1

; pot tone
rdax pot0, 1
sof 0.570642354 , 0.0383933837
wrax tone, 0
;
ldax adcl
rdfx LPF, 1
mulx tone
wrax LPF, 1
wrax dacl, 0

With this code, when the potentiometer is set to zero, the volume goes to zero practically.
Back to top
View user's profile Send private message
Aaron



Joined: 04 Mar 2015
Posts: 46

PostPosted: Thu Mar 29, 2018 8:49 am    Post subject: Reply with quote

No need to apologize for asking a question!

You should start by reading though the knowledge base, particularly this section on low pass filters. It explains the behavior of the algorithm and provides the formula for the cutoff frequency. You should also take a look at the instructions and syntax for RDFX. You will need to deconstruct RDFX so that you can vary K.
Back to top
View user's profile Send private message
frotaitalos



Joined: 07 Feb 2018
Posts: 8
Location: Brazil

PostPosted: Thu Mar 29, 2018 8:53 am    Post subject: Reply with quote

Aaron wrote:
No need to apologize for asking a question!

You should start by reading though the knowledge base, particularly this section on low pass filters. It explains the behavior of the algorithm and provides the formula for the cutoff frequency. You should also take a look at the instructions and syntax for RDFX. You will need to deconstruct RDFX so that you can vary K.


Thanks for the help, my friend, I am currently working on studying the knowledge base and scribbled new lines of code


equ temp reg0
equ fcon reg1
equ fil 0.1

; pot pot
rdax pot0, 1
sof 1, 0
wrax fcon, 0
;
rdax dacl, 1
wrax temp, -1
rdfx fil, 0.1
wrhx fil, -1
mulx fcon
rdax temp, 1
wrax dacl, 0

But unfortunately I still do not get a signal at the exit
Back to top
View user's profile Send private message
Aaron



Joined: 04 Mar 2015
Posts: 46

PostPosted: Thu Mar 29, 2018 9:10 am    Post subject: Reply with quote

This implementation is a shelving filter. You may want to take a look at the input of the filter to make sure you are reading the proper register.
Back to top
View user's profile Send private message
frotaitalos



Joined: 07 Feb 2018
Posts: 8
Location: Brazil

PostPosted: Thu Mar 29, 2018 9:16 am    Post subject: Reply with quote

Aaron wrote:
This implementation is a shelving filter. You may want to take a look at the input of the filter to make sure you are reading the proper register.


I really can not identify the problem, my knowledge with the language of FV-1 is low, my experience is only with C / C +
Back to top
View user's profile Send private message
Aaron



Joined: 04 Mar 2015
Posts: 46

PostPosted: Thu Mar 29, 2018 9:45 am    Post subject: Reply with quote

The combination of RDFX and WRAX creates a simple lpf. In order to modulate the cutoff frequency we need to deconstruct RDFX. Looking at the block diagram of RDFX:



and assuming the input of the filter is in ACC, we see that RDFX perfoms

ACC - Register * K + register

If we start to reconstruct this without using RDFX it would look like

RDAX input,1
RDAX filter,-1
mulx K
RDAX filter

The only thing left to do is update the filter register.
Back to top
View user's profile Send private message
frotaitalos



Joined: 07 Feb 2018
Posts: 8
Location: Brazil

PostPosted: Thu Mar 29, 2018 10:40 am    Post subject: Reply with quote

Aaron wrote:
The combination of RDFX and WRAX creates a simple lpf. In order to modulate the cutoff frequency we need to deconstruct RDFX. Looking at the block diagram of RDFX:



and assuming the input of the filter is in ACC, we see that RDFX perfoms

ACC - Register * K + register

If we start to reconstruct this without using RDFX it would look like

RDAX input,1
RDAX filter,-1
mulx K
RDAX filter

The only thing left to do is update the filter register.


Dude I got a lot of doubts now Laughing

1st: Should I read the adcl signal and record in input?
2: Should I register "filter" in some reg?
3rd: To get the output signal I should insert "WRAX dacl, 0" below "RDAX filter, 0?
Back to top
View user's profile Send private message
Aaron



Joined: 04 Mar 2015
Posts: 46

PostPosted: Fri Mar 30, 2018 5:57 am    Post subject: Reply with quote

Input, Filter, and K were all just used for the sake of example. "Input" should be whatever register you are using for the input to the filter, "Filter" is whatever you want to call your lpf, and "K" is whatever you want to call the cutoff frequency coefficient.

In order to finish the low pass filter you will need to update the "filter" register by writing the output of our additions and multiply to it (WRAX filter).
Back to top
View user's profile Send private message
frotaitalos



Joined: 07 Feb 2018
Posts: 8
Location: Brazil

PostPosted: Sat Mar 31, 2018 5:57 am    Post subject: Reply with quote

Aaron wrote:
Input, Filter, and K were all just used for the sake of example. "Input" should be whatever register you are using for the input to the filter, "Filter" is whatever you want to call your lpf, and "K" is whatever you want to call the cutoff frequency coefficient.

In order to finish the low pass filter you will need to update the "filter" register by writing the output of our additions and multiply to it (WRAX filter).


I have tried this, but I have no signal at the output, can you help me to identify the error?

equ input reg0
equ filter 0.8
equ k reg2

; input filter
rdax adcl, 0.5
rdax adcr, 0.5
wrax input, 0

;pot control
rdax pot1, 1
sof 1, 0
wrax k, 0
;

rdax input, 1
rdax filter, -1
mulx k
rdax filter, 1
wrax filter, 0
wrax dacl, 1
wrax adcl, 0
Back to top
View user's profile Send private message
frank



Joined: 19 Oct 2005
Posts: 984

PostPosted: Sat Mar 31, 2018 1:35 pm    Post subject: Reply with quote

You define "filter" as 0.8 but then do "RDAX filter" and RDAX expects a register not a decimal value as the first parameter.
_________________
Frank Thomson
Experimental Noize
Back to top
View user's profile Send private message Visit poster's website
frotaitalos



Joined: 07 Feb 2018
Posts: 8
Location: Brazil

PostPosted: Mon Apr 02, 2018 9:10 am    Post subject: Reply with quote

frank wrote:
You define "filter" as 0.8 but then do "RDAX filter" and RDAX expects a register not a decimal value as the first parameter.



Hi Frank, I have modified what you said and now I have a high pass filter controlled by the potentiometer, but I want a low pass filter. I changed the "rdfx" and "wrlx" commands to "rdax" and wrax "but I do not get a low-pass filter, it works almost like a volume.

The code below is what works as a high-pass filter



equ input reg0
equ filter reg1
equ k reg2
equ temp reg3



;pot control
rdax pot1, 1
sof 0.9, 0
wrax k, 0
;

; input filter
rdax adcl, 1
rdax adcr, 1
wrax input, 0
;
rdax input, 1
wrax temp, -1
rdfx filter, 0.4
wrlx filter, -1
mulx k
rdax temp,1
wrax dacl, 1
Back to top
View user's profile Send private message
frotaitalos



Joined: 07 Feb 2018
Posts: 8
Location: Brazil

PostPosted: Mon Apr 02, 2018 2:01 pm    Post subject: Reply with quote

frotaitalos wrote:
frank wrote:
You define "filter" as 0.8 but then do "RDAX filter" and RDAX expects a register not a decimal value as the first parameter.



Hi Frank, I have modified what you said and now I have a high pass filter controlled by the potentiometer, but I want a low pass filter. I changed the "rdfx" and "wrlx" commands to "rdax" and wrax "but I do not get a low-pass filter, it works almost like a volume.

The code below is what works as a high-pass filter



equ input reg0
equ filter reg1
equ k reg2
equ temp reg3



;pot control
rdax pot1, 1
sof 0.9, 0
wrax k, 0
;

; input filter
rdax adcl, 1
rdax adcr, 1
wrax input, 0
;
rdax input, 1
wrax temp, -1
rdfx filter, 0.4
wrlx filter, -1
mulx k
rdax temp,1
wrax dacl, 1


Now I was able to create the low-pass filter controlled by the pot, I just had to change "wrlx" to "wrhx" and the filter worked perfectly. Thanks for everyone's help.
Back to top
View user's profile Send private message
frotaitalos



Joined: 07 Feb 2018
Posts: 8
Location: Brazil

PostPosted: Tue Apr 03, 2018 9:37 am    Post subject: Reply with quote

frotaitalos wrote:
frotaitalos wrote:
frank wrote:
You define "filter" as 0.8 but then do "RDAX filter" and RDAX expects a register not a decimal value as the first parameter.



Hi Frank, I have modified what you said and now I have a high pass filter controlled by the potentiometer, but I want a low pass filter. I changed the "rdfx" and "wrlx" commands to "rdax" and wrax "but I do not get a low-pass filter, it works almost like a volume.

The code below is what works as a high-pass filter



equ input reg0
equ filter reg1
equ k reg2
equ temp reg3



;pot control
rdax pot1, 1
sof 0.9, 0
wrax k, 0
;

; input filter
rdax adcl, 1
rdax adcr, 1
wrax input, 0
;
rdax input, 1
wrax temp, -1
rdfx filter, 0.4
wrlx filter, -1
mulx k
rdax temp,1
wrax dacl, 1


Now I was able to create the low-pass filter controlled by the pot, I just had to change "wrlx" to "wrhx" and the filter worked perfectly. Thanks for everyone's help.


Hi Guys, I now have my lowpass filter working but it generates a noise when I raise the -3db bridge of the filter, I am sending the code below and I hope someone helps me to eliminate that noise.

rdax input, 1
wrax temp, -1
rdfx filter, 0.1
wrhx filter, -1
mulx krf
rdax temp,1
wrax mono, 0

This above is the code I am using, I made another code where I insert another fixed low pass filter to try to eliminate the noise but I did not succeed.
rdax input, 1
wrax temp, -1
rdfx filter, 0.1
wrhx filter, -1
mulx krf
rdax temp,1
rdax reg11,1
rdfx reg11,0.4935583443
wrax reg11,0.0000000000
wrax mono, 0
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Spin Semiconductor Forum Index -> Algorithm development All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group