Skip to content
View in the app

A better way to browse. Learn more.

Learn more

mapping a 2d-field to chords

Featured Replies

here is a function to MAP a 2d-field to chords (via intervals) // an idea i got from "Nierhaus - Algorithmic Composition" - Cellular Automata (p. 198). so you can "import/map" some GAME-OF-LIFE configurations or whatelse (a pixel photo?)  // the PITCH-MAPPING is like in Miranda's CAMUS.

 

 

;; FUNCTION ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun 2d-field-to-chord (matrix &key (start 'c4) (merge-chords nil))
  (let* ((int-horizontal
         (x+b (loop for x in (loop for i in matrix 
                               collect (position-item 1 i))
                when (not (null x))
                collect x)
              1))
  
        (int-vertical
         (x+b (loop repeat (length matrix)
                for n = 0 then (incf n)
                
                when (not (null (position-item 1 (nth n matrix))))
                collect n)
              1))

        (chords (loop 
                  for h in int-horizontal
                  for v in int-vertical
                  append (loop for z in h
                           collect (chordize (interval-to-pitch (list z v) :start start))))))

    (if (null merge-chords)
      chords
      (chord-pitch-unique (chordize (flatten chords))))))




;; interval-matrix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; numbers are intervals (inverted order then in the book)
;; (different sizes are possible)

(setf matrix 
              #|1 2 3 4 5 6 7 8 9 etc..|#

       #|1|# '((1 0 0 0 0 0 0 0 0 0 0 0) 
       #|2|#   (0 1 0 0 0 0 0 0 0 0 0 0) 
       #|3|#   (0 0 1 0 0 0 0 0 0 0 0 0) 
       #|4|#   (0 0 0 0 0 0 0 0 0 0 0 0) 
       #|5|#   (0 0 0 0 0 0 0 0 0 0 0 0) 
       #|6|#   (0 0 0 0 0 0 0 0 0 0 0 0)
       #|7|#   (0 0 0 0 0 0 0 0 0 0 0 0)
   #|etc..|#   (0 0 0 0 0 0 0 0 0 0 0 0)
               (0 0 0 0 0 0 0 0 1 0 0 0)
               (0 0 0 0 0 0 0 0 0 0 0 0)
               (0 0 0 0 0 1 0 0 0 0 0 0)
               (0 0 0 0 0 0 0 0 0 0 0 0)))
      
              
(2d-field-to-chord matrix)
(2d-field-to-chord matrix :start 'd4)
(2d-field-to-chord matrix :merge-chords t)
(2d-field-to-chord matrix :merge-chords t :start 'd4)

;; as a scale
(sort-asc (melodize (2d-field-to-chord matrix :merge-chords t)))


;; with rnd-generated field (by probability)

(progn
  (setf matrix (loop repeat 32
                 collect (loop repeat 32 
                           collect (prob-pick '((0 0.97) (1 0.03))))))
  (2d-field-to-chord matrix))

(progn
  (setf matrix (loop repeat 32
                 collect (loop repeat 32 
                           collect (prob-pick '((0 0.99) (1 0.01))))))
  (2d-field-to-chord matrix :merge-chords t))

 

IMG_2723.thumb.jpg.1baf02361f7661b675b67b37ef809dd7.jpg

 

 

 

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.