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

Hello,

Below is a method I use a lot in generating rhythms in my compositions.

It generates a list of pulses of n units, where the pulses are assigned to prime indexes only.

I hope you find it useful.

All the best,

Jawher Matmati

;;; ====================================================

(defun gen-prime-pulses (nb &key (unit 's))

"Return a list of Nb OMN lengths:

index i is UNIT if i is prime, otherwise the corresponding rest (-UNIT).

Example: (gen-prime-pulses 10 :unit 's)

=> (-s -s s s -s s -s s -s -s -s)

NB: 0 and 1 are not prime; primes start at 2.

UNIT may be an OMN length symbol (s e q h w …) or a rational like 1/16."

(labels

((primep (n)

(and (> n 1)

(loop for d from 2 to (isqrt n)

never (zerop (mod n d)))))

(rest-of (u)

;; If UNIT is a symbol like 's -> make symbol '-s.

;; If UNIT is a ratio (e.g. 1/16) -> return negative ratio for rest.

(typecase u

(symbol (intern (format nil "-~a" u))) ; => -S (case-insensitive)

(rational (- u))

(integer (- u))

(float (- u)))))

(loop for i from 0 to (- nb 1)

collect (if (primep i) unit (rest-of unit)))))

;;; ====================================================

image.png

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.