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

◆ Sine() [1/4]

MayaFlux::Nodes::Generator::Sine::Sine ( float  frequency = 440,
double  amplitude = 1,
float  offset = 0 
)

Basic constructor with fixed parameters.

Parameters
frequencyOscillation frequency in Hz (default: 440Hz, A4 note)
amplitudeOutput amplitude (default: 1.0)
offsetDC offset added to the output (default: 0.0)

Creates a sine oscillator with fixed frequency and amplitude.

Definition at line 6 of file Sine.cpp.

7 : m_offset(offset)
8 , m_frequency_modulator(nullptr)
9 , m_amplitude_modulator(nullptr)
10{
11 m_amplitude = amplitude;
12 m_frequency = frequency;
13 update_phase_increment(frequency);
14
16}
virtual std::unique_ptr< NodeContext > create_context(double value) override
Creates a context object for callbacks.
Definition Generator.cpp:19
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
std::unique_ptr< NodeContext > m_last_context
The last context object created for callbacks.
Definition Node.hpp:396

References MayaFlux::Nodes::Generator::Generator::create_context(), MayaFlux::Nodes::Generator::Generator::m_amplitude, MayaFlux::Nodes::Generator::Generator::m_frequency, MayaFlux::Nodes::Node::m_last_context, and update_phase_increment().

+ Here is the call graph for this function: