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

◆ Sine() [3/4]

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

Constructor with amplitude modulation.

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

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

Definition at line 28 of file Sine.cpp.

29 : m_offset(offset)
30 , m_frequency_modulator(nullptr)
31 , m_amplitude_modulator(amplitude_modulator)
32{
33 m_amplitude = amplitude;
34 m_frequency = frequency;
35 update_phase_increment(frequency);
36}
float m_frequency
Base frequency of the generator.
double m_amplitude
Base amplitude of the generator.
float m_offset
DC offset added to the output.
Definition Sine.hpp:217
void update_phase_increment(double frequency)
Updates the phase increment based on a new frequency.
Definition Sine.cpp:54
std::shared_ptr< Node > m_frequency_modulator
Node that modulates the frequency.
Definition Sine.hpp:222
std::shared_ptr< Node > m_amplitude_modulator
Node that modulates the amplitude.
Definition Sine.hpp:227

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: