PLUG'N SCRIPT
rapid plugin development
Tutorial
DSP
KUIML
How-to
Scripts
Main functions
  • processBlock
  • processSample
  • updateInputParameters
  • updateInputParametersForBlock
  • computeOutputData
Additional
  • initialize
  • shutdown
  • reset
  • getTailSize
  • getLatency
  • wantSilence
DSPupdateInputParameters
March 25, 2024

updateInputParameters

This function is called when any input parameter (or input string) has changed.

  1. // called when input parameters change (once per sample, when processSample is used)
  2. void updateInputParameters(){
  3. // recalculate gain
  4. gain = pow(10, inputParameters[0]/20);
  5. }

If it's used together with processSample function, then updateInputParameters may be called before every sample with interpolated (smoothly changing) parameter values.

See the difference of using processSample and processBlock in article "How to make a gain plugin".

There's one with a longer name

In comparison, there is an updateInputParametersForBlock. Which is also called when any input parameter or string has changed (but no more than once per block), and (!) when transport info changes: tempo or signature. 

If you're using processBlock instead of processSample, then updateInputParameters will also be called no more that once per block. So in such case these functions will do almost the same.

2020 - 2025 © Site by LetiMix  |  Plug'n Script and KUIML by Blue Cat Audio