Skip to content
View in the app

A better way to browse. Learn more.

Learn more

Simulation of a Cellular Automaton with Pitch-List-Plot

Featured Replies

Fixed intervals: each generation extracts a predefined interval-sequence. Within the simulation loop—which runs and visualizes multiple generations—users can choose whether to display intervals or absolute pitches.

With every generation (or evaluation), the initial binary sequence is modified. This dynamic updating makes the specific behavior of each rule more apparent, allowing for clearer comparisons between different cellular automaton rules.

(progn
  ;; set rule number
  ;(setf rule 12)
  (setf rule (random 257))
  ;; set n simulations
  (setf sims 5)

  (loop repeat sims
        do (progn
             (setf intervals  (pitch-to-interval (rnd-air :group :symmetric :type :pitch :seed 1234)))
             
             
             (setf seq (cellular-automaton rule 200 (gen-binary-rnd 1 11 1 3)))
             (setf positions (loop for i in seq
                                   collect (position-item 1 i)))
             
             (setf ilist (loop for i in positions
                               collect (position-filter i intervals)))
             
             (setf plist  (loop for i in ilist collect (interval-to-pitch i)))
             (setf plist2  (interval-to-pitch (flatten ilist))))
        
        ;; intervals
      ; do (list-plot (flatten ilist)  :join-points nil :style :fill)
      
      ;; pitches every gen starting on c4  
      ;do (pitch-list-plot (flatten plist)  :join-points t :style :fill))
      
      ;; pitches all (without gen restart)
      do (pitch-list-plot (flatten plist2)  :join-points t :style :fill)
      do (sleep 1)))

Create an account or sign in to comment

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.