output scaling

This commit is contained in:
Gordon JC Pearce 2025-08-22 23:04:38 +01:00
parent e1be8eb404
commit ae4adc6122
1 changed files with 6 additions and 1 deletions

View File

@ -55,12 +55,17 @@ void Tonewheel::deactivate() {
void Tonewheel::run(const float**, float** outputs, uint32_t frames, void Tonewheel::run(const float**, float** outputs, uint32_t frames,
const MidiEvent* ev, uint32_t evCount) { const MidiEvent* ev, uint32_t evCount) {
for (uint32_t i = 0; i < evCount; i++) { for (uint32_t i = 0; i < evCount; i++) {
assigner->handleMidi((MidiEvent*)&ev[i]); assigner->handleMidi((MidiEvent*)&ev[i]);
} }
generator->run(outputs[0], frames); generator->run(outputs[0], frames);
// scale the final output and copy to right channel
for(uint32_t i=0; i<frames; i++) {
outputs[0][i] *= 0.5;
}
memcpy(outputs[1], outputs[0], frames * sizeof(float));
} }
Plugin* createPlugin() { return new Tonewheel(); } Plugin* createPlugin() { return new Tonewheel(); }