      (let [part (most-behind state)
            duration (/ a b)
            pitch (+ c d)
-           time (part state)]
+           time (get state part)]
        (cons (construct time duration pitch)
              (lazy-seq (->> digits
                             (decode (update-in state [part] (partial + duration))))))))))

      (rlpf (line:kr 3000 500 dur) 1/50)
      (clip2 0.3)
      (* (env-gen (adsr 0.05 (* dur 1/3) 0.2) (line:kr 1 0 dur) :action FREE))
      (* vol master-volume)))

; Arrangement
(defmethod live/play-note :default [{hertz :pitch seconds :duration}]
  (when hertz (sing hertz seconds)))

(defn construct [time duration pitch]
  {:time time 
   :pitch pitch
   :duration duration })

(defn most-behind [m]
  (first (apply min-key second m)))

(defn synchronise [m]
  (zipmap (keys m) (repeat (apply max (vals m)))) )

(defn decode
  ([state [a b c d & digits]]

            [leipzig.temperament :as temperament]
            [kolmogorov-music.champernowne :as champernowne]))

(definst sing [freq 110 dur 1.0 vol 1.0]
  (-> (sin-osc freq)
      (+ (sin-osc (* 3.01 freq)))
