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

◆ Phasor() [2/4]

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

Constructor with frequency modulation.

Parameters
frequency_modulatorNode that modulates the frequency
frequencyBase frequency in Hz (default: 1Hz)
amplitudePhasor amplitude (default: 1.0)
offsetDC offset added to the output (default: 0.0)

Creates a phasor generator with frequency modulation, where the actual frequency is the base frequency plus the output of the modulator node.

Definition at line 18 of file Phasor.cpp.

19 : m_offset(offset)
20 , m_frequency_modulator(frequency_modulator)
21 , m_amplitude_modulator(nullptr)
22 , m_phase_wrapped(false)
23 , m_threshold_crossed(false)
24{
25 m_amplitude = amplitude;
26 m_frequency = frequency;
27 update_phase_increment(frequency);
28}
float m_frequency
Base frequency of the generator.
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, MayaFlux::Nodes::Generator::Generator::m_frequency, and update_phase_increment().

+ Here is the call graph for this function: