Page 2 of 2

Re: The formula for the 100dB stroke fader?

Posted: 23 Jan 2012 17:19
by jjlemur
Thanks guys!

I got the C-programming from the manufacturer instead the formula. I don't know if it works or even where I can plug those information in my fader on the Lemur app fader. Could you guys help me out?

It is like this-

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

float DoUnlog(float val) {return (float) pow(10.0f, val/80.0f);}

static float MapFloatValue(float v)
{
const float _minLogResult = DoUnlog(-90.0f);
const float _maxLogResult = DoUnlog(+10.0f);
return (DoUnlog((v*100.0f)-90.0f)-_minLogResult)/(_maxLogResult-_minLogResult);
}

static float GetPositionPercentForDecibelValue(float dB)
{
return MapFloatValue((dB+90.0f)/100.0f);
}

int main(int argc, char ** argv)
{
if (argc < 2)
{
printf("Usage: ./a.out -15dB\n");
return 5;
}

float dB = atof(argv[1]);
float percent = GetPositionPercentForDecibelValue(dB)*100.0f;
printf("%.02fdB corresponds to a fader position at %.02f%%\n", dB, percent);
return 0;
}


Thanks for your help!

JJ

Re: The formula for the 100dB stroke fader?

Posted: 23 Jan 2012 17:25
by jjlemur
Hi guys,

Or even I got this information. Can we get any formula from these data?
10.00dB corresponds to a fader position at 100.00%
0.00dB corresponds to a fader position at 73.50%
-10.00dB corresponds to a fader position at 53.63%
-90.00dB corresponds to a fader position at 0.00%

Thanks
JJ