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

Thread: Audio Router Module?

  1. #1

    Audio Router Module?

    I'm curious if there would be any sort of performance advantage if an audio router component existed. This would basically be like a mixer, but fixed input=output gain. I could see a use for a four in/four output crosspoint style. I am not versed enough in how the audio components are created, so this might not even be possible.

    For those curious, my immediate use would be to take 4 inputs and be able to switch them around under software control - say someone plugs in two of the inputs backwards, we can fix that in software. I could also see a use when playing with various other effects and synths of being able to switch them in and out of the chain.


  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    The mixer and amp features can do this now. When you set the gain to 0 or 1.0, they act like switches. Internally the code handles gain of 0 and 1.0 as special cases, routing the signals rather than going through the work of multiplying every sample.

    So from a technical performance perspective, there's really little to nothing to be gained by having another object that does a complex switch matrix. It would be the same as just building it from mixers or amps.

    From a human usability perspective, things aren't nearly so black & white. Technically, even the amp isn't needed, as it's just the same as using 1 channel of a mixer. But there was consistent feedback from people that using a 4 channel mixer to just switch or amplify or attenuate a single signal didn't feel right. So the 1 input, 1 output amp object was added to the library, and I spent a little time to create a nice graphic showing the 3 usage modes, since it was more about human convenience than a technical need.

    Whether a switch matrix or other routing-oriented object makes sense from a usability perspective is a good question. The idea has come up a couple times. But the feedback so far is nothing like the steady chorus of requests for a simple switch or gain block when we only had the mixer, so at this point my main thinking is along the Zen of GitGub "Anything added dilutes everything else".

  3. #3
    Hi Paul,

    Ah, that makes sense. I noted that the amp mentions the 0 and 1.0 special cases, but the mixer didn't, so I wasn't sure. Thank you for the clarification!

    My plan is to create this as a mixer. While the component would make things easier, I don't see it as much of a priority as what I'm sure your list is already jammed with.

    Personally I'd vote for more work on DAC and ADC directly on the Teensy 4.0 over a router object!

    Thank you!

Posting Permissions

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