Sign in to follow this  

Scaling Question

This topic is 4278 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

First use a logarithmic mapping to get a linear range, and then map that to whatever other range you want. So if you had 220, 440, and 880, map that to log2(220) = 7.78, log2(440) = 8.78, and log2(880) = 9.78. Your're minimum could be log2(1) = 0, and your maximum could be log2(1048576) = 20, which you map to [-1, 1] or [0, 1] using standard linear shifting/scaling techniques.

Share this post


Link to post
Share on other sites
Quote:
Original post by Endemoniada
If my base is 440.0 and one level below is half and one level above is double I have 220.0...440.0...880.0, how do I map [-1.0,1.0] (or [0.0,1.0]) to that ? I'm confused because it's not linear.

#include <math.h>

double frequency(double octaves_from_A4){
return 440.0 * pow(2.0, octaves_from_A4);
}

Share this post


Link to post
Share on other sites

This topic is 4278 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this