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.

binary-layers - alternative version

Featured Replies

A special form of BINARY LAYERS: each new list is applied to the 1-values of the previous list, i.e., added. The next generation is then applied to 2, the next to 3, and so on. Like structure on structure on structure.

I programmed it to read a kind of sample matrix, which results in a continuous replacement process that happens generatively, kind of a tree structure.

(defun binary-layers (seqs)
  (append (list (car seqs))
          (loop repeat (1- (length seqs))
                with seq = (car seqs)
                with seqcnt = 1
                with interf = 1
                collect (setf seq (loop for i in seq
                                        with cnt = 0
                                          
                                when (and (= i interf)
                                          (= (nth cnt (nth seqcnt seqs)) 1))
                                            
                                          collect (+ i 1)
                                        else collect i
                                          
                                        when (> i (1- interf)) do (incf cnt)))
                do (incf seqcnt)
                do (incf interf))))

;;;; EXAMPLES


(binary-layers '((0 1 0 1 1 0 1) (0 1 0 1 1 0 0) (1 1 0 1 1 0 0) (1 0 1 1 1 0 0)))
=> ((0 1 0 1 1 0 1) (0 1 0 2 1 0 2) (0 1 0 3 1 0 3) (0 1 0 4 1 0 3))


(binary-layers '((1 1 0 1 1 0 0 1 0 1 1) (0 1 1 1 0 1 1 0 1 1 0) (1 1 1 1 0 1 1 0 0 1 0) (0 1 1 0 1 1 1 1 1 0 0)))
=> ((1 1 0 1 1 0 0 1 0 1 1) (1 2 0 2 2 0 0 1 0 2 2) (1 3 0 3 3 0 0 1 0 3 2) (1 3 0 4 4 0 0 1 0 3 2))


(binary-layers (loop repeat 10 collect (rnd-order '(1 1 0 1 1 0 0 1 0 1 1) :seed 243)))
=> ((0 1 1 1 1 0 0 1 1 0 1) (0 1 2 2 2 0 0 2 1 0 1) (0 1 2 3 3 0 0 3 1 0 1) (0 1 2 3 4 0 0 4 1 0 1) (0 1 2 3 4 0 0 5 1 0 1) (0 1 2 3 4 0 0 5 1 0 1) (0 1 2 3 4 0 0 5 1 0 1) (0 1 2 3 4 0 0 5 1 0 1) (0 1 2 3 4 0 0 5 1 0 1) (0 1 2 3 4 0 0 5 1 0 1))
               


;; STATIC VIEW - LISTPLOT wit lists in list
(list-plot (binary-layers (loop repeat 10 collect (rnd-order '(1 1 0 1 1 0 0 1 0 1 1) :seed 243))) :join-points t)

;; RANDOM VIEW + flatten all lists -> EVAL A FEW TIMES
(list-plot (flatten (binary-layers (loop repeat 10 collect (rnd-order '(1 1 0 1 1 0 0 1 0 1 1))))) :join-points t)

;; EVAL TO SEE the structures for each generation - it's a kind of REWRITE
(loop repeat 10
       do (list-plot (binary-layers (loop repeat 10 collect (rnd-order '(1 1 0 1 1 0 0 1 0 1 1)))) :join-points t)
      do (sleep 2))

  • Author

interesting results with <dec-to-bin-rhythm>. kind of transitions and pattern by adding "binary counting"...

(defun dec-to-bin-rhythm (ilist)
  (let ((span (find-max (mapcar 'length (decimal-to-binary ilist)))))
	(loop for i in (binary-rhythm span ilist 1 :type 1)
                 collect (loop for x in i
                               when (< x 0)
                                 append (gen-repeat (abs x) 0)
                               else collect  x))))

;;;;;;;;

(list-plot
 (flatten 
  (binary-layers (list (flatten (dec-to-bin-rhythm (gen-integer 0 5)))
                       (flatten (dec-to-bin-rhythm (gen-integer 7 0)))
                       (flatten (dec-to-bin-rhythm (gen-integer 1 5))))))
 :join-points t :style :fill)


;;;;;;;;


(list-plot
 (flatten 
  (binary-layers (list (flatten (dec-to-bin-rhythm (gen-integer 0 11)))
                       (flatten (dec-to-bin-rhythm (gen-integer 7 1)))
                       (flatten (dec-to-bin-rhythm (gen-integer 1 7))))))
 :join-points t :style :fill)

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.