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.