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.

Interval distance of a list (integers or pitches) in relation to a chosen note

Featured Replies

Dear All, 

 

Is there a function for get all intervals of a row (or any list of integers or pitches) in relation to one note ?

For example, given this 12 tone row:

(a3 gs4 c4 d4 bb3 b3 fs4 f4 cs4 g4 ds4 e4)

Get all intervals related to a4 ?

The result should be:

 

(-12 -1 -9 -7 -11 -10 -3 -4 -8 -2 -6 -5)

 

This is for getting a resultant set of numbers related to a chromatic octave-module. Each order of the set result in a different set.

Maybe can be a mapping function.

 


(defun interval-distance (alist n)
  (let ((alist (if (pitchp (car alist))
                 (pitch-to-midi alist)
                 alist))
        (n (if (pitchp n)
             (pitch-to-midi n)
             n)))

    (loop for i in alist
      collect (- i n))))
    
(interval-distance '(c4 d4 b2 e7) 'c4)
=> (0 2 -13 40)
(interval-distance '(c4 d4) 'c4)
=> (0 2)
(interval-distance '(43 44) '41)
=> (2 3)
(interval-distance '(56 48 11) 'c4)
=> (-4 -12 -49)

 

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.