Jump to content

chord-multiplication


Recommended Posts

don't know if this already exists in the library


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; chord-multiplication like boulez ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun chord-multiplication (chord1 chord2 &key (chord 'nil))
  (let ((liste (sort-asc (remove-duplicates (loop for i in chord1
                       append (pitch-transpose-start i chord2))))))
    (if (equal chord 't)
      (chordize liste)
      (append liste))))
    
(defun all-chord-multiplications (liste &key (chord 'nil))
  (let ((liste (loop for i in (combination 2 liste)
                 collect (chord-multiplication (first i) (second i)))))
    (if (equal chord 't)
      (chordize liste)
      (append liste))))


;;; EXAMPLES
;;; with 2 chords
(chord-multiplication '(eb4 a4 d5) '(ab4 g5) :chord 't)

;;; all possible multiplications (combinations of 2) in a diveded list
(setf divided-list '((eb4 a4 d5) (ab4 g5) (e4 gs4 db4) (b3 f4 bb4 c5)))
(all-chord-multiplications divided-list :chord 't)

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

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy