                                  (go (>! set-state-ch id)))
                       "grid" (let [track {"type" "grid"
                                           "id" (:text state)
-                                          "bpc" (:width state) ;; should be separate parameter
                                           "beats" (repeat (:width state) [0])}
                                    tracks (clj->js (conj cursor track))
                                    grid (clj->js {"name" (:text state)
                                                   "id" (:text state)
-                                                  "bpc" (:width state)
+                                                  "bpc" (:bpc state)
                                                   "tracks" []})]
                                (transition {:state :init})
                                (let [grids (om/observe owner (grids))]

                    (dom/span nil "}"))
          :type (p (dom/span #js {:onClick #(transition {:state :init})} (str "{- " (:width state) " ... "))
                   (dom/span #js {:onClick #(transition {:state :sample :type "sample"})} " sample ")
                   (dom/span #js {:onClick #(transition {:state :grid :type "grid"})} " grid ")
                   (dom/span nil "}"))
          :sample (p (dom/span #js {:onClick #(transition {:state :init})} (str "{- " (:width state) " sample ... "))
                     (apply dom/select #js {:onChange #(transition {:state :commit :sample (-> % .-target .-value)})}
                            (map #(dom/option nil %) (om/observe owner (samples))))
                     (dom/span nil "}"))
          :grid (p (dom/span #js {:onClick #(transition {:state :init})} (str "{- " (:width state) " grid ..."))
                   (dom/input #js {:type "text" :value (:text state)
                                   :onChange #(handle-change % owner state)})
                   (dom/span #js {:onClick commit} " commit? ")

                   (dom/div nil 
                            (dom/p #js {:onClick #(om/set-state! owner :grid-expanded false)
                                        :style #js {:color "#999"}}
                                   (str "[-] " id " (" (get cursor "bpc") ")"))
                            (apply dom/table nil
                                   (let [cursors (map #(hash-map :cursor %1 :id %2)
                                                      (get cursor "tracks")
