   (let [new-t (+ curr-t pat-dur)]
     (apply-by new-t #'live-sequencer [new-t pat-dur live-patterns])))
 
+(def a {:rate 2 :amp 0.1 :time-scale-max 5})
 (def a {:rate 100 :amp 0.4 :time-scale-max 5})
-(def a {:rate 2 :amp 0.1 :time-scale-max 5})
 (def b {:pan -1 :freq 1000})
 (def c {:freq 25000 :amp 0.2})
 (def d {:amp 5.0 :dur 0.25})
 (def g {:freq-mul 1})
 
-(metro :bpm 110)
+(metro :bpm 128)
 (volume 0.5)
 (metro :bpm)
 
 ;;(def metro (metronome 128))
-(def one-beat-dur (/ 60.0 110))
+(def one-beat-dur (/ 60.0 128))
 (def one-bar-dur (* one-beat-dur 4))
 (def beat-per-pattern 4)
 (def dur-per-pattern (* beat-per-pattern one-beat-dur))

    ;;(live-sequencer (now) ms-per-pattern *beats)
    ;; (live-sequencer (metro (inc (metro))) ms-per-pattern *beats))
    (live-sequencer (metro (next-beat (metro) 0 beat-per-pattern)) ms-per-pattern *beats))
  (laserplayer (next-beat (metro) 0 beat-per-pattern))
  (init-latchbell-mod (:rate @latchbell-arg))
  (apply-by (metro (next-beat (metro) (+ 4 (* 7 beat-per-pattern)) (* 8 beat-per-pattern)))
            #'swap! [*beats assoc laserbeam [d _ _ [d d] (vec (repeat 64 0.8)) _ _ d _ _ d _ b _ _ [d d d]]])
  (apply-by (metro (next-beat (metro) 0 (* 8 beat-per-pattern)))
    #'swap! [*beats assoc laserbeam [d _ _ [d d] (vec (repeat 64 0.8)) _ _ d _ _ d _ b _ _ [d d d]]])

  (swap! *beats assoc laserbeam [d _ _ [d d] (vec (repeat 64 0.8)) _ _ d _ _ d _ b _ _ [d d d]])
  (swap! *beats assoc laserbeam [_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _])
  (swap! *beats assoc latchbell [a _ a _ a _ a _ a _ a _ a _ a _])
  (swap! *beats assoc latchbell (vec (repeat 1 _)))
  (swap! *beats assoc laserbeam [d c c c b c c d c c d c b c c d])
  (swap! *beats assoc grumble [g _ _ _ _ _ _ _ _  _ _ _ _ _ _ _])

  (reset! *beats beats)
  (stop))

(comment
  (live-sequencer metro (metro) *beats 1/4 0)
  (stop))

(odoc metronome)

;; (def kick (sample "resources/kick.wav"))
;; (kick)

(comment
  (odoc line)
  (odoc asr)
  (odoc buf-rd)
  (odoc phasor)
  (odoc bpz2)
  (odoc latch)
  (odoc buf-rate-scale)
  (odoc buf-dur))

(definst grumble [freq 440 freq-mul 1 speed 10 attack 10 release 50]
  (let [snd (mix (map #(* (lf-cub (* % freq-mul freq))
