Page 1 of 1

Problem with controlling LFO

Posted: Fri Oct 01, 2021 2:37 am
by ZibiSound
Hello,
I got a problem with controlling LFO (sin0). Here's the code:

Code: Select all

skp	run, 1
wlds	sin0, 0, 32767

rdax	pot0, 0.1
wrax	sin0_rate, 0
cho	rdal, sin0
wrax	dacr, 0
And, when I set pot0 to 1 (sin0_rate = 0.1), period of generated sinwave is ~340ms. But when I set pot0 to 0.1 (sin0_rate = 0.01), period isn't 3,4s as I expected, but 5,7s. Why?
How to control it linearly?

Re: Problem with controlling LFO

Posted: Sat Oct 02, 2021 2:10 pm
by frank
Have you looked at the equations and mapping of bits for sinX_rate in AN-0001?

Re: Problem with controlling LFO

Posted: Sat Oct 02, 2021 10:12 pm
by ZibiSound
You mean 2^17/(2*pi*f/R) formula?
If the rate register is 9-bit, there are only 512 frequency change "posibilities"?

Re: Problem with controlling LFO

Posted: Sun Oct 03, 2021 9:58 am
by frank
It is a limited range LFO designed for things like chorus, etc. If you want a really wide ranging sin generator with lots of resolution you will have to code it up by hand and maybe use 2 POTs for a coarse and fine adjustment. In most effects the absolute frequency is unimportant, it is what sounds good that is important so a limit of 512 steps is fine, after all how many steps do you need between 0.1 and 20hz?

Re: Problem with controlling LFO

Posted: Sun Oct 03, 2021 10:23 am
by ZibiSound
Honestly, I need 1ms accuracy. It will be beat-synced fx.

Re: Problem with controlling LFO

Posted: Sun Oct 03, 2021 10:31 am
by frank
Then you will probably need to code it by hand to get the desired range and resolution and not use the built in LFOs.