0
0

Hello,

I am making a bunch of oscillators and corresponding channels in my music program.

What is the difference between changing pitch of an oscillator on the DSP using:
dsp->setParameter(FMOD_DSP_OSCILLATOR_RATE, 440)

and changing the pitch of the channel that is hooked up to the oscillator? Are their advantages or disadvantages to doing it either way? are there different pitch ranges using either method? Is it all the same under the hood?

Thanks!
Bill

  • You must to post comments
0
0

if you use playDSP and use setFrequency, then the oscillator will continue generating at the same rate, but it will be interpolated by fmod’s mixer. If you change the rate with DSP::setParameter as you said, it changes the shape of the oscillator at the generator level, so yes they are different.

  • You must to post comments
0
0

Hi,

I’m bringing this topic up because I’m a little confused…

What is called frequency in the setFrequency function is actually the sampling rate, and what is called rate in the DSP parameters is actually the frequency of the signal, isn’t it?

Because having a pure tone of 44.1 kHz (the default sampling rate) like in the generatetone example would not be audible…

If you divide the sampling rate by 2, it should physically mean that you only take on sample out of 2, which should slightly modify the form of the wave, but not change the perceived pitch.

But actually, what happens here, is that you keep the same number of samples (and their associated value), but you double the time between each 2. Thus, you decrease the perceived pitch.

That’s why going from a 440 Hz tone sampled at 44.1 kHz to a 440 Hz tone sampled at 22.05 kHz sounds like a 220 Hz sampled at 44.1 kHz

Is what I’m saying correct?

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.