for the first parameter of the pitch shift filter, 2.0 means one ocatave up.
So from 1.0 to 2.0 means for example a C4 to a C5?
so would 1.5 represent like F# or am i getting the theory wrong?
therefore I would do something like this :
int Note = 6;
float fPitch = 1.0f + ( ( 1.0f / 12.0f ) * Note );
pdspPitch->setParameter(FMOD_DSP_PITCHSHIFT_PITCH, fPitch );
- TheMadMe asked 8 years ago
[quote:2b90ghec] Then what is a pitch of 0.292 then? [/quote:2b90ghec]
pitch = 2 ^ ( semitone / 12.0f)
take the log of both sides
log(pitch) = log(2 ^ (semitone / 12.0f) )
log(pitch) = (semitone / 12.0f)log(2)
12 x log(pitch) = semitone x log(2)
semitone = 12 x log(pitch) / log(2)
let pitch = 0.292,
gives semitone = -21.312
I’m guessing the reason you’re asking about .292 is because it is (1.0 – 0.707) this is not really relevant since it’s a non-linear scale. As you noticed the pitch required for a 12 semitone shift is not double/half of the shift required for the 6 semitone shift. You could easily wrap our set pitch function with your own version which takes semitone values using the formulas provided if you find that easier.
Hope this helps,
Ah Ok, thank you very much for the info.
So 0.292 is -21.312 semitones done ok .. it not linear at all. Good good. Just been testing with different pitch values and it is true though most of the semitones below on octave produces undesirable results oh well.
Also is there some sort of limit how low the pitch of the sample can go?
I tired playing the same sound twice with one octave down and two octave down both producing the same sound/timbre.
Anyway thanks for all the replies.
[quote:1vatz45o]Also is there some sort of limit how low the pitch of the sample can go? [/quote:1vatz45o]
Well the docs say the range for the pitch value is 0.5 – 2.0 but if you have gone below an octave I guess it doesn’t return an error if you’re outside that range. As you have noticed the quality gets worse the further from the original pitch you go. It’s probably best to try and stay within those limits, if you need more range, you can use audacity’s pitch shift to produce a few sound files with different pitches, then use FMOD’s real time pitch shifting to get the notes in between.
Pitch value. 0.5 to 2.0. Default = 1.0. 0.5 = one octave down, 2.0 = one octave up. 1.0 does not change the pitch.
I know that each not has the same frequency of the previous note multiplied by [img:2c9nwors]http://upload.wikimedia.org/math/7/0/b/70b8b8fc763c20423a65bd934e378085.png[/img:2c9nwors]
does this have any relation to the pitch values?
Its ok now just found this post
http://220.127.116.11/forum/viewtopic.php … itch+value
for anyone else who reads this post.
Though there is few more problem, I tested the pitch shift or sound sample in audacity and it seems to sound more clean rather than FMOD’s
Also if i place pow(2.0f, (float)-6/ 12.0f);
it will give out 0.707, which is more than one octave down.
Would it just require me to have 1.0f – the answer above
[quote:t6qhcwdb]How come? [/quote:t6qhcwdb]
Because Audacity’s brings up a window telling you it’s processing the data when it applies it’s DSP effects. This allows them to use more complicated and slower DSP processing. FMOD does not have that luxury since all the DSP effects have to run in real time while the sound is playing. All of FMODs DSP effects are designed for real time performance.
[quote:t6qhcwdb]it will give out 0.707, which is more than one octave down. [/quote:t6qhcwdb]
Wouldn’t the octave be at pow(2.0f, 1.0f) = 0.5 (i.e. half the original frequency) ?
You might also find that Audacity is doing a time-constatn pitch shift. ie: a 5 second sound changed in pitch still is a 5 second sound.
Fmod’s pitch shifting is just like an old sampler, or like spinning a record faster. It goes up in pitch and faster; or down in pitch and slower. ie: a 5 second sound pitched down an octave is a 10 second sound.
I think Fmod’s pitch changing sounds perfectly fine.
And a pitch of 0.707 is 6 semitones down. A pitch of 0.5 is an octave (12 semitones) down.
- mattconnolly answered 8 years ago
[quote:21nlvaqi]Fmod’s pitch shifting is just like an old sampler, or like spinning a record faster. It goes up in pitch and faster; or down in pitch and slower. ie: a 5 second sound pitched down an octave is a 10 second sound. [/quote:21nlvaqi]
Actually we have both, there is the event::setPitch/channel::setFrequency methods which are time-variant pitch shifting. We also have a time-invariant pitch shifter FMOD_DSP_TYPE_PITCHSHIFT effect which is what TheMadMe was talking about.
Please login first to submit.