I've currently got this bounty running on how to resample audio data with the intention of increasing the pitch.
Many solutions have been made and I have to admit I'm feeling a bit overwhelmed by the choices and information.
I was directed to this solution and found this chunk of code:
public static float InterpolateCubic(float x0, float x1, float x2, float x3, float t)
{
float a0, a1, a2, a3;
a0 = x3 - x2 - x0 + x1;
a1 = x0 - x1 - a0;
a2 = x2 - x0;
a3 = x1;
return (a0 * (t * t * t)) + (a1 * (t * t)) + (a2 * t) + (a3);
}
public static float InterpolateHermite4pt3oX(float x0, float x1, float x2, float x3, float t)
{
float c0 = x1;
float c1 = .5F * (x2 - x0);
float c2 = x0 - (2.5F * x1) + (2 * x2) - (.5F * x3);
float c3 = (.5F * (x3 - x0)) + (1.5F * (x1 - x2));
return (((((c3 * t) + c2) * t) + c1) * t) + c0;
}
This seems like something simple enough that I can wrap my head around, but I'm wondering how I input the amount I would want to increase my pitch by. Which leads me to the following questions:
The t argument of the first method takes a number between 0 and 1. Is this the factor by which I increase the pitch? Would that make 1 an increase of pitch of %100 (essentially double the speed)?.
If the above theory is correct am I able to input a factor of more then 1? If not, how would I be able to do this?
If by stating the above I've clearly shown that I'm totally off track would someone please help clairfy how I control the amount of increase in pitch using this method?
Thank you so much.