21#ifndef ABSTRACT_WAVE_H_
22#define ABSTRACT_WAVE_H_
25#include "AbstractOscillator.h"
26#include "pq_phase_utils.h"
93 [[deprecated(
"Use wave.mapTo(min,max) instead.")]]
97 [[deprecated(
"Use wave.mapTo(min,max) instead.")]]
98 virtual float amplitude()
const {
return fixed32ToFloat(_amplitude); }
107 virtual float skew()
const {
return fixed32ToFloat(_skew32); }
117 [[deprecated(
"Use skew(float) instead.")]]
122 [[deprecated(
"Use skew() instead.")]]
135 virtual void onPassSkew(EventCallback callback);
139 virtual void begin();
146 virtual q0_32u_t _getFixed32(q0_32u_t t)
const = 0;
149 virtual float _getAmplified(q0_32u_t t)
const;
151 bool _isPreSkew()
const {
152 return (_phase32 <= _skew32);
156 void _updatePassedSkew();
AbstractOscillator(float period)
Constructor.
Definition AbstractOscillator.cpp:30
virtual void phaseShift(float phaseShift)
Sets the phase shift (ie.
Definition AbstractOscillator.cpp:157
virtual void phase(float phase)
Sets the phase at % of period.
Definition AbstractOscillator.cpp:153
virtual void period(float period)
Sets the period (in seconds).
Definition AbstractOscillator.cpp:123
virtual void onPassSkew(EventCallback callback)
Registers event callback on wave pass skew point event.
Definition AbstractWave.cpp:108
virtual void width(float width)
Definition AbstractWave.h:118
virtual bool passedSkew() const
Returns true on the step where the wave passed the skew point.
Definition AbstractWave.h:129
virtual Parameter Skew()
Returns the skew as a parameter.
Definition AbstractWave.h:110
virtual float get()
Returns value in [0, 1].
Definition AbstractWave.cpp:35
virtual float shiftByTime(float timeShift) const
Returns oscillator's value with given phase shift expressed in time (in seconds).
Definition AbstractWave.cpp:85
virtual float skew() const
Returns the skew of the signal.
Definition AbstractWave.h:107
virtual float shiftBy(float phaseShift) const
Returns oscillator's value with given phase shift (in % of period).
Definition AbstractWave.cpp:81
virtual float amplitude() const
Returns the amplitude of the wave.
Definition AbstractWave.h:98
virtual bool passedPeriod() const
Returns true on the step where the wave passed the period (end cycle).
Definition AbstractWave.h:126
virtual void skew(float skew)
Sets the skew of the signal as a % of period.
Definition AbstractWave.cpp:97
virtual float width() const
Definition AbstractWave.h:123
virtual float atPhase(float phase) const
Returns the oscillator's value at a given absolute phase (in % of period).
Definition AbstractWave.cpp:89
AbstractWave(Engine &engine=Engine::primary())
Constructor.
Definition AbstractWave.cpp:28
virtual void amplitude(float amplitude)
Sets the amplitude of the wave.
Definition AbstractWave.cpp:93
virtual bool eventTriggered(EventType eventType)
Returns true iff an event of a certain type has been triggered.
Definition AbstractWave.cpp:112
virtual void onPassPeriod(EventCallback callback)
Registers event callback on wave pass period event.
Definition AbstractWave.cpp:104
AnalogSource(Engine &engine)
Constructor.
Definition PqCore.h:485
The main Plaquette static class containing all the units.
Definition PqCore.h:63
static Engine & primary()
Returns the main instance of Plaquette.
Definition PqCore.cpp:30
Engine * engine() const
Returns the engine that owns this unit.
Definition PqCore.h:420