

Public Member Functions | |
| PivotField () | |
| Constructor. | |
| virtual float | at (float proportion) override |
| Returns value at given proportion in [0, 1]. | |
| virtual float | get () override |
| Returns value. | |
| virtual float | put (float value) override |
| Pushes value into the unit. | |
| void | mode (PivotFieldMode mode) |
| Sets mode to use. | |
| PivotFieldMode | mode () const |
| Returns mode. | |
| void | easing (easing_function easing) |
| Sets easing function to apply to ramp. | |
| void | noEasing () |
| Remove easing function (linear/no easing). | |
| void | rampWidth (float rampWidth) |
| Sets ramp width as % of field range. | |
| void | noRampWidth () |
| Removes ramp width. | |
| float | rampWidth () const |
| Returns ramp width. | |
| void | rampShift (float rampShift) |
| Sets ramp shift in [0, 1] (default: 0.5 = center). | |
| float | rampShift () const |
| Returns ramp shift. | |
| void | bumpWidth (float bumpWidth) |
| Sets bump width as % of field range. | |
| float | bumpWidth () const |
| Returns bump width. | |
| void | center (float center) |
| Sets center of the ramp in [0, 1]. | |
| float | center () const |
| Returns center of the ramp. | |
| template<typename T > | |
| void | populate (T *array, size_t size, bool wrap=false) |
| Fills an array with values from this field. | |
| virtual void | clearEvents () |
| float | seconds () const |
| Returns engine time in seconds. | |
| uint32_t | milliSeconds () const |
| Returns engine time in milliseconds. | |
| uint64_t | microSeconds () const |
| Returns engine time in microseconds. | |
| unsigned long | nSteps () const |
| Returns number of engine steps. | |
| float | sampleRate () const |
| Returns engine sample rate. | |
| float | samplePeriod () const |
| Returns enginesample period. | |
| operator float () | |
| Object can be used directly to access its value. | |
| virtual float | mapTo (float toLow, float toHigh) |
| Maps value to new range. | |
| operator bool () | |
| Operator that allows usage in conditional expressions. | |
Protected Member Functions | |
| float | _ramp (float proportion, float value) |
| virtual void | begin () |
| virtual void | step () |
| virtual bool | eventTriggered (EventType eventType) |
| Returns true iff an event of a certain type has been triggered. | |
| virtual void | onEvent (EventCallback callback, EventType eventType) |
| Registers event callback. | |
| Engine * | engine () const |
| Returns the engine that owns this unit. | |
Protected Attributes | |
| PivotFieldMode | _mode |
| float | _value |
| float | _rampWidth |
| float | _rampShift |
| float | _halfBumpWidth |
| float | _center |
| easing_function | _easing |
| float | _invRampWidth |
| float | _rampShiftFactor |
|
overridevirtual |
Returns value at given proportion in [0, 1].
| proportion | the proportion of the field to read |
Implements pq::AbstractField.
| void pq::PivotField::bumpWidth | ( | float | bumpWidth | ) |
Sets bump width as % of field range.
Only applies to PIVOT_BUMP and PIVOT_NOTCH modes.
| bumpWidth | the bump width in [0, 1] |
|
inline |
Sets center of the ramp in [0, 1].
| center | the center in [0, 1] |
|
inline |
Sets easing function to apply to ramp.
| easing | the easing function |
|
inlineprotectedvirtualinherited |
Returns true iff an event of a certain type has been triggered.
Reimplemented in pq::AbstractWave, pq::Alarm, pq::Metronome, pq::PeakDetector, pq::DigitalSource, pq::Ramp, pq::StreamIn, and pq::TimeSliceField< COUNT >.
|
inlineoverridevirtual |
Returns value.
Reimplemented from pq::Chainable.
|
inlinevirtualinherited |
Maps value to new range.
This function guarantees that the value is within [toLow, toHigh]. If the unit's values are unbounded, returns get() constrained to [toLow, toHigh].
Reimplemented in pq::Normalizer, pq::DigitalUnit, pq::AnalogSource, pq::AnalogIn, pq::Ramp, pq::StreamIn, and pq::StreamOut.
|
inline |
Sets mode to use.
| mode | the mode to set |
|
inlineinherited |
Fills an array with values from this field.
| array | the array to read into |
| size | the size of the array |
| wrap | if true, the array is considered to be a circular buffer that wraps around |
|
inlineoverridevirtual |
Pushes value into the unit.
| value | the value sent to the unit |
Reimplemented from pq::Chainable.
| void pq::PivotField::rampShift | ( | float | rampShift | ) |
Sets ramp shift in [0, 1] (default: 0.5 = center).
| rampShift | the ramp shift in [0, 1] |
| void pq::PivotField::rampWidth | ( | float | rampWidth | ) |
Sets ramp width as % of field range.
| rampWidth | the ramp width in [0, 1] |