Skip to content
View in the app

A better way to browse. Learn more.

Opusmodus

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Permute / pitch class

Featured Replies

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!

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

  • 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?

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))

  • 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!

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


Copyright © 2014-2026 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.