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

I sometimes like to turn certain notes into rests. The built-in function length-rest-series is great for that, but it only works with lengths, not full OMN expressions. So, I generalised that function. I can do now, e.g., the following. 

 

(setf melody '((s eb6 < leg f5 < leg c5 < leg f5 < leg) (e e6 f - -q)))

(note-rest-series '(1 1) melody :swallow T :section '(0))

; => ((-s - c5 < leg f5 < leg) (e e6 f - -q))

 

Note that in contrast to the original function length-rest-series, the new function note-rest-series does not only support OMN expressions, but also extra arguments like swallow and section.

 

The definition of this function uses length-rest-series and my function edit-omn for writing such generalisations, and it can therefore be rather short. In fact, the documentation string of the function is much longer than the definition itself :)  Please see below.

 

The function edit-omn is part of my tot library, which is available at GitHub. You can see its definition at starting at (currently) line 24 at https://github.com/tanders/tot/blob/master/sources/OMN-utils.lisp

 

Note that with edit-omn you can also easily turn other functions that expect just a single parameter list (e.g., pitches, or lengths) into functions for OMN expressions by automatically preserving the time signature and very conveniently adding standard arguments like flat or section. 

 

Best,

Torsten

 

(defun note-rest-series (positions sequence &key (flat nil) (swallow nil) (section nil))
  "This function is like the Opusmodus built-in length-rest-series, but supports arbitrary OMN expressions as input and additionally the arguments swallow and section.

  Args:
  - positions (list of ints): positions of notes to be turned into rests
  - sequence (list of lengths or OMN expression): music to process
  - flat (Boolean): whether positions count for sublists (nil) or the whole list (T)
  - swallow (Boolean): whether the pitches of notes turned into rests should be shifted to the next note or omitted (swallowed) 
  - section (list of ints): positions of sublists to process. This argument is ignored if flat is T.

  Example:

;;; (setf melody '((s eb6 < leg f5 < leg c5 < leg f5 < leg) (e e6 f - -q)))
;;; (note-rest-series '(1 1) melody :swallow T :section '(0))
"
  (edit-omn :length sequence 
            #'(lambda (ls) (length-rest-series positions ls))
            :swallow swallow
	    :section section
	    :flat flat))

 

  • Author

Dear Stephane,

 

Did you follow the installation instructions at https://github.com/tanders/tot? Have you installed git? Unfortuantely, the installation is a bit complicated, as there are several dependencies. Therefore I explained it at the link above. The package TU is provided by the library ta-utilities, which you can install with git like everything else. 

 

If you want to only have the function you could also go directly to the library ta-utilities at GitHub and copy out the missing functions (https://github.com/tanders/ta-utilities/blob/master/my-utilities.lisp), e.g., remove-properties which then in turn depends on remove-property in the same file. 

 

Best,

Torsten

Works fine here to.

 

Thx

/Lasse

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.