Routing Audio for Switching

Jim Leyden's icon

I've been looking around and I can't seem to find what I'm looking for - basically an object like "pack/unpack" but for audio signals. I want to be able to have one patch cord run out of a "pack~" object so I can use it to switch between different sections of a patch. Essentially I want to route multitrack audio to a switcher so I can switch it to do something else for different song sections with a keystroke.

nouserid's icon

I reckon [matrix~] would work nicely for that

Jim Leyden's icon

Here's what I did so far, It'll work but I'm wondering if it's the most efficient way to go? I'll have to do it for about 40-60 clumps of 10 audio tracks (as its set up now it's just the 3)

Max Patch
Copy patch and select New From Clipboard in Max.

Robin Parmar's icon

A few tips will help you clean up the patcher. You've got dozens of extra objects there.

First, a message box can hold more than one message.
Replace... (0 0 1) (1 1 1) (2 2 1) ...
With... (0 0 1, 1 1 1, 2 2 1) ...

Second, select can have more than one parameter to match.
Replace... [sel 0] [sel 2] [sel 4]
With... [sel 0 2 4]
And then use the different outlets.

Third, if you are only using MIDI note on data:
Replace... [midiparse]
With... [notein] going to [stripnote]

Fourth, don' t put extra [bang] objects everywhere, since they will degrade performance.

Ernest's icon

The most CPU efficient way to switch audio is to send 'set' commands to receive~ objects. This does not permit simple declicking, as you can do in matrix~, and adds some buffer delay to the output, but it's a lot easier to build. If you have alot of signals I recommend trying it out. At least some of your design will benefit from it probably.

mizu's icon

+ 1
1 sample of delay. Inside a poly~, it's possible to switch audio on/off locally, the time to switch.
zzz