An analog analog source that contains a value constrained to a finite range (typically in [0, 1]). More...
#include <PqCore.h>


Public Member Functions | |
| AnalogSource (Engine &engine=Engine::primary()) | |
| Constructor. | |
| AnalogSource (float initialValue, Engine &engine=Engine::primary()) | |
| virtual float | get () |
| Returns value in [0, 1]. | |
| virtual float | mapTo (float toLow, float toHigh) |
| Maps value to new range. | |
| 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 | put (float value) |
| Pushes value into the unit. | |
| operator bool () | |
| Operator that allows usage in conditional expressions. | |
Protected Member Functions | |
| 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 | |
| float | _value |
An analog analog source that contains a value constrained to a finite range (typically in [0, 1]).
It is the responsibility of the subclass's programmer to make sure the value stays within range OR to update the mapTo() function accordingly.
|
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 >.
|
inlinevirtual |
|
inlinevirtual |
Maps value to new range.
Reimplemented from pq::Chainable.
Reimplemented in pq::Normalizer, pq::StreamIn, and pq::StreamOut.
|
inlinevirtualinherited |
Pushes value into the unit.
| value | the value sent to the unit |
Reimplemented in pq::Chronometer, pq::MinMaxScaler, pq::Normalizer, pq::PeakDetector, pq::DigitalUnit, pq::AnalogOut, pq::AbstractServoOut, pq::Ramp, pq::Smoother, pq::StreamOut, pq::PivotField, and pq::TimeSliceField< COUNT >.