30 lines
598 B
C++
30 lines
598 B
C++
|
|
#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;
|
|
|
|
};
|