Looper's Delight Archive Top (Search)
Date Index
Thread Index
Author Index
Looper's Delight Home
Mailing List Info

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Date Index][Thread Index][Author Index]

Re: Mobius scripts audio examples



You can't yet specify a non-semitone rate shift value.  That's coming soon....

I don't know if it helps but here is the formula for converting a +/- semitone rate 
shift into a floating point number.

/**
 * The frequency factor between two semitones.  
 * This is 2^1/12
 */
#define SEMITONE_FACTOR 1.059463f

float Resampler::getScaleRate(int degree)
{
float rate = 1.0;

if (degree > 0) {
// speed up
rate = (float)pow(SEMITONE_FACTOR, degree);
}
else if (degree < 0) {
// slow down, abs and invert
rate = (1.0f / (float)pow(SEMITONE_FACTOR, -degree));
}

return rate;
}

You can then divide the loop length by this number to get the new loop length.
There may be some round-off error but it should be fairly close.

Jeff



On Thu, Mar 3, 2011 at 2:17 PM, Keith Smith <kahsmith@gmail.com> wrote:
Simeon, you are much farther along on scripting than I am. Can you actually specify a non-semitone value?
Also, I'm thinking the math is not quite on -that the rate factor should actually be the reciprocal of the values in the /cycle (1/ratio) column eg. half triplet = 1/.33333=3
k