       (let [metro (:metronome state)
             steps (:steps state)
             index (mod beat steps)
-            next-beat (inc beat) ]
+            next-beat (inc beat)]
+
         (swap! state-atom assoc-in [:step] index)
-        (doseq [{:keys [inst value]} (:rows state)]
-          (when (nth value index)
-            (at (metro beat) (inst))))
+
+        (doseq [row (:rows state)]
+          (at (metro beat) (play-step row index)))
+
         (apply-at (metro next-beat) #'step-player
                   [state-atom next-beat])))))
 

    :background (color 0 255 0 200)
    :foreground (color 0 150 0)))

(def ^{:private true} current-step-style
  (style
    :stroke 1.0
    :background (color 128 128 224 200)
    :foreground (color 0 150 0)))

(defn- paint-grid [state ^javax.swing.JComponent c g]
  (let [w    (width c)

    (into {} rows)))

(comment
  (do (use 'overtone.live)
      (use 'overtone.gui.sequencer)
      (use 'overtone.gui.control)
      (use 'overtone.inst.drum)
      (def m (metronome 128))
      (step-sequencer m 8 [kick closed-hat snare]))
  )
