0
0

I’m sure I’m doing something wrong, but could someone hint me, how can I (for example) play out two mixed distorted sine waves using FMOD DSP plugins.

Using FMOD 4.30.4

The code I’m trying to use:
[code:1o6rp288]
FMOD_DSP *dsp1, *dsp2, *dspMix;

FMOD_System_CreateDSPByType(sys, FMOD_DSP_TYPE_OSCILLATOR, &dsp1);
FMOD_System_CreateDSPByType(sys, FMOD_DSP_TYPE_OSCILLATOR, &dsp2);
FMOD_System_CreateDSPByType(sys, FMOD_DSP_TYPE_DISTORTION, &dspMix);

FMOD_DSP_SetParameter(dsp1,1,220);
FMOD_DSP_SetParameter(dsp2,1,880);

FMOD_DSP_AddInput(dspMix,dsp1,0);
FMOD_DSP_AddInput(dspMix,dsp2,0);

FMOD_CHANNEL *channel;
//This:
FMOD_System_PlayDSP(sys,FMOD_CHANNEL_FREE,dspMix,false,&channel);
//Or this:
//FMOD_System_AddDSP(sys,dspMix,0);
[/code:1o6rp288]

Neither PlayDSP or AddDSP work (documentation says "plays a DSP unit object [i:1o6rp288]and its input network[/i:1o6rp288] on a particular channel").

DSP properly works if I PlayDSP the oscillator first, and then AddDSP the distortion filter to it. What am I doing wrong here?

Should I add DSP filters to chain first, and then rearrange their inputs? I have a faint feeling DSP’s need to be in DSP chain for them to actually work

  • You must to post comments
0
0

Hm try a blank dsp first, I do what you are saying but add the units to a mixer dsp first.

[code:pp8ss74k]
{
FMOD_DSP_DESCRIPTION dspdesc;

    memset(&dspdesc, 0, sizeof(FMOD_DSP_DESCRIPTION));

    strcpy(dspdesc.name, "mixer");
    result = gSystem->createDSP(&dspdesc, &dspA);
    ERRCHECK(result);
}

[/code:pp8ss74k]

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.