     (.parentSetOutletAssist this (into-array String (concat ["Output changes in Cue state and associated id values"]
                                                             (cue-variable-outlet-assist this))))
     (.parentCreateInfoOutlet this false)
-    (swap! (.state this) assoc :f (fn [new-state _ id]
-                                    (.outlet this 0 (name new-state)
-                                             (into-array Atom [(Atom/newAtom id) (Atom/newAtom cue-name)])))))
-  (controllers/add-cue-fn! (:cue-grid *show*) x y (:f @(.state this))))
+
+    ;; Set up the callback function for changes to cue state
+    (let [f (fn [new-state _ id]
+              (.outlet this 0 (name new-state) (into-array Atom [(Atom/newAtom id) (Atom/newAtom cue-name)]))
+              (case new-state
+                :started (watch-cue-local-variables this)
+                :ended (unwatch-cue-local-variables this)
+                nil))]
+      (swap! (.state this) assoc :cue-fn f)
+      (controllers/add-cue-fn! (:cue-grid *show*) x y f))
+
+    ;; Set up the callback functions for changes to values of permanent show variables bound to the cue
+    (doseq [[i v] (map vector (range) (cue-variables this))]
+      (when (keyword? (:key v))
+        (let [outlet (inc i)
+              f (fn [_ new-value] (when (number? new-value) (.outlet this outlet (float new-value))))]
+          (swap! (.state this) assoc-in [:perm-var-fn (:key v)] f)
+          (show/add-variable-set-fn! (:key v) f))))))
 
 (defn apply-cue-local-variables
   "After we start a cue, this function looks for any local values we

  [this]
  (clojure.string/join (map #(if (= (:type %) :int) "i" "f") (cue-variables this))))

(defn- -init
  [x y]
  (core/init)

(defn- -notifyDeleted
  "The Max peer object has been deleted, so this instance is no longer
  going to be used. Unregister our cue state notification function,
  and any variable change notification functions, and allow this
  object to be garbage collected."
  [this]
  (let [{:keys [x y cue-fn perm-var-fn]} @(.state this)]
    (controllers/clear-cue-fn! (:cue-grid *show*) x y cue-fn)
    (doseq [[k f] perm-var-fn]
      (show/clear-variable-set-fn! k f))
    (unwatch-cue-local-variables this)))
