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

something i've coded...

 

(defun binary-filter (alist bin-list)
  (let ((event-list (cond ((omn-formp alist)
                           (single-events alist))
                          (t alist))))
    (flatten 
     (loop 
       for i in event-list
       for j in bin-list
       when (= j 1)
       collect i
       else append (cond ((omn-formp i)
                          (list (length-invert (car i))))
                         ((lengthp i)
                          (neg! (omn :length (list i)))))))))


(binary-filter '(q -q -q q) '(0 1 0 1))
=> (-1/4 -q -1/4 q)
(binary-filter '(q q q q -q) '(0 1 0 1 1))
=> (-1/4 q -1/4 q -q)
(binary-filter '(c4 d4 e4 f4) '(1 1 0 1))
=> (c4 d4 f4)
(binary-filter '(q c4 mf  d4 e4 e f4 ppp g4 a4 b4) '(1 0 1 1 0 1 1))
=> (q c4 mf -1/4 q e4 mf e f4 ppp -1/8 e a4 ppp e b4 ppp)

 

Hi André

Just investigating your function..
Then I've tried a little cosmetic hack to make it more readable, but it did not work out and I don't understand why. What did I overlook?

Thanks!

 

ole

;;; the orginal function 

(defun binary-filter (alist bin-list)
  (let ((event-list (cond ((omn-formp alist)
                           (single-events alist))
                          (t alist))))
    (flatten 
     (loop 
       for i in event-list
       for j in bin-list
       when (= j 1)
       collect i
       else append (cond ((omn-formp i)
                          (list (length-invert (car i))))
                         ((lengthp i)
                          (neg! (omn :length (list i)))))))))





(binary-filter '(q c4 mf  d4 e4 e f4 ppp g4 a4 b4) '(1 0 1 1 0 1 1))
=> (q c4 mf -1/4 q e4 mf e f4 ppp -1/8 e a4 ppp e b4 ppp)




;;;Why is it not working??



(defun foo-rep (n sequence &key omn)
  (maybe-omn-decode omn
   (binary-filter n sequence)))


(foo-rep '(q c4 mf  d4 e4 e f4 ppp g4 a4 b4) '(1 0 1 1 0 1 1) :omn t)
-->(q c4 mf -1/4 q e4 mf e f4 ppp -1/8 e a4 ppp e b4 ppp);??



 

(defun binary-filter (alist bin-list &key (omn t))
  (let ((event-list (cond ((omn-formp alist)
                           (single-events alist))
                          (t alist))))
    (flatten 
     (loop 
       for i in event-list
       for j in bin-list
       when (= j 1)
       collect i
       else append
       (maybe-omn-decode
        omn
        (cond ((omn-formp i) (list (length-invert (car i))))
              ((lengthp i)  (neg! (omn :length (list i))))))))))

(binary-filter '(q c4 mf d4 e4 e f4 ppp g4 a4 b4) '(1 0 1 1 0 1 1))
=> (q c4 mf -q q e4 mf e f4 ppp -e e a4 ppp e b4 ppp)

 

Only one type of parameters can be decoded at a time.

  • Author

i found an internal function 🙂

 

(binary-invert '((1 0) (0 0 1)))
=> ((0 1) (1 1 0))

 

 

 

how did you found it, it's not documented..?

And it works only for binary lists, right?

  • Author

I wanted to call my own function like that -

"Error: The function binary-invert is predefined by Opusmodus."

 

also:

(binary-invert '(0 8 0 2 2))
=> (1 0 1 0 0)

 

janusz? 😉

 

Predefined functions can't be changed otherwise you would break the system.
The binary-invert is sub function of binary-variant.

(binary-variant '(0 1 1 0 1 0 1 1) 'i)
=> (1 0 0 1 0 1 0 0)

 

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.