From Audacity Wiki
Revision as of 13:34, 15 March 2020 by James (talk | contribs) (Doxygen diagram.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This page of developer code and/or digital audio documentation is part of a collection of pages for learning about our code. We aim to increasingly add interactive diagrams to these pages and over time connect better to the doxygen documentation.

Parameters in and Out

Most effects have settings, and they have a GUI to hold the settings.

  • Toolbox/Dialogs explains how dialogs for settings are constructed, and gives the Echo Effect as an example.

Effects can also persist their values to the audacity.cfg file. The same mechanism is also used for setting parameter values for scripting.

  • Toolbox/Commands explains how audacity.cfg values are set and parameters are set/retrieved for scripting.


Inside an Effect

Here's the core part of the Echo Effects.

 127 size_t EffectEcho::ProcessBlock(float **inBlock, float **outBlock, size_t blockLen)
 128 {
 129    float *ibuf = inBlock[0];
 130    float *obuf = outBlock[0];
 132    for (decltype(blockLen) i = 0; i < blockLen; i++, histPos++)
 133    {
 134       if (histPos == histLen)
 135       {
 136          histPos = 0;
 137       }
 138       history[histPos] = obuf[i] = ibuf[i] + history[histPos] * decay;
 139    }
 141    return blockLen;
 142 }

Rough notes...

Relevant Classes

Here are some more classes relevant to effects.