 ;            ))
 
 (def melody 
-  (let [call
-          {:length (repeats [[2 1/4] [1 1/2] [14 1/4] [1 3/2]])
-           :pitch (runs [[0 -1 3 0] [4] [1 8]])}
-        response
-          {:length (repeats [[10 1/4] [1 1/2] [2 1/4] [1 9/4]])
-           :pitch (runs [[7 -1 0] [0 -3]])}
-        development
-          {:length (repeats [[1 3/4] [12 1/4] [1 1/2] [1 1] [1 1/2] [12 1/4] [1 3]])
-           :pitch (runs [[4] [4] [2 -3] [-1 -2] [0] [3 5] [1] [1] [1 2] [-1 1 -1] [5 0]])}
+  (let [call (vector
+          (repeats [[2 1/4] [1 1/2] [14 1/4] [1 3/2]])
+          (runs [[0 -1 3 0] [4] [1 8]]))
+        response (vector
+          (repeats [[10 1/4] [1 1/2] [2 1/4] [1 9/4]])
+          (runs [[7 -1 0] [0 -3]]))
+        development (vector
+          (repeats [[1 3/4] [12 1/4] [1 1/2] [1 1] [1 1/2] [12 1/4] [1 3]])
+          (runs [[4] [4] [2 -3] [-1 -2] [0] [3 5] [1] [1] [1 2] [-1 1 -1] [5 0]]))
         line
-          (merge-with concat call response development)]
-    (map vector (sums (:length line)) (:pitch line))))
+          (map concat call response development)]
+    (map vector (sums (nth line 0)) (nth line 1))))
+
+;melody
 
 (def bassline
   (let [triples (partial mapcat (partial repeat 3))]

    (=> melody leader play#)
    (=> melody follower play#)))

(canone-alla-quarta#)

       (concat (triples (runs [[0 -3] [-5 -3]])) (run [12 0])))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Canone alla quarta - Johann Sebastian Bach   ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn bpm [per-minute] #(-> % (/ per-minute) (* 60) (* 1000)))

(def t 0)
(def p 1)
