[PD] Shuffling arrays
claudiusmaximus at goto10.org
Mon Oct 4 16:56:10 CEST 2010
On 03/10/10 23:21, Andrew Faraday wrote:
> Hey Guys
> I've recently come across the .shuffle method in Ruby which randomly re-orders the content of an array. Does anyone know of a way to do this in Pd, that is, either change the order of notes within an array or output them in a random order (without repeating any part of it)?
> Help would be appreciated
You can pick pairs of indices at random and swap them with
tabread/tabwrite; repeat to shuffle more.
I used a similar technique to gradually sort an array (swap random
elements only if they are out of order):
More information about the Pd-list