I am sending an specc'ed integer (X) between -2048, and 2048 to a synthesizer to control its tuning.
When X is 0 = Tuning on Synth is 440 (default)
When X is 2048 = Tuning on Synth is 546.42
When X is -2048 = Tuning on Synth is 354.31
I want to change my slider so it's min is 354, max is 546, and default to 440.
The values available to work within the formula would be the raw slider value (354 thru 546), or a "normalized" slider value between 0 and 1.
When the slider would be at its default position (Normalized: 0.5, Displayed: 440), X would be 0.
When the slider would be at its min position (Normalized: 0.0, Displayed: 354), X would be -2048.
When the slider would be at its max position (Normalized: 1.0, Displayed: 546), X would be 2048.
What's the (programming language friendly pseudo-code) formula for getting X, and are there any things (besides bigger brain) that help for generating such formulae? :D
I assume you're trying to get the value of X from the normalized value and the tuning value is irrelevant.
Simply create a line from the point (0, -2048) to the point (1, 2048)
Slope $m=\frac{\Delta y}{\Delta x}=\frac{2048 + 2048}{1 - 0} = 4096$
Then, $y = mx + b$ so just substitute any xy pair into the equation and solve for $b$
$2048 = 4096 * 1 + b \\ b = -2048\\ y = 4096x -2048$