processSample vs processBlock

Official support for:
34 posts since 6 May, 2021

Post Sat Nov 13, 2021 4:19 am

Hello I want to could you explain what is the difference on advantage of each of these. Also what is the relationship of these two functions to the array and in turn how does that affect the buffer?

Many thanks

User avatar
4779 posts since 8 Sep, 2004 from Paris (France)

Post Mon Nov 15, 2021 7:34 am

For both native and angelscript, he dsp scripting framework proposes two types of scripts:

- audio sample processing: the script is called for every audio sample to process it. This is the most simple way to perform audio processing without the need to handle buffers and iterate thru samples. It is however limited: it cannot handle MIDI events, and transport information is not directly accessible in the processing routine. This type of script should implement the processSample function, as well as the updateInputParametersfunction that will be called to update internal variables from the input parameters array if any parameter is required.
- block processing: the processBlock function is called by the plug-in for every block of samples (buffer) provided by the host. You will want to use this type of script if specific parameters handling is required or if you want to process MIDI events. If no specific parameter smoothing is required, the updateInputParametersForBlock function will let you update parameters before every block, or you can use the start and end values provided in the processBlock call.

So depending on your needs and you capabilities you will have to choose one of these types of scripts.

Return to “Blue Cat Audio”