0
0

I want to play 10 sine-oscillators of different frequencies at the same time. Is this the right way, to do this?
[code:3b1rze78]
private FMOD.System system = null;
private FMOD.Channel[] channel = new FMOD.Channel[7];
private FMOD.DSP[] dsp = new FMOD.DSP[7];
FMOD.RESULT result;
result = FMOD.Factory.System_Create(ref system);
ERRCHECK(result);

        result = system.init(32, FMOD.INITFLAG.NORMAL, (IntPtr)null);
        ERRCHECK(result);   

for (int k = 0; k < dsp.Length; k++)
{
result = system.createDSPByType(FMOD.DSP_TYPE.OSCILLATOR, ref dsp[k]);
ERRCHECK(result);
result = dsp[k].setParameter((int)FMOD.DSP_OSCILLATOR.RATE, 0.0f);
ERRCHECK(result);
result = dsp[k].setParameter((int)FMOD.DSP_OSCILLATOR.TYPE, 0);
ERRCHECK(result);
result = system.playDSP(FMOD.CHANNELINDEX.REUSE, dsp[k], true, ref channel[k]);
ERRCHECK(result);
channel[k].setVolume(0.1f);
channel[k].setPaused(false);
}
[/code:3b1rze78]
And then for every dsp:
[code:3b1rze78] FMOD.RESULT result;
result = dsp[i].setParameter((int)FMOD.DSP_OSCILLATOR.RATE, (float)Value);
ERRCHECK(result);[/code:3b1rze78]

I tried this out, but if I go over a volume of about 0.15 for every dsp, i get heavy distortion. But with this value the sounds is too quiet.[/code]

  • You must to post comments
0
0

Yes that looks right but what are your rates, maybe they’re too low

  • You must to post comments
0
0

Rates from oscillators?

Rates are between 30Hz and 400Hz.

But why I can’t set the Volume of e.g. a 30Hz sine to 1.0, without getting distortion of the other oscillators?

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.