engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
Audio::FSineOsc类 参考

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.

成员函数说明

◆ Init()

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.

◆ SetFrequency()

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.


该类的文档由以下文件生成: