processReplacing() and input buffers

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Everybody here knows about this method:

Code: Select all

processReplacing (float** inputs, float** outputs, VstInt32 sampleframes)
Now, does anybody knows if plugins are allowed to modify the contents of the inputs buffers ? I can't find anything about it in the sdk.

Post

Usually not.

Post

Unfortunately if the sdk doesn't specify anything, and since the API doesn't use const float for inputs, I'm afraid one can't assume the plugin won't trash the input.

Post

Big Tick wrote:Unfortunately if the sdk doesn't specify anything, and since the API doesn't use const float for inputs, I'm afraid one can't assume the plugin won't trash the input.
Unspecified behaviour doesn't mean green lights. I must admit I'm not sure, but I've seen plenty of similar implementations that reserves the input buffers - this allows hosts to use the same buffer for parallel / additive processing, which is a significant optimization.

Why would you want to do it anyway?

Post

I don't want to do it. I'm writing a host, and I have some weird behavior that could only be explained by the plugin trashing the input.... I want to know if the plugin is allowed to do it (in which case I need to change my implementation and copy the input buffers for each plugin), or if it is not.

Post

My plugin SoftClipper overwrites the input buffer.
It seems like an obvious speedup, not needing to use dynamic memory in the plugin itself and copying it.
Test it out to verify this behavior :) Use v2 for this.
If it is a problem for some hosts, I can change it, but no one has reported any problem like that so far.

Post

I think most plugins don't, but because of a few that do, hosts need to duplicate the input buffers for each and every plugin :(

Post

Then I take it, it didn't work?

Post

My host is for instruments only, not effects...

Post

Don't most hosts send same buffers for input and output anyway? I think we have a lot of stupid extra code to prevent our stuff from writing to outputs before reading inputs.

Post

Actually Urs, I think I noticed a weird behavior with Zebra, when sending the same input for the left & right buffers. It would generate some kind of strange reverb-like ringing in the output.

Post

Big Tick wrote:Actually Urs, I think I noticed a weird behavior with Zebra, when sending the same input for the left & right buffers. It would generate some kind of strange reverb-like ringing in the output.
Yes, possibly...

Post Reply

Return to “DSP and Plugin Development”