JUCE: juce::dsp::Phase< Type > Struct Template Reference

JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
juce::dsp::Phase< Type > Struct Template Reference
juce_dsp » maths

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

`#include <juce_Phase.h>`

## Public Member Functions
void | reset () noexcept
| Resets the phase to 0.
Type | advance (Type increment) noexcept
| Returns the current value, and increments the phase by the given increment.

## 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.

## Member Function Documentation

## ◆ reset()

template<typename Type >

void juce::dsp::Phase< Type >::reset | ( |  | ) |
| noexcept

Resets the phase to 0.

References juce::dsp::Phase< Type >::phase.

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

## ◆ advance()

template<typename Type >

Type juce::dsp::Phase< Type >::advance | ( | Type | increment | ) |
| noexcept

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).

References jassert, and juce::dsp::Phase< Type >::phase.

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

## Member Data Documentation

## ◆ phase

template<typename Type >

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

Referenced by juce::dsp::Phase< Type >::advance(), and juce::dsp::Phase< Type >::reset().

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

- juce_Phase.h