Gin
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
OscState Struct Reference

State storage for oscillator functions in AudioEquationParser. More...

#include <gin_audiofunctions.h>

Inheritance diagram for OscState:

Public Member Functions

 OscState (double sr)
 
void incPhase (float note)
 
void reset () override
 
- Public Member Functions inherited from FuncState
 FuncState (double sr)
 
virtual ~FuncState ()=default
 
virtual void setSampleRate (double sr)
 

Public Attributes

float phase { juce::Random::getSystemRandom().nextFloat() }
 
float lastNote = -1.0f
 
float frequency = -1.0f
 
float delta = -1.0f
 
- Public Attributes inherited from FuncState
double sampleRate = 44100.0
 

Detailed Description

State storage for oscillator functions in AudioEquationParser.

OscState maintains the phase accumulator and frequency conversion for oscillator functions. It automatically converts MIDI note numbers to Hz and calculates phase increment for accurate oscillation at the current sample rate.

See also
AudioFunctionHost, AudioEquationParser

Constructor & Destructor Documentation

◆ OscState()

OscState::OscState ( double  sr)

Member Function Documentation

◆ incPhase()

void OscState::incPhase ( float  note)

◆ reset()

void OscState::reset ( )
overridevirtual

Reimplemented from FuncState.

References phase.

Member Data Documentation

◆ phase

float OscState::phase { juce::Random::getSystemRandom().nextFloat() }

Referenced by incPhase(), and reset().

◆ lastNote

float OscState::lastNote = -1.0f

Referenced by incPhase().

◆ frequency

float OscState::frequency = -1.0f

Referenced by incPhase().

◆ delta

float OscState::delta = -1.0f

Referenced by incPhase().


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