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

◆ set_phase()

void MayaFlux::Nodes::Generator::Phasor::set_phase ( double  phase)
inline

Sets the current phase of the phasor.

Parameters
phaseNew phase value (0.0 to 1.0)

This allows direct control of the phasor's position in its cycle, useful for synchronizing with other generators or external events.

Definition at line 181 of file Phasor.hpp.

182 {
183 m_phase = phase;
184 // Keep phase in [0, 1) range
185 while (m_phase >= 1.0)
186 m_phase -= 1.0;
187 while (m_phase < 0.0)
188 m_phase += 1.0;
189 }
double m_phase
Current phase of the generator.