wip: filter lfo (still not worked)
This commit is contained in:
20
inc/LFO.h
Normal file
20
inc/LFO.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include "Oscillator.h"
|
||||
|
||||
class LFO: public Oscillator
|
||||
{
|
||||
private:
|
||||
/* data */
|
||||
public:
|
||||
LFO(/* args */);
|
||||
~LFO();
|
||||
void SetFreq(float freq) { m_phase_dt = (this->*m_dt_function)(freq); }
|
||||
};
|
||||
|
||||
LFO::LFO(/* args */): Oscillator(Sine, 0.f, 0.5f)
|
||||
{
|
||||
}
|
||||
|
||||
LFO::~LFO()
|
||||
{
|
||||
}
|
||||
@@ -9,9 +9,7 @@ class Oscillator {
|
||||
float m_key;
|
||||
float m_volume;
|
||||
float m_phase;
|
||||
float m_phase_dt;
|
||||
float (Oscillator::*m_osc_function)(void);
|
||||
float (Oscillator::*m_dt_function)(float freq);
|
||||
void SineOscPhaseIncr();
|
||||
void SawOscPhaseIncr();
|
||||
float CalcSawPhaseDelta(float freq);
|
||||
@@ -22,6 +20,10 @@ class Oscillator {
|
||||
float Sign(float v);
|
||||
float SineOsc();
|
||||
|
||||
protected:
|
||||
float m_phase_dt;
|
||||
float (Oscillator::*m_dt_function)(float freq);
|
||||
|
||||
public:
|
||||
Oscillator(OscillatorType osc, float fine, float volume);
|
||||
~Oscillator();
|
||||
|
||||
Reference in New Issue
Block a user