Jump 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.

Function to get complementary diatonic notes (or any type of set) in relation to a chord

Featured Replies

Dear Friends,

 

I´m trying to make a function to get the complementary diatonic set for a diatonic chord.
For example, if you relate the key of C major (C D E F G A B) with the chord Cmaj7 (C E G B), the complementary set is (D F A). Elliott Carter did this a lot in his Harmony Book, making all kinds of complementarities.

 

This works for comparing stuff. Is there something easier in the system ? For comparing a sequence of chords in relation to a sequence of tonalities for getting the difference ?

 

(defun compare-list-pairs (list-pairs)
  (loop for (list1 list2) in list-pairs
        collect (set-difference list1 list2 :test 'equal)))

 

(compare-list-pairs '(((c4 d4 e4) (c4 e4)) ((5 6 7 8 9) (5 7 8))))

;> ((d4) (9 6))


If you want to work to the diatonic scales as integers, this can be useful, but maybe would be easier with embbeded tonality functions.

 

(position-filter (pitch-to-integer '(e4 eb4 e4 eb4 b4 gb4 e4 db4))
'((0 2 4 5 7 9 11) (1 3 5 6 8 10 0) (2 4 6 7 9 11 1) (4 6 8 9 11 1 3) (5 7 9 10 0 2 4) (6 8 10 11 1 3 5) (7 9 11 0 2 4 6) (8 10 0 1 3 5 7) (9 11 1 2 4 6 😎 (10 0 2 3 5 7 9) (11 1 3 4 6 8 10)))

 

Any idea ?

Thanks !

  • Author

I had this question before:

Here is the answer by Janusz , back in 2021. Thanks, Janusz !

I´m obssessed by the same problems over and over.

Best !

 

(let ((rem (ambitus '(c5 b5) (expand-tonality '((c5 major) (db5 major) (gb5 major)))))
      (super (ambitus '(c5 b5) '((d5 f5 a5 c6) (eb4 gb4 bb4 db4) (fs4 as4 cs4)))))
  (loop for s in super
    for r in rem
    collect (loop for i in s
              do (setf r (remove i r))
              finally (return r))))

 

 

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

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.