# 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
{"ft_lang_label":"__label__en","ft_lang_prob":0.9161551,"math_prob":0.9073343,"size":928,"snap":"2022-27-2022-33","text_gpt3_token_len":237,"char_repetition_ratio":0.0995671,"word_repetition_ratio":0.0,"special_character_ratio":0.23275863,"punctuation_ratio":0.12135922,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96715504,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-06-29T04:17:57Z\",\"WARC-Record-ID\":\"<urn:uuid:32a91e78-2620-413d-a582-fdd192e5c6ff>\",\"Content-Length\":\"26864\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6d6afb41-fe64-4223-a683-860c74783776>\",\"WARC-Concurrent-To\":\"<urn:uuid:077f7cc5-9c17-4130-8d4b-d1379624dee5>\",\"WARC-IP-Address\":\"192.237.163.93\",\"WARC-Target-URI\":\"https://forum.openframeworks.cc/t/exponential-scaling-math-nerds-where-are-you/29372\",\"WARC-Payload-Digest\":\"sha1:UHTVKTUOBAMW4QNJPBB4IBHCHB6ZRBWX\",\"WARC-Block-Digest\":\"sha1:HPDN4MTPHL7UALI5FY5SFYQOXL6QQJVS\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656103620968.33_warc_CC-MAIN-20220629024217-20220629054217-00502.warc.gz\"}"}