Hi everyone,
I’m working on a Teensy 4.0 project with the Audio Shield, where I want to play multiple simultaneous tones (up to 8 voices) using AudioSynthWaveform. My goal is to play simple chords, each voice controlled by a separate softpot.
Here’s what I’ve tried so far:
Some observations:
My questions are:
Any advice or examples for clean polyphonic output would be greatly appreciated!
TLDR;
I’m trying to play multiple AudioSynthWaveform voices on a Teensy 4.0 via a single AudioMixer4, but when I sum 2+ tones I hear harsh digital noise even at low amplitudes. Smoothing and envelopes don’t help. How can I safely mix multiple voices for clean polyphonic output?
I’m working on a Teensy 4.0 project with the Audio Shield, where I want to play multiple simultaneous tones (up to 8 voices) using AudioSynthWaveform. My goal is to play simple chords, each voice controlled by a separate softpot.
Here’s what I’ve tried so far:
- I used multiple AudioSynthWaveform objects connected to an AudioMixer4, and then to the I2S output.
- I kept the amplitude of each waveform low (0.3) and tried smoothing the output, but when I play two or more tones, I still hear harsh digital noise / interference.
- I experimented with trying to manually sum floating-point samples and push them to I2S, but AudioOutputI2S::update() doesn’t accept arguments and AudioStream::allocate() is protected, so that approach doesn’t work.
Some observations:
- The noise occurs even when the summed amplitudes are well below 1.0.
- It happens even when the notes are octaves apart, so it doesn’t seem to be a beating or phase problem.
- Smoothing or envelopes don’t fix it.
My questions are:
- Is there a recommended way to safely mix more than 2–4 AudioSynthWaveform voices into a single output without producing digital noise?
- Should I be using a different approach for polyphony (e.g., multiple mixers, separate outputs, or another class)?
- Are there any best practices for avoiding HF spikes when summing waveforms in the Teensy Audio Library?
Any advice or examples for clean polyphonic output would be greatly appreciated!
TLDR;
I’m trying to play multiple AudioSynthWaveform voices on a Teensy 4.0 via a single AudioMixer4, but when I sum 2+ tones I hear harsh digital noise even at low amplitudes. Smoothing and envelopes don’t help. How can I safely mix multiple voices for clean polyphonic output?