Distorted sound if multiple waveforms are played.

Status
Not open for further replies.
Hello again! So I've built MIDI synthesizer on the teensy 4.0, but I am experiencing a problem. I've used the USBHost_t36.h library to bind functions to note on and off MIDI signals, which works perfectly fine. However, if I press many keys at once, the sound becomes increasingly distorted. In the function playing the note, I am using waveforms[index].begin(velocity, freq, type) followed by envelopes[index].noteOn().
the waveforms is an array of 128 AudioSynthWaveform and envelopes is 128 AudioEffectEnvelope.
I hope somebody can tell me what causes the distortion, and if it is possible to fix it.
Thanks in advance.

-Fred
 
Does the coding account for the amplitude limits on adding multiple sounds at once?

If total signal combined hits over 1 you'll hear distortion. Seems there are notes in the Audio tool - or the Tutorial for details.
 
I know that my default amplification is pretty low (0.45 ish), but I didn't take into account that playing multiple notes at once might mean that the total signal more than 1. I will look into it. Thanks.
 
Status
Not open for further replies.
Back
Top