An abstract unit with one input and one output and no other controls, for simple processing.
More...
#include <Formula.h>
|
float | meter_input () const |
| returns the value of the input buffer, updated at control rate. This method is thread safe.
|
|
float | meter_output () const |
| returns the value of the output buffer, updated at control rate. This method is thread safe.
|
|
Patchable & | set (float value) |
| sets the default input value and returns the Unit ready to be patched.
|
|
void | enableBoundaries (float low, float high) |
| sets some boundaries to which the values of the input will be clamped More...
|
|
void | disableBoundaries () |
| disables the clamping of input values
|
|
| Unit (const Unit &other) |
|
Unit & | operator= (const Unit &other) |
|
| Unit (Unit &&other) |
|
Unit & | operator= (Unit &&other) |
|
virtual void | setOversampleLevel (int newOversampleLevel) |
| sets the unit oversample level More...
|
|
int | getOversampleLevel () const |
| returns the Unit oversample level
|
|
void | resetInputToDefault () |
| resets the selected input to the default.
|
|
void | resetOutputToDefault () |
| resets the selected output to the default.
|
|
Patchable & | in (const char *tag) |
| sets the selected input to the one tagged with "tag", if tag is a valid string, and returns this Patchable ready to be patched. More...
|
|
Patchable & | out (const char *tag) |
| sets the selected output to the one tagged with "tag", if tag is a valid string, and returns this Patchable ready to be patched. More...
|
|
void | disconnectIn () |
| disconnects all the outputs connected to the selected input, then resets the selected input to the default.
|
|
void | disconnectOut () |
| disconnects all the inputs connected to the selected output, then resets the selected output to the default.
|
|
void | disconnectAll () |
| disconnects all the inputs and outputs to their connected outputs and inputs. Also resets the selected input and output to the default.
|
|
InputNode & | getSelectedInput () |
| returns the selected input, you can patch a Patchable or OutputNode to it with the >> operator.
|
|
OutputNode & | getSelectedOutput () |
| returns the selected output, you can patch it to another Patchable or InputNode with the >> operator.
|
|
std::vector< std::string > | getInputsList () |
| returns a vector of the valid input tags
|
|
std::vector< std::string > | getOutputsList () |
| returns a vector of the valid input tags
|
|
|
virtual float | formula (const float &x) noexcept=0 |
| function to be overloaded with your own math function or dsp code. More...
|
|
virtual void | formulaAudioRate (float *&output, const float *&input, const int &bufferSize) noexcept |
| function to be overloaded with your own math function or dsp code. More...
|
|
void | prepareToPlay (int expectedBufferSize, double sampleRate) override |
| you have to use this method only in the constructor, inside if(dynamicConstruction){ } More...
|
|
const float * | processInput (InputNode &node, int &stateNow) |
| process the given input, gives you a pointer to the processed buffer as result and its state More...
|
|
float | processAndGetSingleValue (InputNode &input, int pos) |
| process the given input, gives you a pointer to the processed buffer as result and its state More...
|
|
float * | getOutputBufferToFill (OutputNode &node) |
| gets a pointer to the output buffer for rendering audio to it, and sets the OutputNode state to AudioRate More...
|
|
void | setControlRateOutput (OutputNode &node, float scalarValue) |
| sets the OutputNode buffer to "Changed" and its first value to scalarValue More...
|
|
void | setOutputToZero (OutputNode &node) |
| sets the OutputNode buffer to "Changed" and its first value to 0.0f More...
|
|
void | updateOutputNodes () |
| call this method in the Unit constructor after adding all the Outputs, this is mandatory for the inner working of the patching framework.
|
|
void | addOutput (const char *tag, OutputNode &output) |
| method to add outputs when constructing a Unit More...
|
|
void | addInput (const char *tag, InputNode &input) |
| method to add inputs when constructing a Unit More...
|
|
void | addModuleOutput (const char *tag, Patchable &unit) |
| method to add outputs when constructing a module More...
|
|
void | addModuleInput (const char *tag, Patchable &unit) |
| method to add outputs when constructing a module More...
|
|
|
static double | getGlobalSampleRate () |
|
An abstract unit with one input and one output and no other controls, for simple processing.
This is a class perform on a input the operation defined by the function formula() that the user can implement. If formulaAudioRate() is not implemented, formula() is performed for each sample, otherwise formula() is performent with control rate inputs and formulaAudioRate() for audio rate inputs.
◆ enableBoundaries()
void pdsp::Formula::enableBoundaries |
( |
float |
low, |
|
|
float |
high |
|
) |
| |
sets some boundaries to which the values of the input will be clamped
- Parameters
-
[in] | lo | low boundary (inclusive) |
[in] | hi | high boundary (inclusive) |
◆ formula()
virtual float pdsp::Formula::formula |
( |
const float & |
x | ) |
|
|
protectedpure virtualnoexcept |
function to be overloaded with your own math function or dsp code.
- Parameters
-
◆ formulaAudioRate()
void pdsp::Formula::formulaAudioRate |
( |
float *& |
output, |
|
|
const float *& |
input, |
|
|
const int & |
bufferSize |
|
) |
| |
|
protectedvirtualnoexcept |
function to be overloaded with your own math function or dsp code.
- Parameters
-
[in] | output | output array to fill with the rendered values |
[in] | input | input array to process |
[in] | bufferSize | number of samples to process |
The documentation for this class was generated from the following files: