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.

get-proportions

Featured Replies

;;; GETTING THE LENGTH-PROPORTIONS AS INTEGERS

(defun get-proportions (omn_seq &key (abs 'nil))
  (let ((denoms))
    (progn 
      (setf denoms (remove-duplicates
                    (loop for i in (omn :length omn_seq)
                      collect (denominator (abs i)))))
      (loop for i in (omn :length omn_seq)
        collect (if (equal abs 't)
                  (* (abs i) (apply 'lcm denoms))
                  (* i (apply 'lcm denoms)))))))

;; examples      
(get-proportions '(-3q 3h_h. d3 mf))
(get-proportions '(5q 5q 5q 5q 5q -e -s t t -q))
(get-proportions '(5q 5q 5q 5q 5q -e -s t t -q) :abs t)
(get-proportions '(-e -t t t t t t t t t -s. -q))


;;; HOW TO USE

(setf rhy '(-3h 3q_5h. 5q 5q c4))
(setf props (get-proportions rhy :abs nil))


;;; you can use that for GEN-LENGTH-CONSTANT

;; ordinary
(gen-length-constant props 'w.)
;; a bit advanced
(gen-length-constant props 'h.)
;; crazy 
(gen-length-constant props 'h._e)

 

With nested lists:

(defun get-proportions (sequence &key abs)
  (do-verbose ("get-proportions")
    (flet ((get-proportions-l (sequence &key abs)
             (let* ((length (omn-length sequence))
                    (den (remove-duplicates
                          (loop for i in length
                            collect (denominator (abs i)))
                          :from-end t)))
               (loop for i in length
                 collect (if abs (* (abs i) (apply #'lcm den))
                           (* i (apply #'lcm den)))))))
      (if (listsp sequence)
        (loop for i in sequence
          collect (get-proportions-l i :abs abs))
        (get-proportions-l sequence :abs abs)))))
    
(get-proportions '(5q 5q 5q 5q 5q -e -s t t -q))
=> (8 8 8 8 8 -20 -10 5 5 -40)

(get-proportions '((-e -t t t t) (t t t t t -s. -q)))
=> ((-4 -1 1 1 1) (1 1 1 1 1 -3 -8))

 

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

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.