Community Forums Archive

Go Back

Subject:Calculation error in SF5 pitch shifter.
Posted by: jonhallur
Date:11/30/2001 9:19:09 AM

I was changing a few beats from 160 to 120, and I have made a formula I use for this. In short it is based on 2 in the power of 1/12th for every half tone. This formula has never failed me, and I just punch in initial bmp and a new one and the formula calculates how many halftones and cents I have to pitch for desired effects. Until now I have trusted the SF5 pithing algorithms and never had any complaints. How ever, as I was working with 8 bars of 160 beats it was excactly 12 seconds long, and eight bars of 120 should be 16 seconds long. But when I punched in the values my trusty formula gave me I notice that the lenght was then 16.025, perhaps not the biggest difference in the world, but if this had been a whole song, I'd be off a second or two in the end. Well anyways I just wanted to share this, and perhaps before long we will get an update patch to fix this programming glitch.

Jón Hallur
Sound Engineer
CCP Games

Subject:RE: Calculation error in SF5 pitch shifter.
Reply by: vanblah
Date:11/30/2001 11:01:40 AM

I'm not sure how far you take your formula for the twelfth root of 2, but I do know that no matter how many places you take the decimal there are still inaccuracies when it comes to pitch in musical terms. Again, I don't want to second-guess the formulas (yours or Sonic Foundry's), but in equal-temperament (which I can only assume you are using) the thirds and fifths are flatted slightly to adjust the pitch.
ie:
C - G = one fifth octave; a ratio of 1.5
However the formula is not 1.5 to get the correct pitch. It is closer to 1.498307 or (12th root of 2)^7 (since the number of half-steps between c and g is 7). You can carry the decimal out as far as you want.

Maybe Sonic Foundry truncates the number when you plug it into the field. You may be thinking that you are inputting 1.498307077, but the pitch shift function may only take a 4 place decimal so it rounds to 1.4983.

Anyone from Sonic Foundry care to enlighten us?

Doug

Go Back