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

◆ reset()

void MayaFlux::Nodes::Generator::Phasor::reset ( float  frequency = 1,
float  amplitude = 1.0,
float  offset = 0,
double  phase = 0.0 
)

Resets the generator's phase and parameters.

Parameters
frequencyNew frequency in Hz (default: 1Hz)
amplitudeNew amplitude (default: 1.0)
offsetNew DC offset (default: 0)
phaseInitial phase value (default: 0.0)

This method resets the generator's internal state and parameters, effectively restarting it from the specified phase.

Definition at line 153 of file Phasor.cpp.

154{
155 m_frequency = frequency;
156 m_amplitude = amplitude;
157 m_offset = offset;
158 m_phase = phase;
159
160 while (m_phase >= 1.0)
161 m_phase -= 1.0;
162 while (m_phase < 0.0)
163 m_phase += 1.0;
164
165 update_phase_increment(frequency);
166 m_last_output = 0.0;
167}
float m_frequency
Base frequency of the generator.
double m_amplitude
Base amplitude of the generator.
double m_phase
Current phase of the generator.
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
double m_last_output
The most recent sample value generated by this oscillator.
Definition Node.hpp:378

References MayaFlux::Nodes::Generator::Generator::m_amplitude, MayaFlux::Nodes::Generator::Generator::m_frequency, MayaFlux::Nodes::Node::m_last_output, m_offset, MayaFlux::Nodes::Generator::Generator::m_phase, and update_phase_increment().

+ Here is the call graph for this function: