Multichannel PWM Output


New member
Hello everyone,

A friend and I are working on building a multichannel haptic audio interface designed primarily for artists who are Deaf or hard-of-hearing. The goal is to make it as affordable and easily DIY-able as possible using a Teensy 4.0.

First, some background information: Per my friend, who’s much more knowledgeable about haptic audio than I am, an individual's detection bandwidth for haptic audio goes up to about 1 kHz, and minimum detection thresholds for harmonic distortion are fairly high. So, for this project we’re aiming to trade a lot of unnecessary audio information for a multichannel output. As such, I’ve been working on getting as many PWM outputs as possible from the Teensy audio library. Using the audio library’s PWM and MQS outputs, along with MarkT’s awesome noise-shaped PWM (, discussed in this thread:; thank you so much for making that if you read this, Mark!), I’ve gotten 7 independent PWM outputs that all feel great to me in terms of haptic audio quality. Even using only pin 3 with the audio library’s PWM output seems to give enough of a high-quality signal for our needs that I’m going to try combining two input signals, so that pin 4 gives an 8th channel rather than extra precision for one channel.

With that out of the way, the big question is: how might I get even more PWM audio outputs from a Teensy? In particular, what are the current hardware and/or software limitations that lead to only allowing one PWM output and two MQS outputs from the audio library, plus a maximum of 4 noise-shaped PWM outputs from MarkT’s addition? Second, where would be good to look when designing workarounds for these limitations?

As another side note, we’re planning on sending audio into the interface via USB. I’ve been reading through and attempting to understand this thread on multichannel USB audio with a Teensy, but again because our sample rate needs are so much lower than many other projects, we’ve also been working on interleaving multiple audio channels into one on a computer and de-interleaving them on the Teensy. If anyone’s done that before and has opinions, I’m definitely interested!

Thanks so much!
Glad to hear the noise-shape stuff is being used! In fact going back to it and reading the source makes me realize I've completely forgotten how it works...