I do this using throw~ and catch~ where the mapping happens in an abstraction within a clone object. I've used this heavily for spatialized projects at work up for up to 64 channels.
Here is a simple solution using Han's c_urn suggestion to do the random number generation:
This could be further cleaned by using an output abstraction that wraps a [dac~] without creation args so you can set the output channel. You could also integrate the [dac~] into the existing channel map abstraction too, but I figured it was easier to read using a single doc~ object as an example.
Message: 1Date: Tue, 5 Oct 2021 00:08:22 +0200From: Simon Iten <itensimon@gmail.com>To: Pd-list <pd-list@lists.iem.at>Subject: [PD] Fwd: random routing of 8 audio-streams to 8 outputsMessage-ID: <CAP9NQknMyn6OJSfP9UjBCf-ZNykr5QRP6qnbxA60pOcBLSUoLQ@mail.gmail.com>Content-Type: text/plain; charset="utf-8"is there a somewhat elegant way to route 8 audio outputs (from readsf~) to8 dac~ outputs randomly (on a bang for example)?i.e. out1 to dac4, out2 to dac7 etc.each output is allowed to one dac~ channel only.mathematically speaking that would be 8! 8x7x6x5x4x3x2x1 (40320)possibilites, but i don?t see an easy way to program this in puredata.some way of dynamic patching maybe? or a throw~ and catch~ approach? i getstuck on the random logic, since every ?step? that chooses a destinationschanges the subsequent outputs that are still allowed to be chosen.