Hello.. If I missed the answer to this in the documentation somewhere, I apologize.
The documentation states that the range for the FMOD_DSP_PITCHSHIFT_PITCH paramater is 0.5 to 2.0 with 1.0 being no change. What I’m trying to figure out is how much is each change actually affecting the pitch. Is a 0.9 setting a full key down from the original, or just a semitone (half step)?
Also, if 0.5 is a full octave down, and 2.0 is a full octave up, as stated in the documentation, then is each .1 increment on the up side a semitone, and each .1 increment on the down side a full note? The scale would have to be different as .5 to 1.0 is only 5 possible settings, and 1.0 to 2.0 is 10 possible settings.
Oh, and BTW, major props on FMOD, it is very very cool. I am currently coding an app that I plan on selling, nothing that’s gonna change the world or anything, just a karaoke hosting package, but when I get it ready to start selling it, I will be in touch regarding liscensing.
Thanks in advance for any information regarding this issue.
- Isaac1357 asked 11 years ago
As for pitch shifting, think about your piano. There are 12 keys in an octave; mathematically you could say they’re equally spaced in pitch (black vs white keys don’t matter).
If you have a note with frequency 200 Hz, the next octave (one octave up) is at 400 Hz. There are 12 notes inbetween.
That means that in 12 notes, you double the frequency. Which means that every steps is 1/(2^(1/12)) ‘wide’; in other words, the 12th square root of 2.
That this is correct becomes obvious when you write out 12 times the 12th square root of 2: this multiplication of all the square roots end up at 2.
- Mentos answered 4 years ago
Thanks for the info. I didn’t realize that it was going by percentage.
I’m sure that your calculation is probably the way to get the exact change, but I looked around a bit, and from what i’ve read, a semitone change is generally somewhere around 5.95% on the down side, and 6.0% on the up side. Not sure why there is a difference btwn going up and down, but I’m no math or music genius ;), hehe.
Anyway, I played back a song in my application and in winamp with a key changer most KJ’s use and compared, and it sounds like those numbers work well enough for this application. Actually, the key changer with FMOD sounds better than the one most people use. It tends to sound "wabbly", especially if you get beyond a single half step change.
Yet again, thanks for a fantastic product
Brett’s formula is indeed the correct one to use.
I think what you should have found was
2 ^ (1/12) = 1.05946… which is about 5.95% for a semitone up, and
2 ^ (-1/12) = 0.9438… which is about 5.61% for a semitone down.
Note that this is always compared to your current speed.
This means that for 2 semitones up, it’s not (2 * 5.95% = 1.119), but (1.059 * 1.059 = 1.121) to be correct.
Altough for most tones the results will be similar, I don’t see why you wouldn’t use the correct formula if you have the chance.
- Adion answered 11 years ago
I probably should have been more clear. I will eventually use the formula provided, and very much appreciate the info, but right now I’m in the process of learning Delphi and learning FMOD at the same time. I actually have a working applicaiton that does (almost) everything i want, but it is written in php+gtk2, which is really cool, but isn’t very well suited for commercial apps. I started out trying C++, but all i got was a healthy appreciation for C programmers 😉 It also uses winamp and pacemaker for the audio stuff, which is where FMOD comes in, as i think it’s kinda cheezy to just use a program to control an external program if it’s something you’re gonna sell. I know PHP very well, but have only been doing Delphi code for a couple weeks. At this point, I’m taking alot of shortcuts to get all of the functionality working as simply as I can, as a sort of proof of concept, and then plan to go back and fine tune everything, as my understanding of the language improves. Basically, and embarrasingly, I’m not even sure how to do the math required in Delphi to get that formula working. I’m kinda learning as I go at this point, and am happy to get it working at all, hehehe.
I may just do the math required for each semitone up to one octave up and down to one octave down, and just store that statically in the program, since for KJ applicaitons, that’s more than enough flexibility. 99% of the time people never want anything changed beyond 2 semitones up or down, and usually it’s just one.
Anyway, You are correct, and I should do the math properly, and do plan on it eventually. And, again, I very much appreciate the info.
Hey, I am working on a project and I am trying to use the Pitch Shifter effect, but I am having trouble figuring out the relationship between the parameter and the pitch shift. In this thread there was an equation mentioned but I cannot seem to find. Would one of you mind re-posting that equation.
- avinashb answered 5 years ago
Please login first to submit.