PDA

View Full Version : processDoubleReplacing()


olilarkin
02-01-2010, 03:28 AM
Hi,

What exactly happens when you only implement processDoubleReplacing() in an iPlug if the host has a 32bit signal path? If i implement processReplacing() will that get used instead?

thanks,

oli

cc_
02-01-2010, 04:48 AM
It always uses processDoubleReplacing(). The two cases are handled in IPlugBase.cpp :


void IPlugBase::ProcessBuffers(double sampleType, int nFrames)
{
ProcessDoubleReplacing(mInData.Get(), mOutData.Get(), nFrames);
}

void IPlugBase::ProcessBuffers(float sampleType, int nFrames)
{
ProcessDoubleReplacing(mInData.Get(), mOutData.Get(), nFrames);
int i, n = NOutChannels();
OutChannel** ppOutChannel = mOutChannels.GetList();
for (i = 0; i < n; ++i, ++ppOutChannel) {
OutChannel* pOutChannel = *ppOutChannel;
if (pOutChannel->mConnected) {
CastCopy(pOutChannel->mFDest, *(pOutChannel->mDest), nFrames);
}
}
}


By that time the input samples have already been converted to doubles - for VST the conversion is done IPlugVST.cpp in VSTPrepProcess().

olilarkin
02-01-2010, 05:09 AM
thanks for the info.

Does anyone else get a serious performance boost when they use single precision? I experienced this in a MaxMSP external i made, but i'm not sure if it is due to my system or other factors (i am using a core1duo and testing on osx)

Tale
02-01-2010, 08:59 AM
When I use floats instead of doubles (on Windows) it indeed is faster, but only when I compile without SSE2 support. When I enable SSE2 support, doubles are actually faster than floats.

andreiyefinczuk
12-15-2014, 11:47 AM
is there a way to use only ProcessSingleReplacing? (I really need this)

Tale
12-17-2014, 12:07 AM
is there a way to use only ProcessSingleReplacing? (I really need this)
AFAIK not straight out of the box, but I guess you might be able to hack IPlugVST and IPlugBase to only do single precision.

But are you sure you need this? There is probably a reason why IPlug does double precision processing (I guess efficiency mostly).