You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
633 B

#ifndef __SYNTH_H__
#define __SYNTH_H__
#include "voicemanager.h"
#include "part.h"
class Synth {
public:
Synth() {
for(int i = 0; i < 16; ++i) {
parts[i].voiceManager = &voiceManager;
parts[i].loadPreset(&DEFAULT_PRESET);
}
}
void noteOn(int ch, int note, int vel);
void noteOff(int ch, int note);
void control(int ch, int cc, int val);
frame tick() {
frame out{};
for(auto& part : parts) {
out += part.tick();
}
return out * 0.125;
}
private:
VoiceManager voiceManager{};
Part parts[16];
};
#endif