 
 (defonce ^{:dynamic true} *inactive-node-modification-error* :exception)
 
-(defn inactive-node-modification-error
+(defn- inactive-node-modification-error
   "The default error behaviour triggered when a user attempts to either
   control or kill an inactive node."
   [err-msg]

  all nodes in the group."
  [node ctl-start ctl-vals]
  (ensure-connected!)
  (let [node-id (to-synth-id node)]
    (apply snd "/n_setn" node-id ctl-start (count ctl-vals) ctl-vals)))

(defn node-get-control-range
  "Get a range of n controls starting at a given name or index.
  Returns a vector of values."
  [node name-index n]
  (ensure-connected!)
  (let [res   (recv "/n_setn")
        cvals (do (snd "/s_getn" (to-synth-id node) (to-str name-index) n)
                  (:args (deref! res)))]

  (or (node-live? n)
      (node-loading? n)))

(defn- ensure-node-active!
  ([node] (ensure-node-active! "Trying to modify an inactive node."))
  ([node err-msg]
     (when (and (node? node)
                (not (node-active? node)))
      (inactive-node-modification-error err-msg))))


(defn node-free*
  "Free the specified nodes on the server. The allocated id is
  subsequently freed from the allocator via a callback fn listening
  for /n_end which will call node-destroyed."
  [node]
  {:pre [(server-connected?)]}
  (ensure-node-active! node "Trying to free a synth node that has been destroyed")
  (snd "/n_free" (to-synth-id node))
  node)

(defn- node-destroyed
