OpenWareLaboratory
|
Oscillator that produces an Agnesi curve (Witch of Agnesi) With a=0.5, the output is between near 0 (0.038 for N=5) and 1. More...
Public Member Functions | |
AgnesiOscillator (float sr, float a, float N) | |
float | generate () |
Produce the next consecutive sample. More... | |
virtual float | generate () |
Produce the next consecutive sample. More... | |
float | generate (float fm) |
Produce a sample with frequency modulation. More... | |
virtual void | generate (FloatArray output) |
Produce a block of samples. More... | |
virtual void | generate (FloatArray output) |
Produce a block of samples. More... | |
virtual void | generate (FloatArray output, FloatArray fm) |
Produce a block of samples with frequency modulation. More... | |
float | getFrequency () |
Get oscillator frequency in Hertz. More... | |
float | getNextSample () |
float | getNextSample (float fm) |
float | getPhase () |
Get current oscillator phase in radians. More... | |
void | getSamples (FloatArray output) |
void | getSamples (FloatArray output, FloatArray fm) |
void | normalise () |
Normalise offset and gain so that signal is between -1 and 1. More... | |
void | reset () |
Reset oscillator (typically resets phase) More... | |
void | setFrequency (float freq) |
Set oscillator frequency in Hertz. More... | |
void | setPhase (float phase) |
Set current oscillator phase in radians. More... | |
virtual void | setSampleRate (float value) |
Set oscillator sample rate. More... | |
Static Public Member Functions | |
static float | agnesi (float x, float a) |
static AgnesiOscillator * | create (float sr, float a=0.5, float N=5) |
static void | destroy (AgnesiOscillator *obj) |
Oscillator that produces an Agnesi curve (Witch of Agnesi) With a=0.5, the output is between near 0 (0.038 for N=5) and 1.
N sets the x range for one half period, which determines the y offset.
Definition at line 11 of file AgnesiOscillator.h.
|
inline |
Definition at line 21 of file AgnesiOscillator.h.
Referenced by create().
|
inlinestatic |
Definition at line 23 of file AgnesiOscillator.h.
Referenced by generate(), and normalise().
|
inlinestatic |
Definition at line 65 of file AgnesiOscillator.h.
References AgnesiOscillator(), and normalise().
|
inlinestatic |
Definition at line 70 of file AgnesiOscillator.h.
|
inlinevirtual |
Produce the next consecutive sample.
Reimplemented from SignalGenerator.
Definition at line 49 of file AgnesiOscillator.h.
|
inlinevirtual |
Produce the next consecutive sample.
Reimplemented from SignalGenerator.
Definition at line 19 of file SignalGenerator.h.
|
inlinevirtual |
Produce a sample with frequency modulation.
Implements Oscillator.
Definition at line 56 of file AgnesiOscillator.h.
|
inlinevirtual |
Produce a block of samples.
Reimplemented from SignalGenerator.
Definition at line 25 of file SignalGenerator.h.
|
inlinevirtualinherited |
Produce a block of samples.
Reimplemented in VosimOscillator, VoiceAllocatorSignalGenerator< Allocator, SynthVoice, VOICES >, AntialiasedSquareWaveOscillator, SineOscillator, SampleOscillator< im >, AntialiasedRampOscillator, PolyBlepOscillator, and MorphingOscillator.
Definition at line 25 of file SignalGenerator.h.
References SignalGenerator::generate(), and SimpleArray< T >::getSize().
|
inlinevirtualinherited |
Produce a block of samples with frequency modulation.
Reimplemented in VosimOscillator, SineOscillator, SampleOscillator< im >, PolyBlepOscillator, and MorphingOscillator.
Definition at line 50 of file Oscillator.h.
References Oscillator::generate(), and SimpleArray< T >::getSize().
|
inlinevirtual |
Get oscillator frequency in Hertz.
Implements Oscillator.
Definition at line 29 of file AgnesiOscillator.h.
|
inlineinherited |
Definition at line 55 of file Oscillator.h.
References Oscillator::generate().
|
inlineinherited |
Definition at line 57 of file Oscillator.h.
References Oscillator::generate().
|
inlinevirtual |
Get current oscillator phase in radians.
Implements Oscillator.
Definition at line 35 of file AgnesiOscillator.h.
References M_PI.
|
inlineinherited |
Definition at line 59 of file Oscillator.h.
References Oscillator::generate().
|
inlineinherited |
Definition at line 63 of file Oscillator.h.
References Oscillator::generate().
|
inline |
Normalise offset and gain so that signal is between -1 and 1.
Definition at line 44 of file AgnesiOscillator.h.
References agnesi().
Referenced by create().
|
inlinevirtual |
Reset oscillator (typically resets phase)
Implements Oscillator.
Definition at line 38 of file AgnesiOscillator.h.
|
inlinevirtual |
Set oscillator frequency in Hertz.
Implements Oscillator.
Definition at line 26 of file AgnesiOscillator.h.
|
inlinevirtual |
Set current oscillator phase in radians.
phase | a value between 0 and 2*pi |
Implements Oscillator.
Definition at line 32 of file AgnesiOscillator.h.
References M_PI.
|
inlinevirtualinherited |
Set oscillator sample rate.
Reimplemented in PolyBlepOscillator, OscillatorTemplate< T, BaseOscillator, Sample >, OscillatorTemplate< VosimOscillator >, OscillatorTemplate< AntialiasedWavetableOscillator >, OscillatorTemplate< TriangleOscillator >, OscillatorTemplate< InvertedSquareWaveOscillator >, OscillatorTemplate< VariableShapeOscillator >, OscillatorTemplate< InterpolatingWavetableOscillator< LINEAR_INTERPOLATION > >, OscillatorTemplate< NoiseOscillator >, OscillatorTemplate< SquareWaveOscillator >, OscillatorTemplate< SineOscillator >, OscillatorTemplate< AntialiasedTriangleOscillator >, OscillatorTemplate< AntialiasedRampOscillator >, OscillatorTemplate< InvertedRampOscillator >, OscillatorTemplate< AntialiasedSquareWaveOscillator >, OscillatorTemplate< RampOscillator >, OscillatorTemplate< WavetableOscillator >, and ChirpOscillator.
Definition at line 20 of file Oscillator.h.