September 21, 2025Sep 21 Hello, I'd like to find all permutations / orderings of pitch classes across 2 octaves without repeating pitch classes. So given c4 d4 e4 for example, I'd like permutations that would include like c4 d3 e4 and d4 e3 c5 but not include repeating pitch classes like c4 c3 for example. How would I find that? Thanks for any info!
September 22, 2025Sep 22 I forget if there’s a function to do this or not, but if you had a list of octave representations for each pitch class you want combinations of, you could find every possible “pick one from each list” combination and then sort each of the results if you wanted.For your example, you would have 3 lists: (c3 c4) (d3 d4) (e3 e4)The function would output the 8 possible combinations of picking one from each list.I feel like there’s a built-in function that does this, but I’m not near my Opusmodus machine to check the documentation. If not, I don’t think it would be too difficult write one, particularly if every one of the source lists is the same length.Cheers,Jon
September 23, 2025Sep 23 You can just permute on one octave and add random-octaves.(setf lst '(c3 d3 e3)) (setf result (rnd-octaves '(c3 c5) (permute lst)))
September 23, 2025Sep 23 Author Thanks, running rnd-octaves would give me some of the possible combinations on each execution, but I'm looking to find all combinations/permutations. I had thought there might be a function to do this ( with permute, combination, or filter-repeat on pitch class ) but am not seeing a simple way?
September 23, 2025Sep 23 All prmutation is wast of time and cpu power. The simplest solution is to randomly select the values with a given count.
September 24, 2025Sep 24 14 hours ago, eboats said:Thanks, running rnd-octaves would give me some of the possible combinations on each execution, but I'm looking to find all combinations/permutations. I had thought there might be a function to do this ( with permute, combination, or filter-repeat on pitch class ) but am not seeing a simple way?found it: cartesian(cartesian '((c3 c4)(d3 d4)(e3 e4)))=> ((c3 d3 e3) (c3 d3 e4) (c3 d4 e3) (c3 d4 e4) (c4 d3 e3) (c4 d3 e4) (c4 d4 e3) (c4 d4 e4))
September 24, 2025Sep 24 Author 9 hours ago, jon said:found it: cartesian(cartesian '((c3 c4)(d3 d4)(e3 e4)))=> ((c3 d3 e3) (c3 d3 e4) (c3 d4 e3) (c3 d4 e4) (c4 d3 e3) (c4 d3 e4) (c4 d4 e3) (c4 d4 e4))Ah, that's the kind of thing I was looking for, thanks!
September 24, 2025Sep 24 You're welcome. No doubt @opmo and @Stephane Boussuge are right about the limited compositional utility of generating all the permutations/combinations and whether it outweighs the computational cost. I do find myself sometimes falling into the Tom Johnson "completeness-mode", particularly when I'm playing around with new materials and they're small sets of pitch classes or rhythms.Cheers,Jon
Create an account or sign in to comment