Need help with math - Home Theater Forum and Systems - HomeTheaterShack.com

Old 12-21-12, 05:43 AM Thread Starter
Shackster

Join Date: Dec 2011
Posts: 6
Need help with math

Hello, I'm trying to send OSC (Open Sound Control) commands to apQualizr to automate equalizer creation. For testing I use OSC2VST and OSCControl Editor (and Bidule if I need to see the output of a plugin's parameter). The final goal is to use the C# Bespoke Open Sound Control Library (or other?)

The problem is that the range of values that OSC can send are floats from 0 to 1. The gain parameter is not a problem because it's fixed (1dB = 0.0125), but it's not the case for freq and bandwidth.

Freq (min and max):
0.000003 -> 20 Hz
0.5 -> 650.66 Hz
0.999997 -> 21168 Hz

Bandwidth (min and max):
0.00791 -> 0.010 8va
0.5 -> 2.007 8va
0.99997 -> 8 8va

Could someone help with the formula to convert from a 0-1 range to real world values?

The filter must be first created manually, before accessing it (start from a default preset that contains 20 random filters. With Bidule, it's possible to control presets with OSC).

Last edited by sikus; 12-21-12 at 08:39 AM.
sikus is offline

Old 12-21-12, 12:13 PM Thread Starter
Shackster

Join Date: Dec 2011
Posts: 6
Re: Need help with math

OK, I have found the answer for Frequency:

R = Range values
F = Frequency values

a = (Rmax - Rmin) / ( ln(Fmax) - ln(Fmin) )
b = Rmin - a * ln(Fmin)
R = a * ln(F) + b

But it doesn't work for Bandwidth. It works only when applied to max and min values. Any idea?
sikus is offline

 Bookmarks

 Tags math

Message:
Options

## Register Now

Random Question
Random Question #2

User Name:
OR

## Log-in

Human Verification

In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.