output scaling
This commit is contained in:
parent
e1be8eb404
commit
ae4adc6122
|
@ -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(); }
|
||||||
|
|
Loading…
Reference in New Issue