;;;
;;; c:\\program files\\acl62\\music16.cl
;;;
(load "c:\\program files\\acl62\\music15.cl")

;;;(get-chord-tone "CM7")
;;;(rotate-list-right '(a b c d) 2)
;;;(rotate-list-left '(a b c d) 3)

(defun get-figures-of-a-chord (chord-name)
  (let ((lst (get-chord-tone chord-name)))
   (list (rotate-list-right lst 0)
      (rotate-list-right lst 1)
      (rotate-list-right lst 2)
      (rotate-list-right lst 3))))

(defun drop2-aux (lst)
  (list (third lst) (list (first lst) (second lst) (fourth lst))))

(defun drop2 (chord-name)
  (mapcar #'drop2-aux (get-figures-of-a-chord chord-name)))

(defun drop3-aux (lst)
  (list (second lst) (list (first lst) (third lst) (fourth lst))))

(defun drop3 (chord-name)
  (mapcar #'drop3-aux (get-figures-of-a-chord chord-name)))

(defun drop2&4-aux (lst)
  (list (list (first lst) (third lst)) (list (second lst) (fourth lst))))

(defun drop2&4 (chord-name)
  (mapcar #'drop2&4-aux (get-figures-of-a-chord chord-name)))

(defun drop1&4-aux (lst)
  (list (list (list (first lst) (fourth lst)) (list (second lst) (third lst)))))

(defun drop1&4 (chord-name)
  (drop1&4-aux (first (get-figures-of-a-chord chord-name))))

;;;
;;; (drops "CM7")
;;;
(defun drops (chord-name)
  (format t "~%drop2 ~a" (drop2 chord-name))
  (format t "~%drop3 ~a" (drop3 chord-name))
  (format t "~%drop2&4 ~a" (drop2&4 chord-name))
  (format t "~%drop1&4 ~a" (drop1&4 chord-name))
  (format t "~%Tensions")
  (show-tension-notes chord-name))

(defun set-of-drops (chord-name)
  (append (drop2 chord-name)
       (drop3 chord-name)
       (drop2&4 chord-name)
       (drop1&4 chord-name)))

(defun get-a-drop (chord-name)
  (let ((lst (set-of-drops chord-name)))
   (nth (random (length lst)) lst)))

(defun a-drop (chord-name)
  (format t "~%~a  " (get-a-drop chord-name))
  (format t "~%Tensions")
  (show-tension-notes chord-name))