FOsc Direct-form sinusoid oscillator. 更多...
#include <SinOsc.h>
Public 成员函数 | |
| FSineOsc () | |
| Constructor | |
| FSineOsc (const int32 InSampleRate, const float InFrequencyHz, const float Scale=1.0f, const float Add=0.0f) | |
| Non-default constructor | |
| float | GetFrequency () const |
| Returns the current frequency. | |
| void | Init (const int32 InSampleRate, const float InFrequencyHz, const float Scale=1.0f, const float Add=0.0f) |
| Initialize the oscillator with a sample rate and new frequency. 更多... | |
| float | ProcessAudio () |
| Generates the next sample of the oscillator. | |
| void | SetAdd (const float InAdd) |
| Sets the scale of the oscillator. | |
| void | SetFrequency (const float InFrequencyHz) |
| Sets the frequency of the oscillator in Hz (based on sample rate). 更多... | |
| void | SetScale (const float InScale) |
| Sets the scale of the oscillator. | |
| virtual | ~FSineOsc () |
| Virtual destructor | |
FOsc Direct-form sinusoid oscillator.
Created with a biquad filter (using only feedback coefficients) with poles directly on unit circle in z-plane. Setting frequency uses current filter state to compute initial conditions to avoid pops when changing frequency. Extremely cheap to run but expensive to set new frequencies. Good for test tones.
| void Audio::FSineOsc::Init | ( | const int32 | InSampleRate, |
| const float | InFrequencyHz, | ||
| const float | Scale = 1.0f, |
||
| const float | Add = 0.0f |
||
| ) |
Initialize the oscillator with a sample rate and new frequency.
Must be called before playing oscillator.
| void Audio::FSineOsc::SetFrequency | ( | const float | InFrequencyHz | ) |
Sets the frequency of the oscillator in Hz (based on sample rate).
Performs initial condition calculation to avoid pops.