0
0

Hi to all,
I implemented a class to generate tone using a FMOD::DSP.
I wrote a routine to modify the frequency so:
[code:2o7kw2bi]myClass::setFrequency(float _frequency)
{
currentChannel->setFrequency(_frequency);
}[/code:2o7kw2bi]

The strange thing happens when I try to change the Channel::setFrequency with FMOD::DSP::setParameters(FMOD_DSP_OSCILLATOR_RATE, freqValue) so:
[code:2o7kw2bi]myClass::setFrequency(float _frequency)
{
//currentChannel->setFrequency(_frequency);
myDsp->setParameters(FMOD_DSP_OSCILLATOR_RATE, _frequency);
}[/code:2o7kw2bi]

If I set the same frequency value for the 2 routines I obtain 2 different sounds. Why?
The 2 routine does not the same job?
And with the FMOD::DSP::setParameters I obtain a poor quality noise.
Regards,
Franco

  • You must to post comments
0
0

one is resampled one is not, and the dsp frequency is the -reference- frequency.
If the output rate is 44khz, and you set the channel to 22khz, then it will be half pitch.
If you leave it at 44khz, and set the oscillator to 22khz, then it will only generate data at 22khz and the pitch will be doubled.

  • You must to post comments
0
0

Hi Brett,
thank for your reply.
[quote="brett":2i6pk5ej]one is resampled one is not, and the dsp frequency is the -reference- frequency.[/quote:2i6pk5ej]
What does -reference- frequency mean?
[quote:2i6pk5ej]
If the output rate is 44khz, and you set the channel to 22khz, then it will be half pitch.
If you leave it at 44khz, and set the oscillator to 22khz, then it will only generate data at 22khz and the pitch will be doubled.[/quote:2i6pk5ej]

Can you write some line of code as example please?
Thank you very much
Franco

  • You must to post comments
0
0

code won’t explain what you need to know.

I think that the best step would be to take a look at fundamental digital audio processing book or pages.

You could start by go on wikipedia a read the pages about "Sampling", "Upsampling", "Downsampling", "Oversampling"

I think that then you’ll understand why playing a sound sampled at 22KHz in a System set up in 44Khz just doubles it’s pitch

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.