OpenShot Library | OpenShotAudio
0.2.1
|
Generates a signal based on a user-supplied function. More...
#include <juce_Oscillator.h>
Public Types | |
using | 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) | |
Public Member Functions | |
Oscillator ()=default | |
Creates an uninitialised oscillator. More... | |
Oscillator (const std::function< NumericType(NumericType)> &function, size_t lookupTableNumPoints=0) | |
Creates an oscillator with a periodic input function (-pi..pi). More... | |
bool | isInitialised () const noexcept |
Returns true if the Oscillator has been initialised. More... | |
void | initialise (const std::function< NumericType(NumericType)> &function, size_t lookupTableNumPoints=0) |
Initialises the oscillator with a waveform. More... | |
void | setFrequency (NumericType newFrequency, bool force=false) noexcept |
Sets the frequency of the oscillator. More... | |
NumericType | getFrequency () const noexcept |
Returns the current frequency of the oscillator. More... | |
void | prepare (const ProcessSpec &spec) noexcept |
Called before processing starts. More... | |
void | reset () noexcept |
Resets the internal state of the oscillator. | |
SampleType JUCE_VECTOR_CALLTYPE | processSample (SampleType input) noexcept |
Returns the result of processing a single sample. More... | |
template<typename ProcessContext > | |
void | process (const ProcessContext &context) noexcept |
Processes the input and output buffers supplied in the processing context. More... | |
Generates a signal based on a user-supplied function.
Definition at line 42 of file juce_Oscillator.h.
|
default |
Creates an uninitialised oscillator.
Call initialise before first use.
|
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 58 of file juce_Oscillator.h.
References juce::dsp::Oscillator< SampleType >::initialise().
|
inlinenoexcept |
Returns true if the Oscillator has been initialised.
Definition at line 65 of file juce_Oscillator.h.
Referenced by juce::dsp::Oscillator< SampleType >::process(), and juce::dsp::Oscillator< SampleType >::processSample().
|
inline |
Initialises the oscillator with a waveform.
Definition at line 68 of file juce_Oscillator.h.
Referenced by juce::dsp::Oscillator< SampleType >::Oscillator().
|
inlinenoexcept |
Sets the frequency of the oscillator.
Definition at line 89 of file juce_Oscillator.h.
References juce::SmoothedValueBase< SmoothedValueType >::setCurrentAndTargetValue(), and juce::SmoothedValue< FloatType, SmoothingType >::setTargetValue().
|
inlinenoexcept |
Returns the current frequency of the oscillator.
Definition at line 101 of file juce_Oscillator.h.
References juce::SmoothedValueBase< SmoothedValueType >::getTargetValue().
|
inlinenoexcept |
Called before processing starts.
Definition at line 105 of file juce_Oscillator.h.
References juce::dsp::Oscillator< SampleType >::reset(), and juce::Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::resize().
|
inlinenoexcept |
Returns the result of processing a single sample.
Definition at line 124 of file juce_Oscillator.h.
References juce::dsp::Phase< Type >::advance(), juce::SmoothedValue< FloatType, SmoothingType >::getNextValue(), and juce::dsp::Oscillator< SampleType >::isInitialised().
|
inlinenoexcept |
Processes the input and output buffers supplied in the processing context.
Definition at line 133 of file juce_Oscillator.h.
References juce::dsp::Phase< Type >::advance(), juce::SmoothedValue< FloatType, SmoothingType >::getNextValue(), juce::Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::getRawDataPointer(), juce::dsp::Oscillator< SampleType >::isInitialised(), juce::SmoothedValueBase< SmoothedValueType >::isSmoothing(), juce::Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::size(), and juce::SmoothedValue< FloatType, SmoothingType >::skip().