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();
Triangle/sawtooth oscillator.
Definition AbstractOscillator.h:33
virtual float period() const
Returns the period (in seconds).
Definition AbstractOscillator.h:55
virtual float phaseShift() const
Returns the phase shift (ie.
Definition AbstractOscillator.cpp:158
virtual float phase() const
Returns the phase (in % of period).
Definition AbstractOscillator.h:97
Triangle/sawtooth oscillator.
Definition AbstractWave.h:33
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 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
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
An analog analog source that contains a value constrained to a finite range (typically in [0,...
Definition PqCore.h:482
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