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:
https://github.com/danomatika/BangYourHead/tree/master/3.Audio/rand8player https://github.com/danomatika/BangYourHead/tree/master/3.Audio/rand8player
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.
if you want further heavy usage of this approach with multiple mapping layers, see https://github.com/zkmkarlsruhe/ZirkoniumSpatializationServer https://github.com/zkmkarlsruhe/ZirkoniumSpatializationServer
On Oct 5, 2021, at 4:12 AM, pd-list-request@lists.iem.at wrote:
Message: 1 Date: Tue, 5 Oct 2021 00:08:22 +0200 From: Simon Iten <itensimon@gmail.com mailto:itensimon@gmail.com> To: Pd-list <pd-list@lists.iem.at mailto:pd-list@lists.iem.at> Subject: [PD] Fwd: random routing of 8 audio-streams to 8 outputs Message-ID: <CAP9NQknMyn6OJSfP9UjBCf-ZNykr5QRP6qnbxA60pOcBLSUoLQ@mail.gmail.com mailto: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~) to 8 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 get stuck on the random logic, since every ?step? that chooses a destinations changes the subsequent outputs that are still allowed to be chosen.
Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/