scaffold new classes

This commit is contained in:
2026-06-10 22:56:15 -05:00
parent 1fd4f03668
commit 347f585630
9 changed files with 117 additions and 0 deletions

35
src/synth/Synth.hpp Normal file
View File

@@ -0,0 +1,35 @@
#pragma once
#include "ConfigService.hpp"
#include "LoggerService.hpp"
#include "NoteQueue.hpp"
#include "Voice.hpp"
#include "Scope.hpp"
#include <vector>
class Synth {
public:
Synth(ConfigService* config, LoggerService* logger, ScopeBuffer* scope);
~Synth();
void process(float* out, size_t nFrames, uint32_t sampleRate);
void handleNoteEvent(const NoteEvent& event);
private:
Voice* findFreeVoice();
Voice* findVoiceByNote(uint8_t note);
std::vector<uint8_t> sustainedNotes_;
// voices
static constexpr size_t MAX_VOICES = 32;
std::array<Voice, MAX_VOICES> voices_;
ScopeBuffer* scope_ = nullptr;
}