Skip to content

Can plugins modify input buffers? #152

Answered by tim-janik
jaxter184 asked this question in Q&A
Discussion options

You must be logged in to vote

Ignoring the special case of in-place processing, are there any requirements or restrictions imposed on the host/plugin regarding whether or not the plugin can modify the input buffer? For example, is a plugin allowed to use the input buffer as a sort of scratch space to help with processing?

No, the plugin must not modify the input buffers, that's indicated by the const in const clap_audio_buffer_t *audio_inputs;, part of clap_process_t. If a plugin needs scratch space for processing, allocate that space in clap_plugin_t->activate() and release the memory in ->
deactivate(). That's what the parameter max_frames_count is for.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@robbert-vdh
Comment options

@baconpaul
Comment options

@jaxter184
Comment options

Answer selected by jaxter184
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants