# Exponential Scaling (Math nerds, where are you!)

Hi! Here’s a more math problem than strictly oF one but dunno where to ask!

I’m working on a rPi project with oF which works with eurorack modular synthesisers.
How eurorack synths works is that oscillators have a 1v/octave response, i.e., when double the voltage is fed in the input, the frequency doubles. This works in a exponential scaling fashion.

Now, the range of bipolar control voltages in such a system is usually -5V to 5V. On my raspberry pi circuit, I’m scaling such voltages through an op amp into 0-3.3V to keep the Pi happy. All this works.

Now, I’d like to get an exponential response from this scaled 0-3.3V signal (that I’m getting as a float, between 0-1) that is in scale with the standard exponential response seen in the modular. Any ideas what kind of mapping/scaling I should be doing? I’m not doing audio, only video, so it doesn’t need to be perfectly precise, so a bit of ballpark would also be fine.

I usually use `pow(f,2)` for this kind of things (even with sound amplitudes…) you can adjust the curve by changing the exponent and since you are in the range of 0…1 any exponent will stay in that range as well

So ofMap it back to the 5V range and then use pow?

float v = ofMap(input, 0, 1, 0, 5);

This puts my scaled 0-3.3V back to the 0-5V original voltage range and then,

float response = pow(v, 2);

I’m guessing that’s how it should work? I’ll test soon.

There’s already a linear scale in place from which I want to get the exponential response so that’s where I’m a bit confused.

no, better pow before mapping otherwise the range won’t be preserved.

0^2 == 0
1^2 == 1

but 5^2 = 25