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.

Featured Replies

There is a function "expand-tonality" that gives me the following result: (expand-tonality ' (c4 messiaen-mode4)) => (c4 cs4 d4 f4 fs4 g4 gs4 b4). Is there a reverse function? That is, the input would be the notes and the output would be the name of the scale/tonality?

 

Thanks in advance for your help!

You can use pitch class analysis to know the Forte number of a set of pitches

like this

(pcs-analysis '(7 10 3 8 11 5 2))

 

Original Prime Order: (7 10 3 8 11 5 2)

 

Pitch: (g4 bb4 eb4 gs4 b4 f4 d4)

 

Inversion: (5 2 9 4 1 7 10)

 

Complement: (0 1 4 6 9)

 

Normal Order: (2 3 5 7 8 10 11)

 

Prime Form: (0 1 3 5 6 8 9)

 

Forte: 7-32b - THIS IS WHAT YOU NEED

 

Directed Interval Vector: (1 2 2 1 2 1 3)

 

Interval Vector: (3 3 5 4 4 2)

 

Interval Class: (3 5 5 3 6 3)

Hi, here's a slow way to do it. 

 

Jesper

 

;; for faster result you could remove modes from this list

(setf mds '(Acoustic Chromatic Major Minor Ionian-I Dorian-II Phrygian-III Lydian-IV Mixolydian-V Aeolian-VI Locrian-VII Pentatonic Diminished-Augmented Dominant Altered Tones Hyperaeolian Mischung Genus Octatonic Composers Gypsy Byzantine Gregorian Messiaen Tcherepnin Prometheus Arabic Persian Iran Peruvian Hawaiian Blues Jazz Scottish Greece Armenia Ethiopia Algerian Tunisian Egyptian Korean Japan Jewish Hungarian Romanian Spanish North-America South-America China Indian Indian-Mela Indian-Raga))

 

(setf sc (flatten (loop for x in mds collect (library 'modes x nil :collect :all))))
;; raga-kuntalavarali throws an error so removing it
(setf sc (remove 'raga-kuntalavarali sc))

 

;; scale to look for
(setf scale '(c4 cs4 d4 f4 fs4 g4 gs4 b4))

 

(loop for x in sc when (equal scale (expand-tonality (list (car scale) x) :type :pitch)) collect x)

 

Might be better to use integers otherwise a different spelling will not match

 

(setf scale (pitch-to-integer '(c4 cs4 d4 f4 fs4 g4 gs4 b4)))


(loop for x in sc when (equal scale (expand-tonality (list 'c4 x) :type :integer)) collect x)
 

Faster to collect all the expanded scales once.

(setf all-scales (loop for x in sc collect (list x (expand-tonality (list 'c4 x) :type :integer))))

;; then use find to find the first one

(find scale all-scales :key 'cadr :test 'equal) 

 

;; or collect the positions of all matches

;; new scale with more matches

(setf scale (pitch-to-integer '(c4 d4 e4 f4 g4 gs4 bb4)))

(setf all-positions (loop with pos = -1 while pos collect (setf pos (position scale all-scales :key 'cadr :test 'equal :start (+ 1 pos))))) 

;; then get the matches

(setf result (loop for p in all-positions when p collect (nth p all-scales)))

 

((melodic-major (0 2 4 5 7 8 10)) (major-minor (0 2 4 5 7 8 10)) (mixolydian-b6 (0 2 4 5 7 8 10)) (aeolian-major (0 2 4 5 7 8 10)) (mischung6 (0 2 4 5 7 8 10)) (mela-carukesi (0 2 4 5 7 8 10)) (raga-charukeshi (0 2 4 5 7 8 10)) (raga-tarangini (0 2 4 5 7 8 10)))


 

 

  • Author

Thank you very much, JulioHerrlein. A good way to know the Forte number of a set of pitches. Best, Mauricio.

Many thanks for your kind reply, jesele. Your code works perfect. I am amazed by your absolute mastery of Lisp. Very best, Mauricio.

30 minutes ago, Mauricio said:

I am amazed by your absolute mastery of Lisp.

Ha, I wish but thanks anyway.

 

Jesper

Create an account or sign in to comment


Copyright © 2014-2025 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

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.