MOscillator: What's the Formula to convert Parameter value to Frequency and vise versa?

Official support for: meldaproduction.com
Post Reply New Topic
RELATED
PRODUCTS

Post

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?

Post

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?
the frequency is logarithmic, it seems. but the formula? perhaps this already can help.

Post

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 :D
Vojtech
MeldaProduction MSoundFactory MDrummer MCompleteBundle The best plugins in the world :D

Post Reply

Return to “MeldaProduction”