OpenShot Audio Library | OpenShotAudio 0.4.0
 
Loading...
Searching...
No Matches
juce::dsp::Oscillator< SampleType > Class Template Reference

#include <juce_Oscillator.h>

Public Types

using NumericType = typename SampleTypeHelpers::ElementType<SampleType>::Type
 

Public Member Functions

 Oscillator ()=default
 
 Oscillator (const std::function< NumericType(NumericType)> &function, size_t lookupTableNumPoints=0)
 
bool isInitialised () const noexcept
 
void initialise (const std::function< NumericType(NumericType)> &function, size_t lookupTableNumPoints=0)
 
void setFrequency (NumericType newFrequency, bool force=false) noexcept
 
NumericType getFrequency () const noexcept
 
void prepare (const ProcessSpec &spec) noexcept
 
void reset () noexcept
 
SampleType JUCE_VECTOR_CALLTYPE processSample (SampleType input) noexcept
 
template<typename ProcessContext>
void process (const ProcessContext &context) noexcept
 

Detailed Description

template<typename SampleType>
class juce::dsp::Oscillator< SampleType >

Generates a signal based on a user-supplied function.

Definition at line 35 of file juce_Oscillator.h.

Member Typedef Documentation

◆ NumericType

template<typename SampleType>
using juce::dsp::Oscillator< SampleType >::NumericType = typename SampleTypeHelpers::ElementType<SampleType>::Type

The NumericType is the underlying primitive type used by the SampleType (which could be either a primitive or vector)

Definition at line 41 of file juce_Oscillator.h.

Constructor & Destructor Documentation

◆ Oscillator() [1/2]

template<typename SampleType>
juce::dsp::Oscillator< SampleType >::Oscillator ( )
default

Creates an uninitialised oscillator. Call initialise before first use.

◆ Oscillator() [2/2]

template<typename SampleType>
juce::dsp::Oscillator< SampleType >::Oscillator ( const std::function< NumericType(NumericType)> & function,
size_t lookupTableNumPoints = 0 )
inline

Creates an oscillator with a periodic input function (-pi..pi).

If lookup table is not zero, then the function will be approximated with a lookup table.

Definition at line 51 of file juce_Oscillator.h.

Member Function Documentation

◆ getFrequency()

template<typename SampleType>
NumericType juce::dsp::Oscillator< SampleType >::getFrequency ( ) const
inlinenoexcept

Returns the current frequency of the oscillator.

Definition at line 94 of file juce_Oscillator.h.

◆ initialise()

template<typename SampleType>
void juce::dsp::Oscillator< SampleType >::initialise ( const std::function< NumericType(NumericType)> & function,
size_t lookupTableNumPoints = 0 )
inline

Initialises the oscillator with a waveform.

Definition at line 61 of file juce_Oscillator.h.

Referenced by Oscillator().

◆ isInitialised()

template<typename SampleType>
bool juce::dsp::Oscillator< SampleType >::isInitialised ( ) const
inlinenoexcept

Returns true if the Oscillator has been initialised.

Definition at line 58 of file juce_Oscillator.h.

Referenced by process(), and processSample().

◆ prepare()

template<typename SampleType>
void juce::dsp::Oscillator< SampleType >::prepare ( const ProcessSpec & spec)
inlinenoexcept

Called before processing starts.

Definition at line 98 of file juce_Oscillator.h.

◆ process()

template<typename SampleType>
template<typename ProcessContext>
void juce::dsp::Oscillator< SampleType >::process ( const ProcessContext & context)
inlinenoexcept

Processes the input and output buffers supplied in the processing context.

Definition at line 126 of file juce_Oscillator.h.

◆ processSample()

template<typename SampleType>
SampleType JUCE_VECTOR_CALLTYPE juce::dsp::Oscillator< SampleType >::processSample ( SampleType input)
inlinenoexcept

Returns the result of processing a single sample.

Definition at line 117 of file juce_Oscillator.h.

◆ reset()

template<typename SampleType>
void juce::dsp::Oscillator< SampleType >::reset ( )
inlinenoexcept

Resets the internal state of the oscillator

Definition at line 107 of file juce_Oscillator.h.

Referenced by prepare().

◆ setFrequency()

template<typename SampleType>
void juce::dsp::Oscillator< SampleType >::setFrequency ( NumericType newFrequency,
bool force = false )
inlinenoexcept

Sets the frequency of the oscillator.

Definition at line 82 of file juce_Oscillator.h.


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