0
0

Hi, I’ve noticed in the documentation that we can setFrequency on a single channel, but I can’t find any reference to setting the pitch on a single channel. ๐Ÿ˜•

Is this just a missing entry in the documentation or are we not able to alter the pitch or a specific channel? ๐Ÿ˜•

Reg

ToneDef

  • You must to post comments
0
0

By changing the frequency of a channel, you effectively ARE changing its pitch. So, for example, let’s say that you have a 440Hz sine wave (A4) running at 44,100 samples per second. If you want to change that to, say, G4 (392Hz), you would change the frequency to 44,100 * 392 / 440 = 39289 samples per second.

So you see, the frequency IS the pitch, effectively.

Hope that helps.

  • Guy
  • You must to post comments
0
0

but by doing that, don’t you lengthen the time it takes to play the sample.

I thought the SetPitch command lowered the pitch without altering the sample length, while the setFrequency stretched it out (with probably a pitch lowering as a side effect).

Thnx

ToneDef

  • You must to post comments
0
0

Yes, it does change the length of time it takes to play that sound. If you want a time-invariant pitch-shift, or a pitch-invariant time-shift, have a look at the FMOD_DSP_TYPE_PITCHSHIFT. Be warned, though, it’s very CPU intensive.

  • Guy
  • You must to post comments
0
0

yeah as far as I know, that’s what setPitch for the Channel group does (time-invariant). Can’t afford the CPU-cycles though… guess I’ll have to fake it.

Thnx

ToneDef

  • You must to post comments
0
0

ChannelGroup::setPitch is not an fft pitch shifter, it just uses a different parameter (1.0 based or something instead of hz, because it can have a bunch of different rate channels inside it)

  • You must to post comments
0
0

Oh Ok, Cool.

Thanks for that Brett. :)

Same effect, different scale. ๐Ÿ˜‰

Thnx

ToneDef

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.