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

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; WHEN PATTERN-MATCH => T 
;;; THEN MARKOV PRODUCES THE NEXT VALUES
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;; subfunctions

(defun pattern-match (liste pattern) 
  (loop for z in liste
    with cnt = 0
    with pattern_cnt = 0

    when (or (equal  (nth cnt pattern) z)  (equal '? (nth cnt pattern)))
    do (incf pattern_cnt)
    and do (incf cnt)
    else do (setq cnt (setq pattern_cnt 0))

    when (equal pattern_cnt (length pattern))
    collect 't into bag and do (return (car bag))))

(defun test.pm.omn (seq pattern)
  (let ((seq (if (omn-formp seq)
               (cond ((lengthp (car pattern)) (omn :length seq))
                     ((pitchp (car pattern))(omn :pitch seq))
                     ((velocityp (car pattern)) (omn :velocity seq)))
               (append seq))))
    (pattern-match seq pattern)))


;; mainfuction

(defun test.pm+markov (seq pattern start-slot transitions &key (size 1))
  (if (test.pm.omn seq pattern)
    (if (= size 1)
      (car (rest (gen-markov-from-transitions transitions :size (1+ size) :start start-slot)))
      (rest (gen-markov-from-transitions transitions :size (1+ size) :start start-slot)))
    (append start-slot)))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(setf transitions '((a (a 2) (b 1))
                    (b (a 2) (b 1))))

(setq test-omn '(t fs4 pp tasto g4 ppp tasto -s. t e4 pppp tasto -s. t eb4 pp tasto -het - t))

;; examples1
(test.pm+markov test-omn '(pp ppp) 'a transitions) ;; evaluate a few times
(test.pm+markov test-omn '(fs4 g4) 'a transitions) ;; evaluate a few times
(test.pm+markov test-omn '(g2) 'a transitions) ;; evaluate a few times => no match => no new value
(test.pm+markov test-omn '(1/32 -3/32) 'a transitions) ;; evaluate a few times


;; examples2
(test.pm+markov test-omn '(pp) 'a transitions :size 5) ;; evaluate a few times
(test.pm+markov test-omn '(g4 e4) 'a transitions :size 3) ;; evaluate a few times

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

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.