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

◆ Sine() [2/4]

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

Constructor with frequency modulation.

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

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

Definition at line 18 of file Sine.cpp.

19 : m_offset(offset)
20 , m_frequency_modulator(frequency_modulator)
21 , m_amplitude_modulator(nullptr)
22{
23 m_amplitude = amplitude;
24 m_frequency = frequency;
25 update_phase_increment(frequency);
26}
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: