polyphony checkpoint
This commit is contained in:
@@ -12,9 +12,10 @@ class Voice {
|
||||
public:
|
||||
|
||||
Voice() = default;
|
||||
Voice(ConfigService* config, LoggerService* logger);
|
||||
~Voice() = default;
|
||||
|
||||
void noteOn(int8_t midiNote, float velocity);
|
||||
void noteOn(uint8_t midiNote, float velocity);
|
||||
void noteOff();
|
||||
bool isActive();
|
||||
|
||||
@@ -25,12 +26,16 @@ private:
|
||||
|
||||
float sampleRate_ = 44100.0f;
|
||||
|
||||
inline float noteToFrequency(uint8_t note);
|
||||
inline float noteToFrequency(uint8_t note) {
|
||||
return 440.0f * pow(2.0f, static_cast<float>(note - 69) / static_cast<float>(12));
|
||||
}
|
||||
|
||||
uint8_t note_ = 0;
|
||||
float velocity_ = 1.0f;
|
||||
bool active_ = false;
|
||||
|
||||
Instrument* instrument;
|
||||
ConfigService* config_;
|
||||
LoggerService* logger_;
|
||||
Instrument instrument_;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user