PDA

View Full Version : New User - ProcessReplacing() vs ProcessDoubleReplacing()?


millionshades
09-30-2009, 06:37 AM
I've just downloaded the WDL Framework and finally got the IPlugExample to compile after messing about with includes etc.

I'm very new to the VSTSDK (using 2.4) and documentation seems to be sparse at best...

Could anyone explain to me the difference between ProcessReplacing() and ProcessDoubleReplacing() - and how to correctly implement ProcessReplacing() when using IPlug.

I tried changing the IPlugExample to use ProcessReplacing() instead of ProcessDoubleReplacing(), everything compiles okay but the function does not seem to be called and nothing happens (I get the original output when loading the plug). Any help or guidance would be much appreciated.

PS. I'm testing the plugin in Wavelab 5.

bvesco
09-30-2009, 03:56 PM
My best advice is to forget completely about ProcessReplacing. IPlug works on the assumption that you want to do all your processing through ProcessDoubleReplacing. Calls by the host to ProcessReplacing are routed instead through ProcessDoubleReplacing. Have you seen plugins that brag about a "full 64-bit internal signal path" in their marketing? Well, that's what IPlug does, a full 64-bit internal signal path. Forget about single precision. Forget about implementing templatized processing methods. Forget about implementing things twice, once for single and once for double. Just do everything in double precision and you'll be golden with IPlug.

Also, you put two header files from the VST SDK into a dir so IPlug.lib could compile. Throw away the entire rest of the SDK, you don't need it when building plugins with IPlug. Forget any of that other stuff ever even existed.

millionshades
10-01-2009, 12:44 AM
Thanks, that is a helpful/useful explanation. Theoretically speaking I presume there is no difference in terms of performance between the two (unsure on this).

schwa
10-01-2009, 05:03 AM
Most hosts these days will look for ProcessDoubleReplacing first, and if the plugin supports it, send a double-precision audio stream. If the plugin doesn't support it, the host will call ProcessReplacing instead and send a single-precision audio stream.

A few hosts still support only single-precision audio streams, those hosts will only call ProcessReplacing. As bvesco correctly said, IPlug will convert the stream and forward calls from these hosts on to your plugin's ProcessDoubleReplacing.

On older processors, the single-precision processing will be faster. However in VST, if you want to support single-precision processing by default in a host that wants to do 64-bit processing, you have to *not implement* ProcessDoubleReplacing. IPlug won't do that unless you rewrite some code. On a post-P4 CPU, the processing speed difference between single and double precision is probably negligible.