I am writing a helper script to chain MOscillator with other frequency-related FXs (in REAPER), and I need to retrieve the displayed Frequency value from the parameter value.
The problem is that the relationship between parameter value and the displayed frequency is not linear. Parameter value goes from 0 to 1 in floats, while displayed frequency goes from 20 Hz to 20.0 Hz, with Off as the first value.
I have many some comparisons in quarterly positions, although I'm pretty sure most of the values are rounded:
Parameter == Displayed
0 == Off
0.00001 == 20 Hz
0.25 == 112.5 Hz
0.5 = 632.5 Hz
0.75 == 3557 Hz
0.99964 == 20.0 kHz
1 == 20.0 kHz
My question is that what would be the formula for this function to work?
MOscillator: What's the Formula to convert Parameter value to Frequency and vise versa?
-
- KVRer
- 17 posts since 23 Jun, 2015 from Beijing
- KVRAF
- 3017 posts since 8 Jun, 2018
the frequency is logarithmic, it seems. but the formula? perhaps this already can help.RCJacH wrote: Sun Mar 07, 2021 11:08 pm I am writing a helper script to chain MOscillator with other frequency-related FXs (in REAPER), and I need to retrieve the displayed Frequency value from the parameter value.
The problem is that the relationship between parameter value and the displayed frequency is not linear. Parameter value goes from 0 to 1 in floats, while displayed frequency goes from 20 Hz to 20.0 Hz, with Off as the first value.
I have many some comparisons in quarterly positions, although I'm pretty sure most of the values are rounded:
Parameter == Displayed
0 == Off
0.00001 == 20 Hz
0.25 == 112.5 Hz
0.5 = 632.5 Hz
0.75 == 3557 Hz
0.99964 == 20.0 kHz
1 == 20.0 kHz
My question is that what would be the formula for this function to work?
Primoridal Music: sadà\exposadà - Indusrial & Expanding Your Mind Hurts: Sound Brut
-
MeldaProduction MeldaProduction https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=176122
- KVRAF
- 14339 posts since 15 Mar, 2008 from Czech republic
Hehe it's stretching 20..20k region logarithmically to 0..1, so like this:
exp(ln(20) + x * (ln(20000) - ln(20)))
Hopefully I didn't mess it
exp(ln(20) + x * (ln(20000) - ln(20)))
Hopefully I didn't mess it
