added midi synth base class and voice allocator

This commit is contained in:
Christopher Herb
2023-07-07 15:48:32 +02:00
parent d9bcd96276
commit feba37aae8
2 changed files with 96 additions and 4 deletions

View File

@@ -47,17 +47,16 @@ public:
std::for_each(voices.begin(), voices.end(), f);
}
void process_samples(double** _outputs, int _start_index, int _block_size)
void process_samples(double* _output, int _start_index, int _block_size)
{
for (int s = _start_index; s < _start_index + _block_size; s++) {
process_events(s);
float voices_signal = 0.;
std::for_each(voices.begin(), voices.end(), [&voices_signal](t_voice& voice) { voices_signal += (voice.ProcessSample() / 3.); });
std::for_each(voices.begin(), voices.end(), [&voices_signal](t_voice& voice) { voices_signal += (voice.process_sample() / 3.); });
_outputs[0][s] = voices_signal;
_outputs[1][s] = voices_signal;
_output[s] = voices_signal;
}
}