JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::dsp::Phase< Type > Struct Template Reference

Represents an increasing phase value between 0 and 2*pi. More...

#include <juce_Phase.h>

Inheritance diagram for juce::dsp::Phase< Type >:
Collaboration diagram for juce::dsp::Phase< Type >:

Public Member Functions

Type advance (Type increment) noexcept
 Returns the current value, and increments the phase by the given increment. More...
 
void reset () noexcept
 Resets the phase to 0. More...
 

Public Attributes

Type phase = 0
 

Detailed Description

template<typename Type>
struct juce::dsp::Phase< Type >

Represents an increasing phase value between 0 and 2*pi.

This represents a value which can be incremented, and which wraps back to 0 when it goes past 2 * pi.

@tags{DSP}

Member Function Documentation

◆ advance()

template<typename Type >
Type juce::dsp::Phase< Type >::advance ( Type  increment)
inlinenoexcept

Returns the current value, and increments the phase by the given increment.

The increment must be a positive value, it can't go backwards! The new value of the phase after calling this function will be (phase + increment) % (2 * pi).

Referenced by juce::dsp::Oscillator< SampleType >::process(), and juce::dsp::Oscillator< SampleType >::processSample().

◆ reset()

template<typename Type >
void juce::dsp::Phase< Type >::reset ( )
inlinenoexcept

Resets the phase to 0.

Referenced by juce::dsp::Oscillator< SampleType >::reset().

Member Data Documentation

◆ phase

template<typename Type >
Type juce::dsp::Phase< Type >::phase = 0

The documentation for this struct was generated from the following file: