VST plugin parameter scaling problem

HighHarmonics's icon

I'm using an EQ VST~ plugin in Max and sending parameter data to change band filter frequency, gain and Q values dynamically. I have the parameter mapping worked out and value changes get to the plugin fine.

The problem is how to scale the frequency values. The plugin requires values of 0 -> 1 for all parameters, and I need to send in an exact frequency value, like 50 Hz or 258 Hz, etc. I've tried the scale object with the exponential arg set as low as it goes, but the scaling is still off. The plugin accepts frequency values from 10 to 30,000, so I tried:

scale 10 30000 0. 1. ## linear scaling spread equally
scale 10 30000 0. 1. 0.000001 ## the very low exp value gives a better spread, but it is still way off.

Desired outcome:
The frequency value I specify is translated correctly to the normalized 0. to 1 value.

My approach would be to skip the scale object and write a mathematical expression that converts frequency into 0 -> 1 values. But I don't know how to do this.

Any ideas?

Roman Thilenius's icon

log10 is most likely, but you should also try log 20, log 90, or pow - before you ask the dev.

frequency to 0-1 (as present in RNBO or flowstone) will only be possible if you know what the plug-in does on the other end, i.e. you still needed to know the min and max - as well as the scaling method.

but if you have luck, ftom / 127. might do it, because they might have just used MIDI as starting point.

(however, the min and the max for the formula used in the plug-in is not neccessarily the same min and max as in its GUI.)

HighHarmonics's icon

Thanks Roman!

log10 works, but I had to scale it, with 1 -> 4.477121 mapped to 0. -> 1. The plugin has a frequency range of 10 - 30,000, and the output of log10(30000) = 4.477121, so that is the scale value. The result is an exact frequency mapping.

ftom / 127. was in the ballpark for lower freq, but got off base with higher values.
I appreciate the suggestions.