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.

shift-rhythm Function

Featured Replies

Hello, Opusmoders

Sometime ago I was here searching for a function to displace rhtyhms by a length amount, not just like a list rotation.

Now I did this prototype. I think that this can be very useful, specially inside counterpoint dictums where patterns can be displaced ( I did not tried inside the counterpoint function but seems like it will work).

Hope it can be useful to you too.

All the best,

Julio

(defun shift-rhythm (rhythm shift-length &key span)

;"Moves rhythmic material by inserting a pause at the beginning.

;Use length-adjust to ensure the result fits within the span."

(let* ((rhy (flatten rhythm))

;;;; Ensures a linear list for processing

;; Adds the offset value as a negative pause at the beginning [5]

(with-offset (append (list (- (abs shift-length))) rhy))

;;Define the target span: either the requested one or the original rhythm.

(target-span (or span (get-span rhythm))))

;; The length-adjust function adjusts the total to the desired span [1].

;; With :position 'e (default), it removes or adds from the end of the list [6].

(length-adjust target-span with-offset :omn t :type 'r)))

;;; USE

;Exemplo 1: Span de 4/4 (1/1)

(setf ideia '(e c5 e d4 q f4 -h)) ;; Span original de 1/1

(shift-rhythm ideia 1/8 :span 3/4)

;; (-e e c5 d4 q f4 -e)

(shift-rhythm ideia 3/8 :span 5/4)

;; (-q. e c5 d4 q f4 -q.)

also with negative displacement

(setf ideia '(-h e c5 e d4 q f4 -h))

(shift-rhythm ideia -1/8 :span 7/4)

;;(-e -h e c5 d4 q f4 -h -e)

It could be perfected to deal with nested sublists and with different displacements for each sublist, like

(setf ideia '((-h e c5 e d4 q f4 -h)(-h e c5 e d4 q f4 -h.)(-h e c5 e d4 q f4 -q))

(shift-rhythm ideia '((-1/8) (2/16) (3/8)) :span 7/4)

etc

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

Important Information

Terms of Use Privacy Policy

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.