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.
 
 

36 lines
726 B

#ifndef __SYNTH_H__
#define __SYNTH_H__
#include "voicemanager.h"
#include "channel.h"
#include "frame.h"
class Synth {
public:
Synth() {
for(int i = 0; i < 16; ++i) {
channels[i].number = i;
channels[i].voiceManager = &voiceManager;
channels[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& channel : channels) {
out += channel.tick();
}
out *= 0.100;
return out;
}
private:
VoiceManager voiceManager{};
Channel channels[16];
};
#endif