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.

permute-symmetrical

Featured Replies

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;PERMUTE-SYMMETRCIAL -> seq of any lengths;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; SUB

(defun divide-seq-length (seq)
  (if (evenp (length seq))
    (/ (length seq) 2)
    (/ (1- (length seq)) 2)))
  

;;; MAIN

(defun permute-symmetrical (row &key (chance 0.5))
  (let ((1st (loop repeat (divide-seq-length row)
               for cnt = 0 then (incf cnt)
               collect (nth cnt row)))
        (2nd (loop repeat (divide-seq-length row)
                   for cnt = (- (length row) 1) then (decf cnt)
                   collect (nth cnt row))))

    (loop 
      for i in 1st
      for j in 2nd

      when (prob? chance)
      collect j into 1st-bag and collect i into 2nd-bag
      else collect i into 1st-bag and collect j into 2nd-bag

      when (= (length 1st-bag) (divide-seq-length row))
      do (return (if (evenp (length row))
                   (append 1st-bag (reverse 2nd-bag))
                   (append 1st-bag (list (nth (length 1st) row)) (reverse 2nd-bag)))))))
  

;;; EXAMPLE

(pitch-list-plot 
 (permute-symmetrical '(a4 bb4 ab4 b4 g4 c5 fs4 cs4 f4 d4 e4 eb4) ;zimmermann-row
                      :chance 0.3))

 

 

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.