 
 (def track
   (->>
-    (champernowne/word 10 410033073307230713083309)
-    (encode {:dux 0 :comes 0}) 
+    (champernowne/word 10 4100410033073307230713083309)
+    (encode {:dux 0 :comes 0 :bass 0})
     (wherever :pitch, :pitch (comp temperament/equal scale/A scale/minor scale/lower))
     (where :time (bpm 120))
     (where :duration (bpm 120))))

      (+ (* 1/4 (sin-osc (* 2.01 freq))))
      (+ (* 1/3 (sin-osc (* 1/2 freq))))
      (rlpf (line:kr 3000 500 dur) 1/5)
      (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 :dux [{hertz :pitch}] (buzz hertz))
(defmethod live/play-note :comes [{hertz :pitch seconds :duration}] (sing hertz seconds))

(defn n [time duration pitch part]
  {:time time 

   :duration duration
   :part part})

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

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

(defn encode [state [a b c d & digits]]
  (if (zero? (* a b))
    (encode (max-out state) digits)
    (let [part (least state)
          duration (/ a b)
          pitch (+ c d)
          time (part state)]
