MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ Phasor() [3/4]

MayaFlux::Nodes::Generator::Phasor::Phasor ( float  frequency,
const std::shared_ptr< Node > &  amplitude_modulator,
double  amplitude = 1,
float  offset = 0 
)

Constructor with amplitude modulation.

Parameters
frequencyPhasor cycle rate in Hz
amplitude_modulatorNode that modulates the amplitude
amplitudeBase amplitude (default: 1.0)
offsetDC offset added to the output (default: 0.0)

Creates a phasor generator with amplitude modulation, where the actual amplitude is the base amplitude multiplied by the output of the modulator node.

Definition at line 30 of file Phasor.cpp.

31 : m_offset(offset)
32 , m_frequency_modulator(nullptr)
33 , m_amplitude_modulator(amplitude_modulator)
34 , m_phase_wrapped(false)
35 , m_threshold_crossed(false)
36{
37 m_amplitude = amplitude;
38 update_phase_increment(frequency);
39}
double m_amplitude
Base amplitude of the generator.
std::shared_ptr< Node > m_frequency_modulator
Node that modulates the frequency.
Definition Phasor.hpp:304
bool m_threshold_crossed
Flag indicating whether the threshold has been crossed in the current sample.
Definition Phasor.hpp:338
bool m_phase_wrapped
Flag indicating whether the phase has wrapped in the current sample.
Definition Phasor.hpp:333
std::shared_ptr< Node > m_amplitude_modulator
Node that modulates the amplitude.
Definition Phasor.hpp:309
void update_phase_increment(double frequency)
Updates the phase increment based on a new frequency.
Definition Phasor.cpp:60
float m_offset
DC offset added to the output.
Definition Phasor.hpp:299

References MayaFlux::Nodes::Generator::Generator::m_amplitude, and update_phase_increment().

+ Here is the call graph for this function: