Is there an object that already does this? Any approaches, suggestions etc. most welcome.
Ricky
Generating all possible permutations of a fixed number set
Is there an object that already does this? Any approaches, suggestions etc. most welcome.
Ricky
I have no suggestions but I've always wondered about this; in the Autechre track "Flutter" the drum pattern is apparently programmed to be entirely different every measure, never repeating. It would be really cool to set up something like that in PD with permutations.
Yes, albeit I'm approaching this from an atonal composition point of view. Basically, the same principle applies here. It is simple to work out on paper, but for convenience sake, it would be nice to have an object to output a matrix of a set, variable in size (i.e. variable amount of notes per set). It could of course, then, be applied to various other cues, such as rhythm etc. I'm thinking some combination of
and [coll] may be feasible. Of course there are many ways in which such an object could be built;
e.g. Say we have a number set 1 2 3 4; I might follow "An Ordered Lexicographic Permutation Algorithm based on one published in Practical Algorithms in C++":
http://www.bearcave.com/random_hacks/permute.html
Thus printing all possible permutations of sets of 4 (3, 2, 1) stored, for example, in a [coll];
1 2 3 4 2 1 3 4 3 1 2 4 4 1 2 3
1 2 4 3 2 1 4 3 3 1 4 2 4 1 3 2
1 3 2 4 2 3 1 4 3 2 1 4 4 2 1 3
1 3 4 2 2 3 4 1 3 2 4 1 4 2 3 1
1 4 2 3 2 4 1 3 3 4 1 2 4 3 1 2
1 4 3 2 2 4 3 1 3 4 2 1 4 3 2 1
Does anyone have any suggestions?
Cheers,
Ricky
It's definitely not perfect, but I just made this. It only works for a list containing four elements. It uses a subpatch that permutes a list of three elements (much easier to do).
Couldn't resist a bit of thread necromancy! 
Here's a way of generating randomised permutations of any input list
@Jwif said:
Couldn't resist a bit of thread necromancy!
Here's a way of generating randomised permutations of any input list
Additional necromancy! I found this patch to be helpful. A lot of interesting stuff in the RJDJ library it draws from as well. Just wanted to share a vanilla version as it takes some time to put all those abstractions into subpatches:
: vanilla permutation.pd
if you have a four number set. you would end up with 4x4x4x4 lists right?
so it looks like 0-9999 except that 0-9 is actually a 4 number set instead of a 10 number set. so you count upward and use the numbers as symbols but you only use 4 before rolling over. that might work.
the ones place goes through "a,b c d" over and over and then the tens place changes to b when you hit "a" again. and then when the ones place changes to a "a" third time the tens place changes to "c" etc etc.
aaaa aaab aaac aaad aaba aabb aabc aabd aaca aacb aacc aacd
here I made an odometer thing
mod4_rollover1.pd


@willblackhurst you generate the combinations but the main subject is the permutations I think.
EDIT: my two cents

perm4.pd
Work in progress : FCPD a FreeCAD PureData connexion
this is how you convert the other one, I dont really use symbol lists yet. so I looked it up on the help page for pack object.
abcd_rollover.pd

Oops! Looks like something went wrong!