MayaFlux 0.3.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 150 of file Phasor.cpp.

151{
153 m_amplitude = amplitude;
154 m_offset = offset;
155 m_phase = phase;
156
157 while (m_phase >= 1.0)
158 m_phase -= 1.0;
159 while (m_phase < 0.0)
160 m_phase += 1.0;
161
163 m_last_output = 0.0;
164}
double frequency
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:59
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:377

References frequency, 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: