Allows an audio parameter to be controlled over time with sample accuracate curves.
More...
|
| Param (Node *parentNode, float initialValue=0) |
| Constructs a Param with a pointer (weak reference) to the owning parent Node and an optional initialValue (default = 0). More...
|
|
void | setValue (float value) |
| Sets the value of the Param, blowing away any scheduled Event's or processing Node. More...
|
|
float | getValue () const |
| Returns the current value of the Param. More...
|
|
const float * | getValueArray () const |
|
EventRef | applyRamp (float valueEnd, float rampSeconds, const Options &options=Options()) |
| Replaces any existing Event's with a Event from the current value to valueEnd over rampSeconds, according to options. Any existing processing Node is disconnected. More...
|
|
EventRef | applyRamp (float valueBegin, float valueEnd, float rampSeconds, const Options &options=Options()) |
| Replaces any existing Event's with a Event from valueBegin to valueEnd over rampSeconds, according to options. Any existing processing Node is disconnected. More...
|
|
EventRef | appendRamp (float valueEnd, float rampSeconds, const Options &options=Options()) |
| Appends a Event from the end of the last scheduled Param (or the current time) to valueEnd over rampSeconds, according to options. Any existing processing Node is disconnected. More...
|
|
void | setProcessor (const NodeRef &node) |
|
void | reset () |
| Resets Param, blowing away any Event's or processing Node. More...
|
|
size_t | getNumEvents () const |
| Returns the number of Event's that are currently scheduled. More...
|
|
bool | eval () |
|
bool | eval (float timeBegin, float *array, size_t arrayLength, size_t sampleRate) |
|
float | findDuration () const |
| Returns the total duration of any scheduled Event's, including delay, or 0 if none are scheduled. More...
|
|
std::pair< float, float > | findEndTimeAndValue () const |
| Returns the end time and value of the latest scheduled Event, or [0, getValue()] if none are scheduled. More...
|
|
Allows an audio parameter to be controlled over time with sample accuracate curves.
The Param class enables expressive control over variables that control audio::Node's with a Timeline-esque API. It supports appending 'ramps' (audio animations) and maintains these in an internal timeline that is evaluated from the audio thread. You can also set a Node as the 'processor' with Param::setProcessor(), enabling you to control it with an arbitrary signal.
A Param is owned by a parent Node, from which it gains access to the current Context. This is a necessary step in making it sample accurate yet still controllable in a thread-safe manager on the user thread.