polyphony checkpoint

This commit is contained in:
2026-06-12 23:13:18 -05:00
parent 347f585630
commit 9f79f11a19
10 changed files with 218 additions and 39 deletions

View File

@@ -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_;
};