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

◆ Impulse() [3/4]

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

Constructor with amplitude modulation.

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

Creates an impulse generator 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 Impulse.cpp.

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

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: