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

For generating a harmonic rhythm, I needed to merge notes that are tied. If extracting only the length values with omn directly, then all ties are lost.

 

 (omn :length '((h c4 pizz q arco+tie) (q h tie) (h.)))
 => ((1/2 1/4) (1/4 1/2) (3/4))

 

So, I wrote myself a function that merges the lengths of tied notes.

 

 (lengths-with-merged-ties '((h c4 pizz q arco+tie) (q h tie) (h.)))
 => (1/2 1/2 5/4)

 

 

The definition is below.

 

Best,

Torsten

 

(defun lengths-with-merged-ties (sequence)
  "Returns a flat list of lengths that preserves the lengths in sequence including their tied notes.
  
  Example:
  (lengths-with-merged-ties '((h c4 pizz q arco+tie) (q h tie) (h.)))
  => (1/2 1/2 5/4)

  Contrast:
  (omn :length '((h c4 pizz q arco+tie) (q h tie) (h.)))
  => ((1/2 1/4) (1/4 1/2) (3/4))"
  (butlast
   (reduce #'(lambda (&optional accum pair2)
               (when (and accum pair2)              
                 (append 
                  (butlast accum 2)
                  (if (equal (first (last accum)) 'tie)
                    (list (+ (first (last (butlast accum))) (first pair2)) (second pair2))
                    (list (first (last (butlast accum))) (first pair2) (second pair2)))
                  )))
           (matrix-transpose  
            (list (omn :length (flatten-omn sequence))
                  (mapcar #'(lambda (arts)
                              (when (member 'tie arts)
                                'tie))
                          (mapcar #'disassemble-articulations 
                                  (omn :articulation (flatten-omn sequence)))))))))

;; I shared the function disassemble-articulations alongside similar functions before, 
;; but repeat it here for your convenience  
(defun disassemble-articulations (art)
  "Splits a combined OMN articulations into a list of its individual attributes.

  Example:
  (disassemble-articulations 'leg+ponte)
  => (leg ponte)"  
  (mapcar #'intern (split-string (symbol-name art) :separator "+")))

 

nice, but didn't found this function in the library, so you has to code...

  • Author

Great, thanks! Would you consider adding a documentation file for that function? If not, could you at least add a doc string to the code, so that it could be of use for at least more advanced users?

 

For everyone else: when you are searching for a function that is not documented by its own RTF file and thus cannot be found via the standard Opusmodus documentation search, you could use the following function. Some internal Opusmodus functions without standard Opusmodus documentation have at least a documentation string. 

 

;; return all functions that contain 'omn' in their name, together with their documentation string (if there is any).

(apropos-function-documentation "omn")

 

The function apropos-function-documentation is defined below.

 

Best,

Torsten

 

(defun apropos-function-documentation (my-string &optional (package *package*))
  "Lists all functions that contain `my-string' alongside their documentation in a list of pairs
  (<function-symbol> <doc-string>)"
  (mapcar #'(lambda (x) (list x (documentation x 'function)))
          (remove-if-not #'fboundp (apropos-list my-string package))))

 

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.