add oscillator
This commit is contained in:
29
src/synth/Instruments/WavetableOscillator.hpp
Normal file
29
src/synth/Instruments/WavetableOscillator.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "synth/instruments/Instrument.hpp"
|
||||
|
||||
class PianoString : public Instrument {
|
||||
|
||||
public:
|
||||
|
||||
WavetableOscillator() = default;
|
||||
WavetableOscillator(ConfigService* config, LoggerService* logger, float sampleRate);
|
||||
~WavetableOscillator() = default;
|
||||
|
||||
void noteOn(float frequency, float velocity) override;
|
||||
void noteOff() override;
|
||||
|
||||
bool isActive() override;
|
||||
|
||||
float process(bool& scopeTrigger) override;
|
||||
|
||||
private:
|
||||
|
||||
bool loadWavetable(std::string filename); // TODO: load from conf file instead
|
||||
|
||||
std::vector<float> wavetable;
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user