Hi,
I’ve been messing around with creating custom DSP’s for FMOD Studio. I think I have understood the core logic by looking at the examples and creating a ‘Mute’ plugin. However, I’m a little confused on how exactly the buffers work.
For example, does setting the number of buffers in the FMOD_DSP_DESCRIPTION correspond to the number of buffers given in the BUFFER_ARRAY?
I did this for my ‘Mute’ plugin:
unsigned int samples = length * inbufferarray[0].buffernumchannels[0];
{
while (samples--)
*outbufferarray[0].buffers[0]++ = *inbufferarray[0].buffers[0]++;
}
I’m a little confused how this code affects all channels though. In my head, I imagine you would have to call
for (int i = 0; i < numBuffers; i++)
{
for (int y = 0; y < length; y++)
{
*outputbuffer[i][y] = value;
}
}
And this thinking is a little bit from working with JUCE (I admit my knowledge in that is limited too, though):
float* leftChannel = buffer.getWritePointer(0);
for (loop over samples)
{
float sample = audio logic;
leftChannel[i]= sample;
}
I’ve asked a lecturer about this and I think I’ve got a little more understanding but am I correct in thinking *outputbuffer++
will eventually go over all buffers? Or does it only go over the i’th array? If it does go over all buffers, how does it not go out of bounds?
I think I’ve got the length * channels
-as it will give you every sample in all channels- but not how it works with buffers and using ++
.
Any help will be appreciated.
Thank you,
James