Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Distorted sound if multiple waveforms are played.

  1. #1
    Junior Member
    Join Date
    Oct 2019
    Posts
    6

    Distorted sound if multiple waveforms are played.

    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

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,096
    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.

  3. #3
    Junior Member
    Join Date
    Oct 2019
    Posts
    6
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •