0
0

I’m trying to add 2 in series DSPs (one custom dsp and one fmod delay dsp) to a channel.

(Infact I want to add 2 dsps to 2 separate channels (so there will be 4 DSPs in total) but I figure if I can get it working for one it should be a copy and paste job to get it working for both.)

I’ve been looking at the examples and the DSP_effectperspeaker gives a good demonstration of how to add 2 DSPs in parallel…but I’ve been finding it tricky to change this so I can add 2 DSPs in series.

At the moment I have the following:

[code:3njwt5np]

//attempt to chain 2 dsps in series
result = channel[0]->getDSPHead(&dsphead0);
result = dsphead0->getInput(0, &dspchannelmixer0, 0); 
result = dsphead0->disconnectFrom(dspchannelmixer0); 
//connect my custom dsp to the dsp head
result = dsphead0->addInput(mydsp, &mydspconnection); 

//connect delay dsp to the channelmixer
result = mydspdel->addInput(dspchannelmixer0, 0); 

//now try to connect delay dsp to custom dsp

FMOD::DSP *mydspdel_output;
FMOD::DSPConnection *mydspdel_output_con;
result = mydspdel->getOutput(0, &mydspdel_output, &mydspdel_output_con);
result = mydsp->addInput(mydspdel_output ,&mydspdelconnection);

[/code:3njwt5np]

The problem arised when I try to make the connection between the 2 DSPs. Is the getOutput/ addInput approach the right way to go here?
I get a fmod "invalid parameter" error at the getOutput call when I run the code so it seems to be where my problem is. Does there need to be an inbetween unit between 2 DSPs in series?

PS I can add each DSP to the channel by itself and it acts as expected so I have created the DSPs correctly.

  • You must to post comments
0
0

I think you have a mixup between ‘mydspdel’ and ‘mydsp’.

you connect mydsp to dsphead0 which is correct, but then you use mydspdel->addinput to connect it to the channelmixer. Was this supposed to be mydsp instead? If not, you have broken the chain, this is why mydspdel has returned you an error, there are no outputs.
What is connecting to mydspdel before you call getOutput? Nothing from the code you have presented. You added an input to it, but theres nothing coming out of it.

  • You must to post comments
0
0

Thanks for getting back to me on this.

What I’m ultimately trying to do is this:

[code:dpb8gpjq]| FMOD Channel DSPHead Unit| <— | custom dsp "mydsp"| <— | FMOD delay dsp "mydspdel"| <— |FMOD Wavetable Unit| [/code:dpb8gpjq]

I know that these 4 lines
[code:dpb8gpjq] result = channel[0]->getDSPHead(&dsphead0);
result = dsphead0->getInput(0, &dspchannelmixer0, 0);
result = dsphead0->disconnectFrom(dspchannelmixer0);
//connect my custom dsp to the dsp head
result = dsphead0->addInput(mydsp, &mydspconnection);[/code:dpb8gpjq]

do the following:
[code:dpb8gpjq]| FMOD Channel DSPHead Unit| <— | custom dsp "mydsp"|[/code:dpb8gpjq]

but I can’t figure out how to get the delay dsp into the chain between the custom dsp I’ve added and the wavetable unit.

With these lines

[code:dpb8gpjq] //connect delay dsp to the channelmixer
result = mydspdel->addInput(dspchannelmixer0, 0); [/code:dpb8gpjq]
I was trying to make this connection:

[code:dpb8gpjq]|FMOD delay dsp "mydspdel"| <— |FMOD Wavetable Unit|[/code:dpb8gpjq]

and I was trying to connect the 2 dsps together with the getOutput/addInput commands.
[code:dpb8gpjq]| custom dsp "mydsp"| <— | FMOD delay dsp "mydspdel"|[/code:dpb8gpjq]

I suspect I’m going about this in completely the wrong way tbh!

I’ve also tried to hack my way around it by adding one of the dsps to the channel as normal and then creating a channel group with only this channel in it and adding the other dsp to that. This didn’t seem to work for me either.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.